From 74ce5c2d32a04da488729af262c9a06dcce47429 Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 12:52:15 +0800 Subject: [PATCH 1/9] Auto-apply repository topics to GitHub-synced projects Paper projects pile up as private repositories whose names all look alike, and GitHub search cannot tell them apart. The paper id is already stored locally, so publish it as repository topics and make projects findable by filtered search. - Add openresearch to every synced project, plus arxiv-xxxx (version suffix dropped so v1 and v2 share a topic) and paper-repro when the project comes from a paper. - Let people add their own topics on top, and turn the automatic ones off, per project and in the new-project defaults. - Edit both in project settings, not only at creation time. - Merge with the repository's existing topics rather than replacing them: a repository shared by several projects, or one whose owner added topics by hand, keeps them. Never publish an empty set. - Backfill projects that already sync to GitHub, once, via the v2 schema migration. Publishing topics decorates a push that already succeeded, so a GitHub failure there warns instead of failing project creation. Refs #339 --- src/commands/up.rs | 67 ++- src/config.rs | 9 + src/local/chat/mod.rs | 2 + src/local/demo.rs | 2 + src/local/experiments.rs | 1 + src/local/github.rs | 261 +++++++++++ src/local/model.rs | 58 ++- src/local/opencode.rs | 1 + src/local/projects.rs | 6 + src/local/resolve.rs | 1 + src/local/starter.rs | 1 + src/store.rs | 121 ++++- src/telemetry.rs | 14 + .../{index-CQbtnwiZ.js => index-zOVqYBAH.js} | 416 +++++++++--------- ui/dist/index.html | 2 +- ui/messages/en.json | 8 +- ui/messages/fa.json | 8 +- ui/messages/zh-CN.json | 8 +- ui/src/api.ts | 19 +- ui/src/components/NewProjectForm.tsx | 40 ++ ui/src/components/SettingsPage.tsx | 107 ++++- 21 files changed, 922 insertions(+), 230 deletions(-) rename ui/dist/assets/{index-CQbtnwiZ.js => index-zOVqYBAH.js} (55%) diff --git a/src/commands/up.rs b/src/commands/up.rs index 1bdac9d24..0bac351db 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -1327,6 +1327,8 @@ struct CreateProjectReq { #[serde(default)] initialize_git: bool, github_sync_enabled: Option, + github_auto_topics_enabled: Option, + github_topics: Option>, /// UI locale, for the starter prompts warmed up in the background. locale: Option, } @@ -1368,6 +1370,10 @@ async fn create_project( let github_sync_enabled = req .github_sync_enabled .unwrap_or_else(crate::config::github_for_new_projects); + let github_auto_topics_enabled = req + .github_auto_topics_enabled + .unwrap_or_else(crate::config::github_auto_topics_for_new_projects); + let github_topics = local::github::sanitize_topics(&req.github_topics.unwrap_or_default()); let repo_size_kb = match clone_url.as_deref() { Some(url) => local::github::public_repo_size_kb(url).await, None => None, @@ -1390,6 +1396,8 @@ async fn create_project( run_command, paper_id, paper_pdf, + github_auto_topics_enabled, + github_topics, }, )?; Ok(project) @@ -1550,6 +1558,37 @@ fn push_project(project: &local::model::LocalProject) -> Result<()> { ) } +/// Applies the project's GitHub repository topics (auto-derived + user extras). +/// +/// Merge semantics live in `local::github::set_repo_topics`: it unions with what +/// the repository already carries, so a shared repository — a cloned paper repo, +/// or a folder project riding an existing remote — never has another project's +/// topics (or hand-added ones) wiped out. +async fn sync_project_topics(project: &local::model::LocalProject) -> Result<()> { + if !project.github_topics_enabled() && project.github_topics.is_empty() { + // Nothing to derive and no extras configured: publishing an empty set + // would only risk clearing whatever the repository already carries. + return Ok(()); + } + let topics = local::github::effective_project_topics( + project.paper_id.as_deref(), + &project.github_topics, + project.github_auto_topics_enabled, + ); + local::github::set_repo_topics(&project.github_owner, &project.github_repo, &topics).await +} + +/// Topic publication decorates a push that already succeeded, so a GitHub hiccup +/// here must not fail project creation or an experiment publish. +async fn sync_project_topics_best_effort(project: &local::model::LocalProject) { + if let Err(error) = sync_project_topics(project).await { + eprintln!( + "orx up: could not update GitHub topics for {}: {error}", + project.slug + ); + } +} + fn github_push_was_rejected(error: &str) -> bool { let error = error.to_ascii_lowercase(); error.contains("403") @@ -1640,6 +1679,8 @@ async fn push_project_for_sync( project.github_sync_enabled = true; Store::open()?.update_local_project(&project)?; + // After the row is saved, so a topic failure cannot roll back sync state. + sync_project_topics_best_effort(&project).await; Ok((project, github_status)) } @@ -1706,6 +1747,7 @@ async fn push_project_github(State(state): State, Path(id): Path, #[serde(default, deserialize_with = "double_option")] run_command: Option>, + github_auto_topics_enabled: Option, + github_topics: Option>, } async fn update_project( @@ -1788,9 +1832,13 @@ async fn update_project( .admit(&id) .ok_or_else(|| bad_request("project deletion is in progress"))?; reject_if_moving(&state)?; - if req.name.is_none() && req.run_command.is_none() { + if req.name.is_none() + && req.run_command.is_none() + && req.github_auto_topics_enabled.is_none() + && req.github_topics.is_none() + { return Err(bad_request( - "nothing to update: pass name and/or runCommand", + "nothing to update: pass name, runCommand, githubAutoTopicsEnabled, and/or githubTopics", )); } let store = Store::open()?; @@ -1806,6 +1854,12 @@ async fn update_project( if let Some(cmd) = req.run_command { project.run_command = cmd.filter(|c| !c.trim().is_empty()); } + if let Some(enabled) = req.github_auto_topics_enabled { + project.github_auto_topics_enabled = enabled; + } + if let Some(topics) = req.github_topics { + project.github_topics = local::github::sanitize_topics(&topics); + } store.update_local_project(&project)?; // Re-read: update bumps updated_at, which is also what fires the SSE // project.updated diff. @@ -4910,6 +4964,7 @@ fn git_settings_json(github_status: local::github::Status) -> Value { fn project_defaults_json(github_status: local::github::Status) -> Value { json!({ "githubForNewProjects": crate::config::github_for_new_projects(), + "githubAutoTopicsForNewProjects": crate::config::github_auto_topics_for_new_projects(), "githubDefaultPromptSeen": crate::config::github_default_prompt_seen(), "ghInstalled": github_status.installed, "githubAuthenticated": github_status.authenticated, @@ -4924,6 +4979,7 @@ async fn project_defaults() -> ApiResult { #[serde(rename_all = "camelCase")] struct SetProjectDefaultsReq { github_for_new_projects: bool, + github_auto_topics_for_new_projects: Option, #[serde(default)] github_default_prompt_seen: Option, } @@ -4936,6 +4992,12 @@ async fn set_project_defaults(Json(req): Json) -> ApiResu )); } crate::config::set_github_for_new_projects(req.github_for_new_projects)?; + // Auto topics only ever apply to a project that syncs, so a client toggling + // sync alone keeps them on rather than silently disabling them. + crate::config::set_github_auto_topics_for_new_projects( + req.github_auto_topics_for_new_projects + .unwrap_or(req.github_for_new_projects), + )?; if let Some(seen) = req.github_default_prompt_seen { crate::config::set_github_default_prompt_seen(seen)?; } @@ -8124,6 +8186,7 @@ mod tests { paper_id: None, created_at: 0, updated_at: 0, + ..Default::default() }; let json = project_json_with_artifacts_dir( &project, diff --git a/src/config.rs b/src/config.rs index ace82005f..a1b23251b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -278,6 +278,15 @@ pub fn set_github_for_new_projects(enabled: bool) -> Result<()> { Ok(()) } +pub fn github_auto_topics_for_new_projects() -> bool { + crate::telemetry::github_auto_topics_for_new_projects() +} + +pub fn set_github_auto_topics_for_new_projects(enabled: bool) -> Result<()> { + crate::telemetry::set_github_auto_topics_for_new_projects(enabled)?; + Ok(()) +} + /// Whether orx may install updates on its own (Settings → Updates). Lives in /// the telemetry-owned `settings.json` for the same single-writer reason as the /// data dir above. Read by `updates::auto_update_eligible`. diff --git a/src/local/chat/mod.rs b/src/local/chat/mod.rs index 601fc8bd2..e721a289b 100644 --- a/src/local/chat/mod.rs +++ b/src/local/chat/mod.rs @@ -2436,6 +2436,7 @@ mod slash_skill_tests { paper_id: None, created_at: 0, updated_at: 0, + ..Default::default() } } @@ -6673,6 +6674,7 @@ impl TurnCtx { paper_id: None, created_at: 0, updated_at: 0, + ..Default::default() }, text: String::new(), assistant: WireMessage { diff --git a/src/local/demo.rs b/src/local/demo.rs index 55797de76..aef72865c 100644 --- a/src/local/demo.rs +++ b/src/local/demo.rs @@ -376,6 +376,7 @@ fn seed_at( paper_id: None, created_at: ago(seeded_at, 250, 0), updated_at: ago(seeded_at, 6, 0), + ..Default::default() }; let experiment = LocalExperiment { id: EXPERIMENT_ID.into(), @@ -1997,6 +1998,7 @@ mod tests { paper_id: None, created_at: 1, updated_at: 1, + ..Default::default() }) .unwrap(); let user_files = data.join("files").join(PROJECT_SLUG); diff --git a/src/local/experiments.rs b/src/local/experiments.rs index d334d7cdc..fa726412b 100644 --- a/src/local/experiments.rs +++ b/src/local/experiments.rs @@ -147,6 +147,7 @@ mod tests { paper_id: None, created_at: 0, updated_at: 0, + ..Default::default() } } diff --git a/src/local/github.rs b/src/local/github.rs index 6c6daddf2..90aef6cad 100644 --- a/src/local/github.rs +++ b/src/local/github.rs @@ -9,6 +9,8 @@ use crate::error::{anyhow, Result}; const UA: &str = concat!("orx/", env!("CARGO_PKG_VERSION")); pub const SHALLOW_CLONE_THRESHOLD_KB: u64 = 250 * 1024; +const MAX_REPO_TOPICS: usize = 20; +const MAX_TOPIC_LEN: usize = 50; #[derive(Clone, Copy)] pub struct Status { @@ -158,6 +160,116 @@ pub struct RepoMeta { pub archived: bool, } +pub fn sanitize_topics(topics: &[String]) -> Vec { + let mut out = Vec::new(); + for topic in topics { + if let Some(topic) = normalize_topic(topic) { + if out.iter().any(|existing| existing == &topic) { + continue; + } + out.push(topic); + if out.len() >= MAX_REPO_TOPICS { + break; + } + } + } + out +} + +pub fn default_topics_for_project(paper_id: Option<&str>) -> Vec { + let mut topics = vec!["openresearch".to_string()]; + if let Some(id) = paper_id.and_then(normalize_arxiv_topic) { + topics.push(id); + topics.push("paper-repro".to_string()); + } + topics +} + +pub fn effective_project_topics( + paper_id: Option<&str>, + custom_topics: &[String], + auto_topics_enabled: bool, +) -> Vec { + let mut topics = Vec::new(); + if auto_topics_enabled { + topics.extend(default_topics_for_project(paper_id)); + } + topics.extend(custom_topics.iter().cloned()); + sanitize_topics(&topics) +} + +/// Publishes `topics` onto the repository, unioned with the topics it already +/// carries. Never clears the repository's topics, and skips the write when the +/// union changes nothing. +pub async fn set_repo_topics(owner: &str, repo: &str, topics: &[String]) -> Result<()> { + let existing = repo_topics(owner, repo).await.unwrap_or_default(); + let merged = merge_topics(&sanitize_topics(topics), &existing); + if merged.is_empty() || merged == existing { + // Never PUT an empty set (it clears the repo) and skip a no-op write. + return Ok(()); + } + let mut args = vec![ + "api".to_string(), + "-X".to_string(), + "PUT".to_string(), + repository_endpoint(owner, repo), + ]; + args[3].push_str("/topics"); + for topic in &merged { + args.push("-f".to_string()); + args.push(format!("names[]={topic}")); + } + let borrowed = args.iter().map(String::as_str).collect::>(); + gh(&borrowed, Duration::from_secs(20)).await?; + Ok(()) +} + +/// Topics the repository currently carries. An unreadable list is treated as +/// empty: the caller then diffs against `[]` and still publishes its own set. +async fn repo_topics(owner: &str, repo: &str) -> Result> { + let endpoint = format!("{}/topics", repository_endpoint(owner, repo)); + let body = gh( + &[ + "api", + &endpoint, + "-H", + "Accept: application/vnd.github+json", + ], + Duration::from_secs(15), + ) + .await?; + let parsed: Value = serde_json::from_str(&body)?; + Ok(parsed + .get("names") + .and_then(Value::as_array) + .map(|names| { + names + .iter() + .filter_map(Value::as_str) + .map(str::to_string) + .collect() + }) + .unwrap_or_default()) +} + +/// GitHub's topic PUT replaces the whole set, so merge instead of overwrite: a +/// repository shared by several projects — or one whose owner added topics by +/// hand — keeps everything it already had. Desired topics win the cap because +/// they are the ones this project is asking for. +fn merge_topics(desired: &[String], existing: &[String]) -> Vec { + let mut merged = sanitize_topics(desired); + for topic in sanitize_topics(existing) { + if merged.len() >= MAX_REPO_TOPICS { + break; + } + if merged.contains(&topic) { + continue; + } + merged.push(topic); + } + merged +} + pub async fn viewer_login() -> Result { gh(&["api", "user", "--jq", ".login"], Duration::from_secs(10)) .await @@ -209,6 +321,71 @@ fn repository_name_exists(error: &str) -> bool { .contains("name already exists on this account") } +fn normalize_topic(input: &str) -> Option { + let mut topic = input + .trim() + .to_ascii_lowercase() + .chars() + .map(|ch| { + if ch.is_ascii_alphanumeric() || ch == '-' { + ch + } else { + '-' + } + }) + .collect::(); + while topic.contains("--") { + topic = topic.replace("--", "-"); + } + let topic = topic.trim_matches('-').to_string(); + if topic.is_empty() { + return None; + } + let topic = if topic.len() > MAX_TOPIC_LEN { + topic[..MAX_TOPIC_LEN].trim_matches('-').to_string() + } else { + topic + }; + (!topic.is_empty()).then_some(topic) +} + +fn normalize_arxiv_topic(paper_id: &str) -> Option { + let trimmed = paper_id.trim(); + // Pasted ids arrive as `arXiv:2401.12345` as often as the bare id; match the + // prefix case-insensitively or the scheme word rides into the topic. + let stripped = trimmed + .get(..6) + .filter(|prefix| prefix.eq_ignore_ascii_case("arxiv:")) + .map_or(trimmed, |_| trimmed[6..].trim()); + let id = stripped.split('/').next_back().unwrap_or(stripped); + let id = id.strip_suffix(".pdf").unwrap_or(id); + let id = strip_arxiv_version(id); + if id.is_empty() { + // A blank or scheme-only id has nothing to derive a topic from. + return None; + } + let id = id.replace('.', "-"); + normalize_topic(&format!("arxiv-{id}")) +} + +/// Drops a trailing `vN` so every version of one paper maps to one topic — +/// otherwise `2401.12345v1` and `v2` land in separate search buckets. +/// +/// Only a `v` followed by digits counts, and only when digits precede it, so an +/// old-style id like `hep-th/9901001` keeps its trailing `1`. +fn strip_arxiv_version(id: &str) -> &str { + if let Some((head, tail)) = id.rsplit_once('v') { + if !head.is_empty() + && head.ends_with(|ch: char| ch.is_ascii_digit()) + && !tail.is_empty() + && tail.chars().all(|ch| ch.is_ascii_digit()) + { + return head; + } + } + id +} + #[cfg(test)] mod tests { use super::*; @@ -252,4 +429,88 @@ mod tests { "GraphQL: Name already exists on this account" )); } + + #[test] + fn topic_normalization_and_dedup_work() { + let topics = sanitize_topics(&[ + " OpenResearch ".to_string(), + "paper_repro".to_string(), + "paper--repro".to_string(), + "".to_string(), + ]); + assert_eq!(topics, vec!["openresearch", "paper-repro"]); + } + + #[test] + fn effective_topics_include_auto_and_custom() { + let topics = effective_project_topics( + Some("2401.12345v2"), + &["Topic-A".to_string(), "paper-repro".to_string()], + true, + ); + // The version suffix is dropped, so v1/v2 share one searchable topic. + assert_eq!( + topics, + vec!["openresearch", "arxiv-2401-12345", "paper-repro", "topic-a"] + ); + } + + #[test] + fn auto_topics_can_be_disabled_without_losing_extras() { + let topics = effective_project_topics(Some("2401.12345"), &["llm".to_string()], false); + assert_eq!(topics, vec!["llm"]); + } + + #[test] + fn arxiv_ids_normalize_across_input_shapes() { + let topic = |id: &str| default_topics_for_project(Some(id)); + let expected = vec![ + "openresearch".to_string(), + "arxiv-2401-12345".to_string(), + "paper-repro".to_string(), + ]; + for id in [ + "2401.12345", + "2401.12345v2", + "arXiv:2401.12345v12", + "https://arxiv.org/abs/2401.12345", + "2401.12345.pdf", + ] { + assert_eq!(topic(id), expected, "id {id} should normalize"); + } + } + + #[test] + fn old_style_and_malformed_ids_keep_their_signals() { + // Old-style ids end in digits but carry no `vN`, so nothing is stripped. + assert_eq!(strip_arxiv_version("hep-th/9901001"), "hep-th/9901001"); + assert_eq!(strip_arxiv_version("cs.CL/0701001"), "cs.CL/0701001"); + // A trailing `v` with no digits is part of the id, not a version. + assert_eq!(strip_arxiv_version("2401.12345v"), "2401.12345v"); + // No arxiv id at all leaves the topic off entirely. + assert_eq!(default_topics_for_project(None), vec!["openresearch"]); + assert_eq!( + default_topics_for_project(Some(" ")), + vec!["openresearch"] + ); + } + + #[test] + fn merging_topics_preserves_what_the_repository_already_had() { + let desired = vec!["openresearch".to_string(), "paper-repro".to_string()]; + let existing = vec!["hand-added".to_string(), "paper-repro".to_string()]; + assert_eq!( + merge_topics(&desired, &existing), + vec!["openresearch", "paper-repro", "hand-added"] + ); + } + + #[test] + fn merging_topics_preserves_other_projects_and_respects_the_cap() { + let desired = vec!["a".to_string()]; + let existing = (0..30).map(|i| format!("topic-{i}")).collect::>(); + let merged = merge_topics(&desired, &existing); + assert_eq!(merged.len(), MAX_REPO_TOPICS); + assert_eq!(merged[0], "a"); + } } diff --git a/src/local/model.rs b/src/local/model.rs index 7267aa943..61e5b43e8 100644 --- a/src/local/model.rs +++ b/src/local/model.rs @@ -13,6 +13,8 @@ pub struct LocalProject { pub github_owner: String, pub github_repo: String, pub github_sync_enabled: bool, + pub github_auto_topics_enabled: bool, + pub github_topics: Vec, /// Fork point for baseline roots and the clone's default checkout — not /// where any experiment lives (legacy roots predating per-baseline /// branches may still ride it). @@ -26,7 +28,44 @@ pub struct LocalProject { pub updated_at: i64, } +/// Baseline shape for a project row. Production code builds projects from an +/// explicit literal (all fields are meaningful there), but tests and the demo +/// seed only care about a few of them — having a default keeps a new column +/// from breaking every one of those literals. +impl Default for LocalProject { + fn default() -> Self { + Self { + id: String::new(), + name: String::new(), + slug: String::new(), + github_owner: String::new(), + github_repo: String::new(), + github_sync_enabled: false, + github_auto_topics_enabled: false, + github_topics: Vec::new(), + baseline_branch: "main".to_string(), + repo_path: String::new(), + run_command: None, + paper_id: None, + created_at: 0, + updated_at: 0, + } + } +} + impl LocalProject { + /// Test-only project literal; every field the tests do not set takes its + /// default. Keeps new schema columns from rippling through fixtures. + #[cfg(test)] + pub fn for_test(id: &str) -> Self { + Self { + id: id.to_string(), + name: id.to_string(), + slug: id.to_string(), + ..Self::default() + } + } + pub fn github_enabled(&self) -> bool { self.github_sync_enabled && self.has_github_repository() } @@ -44,8 +83,13 @@ impl LocalProject { }) } + pub fn github_topics_enabled(&self) -> bool { + self.github_enabled() && self.github_auto_topics_enabled + } + /// Column order must match `store::PROJECT_COLS`. pub(crate) fn from_row(row: &rusqlite::Row<'_>) -> std::result::Result { + let github_topics: String = row.get(7)?; Ok(Self { id: row.get(0)?, name: row.get(1)?, @@ -53,12 +97,14 @@ impl LocalProject { github_owner: row.get(3)?, github_repo: row.get(4)?, github_sync_enabled: row.get(5)?, - baseline_branch: row.get(6)?, - repo_path: row.get(7)?, - run_command: row.get(8)?, - paper_id: row.get(9)?, - created_at: row.get(10)?, - updated_at: row.get(11)?, + github_auto_topics_enabled: row.get(6)?, + github_topics: serde_json::from_str::>(&github_topics).unwrap_or_default(), + baseline_branch: row.get(8)?, + repo_path: row.get(9)?, + run_command: row.get(10)?, + paper_id: row.get(11)?, + created_at: row.get(12)?, + updated_at: row.get(13)?, }) } } diff --git a/src/local/opencode.rs b/src/local/opencode.rs index 0bafbbce4..8b28e0356 100644 --- a/src/local/opencode.rs +++ b/src/local/opencode.rs @@ -633,6 +633,7 @@ mod tests { paper_id: None, created_at: 0, updated_at: 0, + ..Default::default() } } diff --git a/src/local/projects.rs b/src/local/projects.rs index b16e11396..511f03dc9 100644 --- a/src/local/projects.rs +++ b/src/local/projects.rs @@ -172,6 +172,8 @@ pub fn create_project( run_command, paper_id, paper_pdf, + github_auto_topics_enabled, + github_topics, } = options; let slug = unique_project_slug(store, &slugify(name))?; let repo_path = prepare_path( @@ -205,6 +207,8 @@ pub fn create_project( github_owner, github_repo, github_sync_enabled: false, + github_auto_topics_enabled, + github_topics, baseline_branch, repo_path: repo_path.to_string_lossy().to_string(), run_command: run_command.filter(|c| !c.trim().is_empty()), @@ -226,6 +230,8 @@ pub struct CreateProjectOptions { pub run_command: Option, pub paper_id: Option, pub paper_pdf: Option>, + pub github_auto_topics_enabled: bool, + pub github_topics: Vec, } #[cfg(test)] diff --git a/src/local/resolve.rs b/src/local/resolve.rs index a6cbc73d5..a1d0b98b8 100644 --- a/src/local/resolve.rs +++ b/src/local/resolve.rs @@ -54,6 +54,7 @@ mod tests { paper_id: None, created_at: now, updated_at: now, + ..Default::default() } } diff --git a/src/local/starter.rs b/src/local/starter.rs index 1a26023e0..23e18a88d 100644 --- a/src/local/starter.rs +++ b/src/local/starter.rs @@ -573,6 +573,7 @@ mod tests { paper_id: None, created_at: 0, updated_at: 0, + ..Default::default() } } diff --git a/src/store.rs b/src/store.rs index 92a67b07e..405b25878 100644 --- a/src/store.rs +++ b/src/store.rs @@ -433,6 +433,8 @@ impl Store { github_owner TEXT NOT NULL, github_repo TEXT NOT NULL, github_sync_enabled INTEGER NOT NULL DEFAULT 1, + github_auto_topics_enabled INTEGER NOT NULL DEFAULT 0, + github_topics TEXT NOT NULL DEFAULT '[]', baseline_branch TEXT NOT NULL DEFAULT 'main', repo_path TEXT NOT NULL, run_command TEXT, @@ -606,6 +608,8 @@ impl Store { "ALTER TABLE chat_sessions ADD COLUMN title_source TEXT", "ALTER TABLE local_projects ADD COLUMN paper_id TEXT", "ALTER TABLE local_projects ADD COLUMN github_sync_enabled INTEGER NOT NULL DEFAULT 1", + "ALTER TABLE local_projects ADD COLUMN github_auto_topics_enabled INTEGER NOT NULL DEFAULT 0", + "ALTER TABLE local_projects ADD COLUMN github_topics TEXT NOT NULL DEFAULT '[]'", "ALTER TABLE local_projects ADD COLUMN workspace_state_json TEXT", "ALTER TABLE local_experiments ADD COLUMN chat_session_id TEXT", "ALTER TABLE ssh_host_tests ADD COLUMN tools_found INTEGER NOT NULL DEFAULT 0", @@ -672,6 +676,23 @@ impl Store { tx.pragma_update(None, "user_version", 1)?; tx.commit()?; } + // Projects that already publish to GitHub predate automatic repository + // topics, and the column default (0) would leave them untagged until + // someone pushed by hand. Enable auto topics for exactly those rows once, + // so the backfill cannot re-fire and re-tag a project the user opted out. + let schema_version: i64 = conn.query_row("PRAGMA user_version", [], |row| row.get(0))?; + if schema_version < 2 { + let tx = conn.unchecked_transaction()?; + tx.execute( + "UPDATE local_projects SET github_auto_topics_enabled = 1 + WHERE github_sync_enabled = 1 + AND TRIM(github_owner) <> '' + AND TRIM(github_repo) <> ''", + [], + )?; + tx.pragma_update(None, "user_version", 2)?; + tx.commit()?; + } // Older builds of this branch created a one-root-per-project unique // index; multiple baselines are allowed, so make sure it's gone. let _ = conn.execute( @@ -1491,8 +1512,9 @@ impl Store { messages: &[StoredChatMessage], ) -> Result { let tx = self.begin()?; + let github_topics = serde_json::to_string(&project.github_topics)?; let inserted = tx.execute( - &format!("INSERT OR IGNORE INTO local_projects ({PROJECT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)"), + &format!("INSERT OR IGNORE INTO local_projects ({PROJECT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14)"), params![ project.id, project.name, @@ -1500,6 +1522,8 @@ impl Store { project.github_owner, project.github_repo, project.github_sync_enabled, + project.github_auto_topics_enabled, + github_topics, project.baseline_branch, project.repo_path, project.run_command, @@ -1607,11 +1631,13 @@ impl Store { } pub fn create_local_project(&self, p: &LocalProject) -> Result<()> { + let github_topics = serde_json::to_string(&p.github_topics)?; self.conn.execute( - &format!("INSERT INTO local_projects ({PROJECT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)"), + &format!("INSERT INTO local_projects ({PROJECT_COLS}) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14)"), params![ p.id, p.name, p.slug, p.github_owner, p.github_repo, - p.github_sync_enabled, p.baseline_branch, p.repo_path, p.run_command, p.paper_id, + p.github_sync_enabled, p.github_auto_topics_enabled, github_topics, + p.baseline_branch, p.repo_path, p.run_command, p.paper_id, p.created_at, p.updated_at, ], )?; @@ -1705,12 +1731,14 @@ impl Store { Ok(()) } - /// Full-row update by id (name / run_command / branch edits). + /// Full-row update by id (name / run_command / branch / topics edits). pub fn update_local_project(&self, p: &LocalProject) -> Result<()> { + let github_topics = serde_json::to_string(&p.github_topics)?; self.conn.execute( "UPDATE local_projects SET name = ?2, slug = ?3, github_owner = ?4, github_repo = ?5, - github_sync_enabled = ?6, baseline_branch = ?7, repo_path = ?8, - run_command = ?9, paper_id = ?10, updated_at = ?11 + github_sync_enabled = ?6, github_auto_topics_enabled = ?7, github_topics = ?8, + baseline_branch = ?9, repo_path = ?10, + run_command = ?11, paper_id = ?12, updated_at = ?13 WHERE id = ?1", params![ p.id, @@ -1719,6 +1747,8 @@ impl Store { p.github_owner, p.github_repo, p.github_sync_enabled, + p.github_auto_topics_enabled, + github_topics, p.baseline_branch, p.repo_path, p.run_command, @@ -3044,7 +3074,8 @@ const SELECT_RUN: &str = "SELECT id, experiment_id, project_id, status, backend_ chat_session_id FROM runs"; const PROJECT_COLS: &str = "id, name, slug, github_owner, github_repo, github_sync_enabled, \ - baseline_branch, repo_path, run_command, paper_id, created_at, updated_at"; + github_auto_topics_enabled, github_topics, baseline_branch, repo_path, \ + run_command, paper_id, created_at, updated_at"; const EXPERIMENT_COLS: &str = "id, project_id, parent_experiment_id, slug, branch_name, \ title, description, run_command, agent_status, created_at, \ @@ -3138,6 +3169,7 @@ mod tests { paper_id: None, created_at: 1, updated_at: 2, + ..Default::default() }) .unwrap(); } @@ -3285,6 +3317,7 @@ mod tests { paper_id: None, created_at: 1, updated_at: 1, + ..Default::default() }) .unwrap(); let mut older = chat_session_fixture("older"); @@ -4972,6 +5005,7 @@ mod tests { paper_id: None, created_at: 1, updated_at: 1, + ..Default::default() }) .unwrap(); @@ -5085,4 +5119,77 @@ mod tests { ); let _ = std::fs::remove_dir_all(&dir); } + + #[test] + fn github_topics_round_trip_through_json_column() { + let dir = std::env::temp_dir().join(format!("orx-topics-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + let project = LocalProject { + id: "p1".into(), + name: "P".into(), + slug: "p".into(), + github_owner: "o".into(), + github_repo: "r".into(), + github_sync_enabled: true, + github_auto_topics_enabled: true, + github_topics: vec!["openresearch".into(), "llm".into()], + ..Default::default() + }; + store.create_local_project(&project).unwrap(); + let stored = store.get_local_project("p1").unwrap().unwrap(); + assert_eq!(stored.github_topics, project.github_topics); + assert!(stored.github_auto_topics_enabled); + assert_eq!(stored.paper_id, project.paper_id); + + let mut renamed = project.clone(); + renamed.github_topics = vec!["openresearch".into()]; + renamed.github_auto_topics_enabled = false; + store.update_local_project(&renamed).unwrap(); + let stored = store.get_local_project("p1").unwrap().unwrap(); + assert_eq!(stored.github_topics, vec!["openresearch"]); + assert!(!stored.github_auto_topics_enabled); + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn migrated_projects_that_already_sync_get_auto_topics() { + let dir = std::env::temp_dir().join(format!("orx-topics-migrate-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + for (id, owner, repo, syncing) in [("linked", "o", "r", true), ("unlinked", "", "", false)] + { + store + .create_local_project(&LocalProject { + id: id.into(), + name: id.into(), + slug: id.into(), + github_owner: owner.into(), + github_repo: repo.into(), + github_sync_enabled: syncing, + ..Default::default() + }) + .unwrap(); + } + // Simulate an upgrade: rewind the marker so the v2 backfill runs again. + store.conn.pragma_update(None, "user_version", 0).unwrap(); + drop(store); + + let reopened = Store::open_at(dir.clone()).unwrap(); + assert!( + reopened + .get_local_project("linked") + .unwrap() + .unwrap() + .github_auto_topics_enabled, + "a project already publishing to GitHub gains auto topics" + ); + assert!( + !reopened + .get_local_project("unlinked") + .unwrap() + .unwrap() + .github_auto_topics_enabled, + "a project with no repository stays untouched" + ); + let _ = std::fs::remove_dir_all(&dir); + } } diff --git a/src/telemetry.rs b/src/telemetry.rs index d1403967f..202bbd764 100644 --- a/src/telemetry.rs +++ b/src/telemetry.rs @@ -152,6 +152,10 @@ pub(crate) struct Settings { /// Whether the one-time post-publication default prompt has been answered. #[serde(default)] pub github_default_prompt_seen: Option, + /// Whether new projects should auto-apply GitHub repository topics when + /// GitHub syncing is enabled. + #[serde(default)] + pub github_auto_topics_for_new_projects: Option, /// Literature sources the user turned off (Settings → Literature sources). /// Values are `LitSource::as_str()` names; empty = all sources enabled, so a /// source added later defaults to enabled. Enforced by discovery and paper reading. @@ -289,6 +293,16 @@ pub(crate) fn set_github_for_new_projects(enabled: bool) -> std::io::Result<()> mutate_settings(|settings| settings.github_for_new_projects = Some(enabled)) } +pub(crate) fn github_auto_topics_for_new_projects() -> bool { + load_settings() + .and_then(|settings| settings.github_auto_topics_for_new_projects) + .unwrap_or_else(github_for_new_projects) +} + +pub(crate) fn set_github_auto_topics_for_new_projects(enabled: bool) -> std::io::Result<()> { + mutate_settings(|settings| settings.github_auto_topics_for_new_projects = Some(enabled)) +} + /// Whether orx may apply updates on its own. Defaults to enabled — the whole /// point is that an install nobody tends stays current. pub(crate) fn auto_update_enabled() -> bool { diff --git a/ui/dist/assets/index-CQbtnwiZ.js b/ui/dist/assets/index-zOVqYBAH.js similarity index 55% rename from ui/dist/assets/index-CQbtnwiZ.js rename to ui/dist/assets/index-zOVqYBAH.js index bfd3ec55d..56417bc04 100644 --- a/ui/dist/assets/index-CQbtnwiZ.js +++ b/ui/dist/assets/index-zOVqYBAH.js @@ -1,4 +1,4 @@ -var eG=Object.defineProperty;var XC=e=>{throw TypeError(e)};var tG=(e,n,t)=>n in e?eG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>tG(e,typeof n!="symbol"?n+"":n,t),tx=(e,n,t)=>n.has(e)||XC("Cannot "+t);var de=(e,n,t)=>(tx(e,n,"read from private field"),t?t.call(e):n.get(e)),rt=(e,n,t)=>n.has(e)?XC("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(tx(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Dt=(e,n,t)=>(tx(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return de(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Gp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nx={exports:{}},s0={};/** +var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in e?sG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>iG(e,typeof n!="symbol"?n+"":n,t),n2=(e,n,t)=>n.has(e)||Z8("Cannot "+t);var ue=(e,n,t)=>(n2(e,n,"read from private field"),t?t.call(e):n.get(e)),st=(e,n,t)=>n.has(e)?Z8("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(n2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ot=(e,n,t)=>(n2(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return ue(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r2={exports:{}},s0={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var eG=Object.defineProperty;var XC=e=>{throw TypeError(e)};var tG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ZC;function nG(){if(ZC)return s0;ZC=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var JC;function rG(){return JC||(JC=1,nx.exports=nG()),nx.exports}var f=rG(),rx={exports:{}},Xt={};/** + */var J8;function aG(){if(J8)return s0;J8=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var e9;function oG(){return e9||(e9=1,r2.exports=aG()),r2.exports}var f=oG(),s2={exports:{}},Xt={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var eG=Object.defineProperty;var XC=e=>{throw TypeError(e)};var tG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var e9;function sG(){if(e9)return Xt;e9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,q,G){this.props=F,this.context=q,this.refs=v,this.updater=G||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,q){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,q,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,q,G){this.props=F,this.context=q,this.refs=v,this.updater=G||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function M(F,q,G){var ee=G.ref;return{$$typeof:e,type:F,key:q,ref:ee!==void 0?ee:null,props:G}}function O(F,q){return M(F.type,q,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var q={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(G){return q[G]})}var U=/\/+/g;function H(F,q){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):q.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(q){F.status==="pending"&&(F.status="fulfilled",F.value=q)},function(q){F.status==="pending"&&(F.status="rejected",F.reason=q)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function V(F,q,G,ee,ce){var oe=typeof F;(oe==="undefined"||oe==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(oe){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,V(ne(F._payload),q,G,ee,ce)}}if(ne)return ce=ce(F),ne=ee===""?"."+H(F,0):ee,E(ce)?(G="",ne!=null&&(G=ne.replace(U,"$&/")+"/"),V(ce,q,G,"",function(ae){return ae})):ce!=null&&(B(ce)&&(ce=O(ce,G+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(U,"$&/")+"/")+ne)),q.push(ce)),1;ne=0;var Q=ee===""?".":ee+":";if(E(F))for(var le=0;le{const n=R.useContext(oM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},iG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(oM.Provider,{value:e,children:n})),aG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,z5,QR,oG=(QR=class{constructor(){rt(this,Qc,aG);rt(this,z5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return de(this,Qc).setTimeout(e,n)}clearTimeout(e){de(this,Qc).clearTimeout(e)}setInterval(e,n){return de(this,Qc).setInterval(e,n)}clearInterval(e){de(this,Qc).clearInterval(e)}},Qc=new WeakMap,z5=new WeakMap,QR);const ad=new oG;function lG(e){setTimeout(e,0)}const cG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function uG(e,n){return typeof e=="function"?e(n):e}function lM(e){return typeof e=="number"&&e>=0&&e!==1/0}function cM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Br(e,n){return typeof e=="function"?e(n):e}function n9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==j5(a,n.options))return!1}else if(!Oh(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function r9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Oh(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function j5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Yw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Oh(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=s9(e)&&s9(n);if(!r&&!(Yw(e)&&Yw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Xw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?T5(e,n):n}function hG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function _G(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const A5=Symbol();function uM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===A5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function R5(e,n){return typeof e=="function"?e(...n):!!e}function pG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let mG=()=>cG;const M5=()=>mG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,vh,YR,gG=(YR=class extends Gd{constructor(){super();rt(this,ud);rt(this,Yc);rt(this,vh);Fe(this,vh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){de(this,Yc)||this.setEventListener(de(this,vh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,vh,n),(t=de(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){de(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof de(this,ud)=="boolean"?de(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,vh=new WeakMap,YR);const D5=new gG,vG=lG;function bG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=vG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=bG();var bh,Xc,yh,XR,yG=(XR=class extends Gd{constructor(){super();rt(this,bh,!0);rt(this,Xc);rt(this,yh);Fe(this,yh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,Xc)||this.setEventListener(de(this,yh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,yh,n),(t=de(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){de(this,bh)!==n&&(Fe(this,bh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return de(this,bh)}},bh=new WeakMap,Xc=new WeakMap,yh=new WeakMap,XR);const H1=new yG;function xG(e){return Math.min(1e3*2**e,3e4)}function dM(e){return(e??"online")==="online"?H1.isOnline():!0}var q1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wG(e){return e instanceof q1}function fM(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new q1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>D5.isFocused()&&(e.networkMode==="always"||H1.isOnline())&&e.canRun(),m=()=>dM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(M5()?0:3),N=e.retryDelay??xG,T=typeof N=="function"?N(t,C):N,z=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,ZR,hM=(ZR=class{constructor(){rt(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M5()?1/0:3e5))}clearGcTimeout(){de(this,dd)!==void 0&&(ad.clearTimeout(de(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,ZR);function SG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{pG(y,()=>n.signal,()=>S=!0)},b=uM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),z=await b(T),{maxPages:M}=n.options,O=E?_G:hG;return{pages:O(y.pages,z,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?kG:a9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:a9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function a9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function kG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var xh,fd,wh,wa,hd,hs,Ap,_d,Ha,Sl,JR,CG=(JR=class extends hM{constructor(n){super();rt(this,Ha);rt(this,xh);rt(this,fd);rt(this,wh);rt(this,wa);rt(this,hd);rt(this,hs);rt(this,Ap);rt(this,_d);Fe(this,_d,!1),Fe(this,Ap,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,de(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,l9(this.options)),this.state=n.state??de(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return de(this,xh)}get promise(){var n;return(n=de(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...de(this,Ap),...n},n!=null&&n._type&&Fe(this,xh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=l9(this.options);t.data!==void 0&&(this.setState(o9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,wa).remove(this)}setData(n,t){const r=Xw(this.state.data,n,this.options);return Dt(this,Ha,Sl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Dt(this,Ha,Sl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=de(this,hs))==null?void 0:r.promise;return(s=de(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return de(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Br(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===A5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Br(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!cM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),de(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(de(this,hs)&&(de(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?de(this,hs).cancel({revert:!0}):de(this,hs).cancelRetry()),this.scheduleGc()),de(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Dt(this,Ha,Sl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=de(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(de(this,hs))return de(this,hs).continueRetry(),de(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=uM(this.options,t),T=(()=>{const z={client:de(this,hd),queryKey:this.queryKey,meta:this.meta};return s(z),z})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:de(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=de(this,xh)==="infinite"?SG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,wh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Dt(this,Ha,Sl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,fM({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof q1&&E.revert&&this.setState({...de(this,wh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Dt(this,Ha,Sl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Dt(this,Ha,Sl).call(this,{type:"pause"})},onContinue:()=>{Dt(this,Ha,Sl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=de(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=de(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof q1){if(E.silent)return de(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Dt(this,Ha,Sl).call(this,{type:"error",error:E}),(w=(b=de(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=de(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{de(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},xh=new WeakMap,fd=new WeakMap,wh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Ap=new WeakMap,_d=new WeakMap,Ha=new WeakSet,Sl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,..._M(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...o9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,wh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),de(this,wa).notify({query:this,type:"updated",action:n})})},JR);function _M(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function o9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function l9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Rp,ri,pd,Sh,Nl,Mp,kh,Ch,md,gd,Zc,Eh,qn,S0,Zw,Jw,e4,t4,n4,r4,s4,i4,eM,L5=(eM=class extends Gd{constructor(n,t){super();rt(this,qn);rt(this,ni);rt(this,Sn);rt(this,Rp);rt(this,ri);rt(this,pd);rt(this,Sh);rt(this,Nl);rt(this,Mp);rt(this,kh);rt(this,Ch);rt(this,md);rt(this,gd);rt(this,Zc);rt(this,Eh,new Set);this.options=t,Fe(this,ni,n),Fe(this,Nl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(de(this,Sn).addObserver(this),c9(de(this,Sn),this.options)?Dt(this,qn,S0).call(this):this.updateResult(),Dt(this,qn,n4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return a4(de(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return a4(de(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Dt(this,qn,r4).call(this),Dt(this,qn,s4).call(this),de(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=de(this,Sn);if(this.options=de(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Br(this.options.enabled,de(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Dt(this,qn,i4).call(this),de(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&de(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:de(this,Sn),observer:this});const s=this.hasListeners();s&&u9(de(this,Sn),r,this.options,t)&&Dt(this,qn,S0).call(this),this.updateResult(),s&&(de(this,Sn)!==r||Br(this.options.enabled,de(this,Sn))!==Br(t.enabled,de(this,Sn))||Br(this.options.staleTime,de(this,Sn))!==Br(t.staleTime,de(this,Sn)))&&Dt(this,qn,Jw).call(this);const i=Dt(this,qn,e4).call(this);s&&(de(this,Sn)!==r||Br(this.options.enabled,de(this,Sn))!==Br(t.enabled,de(this,Sn))||i!==de(this,Zc))&&Dt(this,qn,t4).call(this,i)}getOptimisticResult(n){const t=de(this,ni).getQueryCache().build(de(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,Sh,this.options),Fe(this,pd,de(this,Sn).state)),r}getCurrentResult(){return de(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){de(this,Eh).add(n)}getCurrentQuery(){return de(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=de(this,ni).defaultQueryOptions(n),r=de(this,ni).getQueryCache().build(de(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=de(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Dt(this,qn,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),de(this,ri)))}createResult(n,t){var N;const r=de(this,Sn),s=this.options,i=de(this,ri),a=de(this,pd),o=de(this,Sh),l=n!==r?n.state:de(this,Rp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),z=!T&&c9(n,t),M=T&&u9(n,r,t,s);(z||M)&&(_={..._,..._M(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=de(this,Ch))==null?void 0:N.state.data,de(this,Ch)):t.placeholderData,T!==void 0&&(S="success",p=Xw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===de(this,Mp))p=de(this,kh);else try{Fe(this,Mp,t.select),p=t.select(p),p=Xw(i==null?void 0:i.data,p,t),Fe(this,kh,p),Fe(this,Nl,null)}catch(T){Fe(this,Nl,T)}else p===void 0&&Fe(this,Nl,null);de(this,Nl)&&(m=de(this,Nl),p=de(this,kh),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:O5(n,t),refetch:this.refetch,isEnabled:Br(t.enabled,n)!==!1}}updateResult(){const n=de(this,ri),t=this.createResult(de(this,Sn),this.options);if(Fe(this,pd,de(this,Sn).state),Fe(this,Sh,this.options),de(this,pd).data!==void 0&&Fe(this,Ch,de(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!de(this,Eh).size)return!0;const o=new Set(a??de(this,Eh));return this.options.throwOnError&&o.add("error"),Object.keys(de(this,ri)).some(l=>{const u=l;return de(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(de(this,ri))}),de(this,ni).getQueryCache().notify({query:de(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Dt(this,qn,n4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Rp=new WeakMap,ri=new WeakMap,pd=new WeakMap,Sh=new WeakMap,Nl=new WeakMap,Mp=new WeakMap,kh=new WeakMap,Ch=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Eh=new WeakMap,qn=new WeakSet,S0=function(n){Dt(this,qn,i4).call(this);let t=de(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},Zw=function(n){return!M5()&&Br(this.options.enabled,de(this,Sn))!==!1&&lM(n)},Jw=function(){Dt(this,qn,r4).call(this);const n=Br(this.options.staleTime,de(this,Sn));if(de(this,ri).isStale||!Dt(this,qn,Zw).call(this,n))return;const t=cM(de(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{de(this,ri).isStale||this.updateResult()},t))},e4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(de(this,Sn)):this.options.refetchInterval)??!1},t4=function(n){Dt(this,qn,s4).call(this),Fe(this,Zc,n),!(de(this,Zc)===0||!Dt(this,qn,Zw).call(this,de(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||D5.isFocused())&&Dt(this,qn,S0).call(this)},de(this,Zc)))},n4=function(){Dt(this,qn,Jw).call(this),Dt(this,qn,t4).call(this,Dt(this,qn,e4).call(this))},r4=function(){de(this,md)!==void 0&&(ad.clearTimeout(de(this,md)),Fe(this,md,void 0))},s4=function(){de(this,gd)!==void 0&&(ad.clearInterval(de(this,gd)),Fe(this,gd,void 0))},i4=function(){const n=de(this,ni).getQueryCache().build(de(this,ni),this.options);if(n===de(this,Sn))return;const t=de(this,Sn);Fe(this,Sn,n),Fe(this,Rp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},eM);function EG(e,n){return Br(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Br(n.retryOnMount,e)===!1)}function c9(e,n){return EG(e,n)||e.state.data!==void 0&&a4(e,n,n.refetchOnMount)}function a4(e,n,t){if(Br(n.enabled,e)!==!1&&Br(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&O5(e,n)}return!1}function u9(e,n,t,r){return(e!==n||Br(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&O5(e,t)}function O5(e,n){return Br(n.enabled,e)!==!1&&e.isStaleByTime(Br(n.staleTime,e))}var Dp,Co,qs,vd,Eo,Uc,tM,NG=(tM=class extends hM{constructor(n){super();rt(this,Eo);rt(this,Dp);rt(this,Co);rt(this,qs);rt(this,vd);Fe(this,Dp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Co,[]),this.state=n.state||pM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){de(this,Co).includes(n)||(de(this,Co).push(n),this.clearGcTimeout(),de(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Co,de(this,Co).filter(t=>t!==n)),this.scheduleGc(),de(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){de(this,Co).length||(this.state.status==="pending"?this.scheduleGc():de(this,qs).remove(this))}continue(){var n;return((n=de(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,z;const t=()=>{Dt(this,Eo,Uc).call(this,{type:"continue"})},r={client:de(this,Dp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,fM({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Dt(this,Eo,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Dt(this,Eo,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Dt(this,Eo,Uc).call(this,{type:"pending",variables:n,isPaused:a}),de(this,qs).config.onMutate&&await de(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Dt(this,Eo,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=de(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=de(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Dt(this,Eo,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=de(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=de(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((z=(T=this.options).onSettled)==null?void 0:z.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Dt(this,Eo,Uc).call(this,{type:"error",error:M}),M}finally{de(this,vd)===s&&Fe(this,vd,void 0),de(this,qs).runNext(this)}}},Dp=new WeakMap,Co=new WeakMap,qs=new WeakMap,vd=new WeakMap,Eo=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{de(this,Co).forEach(r=>{r.onMutationUpdate(n)}),de(this,qs).notify({mutation:this,type:"updated",action:n})})},tM);function pM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zl,qa,Lp,nM,zG=(nM=class extends Gd{constructor(n={}){super();rt(this,zl);rt(this,qa);rt(this,Lp);this.config=n,Fe(this,zl,new Set),Fe(this,qa,new Map),Fe(this,Lp,0)}build(n,t,r){const s=new NG({client:n,mutationCache:this,mutationId:++r0(this,Lp)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){de(this,zl).add(n);const t=yg(n);if(typeof t=="string"){const r=de(this,qa).get(t);r?r.push(n):de(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(de(this,zl).delete(n)){const t=yg(n);if(typeof t=="string"){const r=de(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&de(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=yg(n);if(typeof t=="string"){const s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=yg(n);return typeof t=="string"?((s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{de(this,zl).forEach(n=>{this.notify({type:"removed",mutation:n})}),de(this,zl).clear(),de(this,qa).clear()})}getAll(){return Array.from(de(this,zl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){return this.getAll().filter(t=>r9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},zl=new WeakMap,qa=new WeakMap,Lp=new WeakMap,nM);function yg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var jl,Jc,Us,Tl,Ro,k0,o4,rM,jG=(rM=class extends Gd{constructor(t,r){super();rt(this,Ro);rt(this,jl);rt(this,Jc);rt(this,Us);rt(this,Tl);Fe(this,jl,t),this.setOptions(r),this.bindMethods(),Dt(this,Ro,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=de(this,jl).defaultMutationOptions(t),A0(this.options,r)||de(this,jl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:de(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=de(this,Us))==null?void 0:s.state.status)==="pending"&&de(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&de(this,Us)&&(de(this,Us).addObserver(this),Dt(this,Ro,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=de(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Dt(this,Ro,k0).call(this),Dt(this,Ro,o4).call(this,t)}getCurrentResult(){return de(this,Jc)}reset(){var t;(t=de(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Dt(this,Ro,k0).call(this),Dt(this,Ro,o4).call(this)}mutate(t,r){var s;return Fe(this,Tl,r),(s=de(this,Us))==null||s.removeObserver(this),Fe(this,Us,de(this,jl).getMutationCache().build(de(this,jl),this.options)),de(this,Us).addObserver(this),de(this,Us).execute(t)}},jl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Tl=new WeakMap,Ro=new WeakSet,k0=function(){var r;const t=((r=de(this,Us))==null?void 0:r.state)??pM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},o4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(de(this,Tl)&&this.hasListeners()){const d=de(this,Jc).variables,p=de(this,Jc).context,m={client:de(this,jl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=de(this,Tl)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=de(this,Tl)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=de(this,Tl)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=de(this,Tl)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(de(this,Jc))})})},rM);function d9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var Nh,si,zh,bd,Pi,yd,Op,Ip,Bp,$p,ms,l4,c4,mM,u4,d4,f4,sM,TG=(sM=class extends Gd{constructor(n,t,r){super();rt(this,ms);rt(this,Nh);rt(this,si);rt(this,zh);rt(this,bd);rt(this,Pi);rt(this,yd);rt(this,Op);rt(this,Ip);rt(this,Bp);rt(this,$p,[]);Fe(this,Nh,n),Fe(this,bd,r),Fe(this,zh,[]),Fe(this,Pi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&de(this,Pi).forEach(n=>{n.subscribe(t=>{Dt(this,ms,d4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,de(this,Pi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,zh,n),Fe(this,bd,t),Tr.batch(()=>{const r=de(this,Pi),s=Dt(this,ms,u4).call(this,de(this,zh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=de(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,$p,s),Fe(this,Pi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(d9(r,i).forEach(d=>{d.destroy()}),d9(i,r).forEach(d=>{d.subscribe(p=>{Dt(this,ms,d4).call(this,d,p)})})),Dt(this,ms,f4).call(this)))})}getCurrentResult(){return de(this,si)}getQueries(){return de(this,Pi).map(n=>n.getCurrentQuery())}getObservers(){return de(this,Pi)}getOptimisticResult(n,t){const r=Dt(this,ms,u4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Dt(this,ms,c4).call(this,a??s,t,i),()=>Dt(this,ms,l4).call(this,s,r)]}},Nh=new WeakMap,si=new WeakMap,zh=new WeakMap,bd=new WeakMap,Pi=new WeakMap,yd=new WeakMap,Op=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,ms=new WeakSet,l4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},c4=function(n,t,r){if(t){const s=de(this,Bp),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(de(this,si)!==de(this,Ip)||i||t!==de(this,Op))&&(Fe(this,Op,t),Fe(this,Ip,de(this,si)),r!==void 0&&Fe(this,Bp,r),Fe(this,yd,T5(de(this,yd),t(n)))),de(this,yd)}return n},mM=function(){var n;return!((n=de(this,bd))!=null&&n.combine)||de(this,Pi).some((t,r)=>{var s;return t.options.suspense&&((s=de(this,si)[r])==null?void 0:s.data)===void 0})},u4=function(n){const t=new Map;de(this,Pi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=de(this,Nh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new L5(de(this,Nh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},d4=function(n,t){const r=de(this,Pi).indexOf(n);r!==-1&&(Fe(this,si,de(this,si).slice()),de(this,si)[r]=t,Dt(this,ms,f4).call(this))},f4=function(){var n;if(this.hasListeners()){const t=Dt(this,ms,mM).call(this),r=de(this,yd),s=t?r:Dt(this,ms,c4).call(this,Dt(this,ms,l4).call(this,de(this,si),de(this,$p)),(n=de(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(de(this,si))})})}},sM),No,iM,AG=(iM=class extends Gd{constructor(n={}){super();rt(this,No);this.config=n,Fe(this,No,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??j5(s,t);let a=this.get(i);return a||(a=new CG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){de(this,No).has(n.queryHash)||(de(this,No).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=de(this,No).get(n.queryHash);t&&(n.destroy(),t===n&&de(this,No).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return de(this,No).get(n)}getAll(){return[...de(this,No).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>n9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>n9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},No=new WeakMap,iM),zr,eu,tu,jh,Th,nu,Ah,Rh,aM,RG=(aM=class{constructor(e={}){rt(this,zr);rt(this,eu);rt(this,tu);rt(this,jh);rt(this,Th);rt(this,nu);rt(this,Ah);rt(this,Rh);Fe(this,zr,e.queryCache||new AG),Fe(this,eu,e.mutationCache||new zG),Fe(this,tu,e.defaultOptions||{}),Fe(this,jh,new Map),Fe(this,Th,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,de(this,nu)===1&&(Fe(this,Ah,D5.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onFocus())})),Fe(this,Rh,H1.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,de(this,nu)===0&&((e=de(this,Ah))==null||e.call(this),Fe(this,Ah,void 0),(n=de(this,Rh))==null||n.call(this),Fe(this,Rh,void 0))}isFetching(e){return de(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return de(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=de(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime(Br(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return de(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=de(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=uG(n,s);if(i!==void 0)return de(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>de(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=de(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=de(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>de(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(de(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>de(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n),r=t.isStaleByTime(Br(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n);return t.isStaleByTime(Br(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return H1.isOnline()?de(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,zr)}getMutationCache(){return de(this,eu)}getDefaultOptions(){return de(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){de(this,jh).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...de(this,jh).values()],t={};return n.forEach(r=>{Oh(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){de(this,Th).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...de(this,Th).values()],t={};return n.forEach(r=>{Oh(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...de(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=j5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===A5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...de(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){de(this,zr).clear(),de(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,jh=new WeakMap,Th=new WeakMap,nu=new WeakMap,Ah=new WeakMap,Rh=new WeakMap,aM);const gM=R.createContext(!1),vM=()=>R.useContext(gM);gM.Provider;function MG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const DG=R.createContext(MG()),bM=()=>R.useContext(DG),yM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?R5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},xM=e=>{R.useEffect(()=>{e.clearReset()},[e])},wM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||R5(t,[e.error,r])),SM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},h4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,kM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function LG({queries:e,...n},t){const r=i_(),s=vM(),i=bM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{SM(S);const v=r.getQueryCache().get(S.queryHash);yM(S,i,v)}),xM(i);const[l]=R.useState(()=>new TG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>h4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&h4(b,S)){const w=new L5(r,b);return kM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&wM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function OG(e,n,t){const r=vM(),s=bM(),i=i_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,SM(a),yM(a,s,o),xM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),h4(a,_))throw kM(a,u,s);if(wM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return OG(e,L5)}function IG(e,n){const t=i_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function gn(e,n){const t=i_(),[r]=R.useState(()=>new jG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&R5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new RG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let f9=null,Uv=0;const _4=new Set,BG=()=>Uv,h9=e=>(_4.add(e),()=>{_4.delete(e)}),za=()=>["workspace",Uv],Nt=(e,...n)=>[...za(),e,...n];function $G(e,n=!1){if(f9===e&&!n)return!1;const t=za();return f9=e,Uv++,du.clear(),I5({queryKey:t}),_4.forEach(r=>r()),!0}const Pn=e=>e[1]===Uv;async function I5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Gr(e,n){if(Pn(e))return nt.setQueryData(e,n)}var sx={exports:{}},i0={},ix={exports:{}},ax={};/** + */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(P){return P===null||typeof P!="object"?null:(P=p&&P[p]||P["@@iterator"],typeof P=="function"?P:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(P,W,U){this.props=P,this.context=W,this.refs=v,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(P,W){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,W,"setState")},b.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(P,W,U){this.props=P,this.context=W,this.refs=v,this.updater=U||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(P,W,U){var te=U.ref;return{$$typeof:e,type:P,key:W,ref:te!==void 0?te:null,props:U}}function O(P,W){return M(P.type,W,P.props)}function B(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function $(P){var W={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(U){return W[U]})}var H=/\/+/g;function q(P,W){return typeof P=="object"&&P!==null&&P.key!=null?$(""+P.key):W.toString(36)}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(N,N):(P.status="pending",P.then(function(W){P.status==="pending"&&(P.status="fulfilled",P.value=W)},function(W){P.status==="pending"&&(P.status="rejected",P.reason=W)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function G(P,W,U,te,de){var re=typeof P;(re==="undefined"||re==="boolean")&&(P=null);var ne=!1;if(P===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(P.$$typeof){case e:case n:ne=!0;break;case _:return ne=P._init,G(ne(P._payload),W,U,te,de)}}if(ne)return de=de(P),ne=te===""?"."+q(P,0):te,E(de)?(U="",ne!=null&&(U=ne.replace(H,"$&/")+"/"),G(de,W,U,"",function(oe){return oe})):de!=null&&(B(de)&&(de=O(de,U+(de.key==null||P&&P.key===de.key?"":(""+de.key).replace(H,"$&/")+"/")+ne)),W.push(de)),1;ne=0;var Q=te===""?".":te+":";if(E(P))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,T5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,T5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return ue(this,Qc).setTimeout(e,n)}clearTimeout(e){ue(this,Qc).clearTimeout(e)}setInterval(e,n){return ue(this,Qc).setInterval(e,n)}clearInterval(e){ue(this,Qc).clearInterval(e)}},Qc=new WeakMap,T5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==A5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function A5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Xw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Xw(e)&&Xw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Zw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?R5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const M5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===M5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const L5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ue(this,Yc)||this.setEventListener(ue(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=ue(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){ue(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof ue(this,ud)=="boolean"?ue(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const O5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,Xc)||this.setEventListener(ue(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=ue(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){ue(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return ue(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const q1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?q1.isOnline():!0}var U1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof U1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new U1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>O5.isFocused()&&(e.networkMode==="always"||q1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(L5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L5()?1/0:3e5))}clearGcTimeout(){ue(this,dd)!==void 0&&(ad.clearTimeout(ue(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,ue(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??ue(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ue(this,wh)}get promise(){var n;return(n=ue(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...ue(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,wa).remove(this)}setData(n,t){const r=Zw(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=ue(this,hs))==null?void 0:r.promise;return(s=ue(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ue(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===M5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),ue(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(ue(this,hs)&&(ue(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ue(this,hs).cancel({revert:!0}):ue(this,hs).cancelRetry()),this.scheduleGc()),ue(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=ue(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(ue(this,hs))return ue(this,hs).continueRetry(),ue(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:ue(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ue(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=ue(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof U1&&E.revert&&this.setState({...ue(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=ue(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=ue(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof U1){if(E.silent)return ue(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=ue(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=ue(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{ue(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),ue(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,Jw,e4,t4,n4,r4,s4,i4,a4,nM,I5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,Sn).addObserver(this),u9(ue(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,r4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return o4(ue(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return o4(ue(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,s4).call(this),Ot(this,Un,i4).call(this),ue(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=ue(this,Sn);if(this.options=ue(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,ue(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,a4).call(this),ue(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&ue(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,Sn),observer:this});const s=this.hasListeners();s&&d9(ue(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||$r(this.options.staleTime,ue(this,Sn))!==$r(t.staleTime,ue(this,Sn)))&&Ot(this,Un,e4).call(this);const i=Ot(this,Un,t4).call(this);s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||i!==ue(this,Zc))&&Ot(this,Un,n4).call(this,i)}getOptimisticResult(n){const t=ue(this,ni).getQueryCache().build(ue(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,ue(this,Sn).state)),r}getCurrentResult(){return ue(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){ue(this,Nh).add(n)}getCurrentQuery(){return ue(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=ue(this,ni).defaultQueryOptions(n),r=ue(this,ni).getQueryCache().build(ue(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=ue(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,ri)))}createResult(n,t){var N;const r=ue(this,Sn),s=this.options,i=ue(this,ri),a=ue(this,pd),o=ue(this,kh),l=n!==r?n.state:ue(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=ue(this,Eh))==null?void 0:N.state.data,ue(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=Zw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===ue(this,Dp))p=ue(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=Zw(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);ue(this,zl)&&(m=ue(this,zl),p=ue(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:B5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=ue(this,ri),t=this.createResult(ue(this,Sn),this.options);if(Fe(this,pd,ue(this,Sn).state),Fe(this,kh,this.options),ue(this,pd).data!==void 0&&Fe(this,Eh,ue(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,Nh).size)return!0;const o=new Set(a??ue(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(ue(this,ri)).some(l=>{const u=l;return ue(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(ue(this,ri))}),ue(this,ni).getQueryCache().notify({query:ue(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,r4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,a4).call(this);let t=ue(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},Jw=function(n){return!L5()&&$r(this.options.enabled,ue(this,Sn))!==!1&&uM(n)},e4=function(){Ot(this,Un,s4).call(this);const n=$r(this.options.staleTime,ue(this,Sn));if(ue(this,ri).isStale||!Ot(this,Un,Jw).call(this,n))return;const t=dM(ue(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{ue(this,ri).isStale||this.updateResult()},t))},t4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,Sn)):this.options.refetchInterval)??!1},n4=function(n){Ot(this,Un,i4).call(this),Fe(this,Zc,n),!(ue(this,Zc)===0||!Ot(this,Un,Jw).call(this,ue(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||O5.isFocused())&&Ot(this,Un,S0).call(this)},ue(this,Zc)))},r4=function(){Ot(this,Un,e4).call(this),Ot(this,Un,n4).call(this,Ot(this,Un,t4).call(this))},s4=function(){ue(this,md)!==void 0&&(ad.clearTimeout(ue(this,md)),Fe(this,md,void 0))},i4=function(){ue(this,gd)!==void 0&&(ad.clearInterval(ue(this,gd)),Fe(this,gd,void 0))},a4=function(){const n=ue(this,ni).getQueryCache().build(ue(this,ni),this.options);if(n===ue(this,Sn))return;const t=ue(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&o4(e,n,n.refetchOnMount)}function o4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&B5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&B5(e,t)}function B5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){ue(this,Eo).includes(n)||(ue(this,Eo).push(n),this.clearGcTimeout(),ue(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,ue(this,Eo).filter(t=>t!==n)),this.scheduleGc(),ue(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){ue(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():ue(this,qs).remove(this))}continue(){var n;return((n=ue(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:ue(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),ue(this,qs).config.onMutate&&await ue(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=ue(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=ue(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=ue(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=ue(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{ue(this,vd)===s&&Fe(this,vd,void 0),ue(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{ue(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),ue(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){ue(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);r?r.push(n):ue(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(ue(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&ue(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{ue(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),ue(this,jl).clear(),ue(this,qa).clear()})}getAll(){return Array.from(ue(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,l4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=ue(this,Tl).defaultMutationOptions(t),A0(this.options,r)||ue(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ue(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=ue(this,Us))==null?void 0:s.state.status)==="pending"&&ue(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&ue(this,Us)&&(ue(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=ue(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this,t)}getCurrentResult(){return ue(this,Jc)}reset(){var t;(t=ue(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=ue(this,Us))==null||s.removeObserver(this),Fe(this,Us,ue(this,Tl).getMutationCache().build(ue(this,Tl),this.options)),ue(this,Us).addObserver(this),ue(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=ue(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},l4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(ue(this,Al)&&this.hasListeners()){const d=ue(this,Jc).variables,p=ue(this,Jc).context,m={client:ue(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=ue(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=ue(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=ue(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=ue(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(ue(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,c4,u4,vM,d4,f4,h4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&ue(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,f4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,ue(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=ue(this,Fi),s=Ot(this,ms,d4).call(this,ue(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=ue(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,f4).call(this,d,p)})})),Ot(this,ms,h4).call(this)))})}getCurrentResult(){return ue(this,si)}getQueries(){return ue(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return ue(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,d4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,u4).call(this,a??s,t,i),()=>Ot(this,ms,c4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,c4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},u4=function(n,t,r){if(t){const s=ue(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(ue(this,si)!==ue(this,Bp)||i||t!==ue(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,ue(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,R5(ue(this,yd),t(n)))),ue(this,yd)}return n},vM=function(){var n;return!((n=ue(this,bd))!=null&&n.combine)||ue(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=ue(this,si)[r])==null?void 0:s.data)===void 0})},d4=function(n){const t=new Map;ue(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=ue(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new I5(ue(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},f4=function(n,t){const r=ue(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,ue(this,si).slice()),ue(this,si)[r]=t,Ot(this,ms,h4).call(this))},h4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=ue(this,yd),s=t?r:Ot(this,ms,u4).call(this,Ot(this,ms,c4).call(this,ue(this,si),ue(this,Pp)),(n=ue(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(ue(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??A5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){ue(this,zo).has(n.queryHash)||(ue(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=ue(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&ue(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return ue(this,zo).get(n)}getAll(){return[...ue(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,ue(this,nu)===1&&(Fe(this,Rh,O5.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onFocus())})),Fe(this,Mh,q1.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,ue(this,nu)===0&&((e=ue(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=ue(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return ue(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=ue(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return ue(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=ue(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return ue(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>ue(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=ue(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=ue(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>ue(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(ue(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>ue(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return q1.isOnline()?ue(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,zr)}getMutationCache(){return ue(this,eu)}getDefaultOptions(){return ue(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){ue(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...ue(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){ue(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...ue(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...ue(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=A5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===M5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,zr).clear(),ue(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?D5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||D5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>_4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&_4(b,S)){const w=new I5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),_4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,I5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&D5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Gv=0;const p4=new Set,HG=()=>Gv,_9=e=>(p4.add(e),()=>{p4.delete(e)}),za=()=>["workspace",Gv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Gv++,du.clear(),$5({queryKey:t}),p4.forEach(r=>r()),!0}const Fn=e=>e[1]===Gv;async function $5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Vr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var i2={exports:{}},i0={},a2={exports:{}},o2={};/** * @license React * scheduler.production.js * @@ -22,7 +22,7 @@ var eG=Object.defineProperty;var XC=e=>{throw TypeError(e)};var tG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _9;function PG(){return _9||(_9=1,(function(e){function n(V,X){var te=V.length;V.push(X);e:for(;0>>1,L=V[I];if(0>>1;Is(G,te))ees(ce,G)?(V[I]=ce,V[ee]=te,I=ee):(V[I]=G,V[q]=te,I=q);else if(ees(ce,te))V[I]=ce,V[ee]=te,I=ee;else break e}}return X}function s(V,X){var te=V.sortIndex-X.sortIndex;return te!==0?te:V.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(V){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=V)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(V){if(S=!1,C(V),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-V)}}var N=!1,T=-1,z=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MV&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=V);if(V=e.unstable_now(),typeof L=="function"){d.callback=L,C(V),X=!0;break t}d===t(l)&&r(l),C(V)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-V),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=B,$=function(){H.postMessage(null)}}else $=function(){b(B,0)};function Y(V,X){T=b(function(){V(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125I?(V.sortIndex=te,n(u,V),t(l)===null&&V===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(V.sortIndex=L,n(l,V),x||m||(x=!0,N||(N=!0,$()))),V},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(V){var X=p;return function(){var te=p;p=X;try{return V.apply(this,arguments)}finally{p=te}}}})(ax)),ax}var p9;function FG(){return p9||(p9=1,ix.exports=PG()),ix.exports}var ox={exports:{}},Hs={};/** + */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var ee=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(U,ee))tes(de,U)?(G[I]=de,G[te]=ee,I=te):(G[I]=U,G[W]=ee,I=W);else if(tes(de,ee))G[I]=de,G[te]=ee,I=te;else break e}}return X}function s(G,X){var ee=G.sortIndex-X.sortIndex;return ee!==0?ee:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var P=t(u);P!==null&&Y(E,P.startTime-G),X=!1}}break e}finally{d=null,p=ee,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=B,$=function(){q.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=ee,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,ee-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var ee=p;p=X;try{return G.apply(this,arguments)}finally{p=ee}}}})(o2)),o2}var m9;function GG(){return m9||(m9=1,a2.exports=UG()),a2.exports}var l2={exports:{}},Hs={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var eG=Object.defineProperty;var XC=e=>{throw TypeError(e)};var tG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var m9;function HG(){if(m9)return Hs;m9=1;var e=Wp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),ox.exports=HG(),ox.exports}/** + */var g9;function WG(){if(g9)return Hs;g9=1;var e=Vp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),l2.exports=WG(),l2.exports}/** * @license React * react-dom-client.production.js * @@ -38,15 +38,15 @@ var eG=Object.defineProperty;var XC=e=>{throw TypeError(e)};var tG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var v9;function qG(){if(v9)return i0;v9=1;var e=FG(),n=Wp(),t=CM();function r(c){var h="https://react.dev/errors/"+c;if(1L||(c.current=I[L],I[L]=null,L--)}function G(c,h){L++,I[L]=c.current,c.current=h}var ee=F(null),ce=F(null),oe=F(null),ne=F(null);function Q(c,h){switch(G(oe,h),G(ce,c),G(ee,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?yC(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=yC(h),c=xC(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}q(ee),G(ee,c)}function le(){q(ee),q(ce),q(oe)}function ae(c){c.memoizedState!==null&&G(ne,c);var h=ee.current,g=xC(h,c.type);h!==g&&(G(ce,c),G(ee,g))}function ue(c){ce.current===c&&(q(ee),q(ce)),ne.current===c&&(q(ne),J_._currentValue=te)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1L||(c.current=I[L],I[L]=null,L--)}function U(c,h){L++,I[L]=c.current,c.current=h}var te=P(null),de=P(null),re=P(null),ne=P(null);function Q(c,h){switch(U(re,h),U(de,c),U(te,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?x8(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=x8(h),c=w8(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}W(te),U(te,c)}function le(){W(te),W(de),W(re)}function oe(c){c.memoizedState!==null&&U(ne,c);var h=te.current,g=w8(h,c.type);h!==g&&(U(de,c),U(te,g))}function ce(c){de.current===c&&(W(te),W(de)),ne.current===c&&(W(ne),J_._currentValue=ee)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1)":-1A||_e[k]!==Ce[A]){var De=` -`+_e[k].replace(" at new "," at ");return c.displayName&&De.includes("")&&(De=De.replace("",c.displayName)),De}while(1<=k&&0<=A);break}}}finally{qe=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?ye(g):""}function ze(c,h){switch(c.tag){case 26:case 27:case 5:return ye(c.type);case 16:return ye("Lazy");case 13:return c.child!==h&&h!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ie(c.type,!1);case 11:return Ie(c.type.render,!1);case 1:return Ie(c.type,!0);case 31:return ye("Activity");default:return""}}function at(c){try{var h="",g=null;do h+=ze(c,g),g=c,c=c.return;while(c);return h}catch(k){return` +`+_e[k].replace(" at new "," at ");return c.displayName&&De.includes("")&&(De=De.replace("",c.displayName)),De}while(1<=k&&0<=A);break}}}finally{qe=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?ye(g):""}function Te(c,h){switch(c.tag){case 26:case 27:case 5:return ye(c.type);case 16:return ye("Lazy");case 13:return c.child!==h&&h!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ie(c.type,!1);case 11:return Ie(c.type.render,!1);case 1:return Ie(c.type,!0);case 31:return ye("Activity");default:return""}}function vt(c){try{var h="",g=null;do h+=Te(c,g),g=c,c=c.return;while(c);return h}catch(k){return` Error generating stack: `+k.message+` -`+k.stack}}var bt=Object.prototype.hasOwnProperty,$t=e.unstable_scheduleCallback,Pt=e.unstable_cancelCallback,zt=e.unstable_shouldYield,ot=e.unstable_requestPaint,ft=e.unstable_now,It=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,ht=e.unstable_LowPriority,xt=e.unstable_IdlePriority,Vt=e.log,Ve=e.unstable_setDisableYieldValue,Ht=null,sn=null;function fn(c){if(typeof Vt=="function"&&Ve(c),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode(Ht,c)}catch{}}var Zt=Math.clz32?Math.clz32:bn,Qn=Math.log,Jt=Math.LN2;function bn(c){return c>>>=0,c===0?32:31-(Qn(c)/Jt|0)|0}var or=256,lr=262144,br=4194304;function Dn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Wr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var re=k&134217727;return re!==0?(k=re&~D,k!==0?A=Dn(k):(K&=re,K!==0?A=Dn(K):g||(g=re&~c,g!==0&&(A=Dn(g))))):(re=k&~D,re!==0?A=Dn(re):K!==0?A=Dn(K):g||(g=k&~c,g!==0&&(A=Dn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function vt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 un(){var c=br;return br<<=1,(br&62914560)===0&&(br=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function en(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function Jn(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var re=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function $r(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Dr(c,h,g,k,A,D,K,re){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Mr(h)):c.value!==""+Mr(h)&&(c.value=""+Mr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Mr(h)):g!=null?bs(c,K,Mr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),re!=null&&typeof re!="function"&&typeof re!="symbol"&&typeof re!="boolean"?c.name=""+Mr(re):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,re){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Mr(g):"",h=h!=null?""+Mr(h):g,re||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=re?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Rt={};Object.defineProperty(Rt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Rt,Rt),window.removeEventListener("test",Rt,Rt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ai(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var se=!1;function be(c,h){switch(c){case"compositionend":return tl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(se)return c==="compositionend"||!fc&&hc(c,h)?(c=Ai(),la=xs=hr=null,se=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Gn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Qr=null,Js=null,tr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Qr==null||Qr!==ls(k)||(k=Qr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),tr&&Mt(tr,k)||(tr=k,k=ig(Js,"onSelect"),0>=K,A-=K,_o=1<<32-Zt(h)+A|g<an?(xn=yt,yt=null):xn=yt.sibling;var In=Ee(xe,yt,ke[an],Be);if(In===null){yt===null&&(yt=xn);break}c&&yt&&In.alternate===null&&h(xe,yt),me=D(In,me,an),On===null?At=In:On.sibling=In,On=In,yt=xn}if(an===ke.length)return g(xe,yt),wn&&sl(xe,an),At;if(yt===null){for(;anan?(xn=yt,yt=null):xn=yt.sibling;var Oc=Ee(xe,yt,In.value,Be);if(Oc===null){yt===null&&(yt=xn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,an),On===null?At=Oc:On.sibling=Oc,On=Oc,yt=xn}if(In.done)return g(xe,yt),wn&&sl(xe,an),At;if(yt===null){for(;!In.done;an++,In=ke.next())In=Pe(xe,In.value,Be),In!==null&&(me=D(In,me,an),On===null?At=In:On.sibling=In,On=In);return wn&&sl(xe,an),At}for(yt=k(yt);!In.done;an++,In=ke.next())In=je(yt,xe,an,In.value,Be),In!==null&&(c&&In.alternate!==null&&yt.delete(In.key===null?an:In.key),me=D(In,me,an),On===null?At=In:On.sibling=In,On=In);return c&&yt.forEach(function(JU){return h(xe,JU)}),wn&&sl(xe,an),At}function Zn(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var At=ke.key;me!==null;){if(me.key===At){if(At=ke.type,At===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===At||typeof At=="object"&&At!==null&&At.$$typeof===z&&Fu(At)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=wm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(At=ke.key;me!==null;){if(me.key===At)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=by(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case z:return ke=Fu(ke),Zn(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(At=$(ke),typeof At!="function")throw Error(r(150));return ke=At.call(ke),Bt(xe,me,ke,Be)}if(typeof ke.then=="function")return Zn(xe,me,jm(ke),Be);if(ke.$$typeof===y)return Zn(xe,me,Cm(xe,ke),Be);Tm(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=vy(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var At=Zn(xe,me,ke,Be);return kf=null,At}catch(yt){if(yt===Sf||yt===Nm)throw yt;var On=Ri(29,yt,null,xe.mode);return On.lanes=Be,On.return=xe,On}finally{}}}var qu=d7(!0),f7=d7(!1),bc=!1;function Ay(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ry(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,($n&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=xm(c),Qk(c,null,g),h}return ym(c,k,h,g),xm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,En(c,g)}}function My(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Dy=!1;function R_(){if(Dy){var c=wf;if(c!==null)throw c}}function M_(c,h,g,k){Dy=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,re=A.shared.pending;if(re!==null){A.shared.pending=null;var _e=re,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,re=De.lastBaseUpdate,re!==K&&(re===null?De.firstBaseUpdate=Ce:re.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,re=D;do{var Ee=re.lane&-536870913,je=Ee!==re.lane;if(je?(yn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===xf&&(Dy=!0),De!==null&&(De=De.next={lane:0,tag:re.tag,payload:re.payload,callback:null,next:null});e:{var gt=c,Bt=re;Ee=h;var Zn=g;switch(Bt.tag){case 1:if(gt=Bt.payload,typeof gt=="function"){Pe=gt.call(Zn,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=Bt.payload,Ee=typeof gt=="function"?gt.call(Zn,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=re.callback,Ee!==null&&(c.flags|=64,je&&(c.flags|=8192),je=A.callbacks,je===null?A.callbacks=[Ee]:je.push(Ee))}else je={lane:Ee,tag:re.tag,payload:re.payload,callback:re.callback,next:null},De===null?(Ce=De=je,_e=Pe):De=De.next=je,K|=Ee;if(re=re.next,re===null){if(re=A.shared.pending,re===null)break;je=re,re=je.next,je.next=null,A.lastBaseUpdate=je,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function h7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function _7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=V.T,re={};V.T=re,Jy(c,!1,h,g);try{var _e=A(),Ce=V.S;if(Ce!==null&&Ce(re,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Hq(_e,k);O_(c,h,De,Ii(c))}else O_(c,h,k,Ii(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Ii())}finally{X.p=D,K!==null&&re.types!==null&&(K.types=re.types),V.T=K}}function Kq(){}function Xy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=W7(c).queue;G7(c,A,h,te,g===null?Kq:function(){return V7(c),g(k)})}function W7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ll,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ll,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function V7(c){var h=W7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Ii())}function Zy(){return Ts(J_)}function K7(){return Hr().memoizedState}function Q7(){return Hr().memoizedState}function Qq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Ii();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:Ny()},c.payload=h;return}h=h.return}}function Yq(c,h,g){var k=Ii();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Pm(c)?X7(h,g):(g=my(c,h,g,k),g!==null&&(bi(g,c,k),Z7(g,h,k)))}function Y7(c,h,g){var k=Ii();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Pm(c))X7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,re=D(K,g);if(A.hasEagerState=!0,A.eagerState=re,tt(re,K))return ym(c,h,A,0),nr===null&&bm(),!1}catch{}finally{}if(g=my(c,h,A,k),g!==null)return bi(g,c,k),Z7(g,h,k),!0}return!1}function Jy(c,h,g,k){if(k={lane:2,revertLane:A2(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Pm(c)){if(h)throw Error(r(479))}else h=my(c,g,k,2),h!==null&&bi(h,c,2)}function Pm(c){var h=c.alternate;return c===rn||h!==null&&h===rn}function X7(c,h){Ef=Mm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function Z7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,En(c,g)}}var I_={readContext:Ts,use:Om,useCallback:Lr,useContext:Lr,useEffect:Lr,useImperativeHandle:Lr,useLayoutEffect:Lr,useInsertionEffect:Lr,useMemo:Lr,useReducer:Lr,useRef:Lr,useState:Lr,useDebugValue:Lr,useDeferredValue:Lr,useTransition:Lr,useSyncExternalStore:Lr,useId:Lr,useHostTransitionStatus:Lr,useFormState:Lr,useActionState:Lr,useOptimistic:Lr,useMemoCache:Lr,useCacheRefresh:Lr};I_.useEffectEvent=Lr;var J7={readContext:Ts,use:Om,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:O7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,Bm(4194308,4,P7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return Bm(4194308,4,c,h)},useInsertionEffect:function(c,h){Bm(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){fn(!0);try{c()}finally{fn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){fn(!0);try{g(h)}finally{fn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=Yq.bind(null,rn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Wy(c);var h=c.queue,g=Y7.bind(null,rn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Qy,useDeferredValue:function(c,h){var g=ei();return Yy(g,c,h)},useTransition:function(){var c=Wy(!1);return c=G7.bind(null,rn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=rn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),nr===null)throw Error(r(349));(yn&127)!==0||y7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,O7(w7.bind(null,k,D,c),[c]),k.flags|=2048,zf(9,{destroy:void 0},x7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=nr.identifierPrefix;if(wn){var g=po,k=_o;g=(k&~(1<<32-Zt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Dm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[cn]=h,D[qt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&ul(h)}}return gr(h),h2(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&ul(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=oe.current,bf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[cn]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||vC(c.nodeValue,g)),c||gc(h,!0)}else c=ag(c).createTextNode(k),c[cn]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=bf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[cn]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=Sy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Di(h),h):(Di(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=bf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[cn]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=Sy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Di(h),h):(Di(h),null)}return Di(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Gm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&L2(h.stateNode.containerInfo),gr(h),null;case 10:return al(h.type),gr(h),null;case 19:if(q(Fr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Or!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Rm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Gm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Yk(g,c),g=g.sibling;return G(Fr,Fr.current&1|2),wn&&sl(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ft()>Ym&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Rm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Gm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ft()-k.renderingStartTime>Ym&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ft(),c.sibling=null,g=Fr.current,G(Fr,A?g&1|2:g&1),wn&&sl(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Di(h),Oy(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Gm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&q(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),al(Yr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function tU(c,h){switch(xy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return al(Yr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ue(h),null;case 31:if(h.memoizedState!==null){if(Di(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Di(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return q(Fr),null;case 4:return le(),null;case 10:return al(h.type),null;case 22:case 23:return Di(h),Oy(),c!==null&&q(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return al(Yr),null;case 25:return null;default:return null}}function S8(c,h){switch(xy(h),h.tag){case 3:al(Yr),le();break;case 26:case 27:case 5:ue(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Di(h);break;case 13:Di(h);break;case 19:q(Fr);break;case 10:al(h.type);break;case 22:case 23:Di(h),Oy(),c!==null&&q(Pu);break;case 24:al(Yr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(re){Vn(h,h.return,re)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,re=K.destroy;if(re!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=re;try{Ce()}catch(De){Vn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Vn(h,h.return,De)}}function k8(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{_7(h,g)}catch(k){Vn(c,c.return,k)}}}function C8(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Vn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Vn(c,h,A)}}function mo(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Vn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Vn(c,h,A)}else g.current=null}function E8(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Vn(c,c.return,A)}}function _2(c,h,g){try{var k=c.stateNode;SU(k,c.type,g,h),k[qt]=h}catch(A){Vn(c,c.return,A)}}function N8(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function p2(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||N8(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function m2(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Pr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(m2(c,h,g),c=c.sibling;c!==null;)m2(c,h,g),c=c.sibling}function Wm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Wm(c,h,g),c=c.sibling;c!==null;)Wm(c,h,g),c=c.sibling}function z8(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[cn]=c,h[qt]=g}catch(D){Vn(c,c.return,D)}}var dl=!1,Jr=!1,g2=!1,j8=typeof WeakSet=="function"?WeakSet:Set,ws=null;function nU(c,h){if(c=c.containerInfo,B2=hg,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,re=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var je;Pe!==g||A!==0&&Pe.nodeType!==3||(re=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(je=Pe.firstChild)!==null;)Ee=Pe,Pe=je;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(re=K),Ee===D&&++De===k&&(_e=K),(je=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=je}g=re===-1||_e===-1?null:{start:re,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for($2={focusedElem:c,selectionRange:g},hg=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[cn]=c,Ke(D),k=D;break e;case"link":var K=LC("link","href",A).get(k+(g.href||""));if(K){for(var re=0;reZn&&(K=Zn,Zn=Bt,Bt=K);var xe=Ns(re,Bt),me=Ns(re,Zn);if(xe&&me&&(je.rangeCount!==1||je.anchorNode!==xe.node||je.anchorOffset!==xe.offset||je.focusNode!==me.node||je.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),je.removeAllRanges(),Bt>Zn?(je.addRange(ke),je.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),je.addRange(ke))}}}}for(Pe=[],je=re;je=je.parentNode;)je.nodeType===1&&Pe.push({element:je,left:je.scrollLeft,top:je.scrollTop});for(typeof re.focus=="function"&&re.focus(),re=0;reg?32:g,V.T=null,g=k2,k2=null;var D=zc,K=ml;if(ds=0,Mf=zc=null,ml=0,($n&6)!==0)throw Error(r(331));var re=$n;if($n|=4,P8(D.current),I8(D,D.current,K,g),$n=re,V_(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Ht,D)}catch{}return!0}finally{X.p=A,V.T=k,sC(c,h)}}function aC(c,h,g){h=ha(g,h),h=r2(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(en(c,2),go(c))}function Vn(c,h,g){if(c.tag===3)aC(c,c,g);else for(;h!==null;){if(h.tag===3){aC(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=o8(2),k=xc(h,g,2),k!==null&&(l8(g,k,h,c),en(k,2),go(k));break}}h=h.return}}function z2(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new iU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(y2=!0,A.add(g),c=uU.bind(null,c,h,g),h.then(c,c))}function uU(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,nr===c&&(yn&g)===g&&(Or===4||Or===3&&(yn&62914560)===yn&&300>ft()-Qm?($n&2)===0&&Df(c,0):x2|=g,Rf===yn&&(Rf=0)),go(c)}function oC(c,h){h===0&&(h=un()),c=Lu(c,h),c!==null&&(en(c,h),go(c))}function dU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),oC(c,g)}function fU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),oC(c,g)}function hU(c,h){return $t(c,h)}var ng=null,Of=null,j2=!1,rg=!1,T2=!1,Tc=0;function go(c){c!==Of&&c.next===null&&(Of===null?ng=Of=c:Of=Of.next=c),rg=!0,j2||(j2=!0,pU())}function V_(c,h){if(!T2&&rg){T2=!0;do for(var g=!1,k=ng;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,re=k.pingedLanes;D=(1<<31-Zt(42|c)+1)-1,D&=A&~(K&~re),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,dC(k,D))}else D=yn,D=Wr(k,k===nr?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,dC(k,D));k=k.next}while(g);T2=!1}}function _U(){lC()}function lC(){rg=j2=!1;var c=0;Tc!==0&&CU()&&(c=Tc);for(var h=ft(),g=null,k=ng;k!==null;){var A=k.next,D=cC(k,h);D===0?(k.next=null,g===null?ng=A:g.next=A,A===null&&(Of=g)):(g=k,(c!==0||(D&3)!==0)&&(rg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function cC(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0re)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&bC(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function AC(c,h,g){var k=If;if(k&&typeof h=="string"&&h){var A=$r(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),TC.has(A)||(TC.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function DU(c){gl.D(c),AC("dns-prefetch",c,null)}function LU(c,h){gl.C(c,h),AC("preconnect",c,h)}function OU(c,h,g){gl.L(c,h,g);var k=If;if(k&&c&&h){var A='link[rel="preload"][as="'+$r(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+$r(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+$r(g.imageSizes)+'"]')):A+='[href="'+$r(c)+'"]';var D=A;switch(h){case"style":D=Bf(c);break;case"script":D=$f(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function IU(c,h){gl.m(c,h);var g=If;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+$r(k)+'"][href="'+$r(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=$f(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function BU(c,h,g){gl.S(c,h,g);var k=If;if(k&&c){var A=Rr(k).hoistableStyles,D=Bf(c);h=h||"default";var K=A.get(D);if(!K){var re={loading:0,preload:null};if(K=k.querySelector(X_(D)))re.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&W2(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){re.loading|=1}),_e.addEventListener("error",function(){re.loading|=2}),re.loading|=4,lg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:re},A.set(D,K)}}}function $U(c,h){gl.X(c,h);var g=If;if(g&&c){var k=Rr(g).hoistableScripts,A=$f(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&V2(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function PU(c,h){gl.M(c,h);var g=If;if(g&&c){var k=Rr(g).hoistableScripts,A=$f(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&V2(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function RC(c,h,g,k){var A=(A=oe.current)?og(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=Bf(g.href),g=Rr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=Bf(g.href);var D=Rr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||FU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=$f(g),g=Rr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function Bf(c){return'href="'+$r(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function MC(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function FU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function $f(c){return'[src="'+$r(c)+'"]'}function Z_(c){return"script[async]"+c}function DC(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+$r(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),lg(k,g.precedence,c),h.instance=k;case"stylesheet":A=Bf(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=MC(g),(A=ba.get(A))&&W2(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(re,_e){K.onload=re,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,lg(D,g.precedence,c),h.instance=D;case"script":return D=$f(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),V2(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,lg(k,g.precedence,c));return h.instance}function lg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function HU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function IC(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function qU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=Bf(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=ug.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=MC(k),(A=ba.get(A))&&W2(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(re,_e){K.onload=re,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=ug.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var K2=0;function UU(c,h){return c.stylesheets&&c.count===0&&fg(c,c.stylesheets),0K2?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function ug(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var dg=null;function fg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,dg=new Map,h.forEach(GU,c),dg=null,ug.call(c))}function GU(c,h){if(!(h.state.loading&4)){var g=dg.get(c);if(g)var k=g.get(null);else{g=new Map,dg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),sx.exports=qG(),sx.exports}var GG=UG();const WG=!1;var EM=R.useLayoutEffect;function VG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function KG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Ih(e,n){return typeof e=="function"?e(n):e}const NM=Object.prototype.hasOwnProperty,QG=Object.prototype.propertyIsEnumerable;function zM(e){for(const n in e)if(NM.call(e,n))return!0;return!1}const YG=()=>Object.create(null),Ku=(e,n)=>od(e,n,YG);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=w9(e)&&w9(s);if(!i&&!(U1(e)&&U1(s)))return s;const a=i?e:y9(e);if(!a)return s;const o=i?s:y9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!x9(t)||!t.hasOwnProperty("isPrototypeOf"))}function x9(e){return Object.prototype.toString.call(e)==="[object Object]"}function w9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const XG=/[\x00-\x1f\x7f"<>`{}]/g;function ZG(e){return e.replace(XG,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function S9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return ZG(n)}const JG=["http:","https:","mailto:","tel:"];function G1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=S9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+S9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function eW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function tW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,jM=5;function TM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===z&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=nW(E,d,z,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=oh(d);b.kind=jM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=oh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Gv(e,n,d,l,s,i,a,o)}function AM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function oh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function nW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function rW(e,n){const t=oh("/"),r=new Uint16Array(6),s=[];for(const i of e)Gv(!1,r,i,1,t,0,s);for(const i of s)i.sort(AM);n.masksTree=t,n.flatCache=W1(1e3)}function sW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=$5(e,n.masksTree);return n.flatCache.set(e,r),r}function iW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=oh("/"),Gv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),$5(r,a,t)}function aW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=$5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=MM(i.route)),n.matchCache.set(r,i),i}function oW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function lW(e,n=!1,t){const r=oh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Gv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&B5(),a[u.id]=u,l!==0&&u.path){const _=oW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(AM);return{processedTree:{segmentTree:r,singleCache:W1(1e3),matchCache:W1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function $5(e,n,t=!1){const r=e.split("/"),s=uW(e,r,n,t);if(!s)return null;const[i]=RM(e,r,s);return{route:s.node.route,rawParams:i}}function RM(e,n,t){var _,d,p,m;const r=cW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:z,suffix:M}=T;if(!(z&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(z)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const z=d.optional[T];o.push({node:z,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const z=d.optional[T],{prefix:M,suffix:O}=z;if(M||O){const B=z.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:z,suffix:M}=T;if(z||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(z&&!O.startsWith(z)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function m1(e){return g1(e.filter(n=>n!==void 0).join("/"))}function g1(e){return e.replace(/\/{2,}/g,"/")}function DM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Al(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function LM(e){return Al(DM(e))}function V1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function fW(e,n,t){return V1(e,t)===V1(n,t)}function hW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=g1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=g1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?g1(o):o)||"/";return i&&r&&r.set(i,l),l}function _W(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function lx(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>E9(s,t)).join("/"):E9(r,t)}function C9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function xW(e){const n=e.getAttribute(N9);if(n)return`[${N9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let Sg=!1;const v1="window";function p4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function z9(e){const n=new Set;for(const t of e){if(t===v1)continue;const r=p4(t);r&&n.add(r)}return n}function wW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||yW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[v1]={scrollX,scrollY}:u.isConnected&&(l[xW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,Sg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{Sg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),bW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===v1){if(_)continue}else{const y=p4(w);if(!y||_&&u&&(p??(p=z9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}Sg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=z9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===v1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const z=p4(E);z&&(z.scrollLeft=N,z.scrollTop=T,p==null||p.delete(z))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{Sg=!1}}))}function SW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function cx(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function kW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=cx(s):Array.isArray(i)?i.push(cx(s)):t[r]=[i,cx(s)]}return t}const CW=/^(?:\s|["[{\d-]|fa|nu|tr)/,EW=zW(JSON.parse),NW=jW(JSON.stringify,JSON.parse);function zW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=kW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function jW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!CW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=SW(s,r);return i?`?${i}`:""}}const ch="__root__";function TW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function OM(e){return e instanceof Response&&!!e.options}function AW(e){return{input:({url:n})=>{for(const t of e)n=m4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=IM(e[t],n);return n}}}function RW(e){const n=LM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=m1(["/",n,i.pathname]),i)}}function m4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IM(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function MW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{tW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",j9="popstate",T9="beforeunload";function DW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=K1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=A9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=A9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function A9(e,n){n||(n={});const t=P5();return{...n,key:t,__TSR_key:t,[lu]:e}}function LW(e){var T,z;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>K1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((z=n.history.state)!=null&&z.key)){const M=P5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),U=!!v;U||(_=u),u=K1(O,B),v=[$,B,(v==null?void 0:v[2])||M],U||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,U=!B&&!$||d;d=!1;const H=U?"GO":$?"BACK":"FORWARD",Y=U?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const V=i();if(typeof document<"u"&&V.length){for(const X of V)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:H})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const U=$.enableBeforeUnload??!0;if(U===!0){O=!0;break}if(typeof U=="function"&&U()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=DW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(T9,E,{capture:!0}),n.removeEventListener(j9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(T9,E,{capture:!0}),n.addEventListener(j9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function OW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function K1(e,n){const t=OW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=P5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function P5(){return(Math.random()+1).toString(36).substring(7)}function R9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Wv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function M9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function IW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var BW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??WG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=_W(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=LW()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=W1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=MW(this.latestLocation,u),wW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=LM(o);_&&_!=="/"&&u.push(RW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:AW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=lW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&rW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=m4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>hW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=aW(Al(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=K1(i.href,{});i={...i,to:m4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=D9(i.params,_);const m=this.routesByPath[Al(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,U]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!U||U.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&zM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(C9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,b1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=PW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Ih(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Ih(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,z=!1;if(this.rewrite){const B=new URL(E,this.origin),$=IM(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,z=!0):T=$.pathname+$.search+$.hash}else N=eW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:z,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=sW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=D9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Al(this.latestLocation.href)===Al(s.href)&&ou(M9(s.state),M9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(G1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await QW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Wv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&R9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&G1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=uh,this.preloadRoute=t=>YW(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=iW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??NW,parseSearch:e.parseSearch??EW,protocolAllowlist:e.protocolAllowlist??JG}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=MM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Al(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?FW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=b1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Ih(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function FW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return ch}function D9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Ih(e,t))}function L9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function g4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function HW(e,n){const t=g4(e,"component");let r=g4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function uh(e,n,t){const r=()=>n===!1?void 0:n?g4(e,n):HW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function F5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return OM(e)?[Hi,e]:Bh(e)?(e.routeId||(e.routeId=t),[Vv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Mo,e]}function H5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:G5(e,n,t,H5(t,r),s)}async function qW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Rl(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Rl(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=G5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Mo)return Rl(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Rl(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function q5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Rl(e,n){var r;const t=n._flight;n._flight=void 0,(r=q5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=q5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function U5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function BM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function O9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Mo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(BM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Mo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?H5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],G5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Rl(e,t),fu}finally{X0(e,t,!1,o)}}function I9(e,n,t){n[0]!==Hi&&(e.status="success",e.error=void 0,n[0]===Mo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function UW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Rl(e,r)}function B9(e,n){return n[0]===Il||n[0]===Vv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function GW(e,n,t,r,s,i,a){var $,U;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(BM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const H=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=H&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(H){o.invalid=!0,Rl(e,o),m=R0(e,n,l,H,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const H=o._flight;o._flight=w,(U=q5(e,o,H))==null||U.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const z=(m?Promise.resolve(m):E?O9(e,n,o,l,v,s,i):Promise.resolve([Mo,o.loaderData])).then(H=>(E&&(I9(o,H,u),H[0]===Mo&&(x&&!i[0].signal.aborted&&UW(e,o,_),t>=a&&(o.status="pending"))),H)),M=Wd(Promise.resolve().then(()=>uh(l,void 0,T)),i[0].signal).then(()=>{},H=>n[1].some((Y,V)=>V<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,H,i)]).then(H=>z.then(Y=>(E&&!H&&Y[0]===Mo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),H)));if(r.push([t,z,M]),!y)return z.then(H=>B9(o,H));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=O9(e,n,O,l,v,s,i).then(H=>(o.isFetching=!1,I9(O,H,!1),H));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(H=>B9(O,H))}async function v4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=uh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function $9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=Hi)throw[o,a];!s&&a[0]!==Mo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===Hi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function G5(e,n,t,r,s,i){for(;r[0]===Hi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[Hi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:H5(t,l),i=!0}}return r}async function $M(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Vv?v4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=Hi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Mo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=Hi){const m=o[1];if(m[0]!==Hi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>uh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([uh(w),uh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function PM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await v4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=GW(e,s,w,p,x,r,d)},v=await qW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Vv){const w=await v4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=Hi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=$M(e,s,p,r[0],$9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=$9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:F5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:PM(e,a,i,r[6]===t.length?r[6]:0)}function b4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>b4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function P9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!F5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function HM(e,n){e._committed=n,e.stores.setMatches(n)}function WW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=F5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,HM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),IW(e,s,t,n)}async function kg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function qM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function VW(e,n,t,r,s){const i=t.map(l=>({...l}));U5(i);for(const l of r)Rl(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await $M(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===Hi&&e._tx===n&&e._committed===t&&await qM(e,n,o);return}if(await PM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Rl(e,u))}HM(e,i),ki(e,t,i)}async function KW(e,n,t,r,s,i){const a=await FM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===Hi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await qM(e,n,a);return}const o=a[1];if(e._tx===n&&await P9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Wv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await P9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),WW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&VW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function QW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Wv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await kg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});U5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await kg(e,t);return}e._preflight=void 0;let v;const b=()=>KW(e,y,p,()=>b4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await kg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&b4(e,y),v==null||v(b()),await w,await kg(e,y)}async function YW(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),U5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await FM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){Bh(u)||console.error(u);return}}}const XW="Error preloading route! ☝️";var UM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=ch:this.parentRoute||B5();let s=r?ch:t==null?void 0:t.path;s&&s!=="/"&&(s=DM(s));const i=(t==null?void 0:t.id)||s;let a=r?ch:m1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=m1(["/",a]));const o=a==="__root__"?"/":m1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Al(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>TW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},ZW=class extends UM{constructor(e){super(e)}},W5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??JW,{error:e,reset:this.reset}):this.props.children}};function JW({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function eV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:GM()?e:n})}function GM(){return Je.useSyncExternalStore(tV,()=>!0,()=>!1)}function tV(){return()=>{}}var WM=R.createContext(null);function li(e){return R.useContext(WM)}var Kv=R.createContext(void 0),nV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function rV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function sV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const y4=[];let y1=0;const{link:F9,unlink:iV,propagate:aV,checkDirty:VM,shallowPropagate:H9}=rV({update(e){return e._update()},notify(e){y4[x4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,Y1(e))}});let Cg=0,x4=0,ko,w4=0;function oV(e){try{++w4,e()}finally{--w4||KM()}}function Y1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=iV(t,e)}function KM(){if(!(w4>0)){for(;Cg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=ko,o=(n==null?void 0:n.compare)??Object.is;if(t)ko=s,++y1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{ko=a,t&&(s.flags&=~wr.RecursedCheck),Y1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&VM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&H9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return ko!==void 0&&F9(s,ko,y1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(aV(a),H9(a),KM())}},s}function lV(e){const n=()=>{const r=ko;ko=t,++y1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{ko=r,t.flags&=~wr.RecursedCheck,Y1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&VM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,Y1(this)}};return n(),t}var ux={exports:{}},dx={},fx={exports:{}},hx={};/** +`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Pr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=yy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=by(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function Ry(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function My(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Dy(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Ly=!1;function R_(){if(Ly){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Ly=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Ly=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,ex(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function Zy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,ee,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:ee},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function Jy(){return Ts(J_)}function Q7(){return qr().memoizedState}function Y7(){return qr().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:zy()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=gy(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=gy(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function ex(c,h,g,k){if(k={lane:2,revertLane:Rx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=gy(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Vy(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Yy,useDeferredValue:function(c,h){var g=ei();return Xy(g,c,h)},useTransition:function(){var c=Vy(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),_x(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Ox(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(Hr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return U(Hr,Hr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=Hr.current,U(Hr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),Iy(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(wy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ce(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(Hr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),Iy(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(wy(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ce(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(Hr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),Iy(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function px(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function mx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function gx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Fr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(gx(c,h,g),c=c.sibling;c!==null;)gx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,vx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,$x=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Px={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Cx,Cx=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=sx(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function jx(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(xx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):wx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Tx=!1,sg=!1,Ax=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Tx||(Tx=!0,bU())}function V_(c,h){if(!Ax&&sg){Ax=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Ax=!1}}function vU(){c8()}function c8(){sg=Tx=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Pr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Pr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Pr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Pr(g.imageSizes)+'"]')):A+='[href="'+Pr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Pr(k)+'"][href="'+Pr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Vx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Pr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Pr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Pr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Vx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Kx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Vx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Qx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Qx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),i2.exports=VG(),i2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(G1(e)&&G1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function W1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Wv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Wv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=V1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=F5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Wv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),F5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=F5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Wv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&P5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:V1(1e3),matchCache:V1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function F5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function K1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return K1(e,t)===K1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function c2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function m4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=m4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=m4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=m4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function u2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=u2(s):Array.isArray(i)?i.push(u2(s)):t[r]=[i,u2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=g4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function g4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Q1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=H5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Q1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=H5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),H=!!v;H||(_=u),u=Q1(O,B),v=[$,B,(v==null?void 0:v[2])||M],H||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,H=!B&&!$||d;d=!1;const q=H?"GO":$?"BACK":"FORWARD",Y=H?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:q})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const H=$.enableBeforeUnload??!0;if(H===!0){O=!0;break}if(typeof H=="function"&&H()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Q1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=H5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function H5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Vv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=V1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=g4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Q1(i.href,{});i={...i,to:g4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,H]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!H||H.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(W1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Vv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&W1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function v4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=v4(e,"component");let r=v4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?v4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function q5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Kv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function U5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:V5(e,n,t,U5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=V5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function G5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=G5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=G5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function W5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?U5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],V5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Kv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,H;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const q=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=q&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(q){o.invalid=!0,Ml(e,o),m=R0(e,n,l,q,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const q=o._flight;o._flight=w,(H=G5(e,o,q))==null||H.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(q=>(E&&(B9(o,q,u),q[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),q)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},q=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,q,i)]).then(q=>j.then(Y=>(E&&!q&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),q)));if(r.push([t,j,M]),!y)return j.then(q=>$9(o,q));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(q=>(o.isFetching=!1,B9(O,q,!1),q));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(q=>$9(O,q))}async function b4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function V5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:U5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Kv?b4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await b4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Kv){const w=await b4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:q5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function y4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>y4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!q5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=q5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));W5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Vv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Vv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});W5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>y4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&y4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),W5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||P5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},K5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Qv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const x4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){x4[w4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,X1(e))}});let Eg=0,w4=0,Co,S4=0;function dV(e){try{++S4,e()}finally{--S4||YM()}}function X1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(S4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),X1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,X1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,X1(this)}};return n(),t}var d2={exports:{}},f2={},h2={exports:{}},_2={};/** * @license React * use-sync-external-store-shim.production.js * @@ -54,7 +54,7 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var U9;function cV(){if(U9)return hx;U9=1;var e=Wp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return hx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,hx}var G9;function uV(){return G9||(G9=1,fx.exports=cV()),fx.exports}/** + */var G9;function hV(){if(G9)return _2;G9=1;var e=Vp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return _2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,_2}var W9;function _V(){return W9||(W9=1,h2.exports=hV()),h2.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -62,478 +62,478 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var W9;function dV(){if(W9)return dx;W9=1;var e=Wp(),n=uV();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return dx.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var z=p(N);return m!==void 0&&m(T,z)?(y=N,T):(y=N,C=z)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},dx}var V9;function fV(){return V9||(V9=1,ux.exports=dV()),ux.exports}var QM=fV();const hV=Gp(QM);function _V(e,n){return e===n}function Oo(e,n,t=_V){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return QM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var K9={};function V5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?nV:Kv),r=e.from??t,s=n.stores.getMatchStore(r),i=V5(e,n),a=Oo(s,o=>o?i(o):K9);if(a!==K9)return a;(e.shouldThrow??!0)&&B5()}function YM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function XM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function ZM(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function JM(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Qv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function K5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function _x(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function pV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function mV(e,n,t){if(e!=null&&e.external)return G1(e.href,t)?void 0:e.href;if(!SV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),G1(n,t)?void 0:n}catch{}}function gV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!fW(e.pathname,n.pathname,r))return!1}else{const a=V1(e.pathname,r),o=V1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function vV(e,n){const t=li(),r=KG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:z,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:U,hash:H,state:Y,mask:V,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,q=GM(),G=_x(e.search),ee=_x(e.params),ce=_x(a),oe=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,G,ee,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(ot=>{const ft=t.buildLocation({_fromLocation:ot,...oe}),It=wV(ft.maskedLocation?ft.maskedLocation.publicHref:ft.publicHref,ft.maskedLocation?ft.maskedLocation.external:ft.external,t.history,w),we=mV(It,o,t.protocolAllowlist);return[It==null?void 0:It.href,we,gV(ot,ft,ce,t.basepath,q,we!==void 0)]},[ce,w,q,oe,t,o]),[Q,le,ae]=Oo(t.stores.location,ne,pV),ue=ae?Ih(s,{})??bV:px,pe=ae?px:Ih(i,{})??px,Se=[C,ue.className,pe.className].filter(Boolean).join(" "),ye=(y||ue.style||pe.style)&&{...y,...ue.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,ze=u??t.options.defaultPreloadDelay??0,at=R.useCallback(()=>{t.preloadRoute(oe).catch(ot=>{console.warn(ot),console.warn(XW)})},[t,oe]),bt=R.useCallback(ot=>{if(!ot){mx(r);return}if(!(ot.isIntersecting??Ie==="intent")){ot.isIntersecting===!1&&mx(r);return}if(!ze){at();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),at()},ze))},[at,r,Ie,ze]);VG(r,bt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(at(),qe.current=!0)},[at,Ie]);const $t=ot=>{const ft=ot.currentTarget.getAttribute("target"),It=b!==void 0?b:ft;!w&&!(ot.metaKey||ot.altKey||ot.ctrlKey||ot.shiftKey)&&!ot.defaultPrevented&&(!It||It==="_self")&&ot.button===0&&(ot.preventDefault(),t.navigate({...oe,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...z&&{onMouseEnter:z},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Pt=()=>{Ie==="intent"&&at()},zt=()=>{Ie==="intent"&&mx(r)};return{...F,...ue,...pe,href:Q,ref:r,onClick:Ff([E,$t]),onBlur:Ff([N,zt]),onFocus:Ff([T,bt]),onMouseEnter:Ff([z,bt]),onMouseLeave:Ff([M,zt]),onTouchStart:Ff([O,Pt]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&yV,...ae&&xV}}var px={},bV={className:"active"},yV={role:"link","aria-disabled":!0},xV={"data-status":"active","aria-current":"page"},M0=new WeakMap,mx=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Ff=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function wV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function SV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Yv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=vV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),kV=class extends UM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>K5({...t,from:this.id}),this.useSearch=t=>JM({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>ZM({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>XM({...t,from:this.id}),this.useLoaderData=t=>YM({...t,from:this.id}),this.useNavigate=()=>Qv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Yv,{ref:r,from:this.fullPath,...t}))}};function CV(e){return new kV(e)}function EV(){return e=>zV(e)}var NV=class extends ZW{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>K5({...n,from:this.id}),this.useSearch=n=>JM({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>ZM({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>XM({...n,from:this.id}),this.useLoaderData=n=>YM({...n,from:this.id}),this.useNavigate=()=>Qv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Yv,{ref:t,from:this.fullPath,...n}))}};function zV(e){return new NV(e)}function Fo(e){return n=>{const t=CV(n);return t.isRoot=!1,t}}function jV(e){const n=li(),t=`not-found-${Oo(n.stores.location,r=>r.pathname)}-${Oo(n.stores.status,r=>r)}`;return f.jsx(W5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if(Bh(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(Bh(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function TV(){return f.jsx("p",{children:"Not Found"})}function Qf(e){return f.jsx(f.Fragment,{children:e.children})}function eD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(TV,{})}function Xv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var AV=(e,n)=>e[0]===n[0]&&e[1]===n[1],tD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,nD=R.memo(function({routeId:n}){const t=li();return f.jsx(RV,{router:t,match:Oo(t.stores.getMatchStore(n),r=>r)})});function RV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Xv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=tD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Qf,u=s?W5:Qf,_=a?jV:Qf;return f.jsxs(t.isRoot?t.options.shellComponent??Qf:Qf,{children:[f.jsx(Kv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if(Bh(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(eV,{fallback:r,children:f.jsx(Q9,{match:n})}):f.jsx(Q9,{match:n})})})})}),null]})}var Q9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!tD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Xv(t,s)}if(n.status==="notFound")return eD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Kv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Oo(o,l=>[!!l._notFound,l.error],AV),i=Oo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return eD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(nD,{routeId:i});return t===ch?f.jsx(R.Suspense,{fallback:Xv(n),children:a}):a});function rD(e,n){const t=e[1];e.length=0,t==null||t(n)}function MV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{rD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),EM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Al(s.publicHref)!==Al(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Wv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function DV(){const e=li(),n=e.routesById[ch],t=Xv(e,n),r=e.ssr?Qf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(MV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx(LV,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function LV(){const e=li(),n=e._rendered,t=Oo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;EM(()=>{n[0]===t&&rD(n,!0)},[n,t]);const i=s?f.jsx(nD,{routeId:s}):null;return f.jsx(Kv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(W5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var OV=e=>({createMutableStore:q9,createReadonlyStore:q9,batch:oV}),IV=e=>new BV(e),BV=class extends BW{constructor(e){super(e,OV)}};function $V({router:e,children:n,...t}){zM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(WM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function PV({router:e,...n}){return f.jsx($V,{router:e,...n,children:f.jsx(DV,{})})}function FV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function HV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=FV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function sD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Oo(t.stores.__store,V5(e,t))}function qV(e){const n=li();return Oo(n.stores.location,V5(e,n))}const X1=new WeakMap,x1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))X1.set(s,(X1.get(s)??0)+1),(r=x1.get(s))==null||r.add(t)}function Vp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function a_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?X1.get(s):void 0,a=await t();if(!s||X1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;x1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{x1.get(s)===o&&x1.delete(s)}}const $h=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function iD(e){const n=e.queryKey[2];if(n==="resolvedFile")return $h(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&$h(t.ref)}function xa(e,n=za(),t,r=!1){if(!Pn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!iD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Pn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const aD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],Q5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],UV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...Q5,...aD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function GV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...aD,...Q5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function Zv(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])I5({queryKey:[...n,t,e]})}function WV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])Zv(r.id);I5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const VV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function KV(e,n){var a;if(!Pn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(VV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){GV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const QV={},YV="en",Y5=["en","zh-CN","fa"],oD="orx:locale",X5=["localStorage","preferredLanguage","baseLocale"],Y9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let X9=!1,j=()=>{var t;let e=X5;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=uD(window.location.href));const n=XV(e);if(n)return X9||(X9=!0,lD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function XV(e,n){let t;for(const r of e){if(r==="baseLocale")t=YV;else if(r==="preferredLanguage"&&!J0)t=nK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(oD)??void 0;else if(dD(r)&&Z1.has(r)){const i=Z1.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return eK(a)}}const s=ep(t);if(s)return s}}const ZV=e=>{window.location.reload()};let lD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=j()}catch{}const s=[];let i=X5;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=uD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(oD,e);else if(dD(l)&&Z1.has(l)){const u=Z1.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&ZV()};if(s.length)return Promise.all(s).then(()=>{a()});a()},JV=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Y5)if(t.toLowerCase()===n)return t}function cD(e){return!!e&&Y5.some(n=>n===e)}function eK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Y5.join(", ")}`)}function tK(e,n){return e.exec(n.href)}function nK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function rK(e){return sK(e)}function sK(e){const n=typeof e=="string"?new URL(e,JV()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let Z9,J9;function iK(e){if(Y9.length===0)return;const n=typeof e=="string"?e:e.href;if(Z9===n)return J9;const t=new URL(n,"http://example.com"),r=rK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of Y9){const l=new QV(o.match,a.href);if(tK(l,a)){i=o;break}}if(i)break}return Z9=n,J9=i,i}function uD(e){const n=iK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:X5}const Z1=new Map;function dD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const aK=e=>`Actions for ${e==null?void 0:e.name}`,oK=e=>`${e==null?void 0:e.name} 的操作`,lK=e=>`عملیات ${e==null?void 0:e.name}`,cK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?oK(e):t==="fa"?lK(e):aK(e)}),uK=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,dK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,fK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,hK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`Branch: ${e==null?void 0:e.branch}`,pK=e=>`分支:${e==null?void 0:e.branch}`,mK=e=>`شاخه: ${e==null?void 0:e.branch}`,gK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Browse code on ${e==null?void 0:e.branch}`,bK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,yK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,fD=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),xK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,wK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,SK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,kK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?wK(e):t==="fa"?SK(e):xK(e)}),CK=e=>`Collapse ${e==null?void 0:e.name}`,EK=e=>`折叠 ${e==null?void 0:e.name}`,NK=e=>`بستن ${e==null?void 0:e.name}`,zK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,TK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,AK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,RK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,OK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Copy ${e==null?void 0:e.value}`,BK=e=>`复制 ${e==null?void 0:e.value}`,$K=e=>`کپی ${e==null?void 0:e.value}`,PK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Delete ${e==null?void 0:e.name}`,HK=e=>`删除 ${e==null?void 0:e.name}`,qK=e=>`حذف ${e==null?void 0:e.name}`,S4=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),UK=e=>`Download ${e==null?void 0:e.name}`,GK=e=>`下载 ${e==null?void 0:e.name}`,WK=e=>`بارگیری ${e==null?void 0:e.name}`,eE=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?GK(e):t==="fa"?WK(e):UK(e)}),VK=e=>`Expand ${e==null?void 0:e.name}`,KK=e=>`展开 ${e==null?void 0:e.name}`,QK=e=>`باز کردن ${e==null?void 0:e.name}`,YK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?KK(e):t==="fa"?QK(e):VK(e)}),XK=e=>`Hide additional ${e==null?void 0:e.target}`,ZK=e=>`隐藏其余${e==null?void 0:e.target}`,JK=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,eQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,nQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,rQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,sQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,aQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,oQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,lQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,uQ=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,dQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,fQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,_Q=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,pQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,hD=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),mQ=e=>`Open experiment ${e==null?void 0:e.name}`,gQ=e=>`打开实验 ${e==null?void 0:e.name}`,vQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,bQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?gQ(e):t==="fa"?vQ(e):mQ(e)}),yQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,xQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,wQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,SQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.name}`,CQ=e=>`打开 ${e==null?void 0:e.name}`,EQ=e=>`باز کردن ${e==null?void 0:e.name}`,NQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open logs for run ${e==null?void 0:e.run}`,jQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,TQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,AQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,MQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,DQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,J1=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),LQ=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,OQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,IQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,BQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?OQ(e):t==="fa"?IQ(e):LQ(e)}),$Q=e=>`Overleaf — ${e==null?void 0:e.status}`,PQ=e=>`Overleaf — ${e==null?void 0:e.status}`,FQ=e=>`Overleaf — ${e==null?void 0:e.status}`,HQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Preview /${e==null?void 0:e.name} skill`,UQ=e=>`预览 /${e==null?void 0:e.name} 技能`,GQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,WQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Remove annotation ${e==null?void 0:e.number}`,KQ=e=>`移除批注 ${e==null?void 0:e.number}`,QQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,YQ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove ${e==null?void 0:e.name}`,ZQ=e=>`移除 ${e==null?void 0:e.name}`,JQ=e=>`حذف ${e==null?void 0:e.name}`,eY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove queued message: ${e==null?void 0:e.text}`,nY=e=>`移除排队消息:${e==null?void 0:e.text}`,rY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,sY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Retry queued message: ${e==null?void 0:e.text}`,aY=e=>`重试排队消息:${e==null?void 0:e.text}`,oY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Run ${e==null?void 0:e.id}`,uY=e=>`运行 ${e==null?void 0:e.id}`,dY=e=>`اجرای ${e==null?void 0:e.id}`,fY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Show error details for ${e==null?void 0:e.activity}`,_Y=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,pY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,mY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,vY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,bY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,yY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`${e==null?void 0:e.name} skill`,wY=e=>`${e==null?void 0:e.name} 技能`,SY=e=>`مهارت ${e==null?void 0:e.name}`,kY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`Value for ${e==null?void 0:e.name}`,EY=e=>`${e==null?void 0:e.name} 的值`,NY=e=>`مقدار ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=()=>"Agent reported back",TY=()=>"智能体已返回结果",AY=()=>"عامل نتیجه را گزارش کرد",RY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TY():t==="fa"?AY():jY()}),MY=()=>"Browse",DY=()=>"浏览",LY=()=>"مرور",OY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browsing…",BY=()=>"正在浏览…",$Y=()=>"در حال مرور…",PY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Checked experiment status and updated notes",HY=()=>"已检查实验状态并更新笔记",qY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",UY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Closed an agent",WY=()=>"已关闭智能体",VY=()=>"عامل بسته شد",KY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Compacted context",YY=()=>"上下文已压缩",XY=()=>"زمینه فشرده شد",ZY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacting context…",eX=()=>"正在压缩上下文…",tX=()=>"در حال فشرده‌سازی زمینه…",nX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=e=>`Created ${e==null?void 0:e.target}`,sX=e=>`已创建 ${e==null?void 0:e.target}`,iX=e=>`${e==null?void 0:e.target} ایجاد شد`,aX=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?sX(e):t==="fa"?iX(e):rX(e)}),oX=()=>"Delegate",lX=()=>"委派",cX=()=>"واگذاری",uX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lX():t==="fa"?cX():oX()}),dX=()=>"Delegating…",fX=()=>"正在委派…",hX=()=>"در حال واگذاری…",_X=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=e=>`Deleted ${e==null?void 0:e.target}`,mX=e=>`已删除 ${e==null?void 0:e.target}`,gX=e=>`${e==null?void 0:e.target} حذف شد`,vX=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mX(e):t==="fa"?gX(e):pX(e)}),bX=()=>"Edit",yX=()=>"编辑",xX=()=>"ویرایش",wX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yX():t==="fa"?xX():bX()}),SX=e=>`Edited ${e==null?void 0:e.target}`,kX=e=>`已编辑 ${e==null?void 0:e.target}`,CX=e=>`${e==null?void 0:e.target} ویرایش شد`,EX=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?kX(e):t==="fa"?CX(e):SX(e)}),NX=()=>"Editing…",zX=()=>"正在编辑…",jX=()=>"در حال ویرایش…",TX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zX():t==="fa"?jX():NX()}),AX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,RX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,MX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,DX=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?RX(e):t==="fa"?MX(e):AX(e)}),LX=e=>`Listed files matching ${e==null?void 0:e.pattern}`,OX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,IX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,BX=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=()=>"Load",PX=()=>"加载",FX=()=>"بارگیری",HX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PX():t==="fa"?FX():$X()}),qX=()=>"Loaded a skill",UX=()=>"已加载技能",GX=()=>"یک مهارت بارگیری شد",WX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=e=>`Loaded ${e==null?void 0:e.name} skill`,KX=e=>`已加载技能 ${e==null?void 0:e.name}`,QX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,YX=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?KX(e):t==="fa"?QX(e):VX(e)}),XX=()=>"Loading…",ZX=()=>"正在加载…",JX=()=>"در حال بارگیری…",eZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZX():t==="fa"?JX():XX()}),tZ=e=>`Opened ${e==null?void 0:e.target}`,nZ=e=>`已打开 ${e==null?void 0:e.target}`,rZ=e=>`${e==null?void 0:e.target} باز شد`,sZ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?nZ(e):t==="fa"?rZ(e):tZ(e)}),iZ=e=>`Ran ${e==null?void 0:e.command}`,aZ=e=>`已运行 ${e==null?void 0:e.command}`,oZ=e=>`${e==null?void 0:e.command} اجرا شد`,lZ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=()=>"Ran a sub-agent",uZ=()=>"已运行子智能体",dZ=()=>"یک عامل فرعی اجرا شد",fZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uZ():t==="fa"?dZ():cZ()}),hZ=()=>"Read",_Z=()=>"读取",pZ=()=>"خواندن",mZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read experiment notes",vZ=()=>"已读取实验笔记",bZ=()=>"یادداشت‌های آزمایش خوانده شد",yZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read a paper",wZ=()=>"已读取论文",SZ=()=>"یک مقاله خوانده شد",kZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=e=>`Read ${e==null?void 0:e.name} skill`,EZ=e=>`已读取技能 ${e==null?void 0:e.name}`,NZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,gx=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?EZ(e):t==="fa"?NZ(e):CZ(e)}),zZ=e=>`Read ${e==null?void 0:e.target}`,jZ=e=>`已读取 ${e==null?void 0:e.target}`,TZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?jZ(e):t==="fa"?TZ(e):zZ(e)}),AZ=()=>"Read a web page",RZ=()=>"已读取网页",MZ=()=>"یک صفحهٔ وب خوانده شد",DZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RZ():t==="fa"?MZ():AZ()}),LZ=()=>"Reading…",OZ=()=>"正在读取…",IZ=()=>"در حال خواندن…",BZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Resumed an agent",PZ=()=>"已恢复智能体",FZ=()=>"عامل از سر گرفته شد",HZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Review",UZ=()=>"查看",GZ=()=>"بازبینی",WZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Reviewed run log",KZ=()=>"已查看运行日志",QZ=()=>"گزارش اجرا بازبینی شد",YZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run logs",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش‌های اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed experiment status and notes",nJ=()=>"已查看实验状态和笔记",rJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewing…",aJ=()=>"正在查看…",oJ=()=>"در حال بازبینی…",lJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Run",uJ=()=>"运行",dJ=()=>"اجرا",fJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Running…",_J=()=>"正在运行…",pJ=()=>"در حال اجرا…",_D=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),mJ=()=>"Search",gJ=()=>"搜索",vJ=()=>"جست‌وجو",bJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gJ():t==="fa"?vJ():mJ()}),yJ=()=>"Searched alphaXiv full text",xJ=()=>"已搜索 alphaXiv 全文",wJ=()=>"متن کامل alphaXiv جست‌وجو شد",SJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv semantically",CJ=()=>"已对 alphaXiv 进行语义搜索",EJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",NJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched bioRxiv",jJ=()=>"已搜索 bioRxiv",TJ=()=>"bioRxiv جست‌وجو شد",AJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched code",MJ=()=>"已搜索代码",DJ=()=>"کد جست‌وجو شد",vx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),LJ=e=>`Searched code for “${e==null?void 0:e.pattern}”`,OJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,IJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,bx=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?OJ(e):t==="fa"?IJ(e):LJ(e)}),BJ=e=>`Searched images for “${e==null?void 0:e.query}”`,$J=e=>`已搜索图片“${e==null?void 0:e.query}”`,PJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,FJ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$J(e):t==="fa"?PJ(e):BJ(e)}),HJ=()=>"Searched the literature",qJ=()=>"已搜索文献",UJ=()=>"منابع علمی جست‌وجو شد",tE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qJ():t==="fa"?UJ():HJ()}),GJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,WJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,VJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,KJ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?WJ(e):t==="fa"?VJ(e):GJ(e)}),QJ=()=>"Searched OpenAlex",YJ=()=>"已搜索 OpenAlex",XJ=()=>"OpenAlex جست‌وجو شد",ZJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YJ():t==="fa"?XJ():QJ()}),JJ=e=>`Searched the web for “${e==null?void 0:e.query}”`,eee=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,tee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,nE=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?eee(e):t==="fa"?tee(e):JJ(e)}),nee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,ree=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,see=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,iee=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ree(e):t==="fa"?see(e):nee(e)}),aee=()=>"Searching…",oee=()=>"正在搜索…",lee=()=>"در حال جست‌وجو…",cee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oee():t==="fa"?lee():aee()}),uee=()=>"Sent input to an agent",dee=()=>"已向智能体发送输入",fee=()=>"ورودی به عامل فرستاده شد",hee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Spawned an agent",pee=()=>"已创建智能体",mee=()=>"یک عامل ساخته شد",gee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Sub-agent",bee=()=>"子智能体",yee=()=>"عامل فرعی",xee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent interrupted",See=()=>"子智能体已中断",kee=()=>"عامل فرعی متوقف شد",Cee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent started",Nee=()=>"子智能体已启动",zee=()=>"عامل فرعی آغاز شد",jee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Updated experiment notes",Aee=()=>"已更新实验笔记",Ree=()=>"یادداشت‌های آزمایش به‌روز شد",Mee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Waiting on an agent",Lee=()=>"正在等待智能体",Oee=()=>"در انتظار عامل",Iee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=e=>`Approval required: ${e==null?void 0:e.label}`,$ee=e=>`需要批准:${e==null?void 0:e.label}`,Pee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,rE=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$ee(e):t==="fa"?Pee(e):Bee(e)}),Fee=()=>"The CLI is retrying the turn.",Hee=()=>"CLI 正在重试本轮。",qee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Uee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hee():t==="fa"?qee():Fee()}),Gee=()=>"Continue is available.",Wee=()=>"可以继续。",Vee=()=>"ادامه در دسترس است.",Kee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Retry is available.",Yee=()=>"可以重试。",Xee=()=>"تلاش دوباره در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Running a tool",ete=()=>"正在运行工具",tte=()=>"در حال اجرای ابزار",nte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Tool activity completed",ste=()=>"工具活动已完成",ite=()=>"فعالیت ابزار کامل شد",ate=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,lte=e=>`工具活动失败:${e==null?void 0:e.labels}`,cte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,ute=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?lte(e):t==="fa"?cte(e):ote(e)}),dte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,fte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=()=>"Turn did not finish.",mte=()=>"本轮未完成。",gte=()=>"این نوبت کامل نشد.",vte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mte():t==="fa"?gte():pte()}),bte=()=>"Artifacts",yte=()=>"产物",xte=()=>"خروجی‌ها",pD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),wte=()=>"Close panel",Ste=()=>"关闭面板",kte=()=>"بستن پنل",ev=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ste():t==="fa"?kte():wte()}),Cte=()=>"Current task",Ete=()=>"当前任务",Nte=()=>"وظیفهٔ فعلی",sE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ete():t==="fa"?Nte():Cte()}),zte=()=>"Drag to resize panel",jte=()=>"拖动以调整面板大小",Tte=()=>"برای تغییر اندازهٔ پنل بکشید",Ate=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jte():t==="fa"?Tte():zte()}),Rte=()=>"Drag toward the center to restore panel",Mte=()=>"向中央拖动以恢复面板",Dte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",Lte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Entire project",Ite=()=>"整个项目",Bte=()=>"کل پروژه",iE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),$te=()=>"Expand panel",Pte=()=>"展开面板",Fte=()=>"گسترش پنل",aE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pte():t==="fa"?Fte():$te()}),Hte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,qte=e=>`实验筛选:${e==null?void 0:e.scope}`,Ute=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Gte=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qte(e):t==="fa"?Ute(e):Hte(e)}),Wte=()=>"Experiment view",Vte=()=>"实验视图",Kte=()=>"نمای آزمایش",Qte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vte():t==="fa"?Kte():Wte()}),Yte=()=>"Experiments",Xte=()=>"实验",Zte=()=>"آزمایش‌ها",mD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),Jte=()=>"Files",ene=()=>"文件",tne=()=>"فایل‌ها",k4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ene():t==="fa"?tne():Jte()}),nne=()=>"Filter experiments",rne=()=>"筛选实验",sne=()=>"فیلتر آزمایش‌ها",ine=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rne():t==="fa"?sne():nne()}),ane=()=>"Current task filtering is unavailable for unattributed experiments",one=()=>"存在无法归属的实验时,不能按当前任务筛选",lne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",cne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",dne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",fne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",hne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"Open a task to filter to its experiments",pne=()=>"请打开一个任务以筛选其实验",mne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",gne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"projects",bne=()=>"项目",yne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),xne=()=>"Restore panel",wne=()=>"还原面板",Sne=()=>"بازگرداندن اندازهٔ پنل",oE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wne():t==="fa"?Sne():xne()}),kne=()=>"Retry",Cne=()=>"重试",Ene=()=>"تلاش دوباره",Ui=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cne():t==="fa"?Ene():kne()}),Nne=()=>"Select a project to browse its files.",zne=()=>"选择一个项目以浏览其文件。",jne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Tne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zne():t==="fa"?jne():Nne()}),Ane=()=>"settings",Rne=()=>"设置",Mne=()=>"تنظیمات",Dne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,One=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Ine=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Bne=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?One(e):t==="fa"?Ine(e):Lne(e)}),$ne=()=>"Sub-agent",Pne=()=>"子智能体",Fne=()=>"عامل فرعی",Hne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pne():t==="fa"?Fne():$ne()}),qne=()=>"Table",Une=()=>"表格",Gne=()=>"جدول",Wne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Tree",Kne=()=>"树状图",Qne=()=>"درخت",Yne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=e=>`Collapse ${e==null?void 0:e.name}`,Zne=e=>`折叠 ${e==null?void 0:e.name}`,Jne=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,ere=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Zne(e):t==="fa"?Jne(e):Xne(e)}),tre=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,nre=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,rre=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,Z5=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),sre=e=>`Delete folder ${e==null?void 0:e.name}`,ire=e=>`删除文件夹 ${e==null?void 0:e.name}`,are=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,ore=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ire(e):t==="fa"?are(e):sre(e)}),lre=e=>`Expand ${e==null?void 0:e.name}`,cre=e=>`展开 ${e==null?void 0:e.name}`,ure=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=()=>"Binary or unsupported file — no inline preview.",hre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",_re=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",pre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hre():t==="fa"?_re():fre()}),mre=()=>"Copy path",gre=()=>"复制路径",vre=()=>"کپی مسیر",bre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Artifact not found",xre=()=>"找不到产物",wre=()=>"خروجی پیدا نشد",Sre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Open raw",Cre=()=>"打开原始文件",Ere=()=>"باز کردن فایل خام",Nre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Click an artifact to view it",jre=()=>"点击产物即可查看",Tre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Are=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Delete artifact",Mre=()=>"删除产物",Dre=()=>"حذف خروجی",lE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Lre=()=>"Delete folder",Ore=()=>"删除文件夹",Ire=()=>"حذف پوشه",Bre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ore():t==="fa"?Ire():Lre()}),$re=()=>"Failed to load:",Pre=()=>"加载失败:",Fre=()=>"بارگیری ناموفق بود:",Hre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"File truncated — showing the first 512 KB.",Ure=()=>"文件已截断——仅显示前 512 KB。",Gre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Wre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"Listing truncated — the folder has more artifacts.",Kre=()=>"列表已截断——文件夹中还有更多产物。",Qre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",Yre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Loading…",Zre=()=>"正在加载…",Jre=()=>"در حال بارگیری…",gD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),ese=()=>"Loading artifacts…",tse=()=>"正在加载产物…",nse=()=>"در حال بارگیری خروجی‌ها…",rse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tse():t==="fa"?nse():ese()}),sse=()=>"Modified",ise=()=>"修改时间",ase=()=>"ویرایش‌شده",ose=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"No artifacts yet",cse=()=>"尚无产物",use=()=>"هنوز خروجی‌ای وجود ندارد",dse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"Open raw in new tab",hse=()=>"在新标签页中打开原始文件",_se=()=>"باز کردن فایل خام در زبانهٔ جدید",cE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),pse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",mse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",gse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",vse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mse():t==="fa"?gse():pse()}),bse=()=>"File too large to preview inline.",yse=()=>"文件太大,无法内嵌预览。",xse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",wse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"This is the baseline branch, so there is no parent comparison.",kse=()=>"这是基线分支,因此没有父分支可供比较。",Cse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Ese=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"Failed to load changes:",zse=()=>"加载更改失败:",jse=()=>"بارگیری تغییرات ناموفق بود:",Tse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Loading changes…",Rse=()=>"正在加载更改…",Mse=()=>"در حال بارگیری تغییرات…",Dse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"No committed changes from the parent branch.",Ose=()=>"与父分支相比没有已提交的更改。",Ise=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Bse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=e=>`agent ${e==null?void 0:e.number}`,Pse=e=>`智能体 ${e==null?void 0:e.number}`,Fse=e=>`عامل ${e==null?void 0:e.number}`,uE=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Pse(e):t==="fa"?Fse(e):$se(e)}),Hse=()=>"agent sessions",qse=()=>"智能体会话",Use=()=>"نشست‌های عامل‌ها",Gse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qse():t==="fa"?Use():Hse()}),Wse=()=>"All sessions",Vse=()=>"所有会话",Kse=()=>"همهٔ نشست‌ها",vD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Qse=e=>`${e==null?void 0:e.count} annotations`,Yse=e=>`${e==null?void 0:e.count} 条批注`,Xse=e=>`${e==null?void 0:e.count} یادداشت`,Zse=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Yse(e):t==="fa"?Xse(e):Qse(e)}),Jse=()=>"Archive",eie=()=>"归档",tie=()=>"بایگانی",nie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eie():t==="fa"?tie():Jse()}),rie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",sie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",iie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",aie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Asked about selected text",lie=()=>"已询问所选文本",cie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",uie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Attachment",fie=()=>"附件",hie=()=>"پیوست",_ie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,mie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,gie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,vie=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mie(e):t==="fa"?gie(e):pie(e)}),bie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",yie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",xie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",wie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yie():t==="fa"?xie():bie()}),Sie=()=>"Wait for the turn to finish before running a command.",kie=()=>"请等待本轮结束后再运行命令。",Cie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Eie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=e=>`Exited with code ${e==null?void 0:e.code}`,zie=e=>`退出码 ${e==null?void 0:e.code}`,jie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Tie=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?zie(e):t==="fa"?jie(e):Nie(e)}),Aie=e=>`Command not run: ${e==null?void 0:e.error}`,Rie=e=>`命令未运行:${e==null?void 0:e.error}`,Mie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,dE=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Die=()=>"Collapse tool activity",Lie=()=>"折叠工具活动",Oie=()=>"بستن فعالیت ابزارها",Iie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lie():t==="fa"?Oie():Die()}),Bie=()=>"Continue",$ie=()=>"继续",Pie=()=>"ادامه",Fie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=e=>`Delete “${e==null?void 0:e.title}”? + */var V9;function pV(){if(V9)return f2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return f2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},f2}var K9;function mV(){return K9||(K9=1,d2.exports=pV()),d2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Q5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Qv),r=e.from??t,s=n.stores.getMatchStore(r),i=Q5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&P5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Yv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Y5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function p2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return W1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),W1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=K1(e.pathname,r),o=K1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:H,hash:q,state:Y,mask:G,reloadDocument:X,unsafeRelative:ee,from:I,_fromLocation:L,...P}=e,W=VM(),U=p2(e.search),te=p2(e.params),de=p2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,U,te,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,de,t.basepath,W,we!==void 0)]},[de,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ce=oe?Bh(s,{})??SV:m2,pe=oe?m2:Bh(i,{})??m2,Se=[C,ce.className,pe.className].filter(Boolean).join(" "),ye=(y||ce.style||pe.style)&&{...y,...ce.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){g2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&g2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...P,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&g2(r)};return{...P,...ce,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var m2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,g2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Xv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Xv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Y5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Xv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(K5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function Zv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Zv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?K5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Qv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Zv(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Qv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:Zv(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Vv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=Zv(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Qv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(K5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Q5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Q5(e,n))}const Z1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))Z1.set(s,(Z1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?Z1.get(s):void 0,a=await t();if(!s||Z1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],X5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...X5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...X5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function Jv(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])$5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])Jv(r.id);$5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",Z5=["en","zh-CN","fa"],cD="orx:locale",J5=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=J5;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&J1.has(r)){const i=J1.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=J5;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&J1.has(l)){const u=J1.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Z5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&Z5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Z5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:J5}const J1=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,k4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,ev=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,v2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",b2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,y2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",tv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",C4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,e6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? -Its transcript will be permanently removed.`,qie=e=>`删除“${e==null?void 0:e.title}”? +Its transcript will be permanently removed.`,Vie=e=>`删除“${e==null?void 0:e.title}”? -其对话记录将被永久移除。`,Uie=e=>`«${e==null?void 0:e.title}» حذف شود؟ +其对话记录将被永久移除。`,Kie=e=>`«${e==null?void 0:e.title}» حذف شود؟ -رونوشت آن برای همیشه حذف خواهد شد.`,Gie=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qie(e):t==="fa"?Uie(e):Hie(e)}),Wie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Vie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Kie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Qie=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=()=>"Could not exit Plan mode. Try again.",Xie=()=>"无法退出计划模式。请重试。",Zie=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",Jie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xie():t==="fa"?Zie():Yie()}),eae=()=>"Expand tool activity",tae=()=>"展开工具活动",nae=()=>"باز کردن فعالیت ابزارها",rae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"experiments",iae=()=>"实验",aae=()=>"آزمایش‌ها",oae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,cae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,uae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,dae=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cae(e):t==="fa"?uae(e):lae(e)}),fae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,hae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,_ae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,pae=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message not sent: ${e==null?void 0:e.error}`,gae=e=>`消息未发送:${e==null?void 0:e.error}`,vae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,bae=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=()=>"Model unavailable",xae=()=>"模型不可用",wae=()=>"مدل در دسترس نیست",Sae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xae():t==="fa"?wae():yae()}),kae=()=>"New session",Cae=()=>"新会话",Eae=()=>"نشست جدید",fE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),Nae=()=>"No active sessions",zae=()=>"没有活跃会话",jae=()=>"نشست فعالی وجود ندارد",Tae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zae():t==="fa"?jae():Nae()}),Aae=()=>"No activity",Rae=()=>"无活动",Mae=()=>"بدون فعالیت",Dae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No archived sessions",Oae=()=>"没有已归档的会话",Iae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Bae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No sessions yet",Pae=()=>"还没有会话",Fae=()=>"هنوز نشستی وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"1 annotation",Uae=()=>"1 条批注",Gae=()=>"۱ یادداشت",Wae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"Open sub-agent transcript",Kae=()=>"打开子智能体记录",Qae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",Yae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"About this demo",Zae=()=>"关于此演示",Jae=()=>"دربارهٔ این نسخهٔ نمایشی",hE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),eoe=()=>"Accept and auto mode",toe=()=>"接受并使用自动模式",noe=()=>"پذیرش و حالت خودکار",roe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?toe():t==="fa"?noe():eoe()}),soe=()=>"Accept and bypass all",ioe=()=>"接受并跳过所有审批",aoe=()=>"پذیرش و عبور از همهٔ تأییدها",ooe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Active",coe=()=>"活跃",uoe=()=>"فعال",doe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"All",hoe=()=>"全部",_oe=()=>"همه",poe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"Allow",goe=()=>"允许",voe=()=>"اجازه دادن",boe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Approval required",xoe=()=>"需要批准",woe=()=>"نیازمند تأیید",Soe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Archived",Coe=()=>"已归档",Eoe=()=>"بایگانی‌شده",_E=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),Noe=()=>"Ask about this",zoe=()=>"询问此内容",joe=()=>"دربارهٔ این بپرسید",Toe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zoe():t==="fa"?joe():Noe()}),Aoe=()=>"Attach a PDF or image",Roe=()=>"附加 PDF 或图片",Moe=()=>"پیوست PDF یا تصویر",pE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Doe=()=>"Bash",Loe=()=>"Bash",Ooe=()=>"Bash",bD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Loe():t==="fa"?Ooe():Doe()}),Ioe=()=>"Browsed the web",Boe=()=>"已浏览网页",$oe=()=>"وب مرور شد",mE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Boe():t==="fa"?$oe():Ioe()}),Poe=()=>"Built the project",Foe=()=>"已构建项目",Hoe=()=>"پروژه ساخته شد",qoe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Foe():t==="fa"?Hoe():Poe()}),Uoe=()=>"Cancel",Goe=()=>"取消",Woe=()=>"لغو",Voe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancelled an experiment run",Qoe=()=>"已取消实验运行",Yoe=()=>"اجرای آزمایش لغو شد",Xoe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Checked code style",Joe=()=>"已检查代码风格",ele=()=>"سبک کد بررسی شد",tle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked compute options",rle=()=>"已检查算力选项",sle=()=>"گزینه‌های رایانشی بررسی شد",ile=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked experiment status",ole=()=>"已检查实验状态",lle=()=>"وضعیت آزمایش بررسی شد",gE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),cle=()=>"Checked Git status",ule=()=>"已检查 Git 状态",dle=()=>"وضعیت Git بررسی شد",fle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ule():t==="fa"?dle():cle()}),hle=()=>"Checked local times",_le=()=>"已查询当地时间",ple=()=>"زمان‌های محلی بررسی شد",mle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked market data",vle=()=>"已查询市场数据",ble=()=>"داده‌های بازار بررسی شد",yle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked sports data",wle=()=>"已查询体育数据",Sle=()=>"داده‌های ورزشی بررسی شد",kle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked the weather",Ele=()=>"已查询天气",Nle=()=>"آب‌وهوا بررسی شد",zle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked types",Tle=()=>"已检查类型",Ale=()=>"نوع‌ها بررسی شد",Rle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Clear annotations",Dle=()=>"清除批注",Lle=()=>"پاک کردن یادداشت‌ها",vE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ole=()=>"Customize",Ile=()=>"自定义",Ble=()=>"سفارشی‌سازی",$le=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ile():t==="fa"?Ble():Ole()}),Ple=()=>"Data sources",Fle=()=>"数据源",Hle=()=>"منابع داده",yx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),qle=()=>"Delegated a task to a new agent",Ule=()=>"已将任务委派给新智能体",Gle=()=>"وظیفه به عامل جدید واگذار شد",Wle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ule():t==="fa"?Gle():qle()}),Vle=()=>"Delete",Kle=()=>"删除",Qle=()=>"حذف",yD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Yle=()=>"Deny",Xle=()=>"拒绝",Zle=()=>"رد کردن",Jle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xle():t==="fa"?Zle():Yle()}),ece=()=>"Edit and re-send",tce=()=>"编辑并重新发送",nce=()=>"ویرایش و ارسال دوباره",bE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),rce=()=>"Edit message",sce=()=>"编辑消息",ice=()=>"ویرایش پیام",ace=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sce():t==="fa"?ice():rce()}),oce=()=>"Edited a file",lce=()=>"已编辑文件",cce=()=>"فایل ویرایش شد",yE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),uce=()=>"Exit Bash mode",dce=()=>"退出 Bash 模式",fce=()=>"خروج از حالت Bash",xE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dce():t==="fa"?fce():uce()}),hce=()=>"Exit Plan mode",_ce=()=>"退出计划模式",pce=()=>"خروج از حالت طرح",wE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ce():t==="fa"?pce():hce()}),mce=()=>"Failed:",gce=()=>"失败:",vce=()=>"ناموفق:",J5=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gce():t==="fa"?vce():mce()}),bce=()=>"Filter sessions",yce=()=>"筛选会话",xce=()=>"فیلتر نشست‌ها",SE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yce():t==="fa"?xce():bce()}),wce=()=>"is unavailable.",Sce=()=>"不可用。",kce=()=>"در دسترس نیست.",Cce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sce():t==="fa"?kce():wce()}),Ece=()=>"Later queued messages will wait until this is retried or removed.",Nce=()=>"后续排队的消息会等待此消息重试或移除。",zce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",jce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Listed files",Ace=()=>"已列出文件",Rce=()=>"فایل‌ها فهرست شد",kE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Mce=()=>"Listed project runs",Dce=()=>"已列出项目运行",Lce=()=>"اجراهای پروژه فهرست شد",Oce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dce():t==="fa"?Lce():Mce()}),Ice=()=>"Listed projects",Bce=()=>"已列出项目",$ce=()=>"پروژه‌ها فهرست شد",Pce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Loading conversation…",Hce=()=>"正在加载对话…",qce=()=>"در حال بارگیری گفتگو…",Uce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"New Chat",Wce=()=>"新对话",Vce=()=>"گفتگوی جدید",Kce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"Next version",Yce=()=>"下一版本",Xce=()=>"نسخهٔ بعدی",CE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Zce=()=>"Open the session this agent spawned",Jce=()=>"打开此智能体创建的会话",eue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",tue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jce():t==="fa"?eue():Zce()}),nue=()=>"Opened web pages",rue=()=>"已打开网页",sue=()=>"صفحه‌های وب باز شد",iue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Plan",oue=()=>"计划",lue=()=>"طرح",cue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan approved",due=()=>"计划已批准",fue=()=>"طرح تأیید شد",hue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan rejected",pue=()=>"计划已拒绝",mue=()=>"طرح رد شد",gue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan resolved",bue=()=>"计划已处理",yue=()=>"طرح تعیین تکلیف شد",xue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan revision requested",Sue=()=>"已请求修改计划",kue=()=>"درخواست بازنگری طرح ثبت شد",Cue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Previous version",Nue=()=>"上一版本",zue=()=>"نسخهٔ قبلی",EE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),jue=()=>"Ran a command",Tue=()=>"已运行命令",Aue=()=>"فرمان اجرا شد",Rue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tue():t==="fa"?Aue():jue()}),Mue=()=>"Ran tests",Due=()=>"已运行测试",Lue=()=>"آزمون‌ها اجرا شد",Oue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Read a file",Bue=()=>"已读取文件",$ue=()=>"فایل خوانده شد",Pue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read Git history",Hue=()=>"已读取 Git 历史",que=()=>"تاریخچهٔ Git خوانده شد",Uue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read project details",Wue=()=>"已读取项目详情",Vue=()=>"جزئیات پروژه خوانده شد",Kue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Reject",Yue=()=>"拒绝",Xue=()=>"رد کردن",Zue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Remove",ede=()=>"移除",tde=()=>"حذف",nde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove annotation",sde=()=>"移除批注",ide=()=>"حذف یادداشت",ade=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove file",lde=()=>"移除文件",cde=()=>"حذف فایل",NE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),ude=()=>"Remove image",dde=()=>"移除图片",fde=()=>"حذف تصویر",zE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dde():t==="fa"?fde():ude()}),hde=()=>"Remove queued message",_de=()=>"移除排队消息",pde=()=>"حذف پیام صف",jE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_de():t==="fa"?pde():hde()}),mde=()=>"Rename",gde=()=>"重命名",vde=()=>"تغییر نام",xD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gde():t==="fa"?vde():mde()}),bde=()=>"Reviewed code changes",yde=()=>"已审查代码更改",xde=()=>"تغییرات کد بازبینی شد",wde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yde():t==="fa"?xde():bde()}),Sde=()=>"Run",kde=()=>"运行",Cde=()=>"اجرا",TE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Ede=()=>"Selected chat text",Nde=()=>"已选聊天文本",zde=()=>"متن انتخاب‌شدهٔ گفتگو",jde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nde():t==="fa"?zde():Ede()}),Tde=()=>"Selected text:",Ade=()=>"已选文本:",Rde=()=>"متن انتخاب‌شده:",Mde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Send",Lde=()=>"发送",Ode=()=>"ارسال",C4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Ide=()=>"Session options",Bde=()=>"会话选项",$de=()=>"گزینه‌های نشست",AE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bde():t==="fa"?$de():Ide()}),Pde=()=>"Session title",Fde=()=>"会话标题",Hde=()=>"عنوان نشست",qde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fde():t==="fa"?Hde():Pde()}),Ude=()=>"Show sidebar",Gde=()=>"显示侧边栏",Wde=()=>"نمایش نوار کناری",RE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Vde=()=>"Started an experiment run",Kde=()=>"已启动实验运行",Qde=()=>"اجرای آزمایش آغاز شد",Yde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kde():t==="fa"?Qde():Vde()}),Xde=()=>"Reading the project to suggest where to start…",Zde=()=>"正在阅读项目以建议从哪里开始…",Jde=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",efe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Starter prompts",nfe=()=>"入门提示",rfe=()=>"پیشنهادهای شروع",sfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Stop",afe=()=>"停止",ofe=()=>"توقف",ME=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),lfe=()=>"Submit",cfe=()=>"提交",ufe=()=>"ارسال",dfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cfe():t==="fa"?ufe():lfe()}),ffe=()=>"Tool failed",hfe=()=>"工具失败",_fe=()=>"ابزار ناموفق بود",pfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Used tools",gfe=()=>"已使用工具",vfe=()=>"ابزارها استفاده شد",wD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),bfe=()=>"View full plan",yfe=()=>"查看完整计划",xfe=()=>"مشاهدهٔ طرح کامل",wfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yfe():t==="fa"?xfe():bfe()}),Sfe=()=>"Waited for an experiment run",kfe=()=>"已等待实验运行",Cfe=()=>"برای اجرای آزمایش صبر شد",Efe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waiting for your input…",zfe=()=>"正在等待你的输入…",jfe=()=>"منتظر ورودی شما…",Tfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"What should we research?",Rfe=()=>"我们应该研究什么?",Mfe=()=>"چه چیزی را پژوهش کنیم؟",Dfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"You, mid-task",Ofe=()=>"你(任务进行中)",Ife=()=>"شما، هنگام انجام وظیفه",Bfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"Pasted image",Pfe=()=>"粘贴的图片",Ffe=()=>"تصویر جای‌گذاری‌شده",Hfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Plan",Ufe=()=>"计划",Gfe=()=>"طرح",SD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Wfe=()=>"Plan mode — ready to proceed?",Vfe=()=>"计划模式 — 准备好继续了吗?",Kfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Qfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vfe():t==="fa"?Kfe():Wfe()}),Yfe=()=>"Proposed plan",Xfe=()=>"提议的计划",Zfe=()=>"طرح پیشنهادی",DE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),Jfe=()=>"Question",ehe=()=>"问题",the=()=>"پرسش",nhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ehe():t==="fa"?the():Jfe()}),rhe=()=>"Queued",she=()=>"已排队",ihe=()=>"در صف",ahe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Recents",lhe=()=>"最近",che=()=>"اخیر",kD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),uhe=()=>"Re-check its setup.",dhe=()=>"请重新检查其设置。",fhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",hhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dhe():t==="fa"?fhe():uhe()}),_he=()=>"Could not recover this turn. Try again.",phe=()=>"无法恢复本轮。请重试。",mhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",ghe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not remove the queued message. Try again.",bhe=()=>"无法移除排队消息。请重试。",yhe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=e=>`Could not re-send: ${e==null?void 0:e.error}`,She=e=>`无法重新发送:${e==null?void 0:e.error}`,khe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,Che=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?She(e):t==="fa"?khe(e):whe(e)}),Ehe=()=>"Resolved",Nhe=()=>"已处理",zhe=()=>"رسیدگی شد",jhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nhe():t==="fa"?zhe():Ehe()}),The=()=>"Could not retry the queued message. Try again.",Ahe=()=>"无法重试排队消息。请重试。",Rhe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Mhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"run logs",Lhe=()=>"运行日志",Ohe=()=>"گزارش‌های اجرا",Ihe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"Scroll to bottom",$he=()=>"滚动到底部",Phe=()=>"رفتن به پایین گفتگو",LE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Fhe=()=>"The selected harness is unavailable",Hhe=()=>"所选智能体工具不可用",qhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",xx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hhe():t==="fa"?qhe():Fhe()}),Uhe=()=>"Session limit reached",Ghe=()=>"已达到会话使用限额",Whe=()=>"به سقف مصرف نشست رسیده‌اید",Vhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ghe():t==="fa"?Whe():Uhe()}),Khe=()=>"The chat session was not created",Qhe=()=>"未能创建聊天会话",Yhe=()=>"نشست گفت‌وگو ایجاد نشد",Xhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"Show full conversation",Jhe=()=>"显示完整对话",e_e=()=>"نمایش کامل گفتگو",t_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>" · Spawned by another agent",r_e=()=>" · 由另一个智能体创建",s_e=()=>" · ساخته‌شده به‌دست عامل دیگر",i_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>"Starting…",o_e=()=>"正在启动…",l_e=()=>"در حال شروع…",c_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,d_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,f_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,h_e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?d_e(e):t==="fa"?f_e(e):u_e(e)}),__e=()=>"Could not stop the turn. Try again.",p_e=()=>"无法停止本轮。请重试。",m_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",g_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?p_e():t==="fa"?m_e():__e()}),v_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,b_e=e=>`无法切换分支:${e==null?void 0:e.error}`,y_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,x_e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?b_e(e):t==="fa"?y_e(e):v_e(e)}),w_e=()=>"The agent",S_e=()=>"智能体",k_e=()=>"عامل",C_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?S_e():t==="fa"?k_e():w_e()}),E_e=()=>"Thinking",N_e=()=>"正在思考",z_e=()=>"در حال فکر کردن",j_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Could not toggle Plan mode. Try again.",A_e=()=>"无法切换计划模式。请重试。",R_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",OE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),M_e=()=>"This turn did not finish.",D_e=()=>"本轮未完成。",L_e=()=>"این نوبت کامل نشد.",IE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D_e():t==="fa"?L_e():M_e()}),O_e=()=>"Type a custom answer…",I_e=()=>"输入自定义回答…",B_e=()=>"پاسخ دلخواه را بنویسید…",$_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?I_e():t==="fa"?B_e():O_e()}),P_e=()=>"Unarchive",F_e=()=>"取消归档",H_e=()=>"خارج کردن از بایگانی",q_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Untitled",G_e=()=>"未命名",W_e=()=>"بدون عنوان",Eg=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),V_e=()=>"Could not update permissions. Try again.",K_e=()=>"无法更新权限。请重试。",Q_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",Y_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?K_e():t==="fa"?Q_e():V_e()}),X_e=()=>"Work details",Z_e=()=>"工作详情",J_e=()=>"جزئیات کار",e0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,n0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,r0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,s0e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?n0e(e):t==="fa"?r0e(e):t0e(e)}),i0e=e=>`Worked for ${e==null?void 0:e.duration}`,a0e=e=>`已工作 ${e==null?void 0:e.duration}`,o0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,l0e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=()=>"Working…",u0e=()=>"正在工作…",d0e=()=>"در حال کار…",e6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?u0e():t==="fa"?d0e():c0e()}),f0e=()=>"Close tab",h0e=()=>"关闭标签页",_0e=()=>"بستن زبانه",p0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?h0e():t==="fa"?_0e():f0e()}),m0e=()=>"Changes",g0e=()=>"更改",v0e=()=>"تغییرات",CD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),b0e=()=>"Code browser view",y0e=()=>"代码浏览器视图",x0e=()=>"نمای مرورگر کد",w0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y0e():t==="fa"?x0e():b0e()}),S0e=()=>"Files",k0e=()=>"文件",C0e=()=>"فایل‌ها",E0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Refresh",z0e=()=>"刷新",j0e=()=>"تازه‌سازی",BE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),T0e=()=>"listing truncated",A0e=()=>"列表已截断",R0e=()=>"فهرست کوتاه شده است",M0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A0e():t==="fa"?R0e():T0e()}),D0e=()=>"No files.",L0e=()=>"没有文件。",O0e=()=>"فایلی وجود ندارد.",I0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"Refresh failed:",$0e=()=>"刷新失败:",P0e=()=>"تازه‌سازی ناموفق بود:",F0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Cancelling…",q0e=()=>"正在取消…",U0e=()=>"در حال لغو…",G0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Checking…",V0e=()=>"正在检查…",K0e=()=>"در حال بررسی…",Yi=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Q0e=()=>"Copied",Y0e=()=>"已复制",X0e=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Y0e():t==="fa"?X0e():Q0e()}),Z0e=e=>`Failed to load: ${e==null?void 0:e.error}`,J0e=e=>`加载失败:${e==null?void 0:e.error}`,epe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,ED=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?J0e(e):t==="fa"?epe(e):Z0e(e)}),tpe=()=>"Loading…",npe=()=>"正在加载…",rpe=()=>"در حال بارگیری…",ND=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?npe():t==="fa"?rpe():tpe()}),spe=e=>`+ ${e==null?void 0:e.count} more`,ipe=e=>`另有 ${e==null?void 0:e.count} 项`,ape=e=>`${e==null?void 0:e.count}+ مورد دیگر`,ope=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ipe(e):t==="fa"?ape(e):spe(e)}),lpe=()=>"Rendered view",cpe=()=>"渲染视图",upe=()=>"نمای رندرشده",tv=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cpe():t==="fa"?upe():lpe()}),dpe=()=>"Save",fpe=()=>"保存",hpe=()=>"ذخیره",Ho=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fpe():t==="fa"?hpe():dpe()}),_pe=()=>"Saving…",ppe=()=>"正在保存…",mpe=()=>"در حال ذخیره…",ea=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ppe():t==="fa"?mpe():_pe()}),gpe=()=>"Show less",vpe=()=>"收起",bpe=()=>"نمایش کمتر",zD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vpe():t==="fa"?bpe():gpe()}),ype=()=>"Show more",xpe=()=>"展开",wpe=()=>"نمایش بیشتر",Spe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xpe():t==="fa"?wpe():ype()}),kpe=()=>"Stop",Cpe=()=>"停止",Epe=()=>"توقف",jD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),Npe=()=>"Stopping…",zpe=()=>"正在停止…",jpe=()=>"در حال توقف…",Tpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zpe():t==="fa"?jpe():Npe()}),Ape=()=>"View source",Rpe=()=>"查看源代码",Mpe=()=>"نمایش متن منبع",nh=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Dpe=()=>"Runs as a remote Hugging Face Job",Lpe=()=>"作为远程 Hugging Face Job 运行",Ope=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Ipe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lpe():t==="fa"?Ope():Dpe()}),Bpe=()=>"Runs as a Job on your Kubernetes cluster",$pe=()=>"作为 Kubernetes 集群上的 Job 运行",Ppe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs directly on this computer",qpe=()=>"直接在此计算机上运行",Upe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs in a remote Modal sandbox",Vpe=()=>"在远程 Modal 沙箱中运行",Kpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs on an ephemeral OpenResearch box",Xpe=()=>"在临时 OpenResearch 主机上运行",Zpe=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on the connected Ray cluster",tme=()=>"在已连接的 Ray 集群上运行",nme=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs as a scheduled job on your Slurm cluster",ime=()=>"作为 Slurm 集群上的调度作业运行",ame=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs on a host from your SSH config",cme=()=>"在 SSH 配置中的主机上运行",ume=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs through Tinker’s remote compute",hme=()=>"通过 Tinker 远程算力运行",_me=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"HF Jobs",gme=()=>"HF Jobs",vme=()=>"HF Jobs",bme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"Kubernetes",xme=()=>"Kubernetes",wme=()=>"Kubernetes",Sme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"This machine",Cme=()=>"此计算机",Eme=()=>"این رایانه",TD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),Nme=()=>"Modal",zme=()=>"Modal",jme=()=>"Modal",Tme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zme():t==="fa"?jme():Nme()}),Ame=()=>"OpenResearch",Rme=()=>"OpenResearch",Mme=()=>"OpenResearch",Dme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"Ray",Ome=()=>"Ray",Ime=()=>"Ray",Bme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Slurm",Pme=()=>"Slurm",Fme=()=>"Slurm",Hme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"SSH",Ume=()=>"SSH",Gme=()=>"SSH",Wme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"Tinker",Kme=()=>"Tinker",Qme=()=>"Tinker",Yme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",Zme=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",Jme=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",ege=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",nge=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",rge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",sge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",age=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",oge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",lge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"This computer must stay awake and online while Tinker runs.",uge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",dge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",fge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"Context window",_ge=()=>"上下文窗口",pge=()=>"پنجرهٔ زمینه",mge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window used",vge=()=>"已使用的上下文窗口",bge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",yge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=e=>`${e==null?void 0:e.value} tokens`,wge=e=>`${e==null?void 0:e.value} 个 token`,Sge=e=>`${e==null?void 0:e.value} توکن`,kge=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?wge(e):t==="fa"?Sge(e):xge(e)}),Cge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Ege=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Nge=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,zge=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=()=>"No runs yet — ask the agent to launch one.",Tge=()=>"尚无运行——让智能体启动一个。",Age=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Rge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tge():t==="fa"?Age():jge()}),Mge=()=>"Run",Dge=()=>"运行",Lge=()=>"اجرا",$E=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Oge=()=>"Switch run",Ige=()=>"切换运行",Bge=()=>"تغییر اجرا",$ge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ige():t==="fa"?Bge():Oge()}),Pge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Fge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Hge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,qge=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Fge(e):t==="fa"?Hge(e):Pge(e)}),Uge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Gge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Wge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Vge=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.value}m`,Qge=e=>`${e==null?void 0:e.value} 分钟`,Yge=e=>`${e==null?void 0:e.value} دقیقه`,Xge=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}s`,Jge=e=>`${e==null?void 0:e.value} 秒`,e1e=e=>`${e==null?void 0:e.value} ثانیه`,t1e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=()=>"Code",r1e=()=>"代码",s1e=()=>"کد",i1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?r1e():t==="fa"?s1e():n1e()}),a1e=()=>"created",o1e=()=>"创建于",l1e=()=>"ایجادشده",c1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"from",d1e=()=>"来自",f1e=()=>"از",h1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"Logs",p1e=()=>"日志",m1e=()=>"گزارش‌ها",g1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Latest run",b1e=()=>"最新运行",y1e=()=>"آخرین اجرا",x1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Code",S1e=()=>"代码",k1e=()=>"کد",C1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Commit",N1e=()=>"提交",z1e=()=>"کامیت",j1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"created",A1e=()=>"创建于",R1e=()=>"ایجادشده",M1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"Description",L1e=()=>"说明",O1e=()=>"توضیحات",I1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Duration",$1e=()=>"时长",P1e=()=>"مدت",F1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"exit",q1e=()=>"退出码",U1e=()=>"خروج",G1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"from",V1e=()=>"来自",K1e=()=>"از",Q1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"Logs",X1e=()=>"日志",Z1e=()=>"گزارش‌ها",J1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Run",tve=()=>"运行",nve=()=>"اجرا",rve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run history",ive=()=>"运行历史",ave=()=>"تاریخچهٔ اجرا",ove=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Started",cve=()=>"开始时间",uve=()=>"آغاز",dve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Runs",hve=()=>"运行",_ve=()=>"اجراها",pve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",gve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",vve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",bve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"No runs yet",xve=()=>"还没有运行",wve=()=>"هنوز اجرایی وجود ندارد",Sve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No experiments yet.",Cve=()=>"还没有实验。",Eve=()=>"هنوز آزمایشی وجود ندارد.",Nve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"Not run yet",jve=()=>"尚未运行",Tve=()=>"هنوز اجرا نشده",Ave=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"1 run",Mve=()=>"1 次运行",Dve=()=>"۱ اجرا",Lve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"Open logs",Ive=()=>"打开日志",Bve=()=>"باز کردن گزارش‌ها",$ve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=e=>`${e==null?void 0:e.count} runs`,Fve=e=>`${e==null?void 0:e.count} 次运行`,Hve=e=>`${e==null?void 0:e.count} اجرا`,qve=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Fve(e):t==="fa"?Hve(e):Pve(e)}),Uve=()=>"Stop requested",Gve=()=>"已请求停止",Wve=()=>"درخواست توقف ثبت شد",Vve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Gve():t==="fa"?Wve():Uve()}),Kve=()=>"Stop run",Qve=()=>"停止运行",Yve=()=>"توقف اجرا",Xve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Code",Jve=()=>"代码",ebe=()=>"کد",tbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Experiments",rbe=()=>"实验",sbe=()=>"آزمایش‌ها",ibe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Logs",obe=()=>"日志",lbe=()=>"گزارش‌ها",cbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Stop failed:",dbe=()=>"停止失败:",fbe=()=>"توقف ناموفق بود:",hbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Clipboard access is unavailable.",pbe=()=>"无法访问剪贴板。",mbe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",AD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),gbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,vbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,bbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,ybe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?vbe(e):t==="fa"?bbe(e):gbe(e)}),xbe=()=>"Duplicate",wbe=()=>"创建副本",Sbe=()=>"ایجاد نسخهٔ تکراری",kbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wbe():t==="fa"?Sbe():xbe()}),Cbe=e=>`File actions for ${e==null?void 0:e.path}`,Ebe=e=>`${e==null?void 0:e.path} 的文件操作`,Nbe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,zbe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Ebe(e):t==="fa"?Nbe(e):Cbe(e)}),jbe=()=>"Open",Tbe=()=>"打开",Abe=()=>"باز کردن",Rbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tbe():t==="fa"?Abe():jbe()}),Mbe=e=>`Rename ${e==null?void 0:e.path}`,Dbe=e=>`重命名 ${e==null?void 0:e.path}`,Lbe=e=>`تغییر نام ${e==null?void 0:e.path}`,Obe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Dbe(e):t==="fa"?Lbe(e):Mbe(e)}),Ibe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Bbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,$be=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Pbe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=()=>"Binary file — no inline preview.",Hbe=()=>"二进制文件——无法内嵌预览。",qbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Ube=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hbe():t==="fa"?qbe():Fbe()}),Gbe=()=>"This file changed on disk. Your edits have not been overwritten.",Wbe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Vbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",PE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Kbe=()=>"Compile failed",Qbe=()=>"编译失败",Ybe=()=>"کامپایل ناموفق بود",Xbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qbe():t==="fa"?Ybe():Kbe()}),Zbe=()=>"Compile PDF",Jbe=()=>"编译 PDF",eye=()=>"کامپایل PDF",FE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),tye=()=>"Compiled, but the engine reported errors — check the output below.",nye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",rye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",sye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nye():t==="fa"?rye():tye()}),iye=()=>"Copy command",aye=()=>"复制命令",oye=()=>"کپی فرمان",lye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy install command",uye=()=>"复制安装命令",dye=()=>"کپی فرمان نصب",fye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"This file was deleted on disk. Your edits have not been discarded.",_ye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",pye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",HE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),mye=()=>"Discard my edits and reload",gye=()=>"放弃我的编辑并重新加载",vye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",bye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gye():t==="fa"?vye():mye()}),yye=()=>"Discard unsaved changes and close this file?",xye=()=>"要丢弃未保存的更改并关闭此文件吗?",wye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",qE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),Sye=()=>"Dismiss",kye=()=>"关闭",Cye=()=>"بستن",Eye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kye():t==="fa"?Cye():Sye()}),Nye=()=>"Dismiss compile message",zye=()=>"关闭编译消息",jye=()=>"بستن پیام کامپایل",Tye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss Overleaf message",Rye=()=>"关闭 Overleaf 消息",Mye=()=>"بستن پیام Overleaf",Dye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Download",Oye=()=>"下载",Iye=()=>"بارگیری",RD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),Bye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,$ye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Pye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Fye=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$ye(e):t==="fa"?Pye(e):Bye(e)}),Hye=()=>"Failed to load file:",qye=()=>"加载文件失败:",Uye=()=>"بارگیری فایل ناموفق بود:",UE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qye():t==="fa"?Uye():Hye()}),Gye=()=>"File truncated — showing the first 512 KB.",Wye=()=>"文件已截断——仅显示前 512 KB。",Vye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Kye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wye():t==="fa"?Vye():Gye()}),Qye=()=>"The page below stops partway — the full file could not be loaded.",Yye=()=>"下方页面在中途结束——无法加载完整文件。",Xye=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",Zye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=e=>`Rendered HTML: ${e==null?void 0:e.name}`,e2e=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,t2e=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,n2e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?e2e(e):t==="fa"?t2e(e):Jye(e)}),r2e=()=>"Loading…",s2e=()=>"正在加载…",i2e=()=>"در حال بارگیری…",MD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s2e():t==="fa"?i2e():r2e()}),a2e=()=>"File not found.",o2e=()=>"找不到文件。",l2e=()=>"فایل پیدا نشد.",c2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?o2e():t==="fa"?l2e():a2e()}),u2e=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,d2e=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,f2e=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,h2e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?d2e(e):t==="fa"?f2e(e):u2e(e)}),_2e=e=>`File not found on branch ${e==null?void 0:e.branch}.`,p2e=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,m2e=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,g2e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?p2e(e):t==="fa"?m2e(e):_2e(e)}),v2e=()=>"File not found on disk.",b2e=()=>"磁盘上找不到此文件。",y2e=()=>"فایل روی دیسک پیدا نشد.",x2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?b2e():t==="fa"?y2e():v2e()}),w2e=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,S2e=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,k2e=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,C2e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?S2e(e):t==="fa"?k2e(e):w2e(e)}),E2e=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,N2e=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,z2e=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,j2e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?N2e(e):t==="fa"?z2e(e):E2e(e)}),T2e=()=>"Open in default editor",A2e=()=>"在默认编辑器中打开",R2e=()=>"باز کردن در ویرایشگر پیش‌فرض",GE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A2e():t==="fa"?R2e():T2e()}),M2e=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",D2e=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",L2e=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",O2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D2e():t==="fa"?L2e():M2e()}),I2e=()=>"Overwrite disk file",B2e=()=>"覆盖磁盘文件",$2e=()=>"بازنویسی فایل روی دیسک",P2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?B2e():t==="fa"?$2e():I2e()}),F2e=()=>"Compiled PDF is out of date",H2e=()=>"已编译的 PDF 不是最新版本",q2e=()=>"PDF کامپایل‌شده به‌روز نیست",U2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?H2e():t==="fa"?q2e():F2e()}),G2e=()=>"project clone",W2e=()=>"项目克隆",V2e=()=>"کلون پروژه",Ng=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?W2e():t==="fa"?V2e():G2e()}),K2e=()=>"Recompile PDF",Q2e=()=>"重新编译 PDF",Y2e=()=>"کامپایل دوبارهٔ PDF",WE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Q2e():t==="fa"?Y2e():K2e()}),X2e=()=>"Reload from disk",Z2e=()=>"从磁盘重新加载",J2e=()=>"بارگذاری مجدد از دیسک",exe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Z2e():t==="fa"?J2e():X2e()}),txe=()=>"Save failed",nxe=()=>"保存失败",rxe=()=>"ذخیره ناموفق بود",sxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nxe():t==="fa"?rxe():txe()}),ixe=()=>"Saving…",axe=()=>"正在保存…",oxe=()=>"در حال ذخیره…",lxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?axe():t==="fa"?oxe():ixe()}),cxe=()=>"Selected — press ⌘C",uxe=()=>"已选中 — 按 ⌘C 复制",dxe=()=>"انتخاب شد — برای کپی ⌘C را بزنید",fxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uxe():t==="fa"?dxe():cxe()}),hxe=()=>"session’s worktree",_xe=()=>"会话工作树",pxe=()=>"درخت کاری نشست",zg=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_xe():t==="fa"?pxe():hxe()}),mxe=()=>"Show compiled PDF",gxe=()=>"显示已编译的 PDF",vxe=()=>"نمایش PDF کامپایل‌شده",VE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gxe():t==="fa"?vxe():mxe()}),bxe=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",yxe=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",xxe=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",wxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yxe():t==="fa"?xxe():bxe()}),Sxe=()=>"This session's worktree isn't available — showing the project clone's copy.",kxe=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",Cxe=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",Exe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kxe():t==="fa"?Cxe():Sxe()}),Nxe=()=>"Unsaved",zxe=()=>"未保存",jxe=()=>"ذخیره نشده",DD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zxe():t==="fa"?jxe():Nxe()}),Txe=()=>"Unsaved — ⌘S to save",Axe=()=>"未保存 — 按 ⌘S 保存",Rxe=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",Mxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Axe():t==="fa"?Rxe():Txe()}),Dxe=()=>"Update orx on the remote machine to edit this file safely.",Lxe=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",Oxe=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",Ixe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Bxe=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",$xe=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",Pxe=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",Fxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$xe():t==="fa"?Pxe():Bxe()}),Hxe=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",qxe=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",Uxe=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Gxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qxe():t==="fa"?Uxe():Hxe()}),Wxe=()=>"Back to preview",Vxe=()=>"返回预览",Kxe=()=>"بازگشت به پیش‌نمایش",Qxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vxe():t==="fa"?Kxe():Wxe()}),Yxe=e=>`${e==null?void 0:e.count} changed files`,Xxe=e=>`${e==null?void 0:e.count} 个已更改文件`,Zxe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,LD=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Xxe(e):t==="fa"?Zxe(e):Yxe(e)}),Jxe=()=>"Changed files",ewe=()=>"已更改文件",twe=()=>"فایل‌های تغییرکرده",nwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ewe():t==="fa"?twe():Jxe()}),rwe=()=>"Diff preview truncated",swe=()=>"差异预览已截断",iwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",awe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=e=>`${e==null?void 0:e.count} files shown (partial)`,lwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,cwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,uwe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?lwe(e):t==="fa"?cwe(e):owe(e)}),dwe=()=>"No changes.",fwe=()=>"没有更改。",hwe=()=>"تغییری وجود ندارد.",_we=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fwe():t==="fa"?hwe():dwe()}),pwe=()=>"No complete file preview was available before the cutoff.",mwe=()=>"在截断位置之前没有完整的文件预览。",gwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",vwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No textual diff for this file.",ywe=()=>"此文件没有文本差异。",xwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",wwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"1 changed file",kwe=()=>"1 个已更改文件",Cwe=()=>"۱ فایل تغییرکرده",OD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Ewe=()=>"1 file shown (partial)",Nwe=()=>"显示 1 个文件(部分)",zwe=()=>"۱ فایل نمایش داده شده (ناقص)",jwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nwe():t==="fa"?zwe():Ewe()}),Twe=()=>"Unable to parse this diff.",Awe=()=>"无法解析此差异。",Rwe=()=>"خواندن این تفاوت ممکن نبود.",Mwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,Lwe=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Owe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Iwe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Lwe(e):t==="fa"?Owe(e):Dwe(e)}),Bwe=()=>"View full diff",$we=()=>"查看完整差异",Pwe=()=>"نمایش تفاوت کامل",Fwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$we():t==="fa"?Pwe():Bwe()}),Hwe=()=>"Create a token ↗",qwe=()=>"创建令牌 ↗",Uwe=()=>"ساخت توکن ↗",Gwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"All projects",Vwe=()=>"所有项目",Kwe=()=>"همهٔ پروژه‌ها",KE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Qwe=()=>"Configure Repository",Ywe=()=>"配置仓库",Xwe=()=>"پیکربندی مخزن",Zwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ywe():t==="fa"?Xwe():Qwe()}),Jwe=()=>"Create a new project",e4e=()=>"新建项目",t4e=()=>"ایجاد پروژهٔ جدید",n4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Hide sidebar",s4e=()=>"隐藏侧边栏",i4e=()=>"پنهان کردن نوار کناری",QE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),a4e=()=>"Project",o4e=()=>"项目",l4e=()=>"پروژه",c4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?o4e():t==="fa"?l4e():a4e()}),u4e=e=>`${e==null?void 0:e.count} cancelled`,d4e=e=>`${e==null?void 0:e.count} 次取消`,f4e=e=>`${e==null?void 0:e.count} لغوشده`,h4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?d4e(e):t==="fa"?f4e(e):u4e(e)}),_4e=e=>`${e==null?void 0:e.count} done`,p4e=e=>`${e==null?void 0:e.count} 次完成`,m4e=e=>`${e==null?void 0:e.count} تمام‌شده`,g4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} failed`,b4e=e=>`${e==null?void 0:e.count} 次失败`,y4e=e=>`${e==null?void 0:e.count} ناموفق`,x4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} files`,S4e=e=>`${e==null?void 0:e.count} 个文件`,k4e=e=>`${e==null?void 0:e.count} فایل`,C4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count}+ files`,N4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,z4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count} live`,A4e=e=>`${e==null?void 0:e.count} 次进行中`,R4e=e=>`${e==null?void 0:e.count} فعال`,M4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=()=>"1 file",L4e=()=>"1 个文件",O4e=()=>"۱ فایل",I4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?L4e():t==="fa"?O4e():D4e()}),B4e=()=>"1 run",$4e=()=>"1 次运行",P4e=()=>"۱ اجرا",F4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=e=>`${e==null?void 0:e.count} runs`,q4e=e=>`${e==null?void 0:e.count} 次运行`,U4e=e=>`${e==null?void 0:e.count} اجرا`,G4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?q4e(e):t==="fa"?U4e(e):H4e(e)}),W4e=()=>"No instances yet.",V4e=()=>"还没有实例。",K4e=()=>"هنوز نمونه‌ای وجود ندارد.",Q4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?V4e():t==="fa"?K4e():W4e()}),Y4e=()=>"Nothing running right now.",X4e=()=>"当前没有运行中的实例。",Z4e=()=>"اکنون چیزی در حال اجرا نیست.",J4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Select a project to see its history.",t3e=()=>"请选择一个项目以查看其历史记录。",n3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",r3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its runs.",i3e=()=>"请选择一个项目以查看其运行。",a3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"View history",c3e=()=>"查看历史记录",u3e=()=>"مشاهدهٔ تاریخچه",d3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=e=>`View history (${e==null?void 0:e.count})`,h3e=e=>`查看历史记录(${e==null?void 0:e.count})`,_3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,p3e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?h3e(e):t==="fa"?_3e(e):f3e(e)}),m3e=()=>"The engine exited without producing a PDF or a log.",g3e=()=>"引擎已退出,但没有生成 PDF 或日志。",v3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",b3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?g3e():t==="fa"?v3e():m3e()}),y3e=()=>"Loading…",x3e=()=>"正在加载…",w3e=()=>"در حال بارگیری…",S3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Add local model",C3e=()=>"添加本地模型",E3e=()=>"افزودن مدل محلی",ID=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),N3e=()=>"Local server address",z3e=()=>"本地服务器地址",j3e=()=>"نشانی سرور محلی",T3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?z3e():t==="fa"?j3e():N3e()}),A3e=()=>"Find models",R3e=()=>"查找模型",M3e=()=>"یافتن مدل‌ها",D3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"(OpenAI compatible)",O3e=()=>"(兼容 OpenAI)",I3e=()=>"(سازگار با OpenAI)",BD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),B3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",$3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",P3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",F3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$3e():t==="fa"?P3e():B3e()}),H3e=()=>"Connected",q3e=()=>"已连接",U3e=()=>"متصل شد",G3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Context window",V3e=()=>"上下文窗口",K3e=()=>"پنجرهٔ زمینه",Q3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",X3e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",Z3e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",J3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Custom Endpoint",t5e=()=>"自定义端点",n5e=()=>"نقطهٔ اتصال سفارشی",t6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),r5e=e=>`Disconnect ${e==null?void 0:e.name}`,s5e=e=>`断开 ${e==null?void 0:e.name}`,i5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,a5e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?s5e(e):t==="fa"?i5e(e):r5e(e)}),o5e=()=>"Get OpenCode",l5e=()=>"获取 OpenCode",c5e=()=>"دریافت OpenCode",u5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?l5e():t==="fa"?c5e():o5e()}),d5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",f5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",h5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",_5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"API key (optional)",m5e=()=>"API 密钥(可选)",g5e=()=>"کلید API (اختیاری)",v5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"Save model",y5e=()=>"保存模型",x5e=()=>"ذخیرهٔ مدل",w5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Model server",k5e=()=>"模型服务器",C5e=()=>"سرور مدل",YE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),E5e=()=>"Local models",N5e=()=>"本地模型",z5e=()=>"مدل‌های محلی",XE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?N5e():t==="fa"?z5e():E5e()}),j5e=()=>"API token (optional)",T5e=()=>"API 令牌(可选)",A5e=()=>"توکن API (اختیاری)",R5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?T5e():t==="fa"?A5e():j5e()}),M5e=()=>"Copy",D5e=()=>"复制",L5e=()=>"کپی",n6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),O5e=()=>"Copy code",I5e=()=>"复制代码",B5e=()=>"کپی کد",$5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?I5e():t==="fa"?B5e():O5e()}),P5e=()=>"Download",F5e=()=>"下载",H5e=()=>"بارگیری",$D=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),q5e=()=>"This browser can’t preview this media format.",U5e=()=>"此浏览器无法预览该媒体格式。",G5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",W5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?U5e():t==="fa"?G5e():q5e()}),V5e=()=>"Add Local Model",K5e=()=>"添加本地模型",Q5e=()=>"افزودن مدل محلی",Y5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>" · CLI configuration",Z5e=()=>" · CLI 配置",J5e=()=>" · پیکربندی CLI",PD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),e6e=()=>"· Default",t6e=()=>"· 默认",n6e=()=>"· پیش‌فرض",FD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?t6e():t==="fa"?n6e():e6e()}),r6e=()=>"Default model",s6e=()=>"默认模型",i6e=()=>"مدل پیش‌فرض",ZE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s6e():t==="fa"?i6e():r6e()}),a6e=()=>"Detecting harnesses…",o6e=()=>"正在检测智能体工具…",l6e=()=>"در حال شناسایی ابزارهای عامل…",c6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?o6e():t==="fa"?l6e():a6e()}),u6e=()=>"Effort",d6e=()=>"推理强度",f6e=()=>"میزان استدلال",h6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Fast speed ·",p6e=()=>"快速 ·",m6e=()=>"سرعت بالا ·",g6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Mode",b6e=()=>"模式",y6e=()=>"حالت",JE=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),x6e=()=>"Model",w6e=()=>"模型",S6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?w6e():t==="fa"?S6e():x6e()}),k6e=e=>`${e==null?void 0:e.count} more — search to find`,C6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,E6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,N6e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?C6e(e):t==="fa"?E6e(e):k6e(e)}),z6e=()=>"Not available",j6e=()=>"不可用",T6e=()=>"در دسترس نیست",A6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?j6e():t==="fa"?T6e():z6e()}),R6e=()=>"Search models…",M6e=()=>"搜索模型…",D6e=()=>"جست‌وجوی مدل‌ها…",HD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),L6e=()=>"Sessions keep their harness. Start a new chat to switch.",O6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",I6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",B6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?O6e():t==="fa"?I6e():L6e()}),$6e=()=>"Speed",P6e=()=>"速度",F6e=()=>"سرعت",eN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),H6e=()=>"Unavailable",q6e=()=>"不可用",U6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q6e():t==="fa"?U6e():H6e()}),G6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,W6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,V6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,K6e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?W6e(e):t==="fa"?V6e(e):G6e(e)}),Q6e=()=>"Variant",Y6e=()=>"变体",X6e=()=>"گونه",Z6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Y6e():t==="fa"?X6e():Q6e()}),J6e=()=>"Advanced",eSe=()=>"高级",tSe=()=>"پیشرفته",nSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced · Connect GitHub",sSe=()=>"高级 · 连接 GitHub",iSe=()=>"پیشرفته · اتصال GitHub",aSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · GitHub sync on",lSe=()=>"高级 · GitHub 同步已开启",cSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",uSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",fSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",hSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",_Se=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,mSe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,gSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,vSe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mSe(e):t==="fa"?gSe(e):pSe(e)}),bSe=()=>"Choose an existing project folder",ySe=()=>"选择现有项目文件夹",xSe=()=>"انتخاب پوشهٔ موجود پروژه",tN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ySe():t==="fa"?xSe():bSe()}),wSe=()=>"Choosing…",SSe=()=>"正在选择…",kSe=()=>"در حال انتخاب…",CSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SSe():t==="fa"?kSe():wSe()}),ESe=()=>"Clone destination",NSe=()=>"克隆位置",zSe=()=>"مقصد کلون",jSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone paper project",ASe=()=>"克隆论文项目",RSe=()=>"کلون پروژهٔ مقاله",MSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Create project",LSe=()=>"创建项目",OSe=()=>"ایجاد پروژه",nN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),ISe=()=>"Creating…",BSe=()=>"正在创建…",$Se=()=>"در حال ایجاد…",PSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BSe():t==="fa"?$Se():ISe()}),FSe=()=>"Choose a different destination. This path is a file, not a folder.",HSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",qSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",wx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),USe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",GSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",WSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",rN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GSe():t==="fa"?WSe():USe()}),VSe=()=>"Blank project",KSe=()=>"空白项目",QSe=()=>"پروژهٔ خالی",YSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KSe():t==="fa"?QSe():VSe()}),XSe=()=>"Cancel",ZSe=()=>"取消",JSe=()=>"لغو",eke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Change",nke=()=>"更改",rke=()=>"تغییر",ske=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Change selected paper",ake=()=>"更改所选论文",oke=()=>"تغییر مقالهٔ انتخاب‌شده",lke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Check out a Git branch before using this folder.",uke=()=>"使用此文件夹前,请先检出一个 Git 分支。",dke=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",fke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Checking project location.",_ke=()=>"正在检查项目位置。",pke=()=>"در حال بررسی محل پروژه.",sN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),mke=()=>"Existing folder",gke=()=>"现有文件夹",vke=()=>"پوشهٔ موجود",bke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gke():t==="fa"?vke():mke()}),yke=()=>"Experiment branches will be pushed to the remote GitHub repository.",xke=()=>"实验分支将推送到远程 GitHub 仓库。",wke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Ske=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xke():t==="fa"?wke():yke()}),kke=()=>"From a paper",Cke=()=>"从论文创建",Eke=()=>"از یک مقاله",Nke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cke():t==="fa"?Eke():kke()}),zke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",jke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Tke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Ake=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"my-research",Mke=()=>"my-research",Dke=()=>"my-research",iN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Lke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Oke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Ike=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Bke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Oke():t==="fa"?Ike():Lke()}),$ke=()=>"No public repository found on alphaXiv",Pke=()=>"在 alphaXiv 上未找到公开仓库",Fke=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",Hke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"OpenResearch will start a blank project with this paper's PDF.",Uke=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",Gke=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",Wke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"Paper",Kke=()=>"论文",Qke=()=>"مقاله",Yke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Xke=()=>"Project location",Zke=()=>"项目位置",Jke=()=>"محل پروژه",Sx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zke():t==="fa"?Jke():Xke()}),e7e=()=>"Project name",t7e=()=>"项目名称",n7e=()=>"نام پروژه",aN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),r7e=()=>"Search for a paper by arXiv ID, URL, or title",s7e=()=>"按 arXiv ID、网址或标题搜索论文",i7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",a7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s7e():t==="fa"?i7e():r7e()}),o7e=()=>"Sync experiments to GitHub",l7e=()=>"将实验同步到 GitHub",c7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",u7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?l7e():t==="fa"?c7e():o7e()}),d7e=()=>"That folder no longer exists. Choose it again.",f7e=()=>"该文件夹已不存在。请重新选择。",h7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",_7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?f7e():t==="fa"?h7e():d7e()}),p7e=()=>"The selected folder contains an invalid Git repository.",m7e=()=>"所选文件夹包含无效的 Git 仓库。",g7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",v7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),b7e=()=>"The selected path is not a folder.",y7e=()=>"所选路径不是文件夹。",x7e=()=>"مسیر انتخاب‌شده پوشه نیست.",w7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y7e():t==="fa"?x7e():b7e()}),S7e=e=>`Checking ${e==null?void 0:e.repository}.`,k7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,C7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,E7e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?k7e(e):t==="fa"?C7e(e):S7e(e)}),N7e=e=>`Creates ${e==null?void 0:e.repository}.`,z7e=e=>`将创建 ${e==null?void 0:e.repository}。`,j7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,T7e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?z7e(e):t==="fa"?j7e(e):N7e(e)}),A7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,R7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,M7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,D7e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?R7e(e):t==="fa"?M7e(e):A7e(e)}),L7e=()=>"Project location is required.",O7e=()=>"必须填写项目位置。",I7e=()=>"محل پروژه الزامی است.",oN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?O7e():t==="fa"?I7e():L7e()}),B7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",$7e=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",P7e=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",lN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$7e():t==="fa"?P7e():B7e()}),F7e=()=>"A linked public code repository is cloned without credentials.",H7e=()=>"关联的公开代码仓库无需凭据即可克隆。",q7e=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",U7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?H7e():t==="fa"?q7e():F7e()}),G7e=e=>`Run ${e==null?void 0:e.command} before creating the project.`,W7e=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,V7e=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,K7e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?W7e(e):t==="fa"?V7e(e):G7e(e)}),Q7e=()=>"Searching alphaXiv…",Y7e=()=>"正在搜索 alphaXiv…",X7e=()=>"در حال جست‌وجوی alphaXiv…",Z7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Y7e():t==="fa"?X7e():Q7e()}),J7e=()=>"Use folder",e8e=()=>"使用文件夹",t8e=()=>"استفاده از پوشه",n8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?e8e():t==="fa"?t8e():J7e()}),r8e=()=>"Can’t reach OpenResearch. This page is no longer live.",s8e=()=>"无法连接 OpenResearch。此页面已不再实时同步。",i8e=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",E4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s8e():t==="fa"?i8e():r8e()}),a8e=()=>"A workspace for your research agents",o8e=()=>"面向研究智能体的工作空间",l8e=()=>"فضای کاری برای عامل‌های پژوهشی شما",c8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?o8e():t==="fa"?l8e():a8e()}),u8e=()=>"Add papers that represent your research interests, including papers by other authors.",d8e=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",f8e=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",h8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?d8e():t==="fa"?f8e():u8e()}),_8e=()=>"API key",p8e=()=>"API 密钥",m8e=()=>"کلید API",r6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?p8e():t==="fa"?m8e():_8e()}),g8e=()=>"AI/ML",v8e=()=>"人工智能与机器学习",b8e=()=>"هوش مصنوعی و یادگیری ماشین",y8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Biology",w8e=()=>"生物学",S8e=()=>"زیست‌شناسی",k8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Other",E8e=()=>"其他",N8e=()=>"سایر",z8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Physics",T8e=()=>"物理学",A8e=()=>"فیزیک",R8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Back",D8e=()=>"返回",L8e=()=>"بازگشت",cN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Check failed",I8e=()=>"检查失败",B8e=()=>"بررسی ناموفق بود",$8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Checking",F8e=()=>"正在检查",H8e=()=>"در حال بررسی",q8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"Checking Git…",G8e=()=>"正在检查 Git…",W8e=()=>"در حال بررسی Git…",V8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Choose a coding agent",Q8e=()=>"选择编程智能体",Y8e=()=>"یک عامل کدنویسی انتخاب کنید",X8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Choose a coding agent to continue.",J8e=()=>"选择一个编程智能体以继续。",eCe=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",tCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?J8e():t==="fa"?eCe():Z8e()}),nCe=()=>"Choose at least one research area to continue.",rCe=()=>"请至少选择一个研究领域后再继续。",sCe=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",iCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=()=>"Choose one or more.",oCe=()=>"请选择一项或多项。",lCe=()=>"یک یا چند مورد را انتخاب کنید.",cCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oCe():t==="fa"?lCe():aCe()}),uCe=()=>"Choose your preferred coding agent",dCe=()=>"请选择首选编程智能体",fCe=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",hCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Consolidate your research",pCe=()=>"集中管理研究",mCe=()=>"پژوهش خود را یکپارچه کنید",gCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Continue",bCe=()=>"继续",yCe=()=>"ادامه",uN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"Describe your research area to continue.",wCe=()=>"请描述你的研究领域后再继续。",SCe=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",kCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",ECe=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",NCe=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",zCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",TCe=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",ACe=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",RCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),MCe=()=>"Everything stays local",DCe=()=>"一切都保留在本地",LCe=()=>"همه‌چیز محلی می‌ماند",OCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DCe():t==="fa"?LCe():MCe()}),ICe=()=>"Get started",BCe=()=>"开始使用",$Ce=()=>"شروع",PCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BCe():t==="fa"?$Ce():ICe()}),FCe=()=>"Git is required for local experiments. Install Git, then re-check.",HCe=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",qCe=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",UCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HCe():t==="fa"?qCe():FCe()}),GCe=()=>"Ground your agents",WCe=()=>"为智能体提供可靠依据",VCe=()=>"عامل‌هایتان را به منابع متصل کنید",KCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WCe():t==="fa"?VCe():GCe()}),QCe=()=>"Install broken",YCe=()=>"安装损坏",XCe=()=>"نصب خراب است",ZCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YCe():t==="fa"?XCe():QCe()}),JCe=()=>"Install Git to continue",e9e=()=>"请安装 Git 后再继续",t9e=()=>"برای ادامه Git را نصب کنید",n9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?e9e():t==="fa"?t9e():JCe()}),r9e=()=>"Local Git",s9e=()=>"本地 Git",i9e=()=>"Git محلی",a9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s9e():t==="fa"?i9e():r9e()}),o9e=()=>", and ",l9e=()=>" 和 ",c9e=()=>" و ",u9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?l9e():t==="fa"?c9e():o9e()}),d9e=()=>"Compatible with",f9e=()=>"兼容",h9e=()=>"سازگار با",_9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?f9e():t==="fa"?h9e():d9e()}),p9e=()=>"Use your own local models",m9e=()=>"使用你自己的本地模型",g9e=()=>"از مدل‌های محلی خود استفاده کنید",v9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?m9e():t==="fa"?g9e():p9e()}),b9e=()=>"Not detected",y9e=()=>"未检测到",x9e=()=>"شناسایی نشد",dN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y9e():t==="fa"?x9e():b9e()}),w9e=()=>"Not found",S9e=()=>"未找到",k9e=()=>"پیدا نشد",qD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),C9e=()=>"Not signed in",E9e=()=>"未登录",N9e=()=>"وارد نشده",z9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?E9e():t==="fa"?N9e():C9e()}),j9e=()=>"OpenResearch uses a coding agent already installed on this machine.",T9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",A9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",R9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?T9e():t==="fa"?A9e():j9e()}),M9e=()=>"Other research area",D9e=()=>"其他研究领域",L9e=()=>"حوزهٔ پژوهشی دیگر",O9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D9e():t==="fa"?L9e():M9e()}),I9e=()=>"Re-check",B9e=()=>"重新检查",$9e=()=>"بررسی دوباره",UD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Ready",F9e=()=>"已就绪",H9e=()=>"آماده",s6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),q9e=()=>"Re-check Git before continuing",U9e=()=>"请重新检查 Git 后再继续",G9e=()=>"پیش از ادامه Git را دوباره بررسی کنید",W9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?U9e():t==="fa"?G9e():q9e()}),V9e=()=>"Representative papers",K9e=()=>"代表性论文",Q9e=()=>"مقاله‌های شاخص",Y9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?K9e():t==="fa"?Q9e():V9e()}),X9e=()=>"Research background",Z9e=()=>"研究背景",J9e=()=>"پیشینهٔ پژوهشی",eEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Z9e():t==="fa"?J9e():X9e()}),tEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",nEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",rEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",fN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Search alphaXiv by title to link a paper…",iEe=()=>"按标题搜索 alphaXiv 以关联论文…",aEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",oEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Searching alphaXiv…",cEe=()=>"正在搜索 alphaXiv…",uEe=()=>"در حال جست‌وجوی alphaXiv…",dEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Selected",hEe=()=>"已选择",_Ee=()=>"انتخاب‌شده",pEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Local model unavailable",gEe=()=>"本地模型不可用",vEe=()=>"مدل محلی در دسترس نیست",GD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Setting things up…",yEe=()=>"正在设置…",xEe=()=>"در حال راه‌اندازی…",wEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Connect a local model or sign in to a coding agent to continue",kEe=()=>"连接本地模型或登录编码智能体以继续",CEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",EEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Connect a local model or sign in to an agent to continue.",zEe=()=>"连接本地模型或登录一个智能体以继续。",jEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",TEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Signed in",REe=()=>"已登录",MEe=()=>"وارد شده",DEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),LEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",OEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",IEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",BEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OEe():t==="fa"?IEe():LEe()}),$Ee=()=>"· Step 1 of 2",PEe=()=>"· 第 1 步,共 2 步",FEe=()=>"· مرحلهٔ ۱ از ۲",HEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PEe():t==="fa"?FEe():$Ee()}),qEe=()=>"· Step 2 of 2",UEe=()=>"· 第 2 步,共 2 步",GEe=()=>"· مرحلهٔ ۲ از ۲",WEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UEe():t==="fa"?GEe():qEe()}),VEe=()=>"Tell us about your research",KEe=()=>"介绍一下你的研究",QEe=()=>"از پژوهش خود بگویید",YEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KEe():t==="fa"?QEe():VEe()}),XEe=()=>"Tell us your other research area",ZEe=()=>"告诉我们你的其他研究领域",JEe=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",eNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZEe():t==="fa"?JEe():XEe()}),tNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",nNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",rNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",sNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nNe():t==="fa"?rNe():tNe()}),iNe=()=>"Unable to verify",aNe=()=>"无法验证",oNe=()=>"تأیید ممکن نیست",lNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aNe():t==="fa"?oNe():iNe()}),cNe=()=>"Update required",uNe=()=>"需要更新",dNe=()=>"نیازمند به‌روزرسانی",fNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uNe():t==="fa"?dNe():cNe()}),hNe=()=>"Waiting for the Git check",_Ne=()=>"正在等待 Git 检查",pNe=()=>"در انتظار بررسی Git",mNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Ne():t==="fa"?pNe():hNe()}),gNe=()=>"Waiting for the local tool checks",vNe=()=>"正在等待本地工具检查",bNe=()=>"در انتظار بررسی ابزارهای محلی",yNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vNe():t==="fa"?bNe():gNe()}),xNe=()=>"What areas are you interested in?",wNe=()=>"你对哪些领域感兴趣?",SNe=()=>"به چه حوزه‌هایی علاقه دارید؟",kNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wNe():t==="fa"?SNe():xNe()}),CNe=()=>"Your code, data, and experiment history stay on your machine.",ENe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",NNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",zNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ENe():t==="fa"?NNe():CNe()}),jNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",TNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",ANe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",RNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TNe():t==="fa"?ANe():jNe()}),MNe=()=>"Add cookie",DNe=()=>"添加 cookie",LNe=()=>"افزودن کوکی",ONe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DNe():t==="fa"?LNe():MNe()}),INe=()=>"Changed here and on Overleaf — choose which copy to keep",BNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",$Ne=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",PNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BNe():t==="fa"?$Ne():INe()}),FNe=()=>"Create a token ↗",HNe=()=>"创建令牌 ↗",qNe=()=>"ساخت توکن ↗",UNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HNe():t==="fa"?qNe():FNe()}),GNe=()=>"Overleaf Git token",WNe=()=>"Overleaf Git 令牌",VNe=()=>"توکن Git در Overleaf",hN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WNe():t==="fa"?VNe():GNe()}),KNe=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",QNe=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",YNe=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",XNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Import from browser",JNe=()=>"从浏览器导入",eze=()=>"وارد کردن از مرورگر",tze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"In step with Overleaf",rze=()=>"已与 Overleaf 同步",sze=()=>"با Overleaf همگام است",WD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),ize=()=>"The last sync did not finish.",aze=()=>"上次同步未完成。",oze=()=>"آخرین همگام‌سازی کامل نشد.",lze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aze():t==="fa"?oze():ize()}),cze=()=>"Link and sync",uze=()=>"关联并同步",dze=()=>"پیوند و همگام‌سازی",fze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Connecting to Overleaf…",_ze=()=>"正在连接 Overleaf…",pze=()=>"در حال اتصال به Overleaf…",mze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"Edits are live on Overleaf",vze=()=>"编辑已在 Overleaf 实时同步",bze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",yze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),xze=()=>"Retry",wze=()=>"重试",Sze=()=>"تلاش دوباره",kze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wze():t==="fa"?Sze():xze()}),Cze=()=>"Live sync stopped.",Eze=()=>"实时同步已停止。",Nze=()=>"همگام‌سازی زنده متوقف شد.",zze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Eze():t==="fa"?Nze():Cze()}),jze=()=>"Live sync starts once the paper is in step with Overleaf.",Tze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Aze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Rze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tze():t==="fa"?Aze():jze()}),Mze=()=>"My projects ↗",Dze=()=>"我的项目 ↗",Lze=()=>"پروژه‌های من ↗",_N=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dze():t==="fa"?Lze():Mze()}),Oze=()=>"Nothing could be synced.",Ize=()=>"没有内容可以同步。",Bze=()=>"هیچ موردی قابل همگام‌سازی نبود.",$ze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Open Overleaf ↗",Fze=()=>"打开 Overleaf ↗",Hze=()=>"باز کردن Overleaf ↗",qze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Cancel",Gze=()=>"取消",Wze=()=>"لغو",VD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Vze=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",Kze=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",Qze=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",Yze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kze():t==="fa"?Qze():Vze()}),Xze=()=>"Keep this copy",Zze=()=>"保留此副本",Jze=()=>"نگه داشتن این نسخه",eje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open in Overleaf",nje=()=>"在 Overleaf 中打开",rje=()=>"باز کردن در Overleaf",sje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Replace the Overleaf token",aje=()=>"替换 Overleaf 令牌",oje=()=>"جایگزینی توکن Overleaf",pN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"Sync files",cje=()=>"同步文件",uje=()=>"همگام‌سازی فایل‌ها",dje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Unlink",hje=()=>"取消关联",_je=()=>"قطع پیوند",pje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Upload a copy as a new project ↗",gje=()=>"上传副本作为新项目 ↗",vje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",KD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),bje=()=>"Use Overleaf's",yje=()=>"使用 Overleaf 的副本",xje=()=>"استفاده از نسخهٔ Overleaf",wje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yje():t==="fa"?xje():bje()}),Sje=()=>"This paper stays in step with Overleaf.",kje=()=>"此论文将与 Overleaf 保持同步。",Cje=()=>"این مقاله با Overleaf همگام می‌ماند.",Eje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Paste it instead",zje=()=>"改为粘贴",jje=()=>"به‌جایش بچسبانید",Tje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=e=>`Pulled ${e==null?void 0:e.paths}.`,Rje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Mje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Dje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Rje(e):t==="fa"?Mje(e):Aje(e)}),Lje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Oje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Ije=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Bje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Oje(e):t==="fa"?Ije(e):Lje(e)}),$je=e=>`Pushed ${e==null?void 0:e.paths}.`,Pje=e=>`已推送 ${e==null?void 0:e.paths}。`,Fje=e=>`${e==null?void 0:e.paths} ارسال شد.`,Hje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Pje(e):t==="fa"?Fje(e):$je(e)}),qje=()=>"Add a fresh Overleaf session cookie to start following again.",Uje=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",Gje=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",Wje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Uje():t==="fa"?Gje():qje()}),Vje=()=>"Save the file first",Kje=()=>"请先保存文件",Qje=()=>"ابتدا فایل را ذخیره کنید",Yje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kje():t==="fa"?Qje():Vje()}),Xje=()=>"Save this file to sync it with Overleaf",Zje=()=>"保存此文件以与 Overleaf 同步",Jje=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",QD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zje():t==="fa"?Jje():Xje()}),eTe=()=>"Save token",tTe=()=>"保存令牌",nTe=()=>"ذخیرهٔ توکن",rTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tTe():t==="fa"?nTe():eTe()}),sTe=()=>"Send this paper to Overleaf",iTe=()=>"将此论文发送到 Overleaf",aTe=()=>"ارسال مقاله به Overleaf",oTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Overleaf session cookie",cTe=()=>"Overleaf 会话 cookie",uTe=()=>"کوکی نشست Overleaf",N4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),dTe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",fTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",hTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",_Te=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fTe():t==="fa"?hTe():dTe()}),pTe=()=>"Overleaf sync failed",mTe=()=>"Overleaf 同步失败",gTe=()=>"همگام‌سازی با Overleaf ناموفق بود",z4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),vTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",bTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",yTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",xTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bTe():t==="fa"?yTe():vTe()}),wTe=()=>"Syncing with Overleaf…",STe=()=>"正在与 Overleaf 同步…",kTe=()=>"در حال همگام‌سازی با Overleaf…",YD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?STe():t==="fa"?kTe():wTe()}),CTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",ETe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",NTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",zTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ETe():t==="fa"?NTe():CTe()}),jTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",TTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",ATe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",RTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TTe():t==="fa"?ATe():jTe()}),MTe=()=>"Toggle Plan mode for this chat",DTe=()=>"切换此聊天的计划模式",LTe=()=>"تغییر حالت طرح این گفت‌وگو",OTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Accept and auto mode",BTe=()=>"接受并使用自动模式",$Te=()=>"پذیرش و حالت خودکار",PTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),FTe=()=>"Accept and bypass all",HTe=()=>"接受并跳过所有审批",qTe=()=>"پذیرش و عبور از همهٔ تأییدها",UTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HTe():t==="fa"?qTe():FTe()}),GTe=()=>"Accept plan",WTe=()=>"接受计划",VTe=()=>"پذیرش طرح",KTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WTe():t==="fa"?VTe():GTe()}),QTe=e=>`${e==null?void 0:e.agent} proposed a plan`,YTe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,XTe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,ZTe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?YTe(e):t==="fa"?XTe(e):QTe(e)}),JTe=e=>`${e==null?void 0:e.agent} is ready to proceed`,eAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,tAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,nAe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?eAe(e):t==="fa"?tAe(e):JTe(e)}),rAe=()=>"Back",sAe=()=>"返回",iAe=()=>"بازگشت",aAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sAe():t==="fa"?iAe():rAe()}),oAe=()=>"More approval options",lAe=()=>"更多批准选项",cAe=()=>"گزینه‌های تأیید بیشتر",uAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lAe():t==="fa"?cAe():oAe()}),dAe=()=>"Open plan",fAe=()=>"打开计划",hAe=()=>"باز کردن طرح",_Ae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fAe():t==="fa"?hAe():dAe()}),pAe=()=>"Reject",mAe=()=>"拒绝",gAe=()=>"رد کردن",vAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mAe():t==="fa"?gAe():pAe()}),bAe=()=>"Revise",yAe=()=>"修改",xAe=()=>"بازنگری",wAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yAe():t==="fa"?xAe():bAe()}),SAe=()=>"Revise…",kAe=()=>"修改…",CAe=()=>"بازنگری…",EAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kAe():t==="fa"?CAe():SAe()}),NAe=()=>"What should change? (optional)",zAe=()=>"需要更改什么?(可选)",jAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",TAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zAe():t==="fa"?jAe():NAe()}),AAe=e=>`${e==null?void 0:e.count} active`,RAe=e=>`${e==null?void 0:e.count} 个活跃`,MAe=e=>`${e==null?void 0:e.count} فعال`,DAe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?RAe(e):t==="fa"?MAe(e):AAe(e)}),LAe=e=>`${e==null?void 0:e.count} total agents`,OAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,IAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,BAe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?OAe(e):t==="fa"?IAe(e):LAe(e)}),$Ae=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,PAe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,FAe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,HAe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?PAe(e):t==="fa"?FAe(e):$Ae(e)}),qAe=()=>"Agents",UAe=()=>"智能体",GAe=()=>"عامل‌ها",mN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UAe():t==="fa"?GAe():qAe()}),WAe=()=>"arXiv paper ID:",VAe=()=>"arXiv 论文 ID:",KAe=()=>"شناسهٔ مقالهٔ arXiv:",QAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VAe():t==="fa"?KAe():WAe()}),YAe=()=>"Cancel",XAe=()=>"取消",ZAe=()=>"لغو",JAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XAe():t==="fa"?ZAe():YAe()}),eRe=()=>"Created",tRe=()=>"创建时间",nRe=()=>"ایجادشده",rRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tRe():t==="fa"?nRe():eRe()}),sRe=()=>"Delete project?",iRe=()=>"删除项目?",aRe=()=>"پروژه حذف شود؟",oRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),lRe=()=>"Delete project",cRe=()=>"删除项目",uRe=()=>"حذف پروژه",dRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cRe():t==="fa"?uRe():lRe()}),fRe=()=>"Deleting…",hRe=()=>"正在删除…",_Re=()=>"در حال حذف…",pRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hRe():t==="fa"?_Re():fRe()}),mRe=()=>"Experiments",gRe=()=>"实验",vRe=()=>"آزمایش‌ها",gN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gRe():t==="fa"?vRe():mRe()}),bRe=()=>"The local folder and linked GitHub repository are kept.",yRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",xRe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",wRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"The local folder is kept.",kRe=()=>"本地文件夹会保留。",CRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",ERe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"New project",zRe=()=>"新建项目",jRe=()=>"پروژهٔ جدید",XD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),TRe=()=>"No projects yet — create one to get started.",ARe=()=>"尚无项目——新建一个即可开始。",RRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",MRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ARe():t==="fa"?RRe():TRe()}),DRe=()=>"Project",LRe=()=>"项目",ORe=()=>"پروژه",IRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"Projects",$Re=()=>"项目",PRe=()=>"پروژه‌ها",FRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"Repository",qRe=()=>"仓库",URe=()=>"مخزن",vN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"Idle",WRe=()=>"空闲",VRe=()=>"بیکار",KRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Local",YRe=()=>"本地",XRe=()=>"محلی",i6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),ZRe=()=>"1 total agent",JRe=()=>"共 1 个智能体",eMe=()=>"در مجموع ۱ عامل",tMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JRe():t==="fa"?eMe():ZRe()}),nMe=e=>`${e==null?void 0:e.count} running`,rMe=e=>`${e==null?void 0:e.count} 个运行中`,sMe=e=>`${e==null?void 0:e.count} در حال اجرا`,iMe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?rMe(e):t==="fa"?sMe(e):nMe(e)}),aMe=e=>`${e==null?void 0:e.count} total`,oMe=e=>`共 ${e==null?void 0:e.count} 个`,lMe=e=>`در مجموع ${e==null?void 0:e.count}`,bN=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?oMe(e):t==="fa"?lMe(e):aMe(e)}),cMe=()=>"Installing the compatible binary. This may take a few minutes.",uMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",dMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",fMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uMe():t==="fa"?dMe():cMe()}),hMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,_Me=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,pMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,mMe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_Me(e):t==="fa"?pMe(e):hMe(e)}),gMe=()=>"Check again",vMe=()=>"再次检查",bMe=()=>"بررسی دوباره",yN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vMe():t==="fa"?bMe():gMe()}),yMe=()=>"Closing…",xMe=()=>"正在关闭…",wMe=()=>"در حال بستن…",SMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xMe():t==="fa"?wMe():yMe()}),kMe=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,CMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,EMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,NMe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?CMe(e):t==="fa"?EMe(e):kMe(e)}),zMe=()=>"Preparing your remote workspace…",jMe=()=>"正在准备远程工作区…",TMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",AMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jMe():t==="fa"?TMe():zMe()}),RMe=e=>`Connecting to ${e==null?void 0:e.host}`,MMe=e=>`正在连接到 ${e==null?void 0:e.host}`,DMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,LMe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?MMe(e):t==="fa"?DMe(e):RMe(e)}),OMe=()=>"Close remote host picker",IMe=()=>"关闭远程主机选择器",BMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",$Me=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IMe():t==="fa"?BMe():OMe()}),PMe=()=>"Choose a configured SSH host.",FMe=()=>"选择已配置的 SSH 主机。",HMe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",qMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FMe():t==="fa"?HMe():PMe()}),UMe=()=>"Connect to remote",GMe=()=>"连接到远程主机",WMe=()=>"اتصال به میزبان راه‌دور",ZD=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GMe():t==="fa"?WMe():UMe()}),VMe=()=>"Disconnect",KMe=()=>"断开连接",QMe=()=>"قطع اتصال",j4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KMe():t==="fa"?QMe():VMe()}),YMe=()=>"Your remote work is still running. Reconnect when you’re ready.",XMe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",ZMe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",JMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XMe():t==="fa"?ZMe():YMe()}),eDe=e=>`Disconnected from ${e==null?void 0:e.host}`,tDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,nDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,JD=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?tDe(e):t==="fa"?nDe(e):eDe(e)}),rDe=e=>`Could not connect to ${e==null?void 0:e.host}`,sDe=e=>`无法连接到 ${e==null?void 0:e.host}`,iDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,aDe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?sDe(e):t==="fa"?iDe(e):rDe(e)}),oDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",lDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",cDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",uDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lDe():t==="fa"?cDe():oDe()}),dDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",fDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",hDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",_De=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,mDe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,gDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,vDe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),bDe=()=>"OpenResearch binary",yDe=()=>"OpenResearch 二进制文件",xDe=()=>"فایل اجرایی OpenResearch",wDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yDe():t==="fa"?xDe():bDe()}),SDe=()=>"OpenResearch Database",kDe=()=>"OpenResearch 数据库",CDe=()=>"پایگاه دادهٔ OpenResearch",EDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kDe():t==="fa"?CDe():SDe()}),NDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",zDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",jDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",TDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zDe():t==="fa"?jDe():NDe()}),ADe=()=>"Install OpenResearch?",RDe=()=>"安装 OpenResearch?",MDe=()=>"OpenResearch نصب شود؟",DDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RDe():t==="fa"?MDe():ADe()}),LDe=()=>"Installing…",ODe=()=>"正在安装…",IDe=()=>"در حال نصب…",BDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ODe():t==="fa"?IDe():LDe()}),$De=()=>"No matching SSH hosts",PDe=()=>"没有匹配的 SSH 主机",FDe=()=>"میزبان SSH منطبقی پیدا نشد",HDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PDe():t==="fa"?FDe():$De()}),qDe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,UDe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,GDe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,WDe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?UDe(e):t==="fa"?GDe(e):qDe(e)}),VDe=()=>"Open remote",KDe=()=>"打开远程工作区",QDe=()=>"باز کردن راه‌دور",YDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KDe():t==="fa"?QDe():VDe()}),XDe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",ZDe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",JDe=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",eLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZDe():t==="fa"?JDe():XDe()}),tLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",nLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",rLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",sLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nLe():t==="fa"?rLe():tLe()}),iLe=()=>"Preparing remote workspace…",aLe=()=>"正在准备远程工作区…",oLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",lLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aLe():t==="fa"?oLe():iLe()}),cLe=()=>"Reconnect",uLe=()=>"重新连接",dLe=()=>"اتصال دوباره",xN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uLe():t==="fa"?dLe():cLe()}),fLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",hLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",_Le=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",pLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=e=>`Reconnecting to ${e==null?void 0:e.host}`,gLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,vLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,bLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?gLe(e):t==="fa"?vLe(e):mLe(e)}),yLe=()=>"Search SSH hosts",xLe=()=>"搜索 SSH 主机",wLe=()=>"جستجوی میزبان‌های SSH",wN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),SLe=e=>`SSH: ${e==null?void 0:e.host}`,kLe=e=>`SSH:${e==null?void 0:e.host}`,CLe=e=>`SSH: ${e==null?void 0:e.host}`,kx=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?kLe(e):t==="fa"?CLe(e):SLe(e)}),ELe=()=>"Start a new OpenResearch host",NLe=()=>"启动新的 OpenResearch 主机",zLe=()=>"راه‌اندازی میزبان جدید OpenResearch",jLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NLe():t==="fa"?zLe():ELe()}),TLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,ALe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,RLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,MLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ALe(e):t==="fa"?RLe(e):TLe(e)}),DLe=()=>"Stop OpenResearch",LLe=()=>"停止 OpenResearch",OLe=()=>"توقف OpenResearch",ILe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LLe():t==="fa"?OLe():DLe()}),BLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,$Le=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,PLe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,FLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),HLe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,qLe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,ULe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,GLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qLe(e):t==="fa"?ULe(e):HLe(e)}),WLe=()=>"Stop OpenResearch on host",VLe=()=>"停止主机上的 OpenResearch",KLe=()=>"توقف OpenResearch روی میزبان",eL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VLe():t==="fa"?KLe():WLe()}),QLe=()=>"This will also:",YLe=()=>"这还将:",XLe=()=>"این کار همچنین:",ZLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=()=>"End 1 pending approval.",eOe=()=>"结束 1 个待审批请求。",tOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",nOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eOe():t==="fa"?tOe():JLe()}),rOe=()=>"Leave 1 submitted experiment running.",sOe=()=>"让 1 个已提交实验继续运行。",iOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",aOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sOe():t==="fa"?iOe():rOe()}),oOe=()=>"Disconnect 1 other client.",lOe=()=>"断开 1 个其他客户端。",cOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",uOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),dOe=()=>"Keep 1 queued message saved.",fOe=()=>"保留 1 条排队消息。",hOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",_Oe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fOe():t==="fa"?hOe():dOe()}),pOe=()=>"Interrupt 1 active agent turn.",mOe=()=>"中断 1 个活动代理任务。",gOe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",vOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mOe():t==="fa"?gOe():pOe()}),bOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,yOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,xOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,wOe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?yOe(e):t==="fa"?xOe(e):bOe(e)}),SOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,kOe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,COe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,EOe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?kOe(e):t==="fa"?COe(e):SOe(e)}),NOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,zOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,jOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,TOe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?zOe(e):t==="fa"?jOe(e):NOe(e)}),AOe=()=>"Stopping host…",ROe=()=>"正在停止主机…",MOe=()=>"در حال توقف میزبان…",DOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ROe():t==="fa"?MOe():AOe()}),LOe=()=>"Update",OOe=()=>"更新",IOe=()=>"به‌روزرسانی",SN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OOe():t==="fa"?IOe():LOe()}),BOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,$Oe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,POe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,FOe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=()=>"Update OpenResearch?",qOe=()=>"更新 OpenResearch?",UOe=()=>"OpenResearch به‌روزرسانی شود؟",GOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qOe():t==="fa"?UOe():HOe()}),WOe=()=>"Updating…",VOe=()=>"正在更新…",KOe=()=>"در حال به‌روزرسانی…",QOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Disable syncing",XOe=()=>"关闭同步",ZOe=()=>"غیرفعال کردن همگام‌سازی",JOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),eIe=()=>"Enable GitHub syncing",tIe=()=>"启用 GitHub 同步",nIe=()=>"فعال‌سازی همگام‌سازی GitHub",rIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tIe():t==="fa"?nIe():eIe()}),sIe=()=>"Enabling…",iIe=()=>"正在启用…",aIe=()=>"در حال فعال‌سازی…",oIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iIe():t==="fa"?aIe():sIe()}),lIe=()=>"Updating…",cIe=()=>"正在更新…",uIe=()=>"در حال به‌روزرسانی…",dIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cIe():t==="fa"?uIe():lIe()}),fIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,hIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,_Ie=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,pIe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?hIe(e):t==="fa"?_Ie(e):fIe(e)}),mIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,gIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,vIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,bIe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?gIe(e):t==="fa"?vIe(e):mIe(e)}),yIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,xIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,wIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,SIe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?xIe(e):t==="fa"?wIe(e):yIe(e)}),kIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,CIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,EIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,NIe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?CIe(e):t==="fa"?EIe(e):kIe(e)}),zIe=()=>"CLI is retrying…",jIe=()=>"CLI 正在重试…",TIe=()=>"CLI در حال تلاش دوباره است…",AIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jIe():t==="fa"?TIe():zIe()}),RIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,MIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,DIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,LIe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?MIe(e):t==="fa"?DIe(e):RIe(e)}),OIe=()=>"Sending again…",IIe=()=>"正在重新发送…",BIe=()=>"در حال ارسال دوباره…",$Ie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IIe():t==="fa"?BIe():OIe()}),PIe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,FIe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,HIe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,qIe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?FIe(e):t==="fa"?HIe(e):PIe(e)}),UIe=()=>"Retrying…",GIe=()=>"正在重试…",WIe=()=>"در حال تلاش دوباره…",tL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GIe():t==="fa"?WIe():UIe()}),VIe=()=>"Default speed",KIe=()=>"默认速度",QIe=()=>"سرعت پیش‌فرض",YIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KIe():t==="fa"?QIe():VIe()}),XIe=()=>"Standard",ZIe=()=>"标准",JIe=()=>"استاندارد",eBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,nBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,rBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,sBe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Appearance",aBe=()=>"外观",oBe=()=>"ظاهر",lBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),cBe=()=>"Check",uBe=()=>"检查",dBe=()=>"بررسی",fBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uBe():t==="fa"?dBe():cBe()}),hBe=()=>"Check again",_Be=()=>"再次检查",pBe=()=>"بررسی دوباره",Kp=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Be():t==="fa"?pBe():hBe()}),mBe=()=>"Check for updates",gBe=()=>"检查更新",vBe=()=>"بررسی به‌روزرسانی",bBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gBe():t==="fa"?vBe():mBe()}),yBe=()=>"Check now",xBe=()=>"立即检查",wBe=()=>"اکنون بررسی کن",SBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check setup",CBe=()=>"检查设置",EBe=()=>"بررسی راه‌اندازی",NBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"orx checks a few times a day on its own.",jBe=()=>"orx 每天会自动检查几次。",TBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",ABe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),RBe=()=>"Choose a flavor",MBe=()=>"选择配置",DBe=()=>"انتخاب پیکربندی",LBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MBe():t==="fa"?DBe():RBe()}),OBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,IBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,BBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,$Be=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?IBe(e):t==="fa"?BBe(e):OBe(e)}),PBe=()=>"clean",FBe=()=>"无更改",HBe=()=>"بدون تغییر",qBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FBe():t==="fa"?HBe():PBe()}),UBe=e=>`Already linked at ${e==null?void 0:e.link}.`,GBe=e=>`已链接到 ${e==null?void 0:e.link}。`,WBe=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,VBe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?GBe(e):t==="fa"?WBe(e):UBe(e)}),KBe=e=>`Linked ${e==null?void 0:e.link}.`,QBe=e=>`已链接 ${e==null?void 0:e.link}。`,YBe=e=>`${e==null?void 0:e.link} پیوند شد.`,XBe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?QBe(e):t==="fa"?YBe(e):KBe(e)}),ZBe=()=>"Connect",JBe=()=>"连接",e$e=()=>"اتصال",a6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JBe():t==="fa"?e$e():ZBe()}),t$e=()=>"Connected via GitHub CLI",n$e=()=>"已通过 GitHub CLI 连接",r$e=()=>"از طریق GitHub CLI متصل است",nL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),s$e=()=>"Connecting…",i$e=()=>"正在连接…",a$e=()=>"در حال اتصال…",rL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?i$e():t==="fa"?a$e():s$e()}),o$e=e=>`CPU cores: ${e==null?void 0:e.count}`,l$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,c$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,u$e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?l$e(e):t==="fa"?c$e(e):o$e(e)}),d$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",f$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",h$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",_$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?f$e():t==="fa"?h$e():d$e()}),p$e=()=>"the current project",m$e=()=>"当前项目",g$e=()=>"پروژهٔ فعلی",v$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?m$e():t==="fa"?g$e():p$e()}),b$e=e=>`${e==null?void 0:e.value} (custom)`,y$e=e=>`${e==null?void 0:e.value}(自定义)`,x$e=e=>`${e==null?void 0:e.value} (سفارشی)`,w$e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?y$e(e):t==="fa"?x$e(e):b$e(e)}),S$e=()=>"detached",k$e=()=>"分离头指针",C$e=()=>"جدا از شاخه",o6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?k$e():t==="fa"?C$e():S$e()}),E$e=()=>"Disconnected",N$e=()=>"已断开连接",z$e=()=>"قطع اتصال",sL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),j$e=()=>"Environment tab",T$e=()=>"环境标签页",A$e=()=>"زبانهٔ محیط",R$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?T$e():t==="fa"?A$e():j$e()}),M$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,D$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,L$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,O$e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?D$e(e):t==="fa"?L$e(e):M$e(e)}),I$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",B$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",$$e=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",P$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?B$e():t==="fa"?$$e():I$e()}),F$e=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",H$e=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",q$e=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",U$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),G$e=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",W$e=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",V$e=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",K$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?W$e():t==="fa"?V$e():G$e()}),Q$e=e=>`GPU × ${e==null?void 0:e.count}`,Y$e=e=>`${e==null?void 0:e.count} 个 GPU`,X$e=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,Z$e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Y$e(e):t==="fa"?X$e(e):Q$e(e)}),J$e=()=>"has changes",ePe=()=>"有更改",tPe=()=>"دارای تغییر",nPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ePe():t==="fa"?tPe():J$e()}),rPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,sPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,iPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,aPe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?sPe(e):t==="fa"?iPe(e):rPe(e)}),oPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",lPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",cPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",uPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lPe():t==="fa"?cPe():oPe()}),dPe=()=>"Install",fPe=()=>"安装",hPe=()=>"نصب",_Pe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fPe():t==="fa"?hPe():dPe()}),pPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,mPe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,gPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,vPe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mPe(e):t==="fa"?gPe(e):pPe(e)}),bPe=e=>`Install the ${e==null?void 0:e.command} command`,yPe=e=>`安装 ${e==null?void 0:e.command} 命令`,xPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,wPe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?yPe(e):t==="fa"?xPe(e):bPe(e)}),SPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",kPe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",CPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",EPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kPe():t==="fa"?CPe():SPe()}),NPe=()=>"Install the new release now instead of waiting for the background update.",zPe=()=>"立即安装新版本,无需等待后台更新。",jPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",TPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zPe():t==="fa"?jPe():NPe()}),APe=()=>"Discard your unsaved Kubernetes changes?",RPe=()=>"要放弃未保存的 Kubernetes 更改吗?",MPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",DPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RPe():t==="fa"?MPe():APe()}),LPe=()=>"Key from",OPe=()=>"密钥来自",IPe=()=>"کلید از",BPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OPe():t==="fa"?IPe():LPe()}),$Pe=()=>"Use current kubectl context",PPe=()=>"使用当前 kubectl 上下文",FPe=()=>"استفاده از کانتکست فعلی kubectl",HPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PPe():t==="fa"?FPe():$Pe()}),qPe=e=>`Use current context (${e==null?void 0:e.context})`,UPe=e=>`使用当前上下文(${e==null?void 0:e.context})`,GPe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,WPe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?UPe(e):t==="fa"?GPe(e):qPe(e)}),VPe=()=>"Language",KPe=()=>"语言",QPe=()=>"زبان",YPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KPe():t==="fa"?QPe():VPe()}),XPe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,ZPe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,JPe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,eFe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ZPe(e):t==="fa"?JPe(e):XPe(e)}),tFe=()=>"Make default",nFe=()=>"设为默认值",rFe=()=>"پیش‌فرض شود",sFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nFe():t==="fa"?rFe():tFe()}),iFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",aFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",oFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",lFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aFe():t==="fa"?oFe():iFe()}),cFe=()=>"Replace token ID",uFe=()=>"替换令牌 ID",dFe=()=>"جایگزینی شناسهٔ توکن",fFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uFe():t==="fa"?dFe():cFe()}),hFe=()=>"Replace token secret",_Fe=()=>"替换令牌密钥",pFe=()=>"جایگزینی رمز توکن",mFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Fe():t==="fa"?pFe():hFe()}),gFe=()=>"How to get a Modal token",vFe=()=>"如何获取 Modal 令牌",bFe=()=>"روش دریافت توکن Modal",yFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vFe():t==="fa"?bFe():gFe()}),xFe=()=>"Token ID",wFe=()=>"令牌 ID",SFe=()=>"شناسهٔ توکن",kFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wFe():t==="fa"?SFe():xFe()}),CFe=()=>"Token secret",EFe=()=>"令牌密钥",NFe=()=>"رمز توکن",zFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EFe():t==="fa"?NFe():CFe()}),jFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,TFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,AFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,iL=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?TFe(e):t==="fa"?AFe(e):jFe(e)}),RFe=e=>`Needs ${e==null?void 0:e.tool}`,MFe=e=>`需要 ${e==null?void 0:e.tool}`,DFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,LFe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?MFe(e):t==="fa"?DFe(e):RFe(e)}),OFe=()=>"Needs tools",IFe=()=>"缺少工具",BFe=()=>"به ابزارها نیاز دارد",$Fe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,FFe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,HFe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,qFe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?FFe(e):t==="fa"?HFe(e):PFe(e)}),UFe=()=>"New runs use SSH; choose a host when launching.",GFe=()=>"新运行将使用 SSH;启动时请选择主机。",WFe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",VFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GFe():t==="fa"?WFe():UFe()}),KFe=()=>"New token",QFe=()=>"新令牌",YFe=()=>"توکن جدید",XFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QFe():t==="fa"?YFe():KFe()}),ZFe=()=>"No default flavor",JFe=()=>"不设默认配置",eHe=()=>"بدون پیکربندی پیش‌فرض",tHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JFe():t==="fa"?eHe():ZFe()}),nHe=()=>"none",rHe=()=>"无",sHe=()=>"هیچ‌کدام",l6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rHe():t==="fa"?sHe():nHe()}),iHe=()=>"Not connected",aHe=()=>"未连接",oHe=()=>"متصل نیست",aL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),lHe=()=>"not found on PATH",cHe=()=>"在 PATH 中未找到",uHe=()=>"در PATH پیدا نشد",dHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cHe():t==="fa"?uHe():lHe()}),fHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,hHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,_He=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,pHe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?hHe(e):t==="fa"?_He(e):fHe(e)}),mHe=()=>"not initialized",gHe=()=>"尚未初始化",vHe=()=>"راه‌اندازی نشده",bHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gHe():t==="fa"?vHe():mHe()}),yHe=()=>"Not set",xHe=()=>"未设置",wHe=()=>"تنظیم نشده",T4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"OAuth (subscription login)",kHe=()=>"OAuth(订阅登录)",CHe=()=>"OAuth (ورود با اشتراک)",EHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,zHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,jHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,THe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"Setting up…",RHe=()=>"正在设置…",MHe=()=>"در حال راه‌اندازی…",DHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Account",OHe=()=>"账户",IHe=()=>"حساب",c6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"Add one with",$He=()=>"使用以下命令添加:",PHe=()=>"یکی با این فرمان اضافه کنید:",FHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=()=>"Add variable",qHe=()=>"添加变量",UHe=()=>"افزودن متغیر",GHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qHe():t==="fa"?UHe():HHe()}),WHe=()=>"Agent models",VHe=()=>"智能体模型",KHe=()=>"مدل‌های عامل",QHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Anonymous usage analytics",XHe=()=>"匿名使用情况分析",ZHe=()=>"تحلیل ناشناس استفاده",kN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Auth",eqe=()=>"身份验证",tqe=()=>"احراز هویت",nqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Authentication",sqe=()=>"身份验证",iqe=()=>"احراز هویت",oL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),aqe=()=>"Back to Compute",oqe=()=>"返回算力设置",lqe=()=>"بازگشت به رایانش",lL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oqe():t==="fa"?lqe():aqe()}),cqe=()=>"Backend",uqe=()=>"后端",dqe=()=>"بک‌اند",fqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uqe():t==="fa"?dqe():cqe()}),hqe=()=>"Baseline",_qe=()=>"基线",pqe=()=>"خط مبنا",mqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_qe():t==="fa"?pqe():hqe()}),gqe=()=>"Binary",vqe=()=>"可执行文件",bqe=()=>"فایل اجرایی",yqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vqe():t==="fa"?bqe():gqe()}),xqe=()=>"Cancel",wqe=()=>"取消",Sqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wqe():t==="fa"?Sqe():xqe()}),kqe=()=>"Cancel new variable",Cqe=()=>"取消新变量",Eqe=()=>"لغو متغیر جدید",Nqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cqe():t==="fa"?Eqe():kqe()}),zqe=()=>"Checking compute targets…",jqe=()=>"正在检查算力目标…",Tqe=()=>"در حال بررسی مقصدهای رایانشی…",Aqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jqe():t==="fa"?Tqe():zqe()}),Rqe=()=>"Checking kubectl…",Mqe=()=>"正在检查 kubectl…",Dqe=()=>"در حال بررسی kubectl…",Lqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mqe():t==="fa"?Dqe():Rqe()}),Oqe=()=>"Checking Modal…",Iqe=()=>"正在检查 Modal…",Bqe=()=>"در حال بررسی Modal…",$qe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Iqe():t==="fa"?Bqe():Oqe()}),Pqe=()=>"Choose a preset flavor",Fqe=()=>"选择预设规格",Hqe=()=>"یک پیکربندی آماده انتخاب کنید",CN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fqe():t==="fa"?Hqe():Pqe()}),qqe=()=>"cluster default",Uqe=()=>"集群默认值",Gqe=()=>"پیش‌فرض خوشه",EN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Uqe():t==="fa"?Gqe():qqe()}),Wqe=()=>"cluster default (e.g. 4h, 30m)",Vqe=()=>"集群默认值(例如 4h、30m)",Kqe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",Qqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vqe():t==="fa"?Kqe():Wqe()}),Yqe=()=>"Cluster unreachable",Xqe=()=>"无法连接集群",Zqe=()=>"خوشه در دسترس نیست",Jqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xqe():t==="fa"?Zqe():Yqe()}),eUe=()=>"Compute",tUe=()=>"算力",nUe=()=>"رایانش",cL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tUe():t==="fa"?nUe():eUe()}),rUe=()=>"Connect compute backends and choose where new runs execute.",sUe=()=>"连接算力后端,并选择新运行的执行位置。",iUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",aUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Connected",lUe=()=>"已连接",cUe=()=>"متصل",uUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),dUe=()=>"Context",fUe=()=>"上下文",hUe=()=>"زمینه",_Ue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fUe():t==="fa"?hUe():dUe()}),pUe=()=>"Current",mUe=()=>"当前",gUe=()=>"فعلی",vUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mUe():t==="fa"?gUe():pUe()}),bUe=()=>"Currently off:",yUe=()=>"当前已关闭:",xUe=()=>"اکنون خاموش است:",wUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yUe():t==="fa"?xUe():bUe()}),SUe=()=>"Custom flavor",kUe=()=>"自定义规格",CUe=()=>"پیکربندی سفارشی",EUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kUe():t==="fa"?CUe():SUe()}),NUe=()=>"Custom flavor…",zUe=()=>"自定义规格…",jUe=()=>"پیکربندی سفارشی…",TUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zUe():t==="fa"?jUe():NUe()}),AUe=()=>"Data directory",RUe=()=>"数据目录",MUe=()=>"پوشهٔ داده",DUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RUe():t==="fa"?MUe():AUe()}),LUe=()=>"default",OUe=()=>"默认",IUe=()=>"پیش‌فرض",BUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OUe():t==="fa"?IUe():LUe()}),$Ue=()=>"Default",PUe=()=>"默认",FUe=()=>"پیش‌فرض",uL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PUe():t==="fa"?FUe():$Ue()}),HUe=()=>"Default destination",qUe=()=>"默认目标",UUe=()=>"مقصد پیش‌فرض",GUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qUe():t==="fa"?UUe():HUe()}),WUe=()=>"Detecting hardware…",VUe=()=>"正在检测硬件…",KUe=()=>"در حال شناسایی سخت‌افزار…",QUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VUe():t==="fa"?KUe():WUe()}),YUe=()=>"Detecting harnesses…",XUe=()=>"正在检测智能体工具…",ZUe=()=>"در حال شناسایی ابزارهای عامل…",JUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XUe():t==="fa"?ZUe():YUe()}),eGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",tGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",nGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",rGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tGe():t==="fa"?nGe():eGe()}),sGe=()=>"Effective URL",iGe=()=>"实际使用的网址",aGe=()=>"نشانی مؤثر",oGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iGe():t==="fa"?aGe():sGe()}),lGe=()=>"Enable GitHub syncing for new projects",cGe=()=>"为新项目启用 GitHub 同步",uGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",NN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cGe():t==="fa"?uGe():lGe()}),dGe=()=>"Environment",fGe=()=>"环境",hGe=()=>"محیط",dL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fGe():t==="fa"?hGe():dGe()}),_Ge=()=>"Failed",pGe=()=>"失败",mGe=()=>"ناموفق",u6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pGe():t==="fa"?mGe():_Ge()}),gGe=()=>"General",vGe=()=>"常规",bGe=()=>"عمومی",yGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"GitHub publishing",wGe=()=>"GitHub 发布",SGe=()=>"انتشار در GitHub",kGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Git token",EGe=()=>"Git 令牌",NGe=()=>"توکن Git",zGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Harnesses",TGe=()=>"智能体工具",AGe=()=>"ابزارهای عامل",RGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),MGe=()=>"hf_…",DGe=()=>"hf_…",LGe=()=>"hf_…",OGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DGe():t==="fa"?LGe():MGe()}),IGe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",BGe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",$Ge=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",PGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BGe():t==="fa"?$Ge():IGe()}),FGe=()=>"Initialize Git",HGe=()=>"初始化 Git",qGe=()=>"راه‌اندازی Git",UGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HGe():t==="fa"?qGe():FGe()}),GGe=()=>"Install",WGe=()=>"安装",VGe=()=>"نصب",fL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WGe():t==="fa"?VGe():GGe()}),KGe=()=>"Install broken",QGe=()=>"安装损坏",YGe=()=>"نصب خراب است",XGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QGe():t==="fa"?YGe():KGe()}),ZGe=()=>"Install GitHub CLI",JGe=()=>"安装 GitHub CLI",eWe=()=>"نصب GitHub CLI",tWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JGe():t==="fa"?eWe():ZGe()}),nWe=()=>"Install updates automatically",rWe=()=>"自动安装更新",sWe=()=>"نصب خودکار به‌روزرسانی‌ها",zN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rWe():t==="fa"?sWe():nWe()}),iWe=()=>"Instance history",aWe=()=>"实例历史",oWe=()=>"تاریخچهٔ نمونه‌ها",lWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aWe():t==="fa"?oWe():iWe()}),cWe=()=>"Invalid Token",uWe=()=>"令牌无效",dWe=()=>"توکن نامعتبر",fWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uWe():t==="fa"?dWe():cWe()}),hWe=()=>"Jobs / Dashboard URL",_We=()=>"Jobs / 控制台网址",pWe=()=>"نشانی Jobs / داشبورد",mWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_We():t==="fa"?pWe():hWe()}),gWe=()=>"kubectl not found",vWe=()=>"未找到 kubectl",bWe=()=>"kubectl پیدا نشد",yWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vWe():t==="fa"?bWe():gWe()}),xWe=()=>"Latest",wWe=()=>"最新版本",SWe=()=>"جدیدترین",kWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wWe():t==="fa"?SWe():xWe()}),CWe=()=>"Loading…",EWe=()=>"正在加载…",NWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EWe():t==="fa"?NWe():CWe()}),zWe=()=>"Loading Ray settings…",jWe=()=>"正在加载 Ray 设置…",TWe=()=>"در حال بارگیری تنظیمات Ray…",AWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jWe():t==="fa"?TWe():zWe()}),RWe=()=>"Loading slurm settings…",MWe=()=>"正在加载 Slurm 设置…",DWe=()=>"در حال بارگیری تنظیمات Slurm…",LWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MWe():t==="fa"?DWe():RWe()}),OWe=()=>"Loading status…",IWe=()=>"正在加载状态…",BWe=()=>"در حال بارگیری وضعیت…",$We=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IWe():t==="fa"?BWe():OWe()}),PWe=()=>"Local only",FWe=()=>"仅本地",HWe=()=>"فقط محلی",qWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FWe():t==="fa"?HWe():PWe()}),UWe=()=>"Local repository",GWe=()=>"本地仓库",WWe=()=>"مخزن محلی",VWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GWe():t==="fa"?WWe():UWe()}),KWe=()=>"Login node",QWe=()=>"登录节点",YWe=()=>"گرهٔ ورود",XWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QWe():t==="fa"?YWe():KWe()}),ZWe=()=>"Make GitHub syncing the default?",JWe=()=>"将 GitHub 同步设为默认值?",eVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",tVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JWe():t==="fa"?eVe():ZWe()}),nVe=()=>"Missing bash/tar",rVe=()=>"缺少 bash/tar",sVe=()=>"bash/tar موجود نیست",iVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rVe():t==="fa"?sVe():nVe()}),aVe=()=>"More compute options",oVe=()=>"更多算力选项",lVe=()=>"گزینه‌های رایانشی بیشتر",cVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oVe():t==="fa"?lVe():aVe()}),uVe=()=>"Move failed:",dVe=()=>"移动失败:",fVe=()=>"انتقال ناموفق بود:",hVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dVe():t==="fa"?fVe():uVe()}),_Ve=()=>"Moved. orx is now using the new location.",pVe=()=>"已移动。orx 现在使用新位置。",mVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",gVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pVe():t==="fa"?mVe():_Ve()}),vVe=()=>"Namespace",bVe=()=>"命名空间",yVe=()=>"فضای نام",xVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bVe():t==="fa"?yVe():vVe()}),wVe=()=>"New location",SVe=()=>"新位置",kVe=()=>"محل جدید",CVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SVe():t==="fa"?kVe():wVe()}),EVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",NVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",zVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",jVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NVe():t==="fa"?zVe():EVe()}),TVe=()=>"New variable key",AVe=()=>"新变量键名",RVe=()=>"کلید متغیر جدید",MVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AVe():t==="fa"?RVe():TVe()}),DVe=()=>"New variable value",LVe=()=>"新变量值",OVe=()=>"مقدار متغیر جدید",IVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LVe():t==="fa"?OVe():DVe()}),BVe=()=>"No code, prompts, file contents, or account identifiers are sent.",$Ve=()=>"不会发送代码、提示词、文件内容或账户标识符。",PVe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",FVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Ve():t==="fa"?PVe():BVe()}),HVe=()=>"No hosts found in ~/.ssh/config.",qVe=()=>"在 ~/.ssh/config 中未找到主机。",UVe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",GVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qVe():t==="fa"?UVe():HVe()}),WVe=()=>"No job-create permission",VVe=()=>"没有创建 Job 的权限",KVe=()=>"مجوز ساخت Job وجود ندارد",QVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VVe():t==="fa"?KVe():WVe()}),YVe=()=>"No Write Permissions",XVe=()=>"无写入权限",ZVe=()=>"بدون مجوز نوشتن",JVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XVe():t==="fa"?ZVe():YVe()}),eKe=()=>"No key on this computer to register — load a registered key with",tKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",nKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",rKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tKe():t==="fa"?nKe():eKe()}),sKe=()=>"No key on this computer yet — create one with",iKe=()=>"此计算机上还没有密钥——使用以下命令创建:",aKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",oKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iKe():t==="fa"?aKe():sKe()}),lKe=()=>"No Slurm CLI",cKe=()=>"无 Slurm CLI",uKe=()=>"بدون CLI اسلورم",dKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cKe():t==="fa"?uKe():lKe()}),fKe=()=>"None registered",hKe=()=>"未注册任何密钥",_Ke=()=>"هیچ‌کدام ثبت نشده",pKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hKe():t==="fa"?_Ke():fKe()}),mKe=()=>"Not checked",gKe=()=>"未检查",vKe=()=>"بررسی نشده",hL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gKe():t==="fa"?vKe():mKe()}),bKe=()=>"Not configured",yKe=()=>"未配置",xKe=()=>"پیکربندی نشده",Jv=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yKe():t==="fa"?xKe():bKe()}),wKe=()=>"Not installed",SKe=()=>"未安装",kKe=()=>"نصب نیست",CKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SKe():t==="fa"?kKe():wKe()}),EKe=()=>"Not now",NKe=()=>"暂不",zKe=()=>"اکنون نه",jKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NKe():t==="fa"?zKe():EKe()}),TKe=()=>"Not on this computer",AKe=()=>"不在此计算机上",RKe=()=>"روی این رایانه نیست",MKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AKe():t==="fa"?RKe():TKe()}),DKe=()=>"Not set (pass --host per launch)",LKe=()=>"未设置(每次启动时传入 --host)",OKe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",IKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LKe():t==="fa"?OKe():DKe()}),BKe=()=>"Not signed in",$Ke=()=>"未登录",PKe=()=>"وارد نشده",_L=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Ke():t==="fa"?PKe():BKe()}),FKe=()=>"On this computer",HKe=()=>"在此计算机上",qKe=()=>"روی این رایانه",UKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HKe():t==="fa"?qKe():FKe()}),GKe=()=>"Open a project to inspect its repository and GitHub publication state.",WKe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",VKe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",KKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WKe():t==="fa"?VKe():GKe()}),QKe=()=>"Open job page",YKe=()=>"打开作业页面",XKe=()=>"باز کردن صفحهٔ کار",jN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YKe():t==="fa"?XKe():QKe()}),ZKe=()=>"Open on GitHub",JKe=()=>"在 GitHub 上打开",eQe=()=>"باز کردن در GitHub",TN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JKe():t==="fa"?eQe():ZKe()}),tQe=()=>", or create one with",nQe=()=>",或使用以下命令创建:",rQe=()=>"، یا با این فرمان یکی بسازید:",sQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Org",aQe=()=>"组织",oQe=()=>"سازمان",lQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),cQe=()=>"Orgs",uQe=()=>"组织",dQe=()=>"سازمان‌ها",fQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uQe():t==="fa"?dQe():cQe()}),hQe=()=>"orx can't update this install",_Qe=()=>"orx 无法更新此安装",pQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",mQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Qe():t==="fa"?pQe():hQe()}),gQe=()=>"Overleaf",vQe=()=>"Overleaf",bQe=()=>"Overleaf",pL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vQe():t==="fa"?bQe():gQe()}),yQe=()=>"Overleaf Git authentication token",xQe=()=>"Overleaf Git 身份验证令牌",wQe=()=>"توکن احراز هویت Git در Overleaf",SQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xQe():t==="fa"?wQe():yQe()}),kQe=()=>"Overridden by env",CQe=()=>"已被环境变量覆盖",EQe=()=>"بازنویسی‌شده توسط محیط",NQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CQe():t==="fa"?EQe():kQe()}),zQe=()=>"Partition",jQe=()=>"分区",TQe=()=>"پارتیشن",AQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jQe():t==="fa"?TQe():zQe()}),RQe=()=>"Path",MQe=()=>"路径",DQe=()=>"مسیر",LQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MQe():t==="fa"?DQe():RQe()}),OQe=()=>"Plan",IQe=()=>"方案",BQe=()=>"سطح اشتراک",$Qe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IQe():t==="fa"?BQe():OQe()}),PQe=()=>"Project",FQe=()=>"项目",HQe=()=>"پروژه",qQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FQe():t==="fa"?HQe():PQe()}),UQe=()=>"Ray version",GQe=()=>"Ray 版本",WQe=()=>"نسخهٔ Ray",VQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GQe():t==="fa"?WQe():UQe()}),KQe=()=>"Reachable",QQe=()=>"可访问",YQe=()=>"در دسترس",XQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QQe():t==="fa"?YQe():KQe()}),ZQe=()=>"Reading ~/.ssh/config…",JQe=()=>"正在读取 ~/.ssh/config…",eYe=()=>"در حال خواندن ‎~/.ssh/config…",mL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JQe():t==="fa"?eYe():ZQe()}),tYe=()=>"Ready",nYe=()=>"就绪",rYe=()=>"آماده",Qp=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nYe():t==="fa"?rYe():tYe()}),sYe=()=>"Ready to move",iYe=()=>"可以移动",aYe=()=>"آمادهٔ انتقال",oYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iYe():t==="fa"?aYe():sYe()}),lYe=()=>"Configured",cYe=()=>"已配置",uYe=()=>"پیکربندی‌شده",d6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cYe():t==="fa"?uYe():lYe()}),dYe=()=>"Refresh",fYe=()=>"刷新",hYe=()=>"تازه‌سازی",Yp=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),_Ye=()=>"Remotes",pYe=()=>"远程仓库",mYe=()=>"مخزن‌های دوردست",gYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pYe():t==="fa"?mYe():_Ye()}),vYe=()=>"Repository",bYe=()=>"仓库",yYe=()=>"مخزن",xYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bYe():t==="fa"?yYe():vYe()}),wYe=()=>"Restart to finish updating",SYe=()=>"重新启动以完成更新",kYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",CYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),EYe=()=>"Running instances",NYe=()=>"正在运行的实例",zYe=()=>"نمونه‌های در حال اجرا",jYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NYe():t==="fa"?zYe():EYe()}),TYe=()=>"Runtime",AYe=()=>"运行时间",RYe=()=>"زمان اجرا",MYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AYe():t==="fa"?RYe():TYe()}),DYe=()=>". Save it under that key if it's meant for HF Jobs.",LYe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",OYe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",IYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LYe():t==="fa"?OYe():DYe()}),BYe=()=>"Session cookie",$Ye=()=>"会话 cookie",PYe=()=>"کوکی نشست",FYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Ye():t==="fa"?PYe():BYe()}),HYe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",qYe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",UYe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",GYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qYe():t==="fa"?UYe():HYe()}),WYe=()=>"Settings",VYe=()=>"设置",KYe=()=>"تنظیمات",f6=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VYe():t==="fa"?KYe():WYe()}),QYe=()=>"Signed in",YYe=()=>"已登录",XYe=()=>"وارد شده",ZYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YYe():t==="fa"?XYe():QYe()}),JYe=()=>"Source",eXe=()=>"来源",tXe=()=>"منبع",gL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eXe():t==="fa"?tXe():JYe()}),nXe=()=>"SSH Key",rXe=()=>"SSH 密钥",sXe=()=>"کلید SSH",iXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rXe():t==="fa"?sXe():nXe()}),aXe=()=>"Started",oXe=()=>"开始时间",lXe=()=>"آغاز",cXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oXe():t==="fa"?lXe():aXe()}),uXe=()=>"State",dXe=()=>"状态",fXe=()=>"وضعیت",hXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dXe():t==="fa"?fXe():uXe()}),_Xe=()=>"Status",pXe=()=>"状态",mXe=()=>"وضعیت",o_=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pXe():t==="fa"?mXe():_Xe()}),gXe=()=>"Storage",vXe=()=>"存储",bXe=()=>"ذخیره‌سازی",yXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vXe():t==="fa"?bXe():gXe()}),xXe=()=>"Sync",wXe=()=>"同步",SXe=()=>"همگام‌سازی",kXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wXe():t==="fa"?SXe():xXe()}),CXe=()=>"Syncing off",EXe=()=>"同步已关闭",NXe=()=>"همگام‌سازی خاموش",zXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EXe():t==="fa"?NXe():CXe()}),jXe=()=>"Test connection",TXe=()=>"测试连接",AXe=()=>"آزمایش اتصال",RXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TXe():t==="fa"?AXe():jXe()}),MXe=()=>"Testing…",DXe=()=>"正在测试…",LXe=()=>"در حال آزمایش…",OXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DXe():t==="fa"?LXe():MXe()}),IXe=()=>", then add it with",BXe=()=>",然后使用以下命令添加:",$Xe=()=>"، سپس با این فرمان اضافه‌اش کنید:",PXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BXe():t==="fa"?$Xe():IXe()}),FXe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",HXe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",qXe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",UXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HXe():t==="fa"?qXe():FXe()}),GXe=()=>"This saved destination is not configured. Set it up below or choose another backend.",WXe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",VXe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",KXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"This value looks like a Hugging Face token — compute runs only read it from",YXe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",XXe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",ZXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Time limit",eZe=()=>"时间限制",tZe=()=>"محدودیت زمانی",nZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Unable to verify",sZe=()=>"无法验证",iZe=()=>"تأیید ممکن نیست",A4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),aZe=()=>"Unknown",oZe=()=>"未知",lZe=()=>"نامشخص",vL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oZe():t==="fa"?lZe():aZe()}),cZe=()=>"Update required",uZe=()=>"需要更新",dZe=()=>"نیازمند به‌روزرسانی",fZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uZe():t==="fa"?dZe():cZe()}),hZe=()=>"Updates",_Ze=()=>"更新",pZe=()=>"به‌روزرسانی‌ها",AN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Ze():t==="fa"?pZe():hZe()}),mZe=()=>"Usage analytics",gZe=()=>"使用情况分析",vZe=()=>"تحلیل استفاده",bZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gZe():t==="fa"?vZe():mZe()}),yZe=()=>"value",xZe=()=>"值",wZe=()=>"مقدار",bL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xZe():t==="fa"?wZe():yZe()}),SZe=()=>"Variables available to runs and the research agent (API keys, tokens).",kZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",CZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",EZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Version",zZe=()=>"版本",jZe=()=>"نسخه",yL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),TZe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",AZe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",RZe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",MZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AZe():t==="fa"?RZe():TZe()}),DZe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",LZe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",OZe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",IZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LZe():t==="fa"?OZe():DZe()}),BZe=()=>"Pick a login node first",$Ze=()=>"请先选择登录节点",PZe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",FZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Ze():t==="fa"?PZe():BZe()}),HZe=()=>"Providers",qZe=()=>"提供商",UZe=()=>"ارائه‌دهندگان",GZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qZe():t==="fa"?UZe():HZe()}),WZe=()=>"Reconnect",VZe=()=>"重新连接",KZe=()=>"اتصال دوباره",xL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VZe():t==="fa"?KZe():WZe()}),QZe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,YZe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,XZe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,ZZe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?YZe(e):t==="fa"?XZe(e):QZe(e)}),JZe=()=>"Reinstall with the orx installer to get automatic updates.",eJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",tJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",nJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eJe():t==="fa"?tJe():JZe()}),rJe=()=>"Re-link",sJe=()=>"重新链接",iJe=()=>"پیوند دوباره",aJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sJe():t==="fa"?iJe():rJe()}),oJe=()=>"Remove cookie",lJe=()=>"移除 cookie",cJe=()=>"حذف کوکی",uJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lJe():t==="fa"?cJe():oJe()}),dJe=()=>"Remove token",fJe=()=>"移除令牌",hJe=()=>"حذف توکن",_Je=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fJe():t==="fa"?hJe():dJe()}),pJe=()=>"Removing…",mJe=()=>"正在移除…",gJe=()=>"در حال حذف…",RN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mJe():t==="fa"?gJe():pJe()}),vJe=()=>"Replace anyway",bJe=()=>"仍要替换",yJe=()=>"به‌هرحال جایگزین کن",xJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bJe():t==="fa"?yJe():vJe()}),wJe=()=>"Replace key",SJe=()=>"替换密钥",kJe=()=>"جایگزینی کلید",CJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SJe():t==="fa"?kJe():wJe()}),EJe=()=>"Replace token",NJe=()=>"替换令牌",zJe=()=>"جایگزینی توکن",jJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NJe():t==="fa"?zJe():EJe()}),TJe=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,AJe=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,RJe=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,MJe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?AJe(e):t==="fa"?RJe(e):TJe(e)}),DJe=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,LJe=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,OJe=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,IJe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?LJe(e):t==="fa"?OJe(e):DJe(e)}),BJe=()=>"Run `gh auth login` in your terminal.",$Je=()=>"请在终端中运行 `gh auth login`。",PJe=()=>"در پایانه `gh auth login` را اجرا کنید.",FJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Je():t==="fa"?PJe():BJe()}),HJe=()=>"Saved",qJe=()=>"已保存",UJe=()=>"ذخیره شده",MN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qJe():t==="fa"?UJe():HJe()}),GJe=()=>"Set up",WJe=()=>"设置",VJe=()=>"راه‌اندازی",KJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WJe():t==="fa"?VJe():GJe()}),QJe=()=>"Set up SSH key",YJe=()=>"设置 SSH 密钥",XJe=()=>"راه‌اندازی کلید SSH",ZJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YJe():t==="fa"?XJe():QJe()}),JJe=()=>"Sign in",eet=()=>"登录",tet=()=>"ورود",wL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eet():t==="fa"?tet():JJe()}),net=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,ret=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,set=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,SL=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ret(e):t==="fa"?set(e):net(e)}),iet=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",aet=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",oet=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",cet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aet():t==="fa"?oet():iet()}),uet=()=>"The terminal disconnected before setup completed. Try again.",det=()=>"设置完成前终端连接已断开。请重试。",fet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",DN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?det():t==="fa"?fet():uet()}),het=()=>"Dark",_et=()=>"深色",pet=()=>"تیره",met=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_et():t==="fa"?pet():het()}),get=()=>"Theme",vet=()=>"主题",bet=()=>"پوسته",LN=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vet():t==="fa"?bet():get()}),yet=()=>"Light",xet=()=>"浅色",wet=()=>"روشن",ket=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"System",Eet=()=>"系统",Net=()=>"سیستم",zet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),jet=()=>"Set up billing in the Tinker console",Tet=()=>"在 Tinker 控制台设置账单",Aet=()=>"تنظیم پرداخت در کنسول Tinker",Ret=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tet():t==="fa"?Aet():jet()}),Met=()=>"Billing setup required",Det=()=>"需要设置账单",Let=()=>"تنظیم پرداخت لازم است",Oet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Det():t==="fa"?Let():Met()}),Iet=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",Bet=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",$et=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",Pet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bet():t==="fa"?$et():Iet()}),Fet=()=>"Invalid Key",Het=()=>"密钥无效",qet=()=>"کلید نامعتبر",Uet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Het():t==="fa"?qet():Fet()}),Get=()=>"Token from",Wet=()=>"令牌来自",Vet=()=>"توکن از",Ket=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wet():t==="fa"?Vet():Get()}),Qet=()=>"Update now",Yet=()=>"立即更新",Xet=()=>"اکنون به‌روزرسانی کن",Zet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=e=>`Update to ${e==null?void 0:e.version}`,ett=e=>`更新到 ${e==null?void 0:e.version}`,ttt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,ntt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ett(e):t==="fa"?ttt(e):Jet(e)}),rtt=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",stt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",itt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",att=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"Updating default destination…",ltt=()=>"正在更新默认运行位置…",ctt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",utt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",ftt=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",htt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",_tt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Validating…",mtt=()=>"正在验证…",gtt=()=>"در حال اعتبارسنجی…",kL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),vtt=()=>"View settings",btt=()=>"查看设置",ytt=()=>"مشاهدهٔ تنظیمات",xtt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?btt():t==="fa"?ytt():vtt()}),wtt=()=>"Skill",Stt=()=>"技能",ktt=()=>"مهارت",Ctt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Stt():t==="fa"?ktt():wtt()}),Ett=()=>"Loading skill…",Ntt=()=>"正在加载技能…",ztt=()=>"در حال بارگیری مهارت…",jtt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ntt():t==="fa"?ztt():Ett()}),Ttt=()=>"Personal",Att=()=>"个人",Rtt=()=>"شخصی",Mtt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Att():t==="fa"?Rtt():Ttt()}),Dtt=()=>"Alternatively, tell your agent to save a reusable skill for you.",Ltt=()=>"或者,请你的智能体为你保存可重复使用的技能。",Ott=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",Itt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ltt():t==="fa"?Ott():Dtt()}),Btt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,$tt=e=>`删除技能“${e==null?void 0:e.name}”?`,Ptt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,Ftt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$tt(e):t==="fa"?Ptt(e):Btt(e)}),Htt=e=>`Delete skill ${e==null?void 0:e.name}`,qtt=e=>`删除技能 ${e==null?void 0:e.name}`,Utt=e=>`حذف مهارت ${e==null?void 0:e.name}`,Gtt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qtt(e):t==="fa"?Utt(e):Htt(e)}),Wtt=e=>`Delete the “${e==null?void 0:e.name}” template?`,Vtt=e=>`删除模板“${e==null?void 0:e.name}”?`,Ktt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,Qtt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Vtt(e):t==="fa"?Ktt(e):Wtt(e)}),Ytt=e=>`Delete template ${e==null?void 0:e.name}`,Xtt=e=>`删除模板 ${e==null?void 0:e.name}`,Ztt=e=>`حذف قالب ${e==null?void 0:e.name}`,Jtt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Xtt(e):t==="fa"?Ztt(e):Ytt(e)}),ent=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",tnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",nnt=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",rnt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Drop a SKILL.md or .zip here, or click to choose",int=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",ant=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",ont=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=()=>"Drop a .tex or .zip here, or click to choose",cnt=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",unt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",dnt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cnt():t==="fa"?unt():lnt()}),fnt=()=>"File too large (max 20 MB).",hnt=()=>"文件过大(最大 20 MB)。",_nt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",CL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hnt():t==="fa"?_nt():fnt()}),pnt=()=>" + 1 file",mnt=()=>" + 1 个文件",gnt=()=>" + ۱ فایل",vnt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mnt():t==="fa"?gnt():pnt()}),bnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",ynt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",xnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",wnt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ynt():t==="fa"?xnt():bnt()}),Snt=()=>"Remove from OpenResearch",knt=()=>"从 OpenResearch 移除",Cnt=()=>"حذف از OpenResearch",Ent=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?knt():t==="fa"?Cnt():Snt()}),Nnt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,znt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,jnt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,Tnt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?znt(e):t==="fa"?jnt(e):Nnt(e)}),Ant=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,Rnt=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,Mnt=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,Dnt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Rnt(e):t==="fa"?Mnt(e):Ant(e)}),Lnt=e=>` + ${e==null?void 0:e.count} files`,Ont=e=>` + ${e==null?void 0:e.count} 个文件`,Int=e=>` + ${e==null?void 0:e.count} فایل`,Bnt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Ont(e):t==="fa"?Int(e):Lnt(e)}),$nt=()=>"Could not load skills:",Pnt=()=>"无法加载技能:",Fnt=()=>"بارگیری مهارت‌ها ممکن نشد:",Hnt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pnt():t==="fa"?Fnt():$nt()}),qnt=()=>"Could not load templates:",Unt=()=>"无法加载模板:",Gnt=()=>"بارگیری قالب‌ها ممکن نشد:",Wnt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Customize",Knt=()=>"自定义",Qnt=()=>"سفارشی‌سازی",Ynt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=()=>"Delete skill",Znt=()=>"删除技能",Jnt=()=>"حذف مهارت",ert=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Znt():t==="fa"?Jnt():Xnt()}),trt=()=>"Delete template",nrt=()=>"删除模板",rrt=()=>"حذف قالب",srt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nrt():t==="fa"?rrt():trt()}),irt=()=>"LaTeX templates",art=()=>"LaTeX 模板",ort=()=>"قالب‌های LaTeX",lrt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?art():t==="fa"?ort():irt()}),crt=()=>"Loading skills…",urt=()=>"正在加载技能…",drt=()=>"در حال بارگیری مهارت‌ها…",frt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?urt():t==="fa"?drt():crt()}),hrt=()=>"Loading templates…",_rt=()=>"正在加载模板…",prt=()=>"در حال بارگیری قالب‌ها…",mrt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"No skills yet.",vrt=()=>"尚无技能。",brt=()=>"هنوز مهارتی وجود ندارد.",yrt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"No templates yet.",wrt=()=>"尚无模板。",Srt=()=>"هنوز قالبی وجود ندارد.",krt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Skills",Ert=()=>"技能",Nrt=()=>"مهارت‌ها",zrt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"Uploading…",Trt=()=>"正在上传…",Art=()=>"در حال بارگذاری…",Rrt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",Drt=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",Lrt=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",Ort=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Upload a SKILL.md file or a .zip of a skill folder.",Brt=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",$rt=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",Prt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"Upload a .tex file or a .zip of a template folder.",Hrt=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",qrt=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",Urt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"Close SSH config",Wrt=()=>"关闭 SSH 配置",Vrt=()=>"بستن پیکربندی SSH",Krt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"Discard your unsaved SSH config changes?",Yrt=()=>"要放弃未保存的 SSH 配置更改吗?",Xrt=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",Zrt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Loading SSH config…",est=()=>"正在加载 SSH 配置…",tst=()=>"در حال بارگیری پیکربندی SSH…",nst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"SSH config saved",sst=()=>"SSH 配置已保存",ist=()=>"پیکربندی SSH ذخیره شد",ast=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"SSH config",lst=()=>"SSH 配置",cst=()=>"پیکربندی SSH",ust=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Configure SSH hosts…",fst=()=>"配置 SSH 主机…",hst=()=>"پیکربندی میزبان‌های SSH…",EL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),_st=()=>"Cancelled",pst=()=>"已取消",mst=()=>"لغوشده",gst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pst():t==="fa"?mst():_st()}),vst=()=>"Cancelling",bst=()=>"正在取消",yst=()=>"در حال لغو",xst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bst():t==="fa"?yst():vst()}),wst=()=>"Done",Sst=()=>"已完成",kst=()=>"انجام‌شده",Cst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sst():t==="fa"?kst():wst()}),Est=()=>"Editing",Nst=()=>"正在编辑",zst=()=>"در حال ویرایش",jst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nst():t==="fa"?zst():Est()}),Tst=()=>"Failed",Ast=()=>"失败",Rst=()=>"ناموفق",Mst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ast():t==="fa"?Rst():Tst()}),Dst=()=>"Idle",Lst=()=>"空闲",Ost=()=>"بی‌کار",Ist=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lst():t==="fa"?Ost():Dst()}),Bst=()=>"Running",$st=()=>"运行中",Pst=()=>"در حال اجرا",Fst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$st():t==="fa"?Pst():Bst()}),Hst=()=>"Starting",qst=()=>"正在启动",Ust=()=>"در حال آغاز",Gst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Copying…",Vst=()=>"正在复制…",Kst=()=>"در حال کپی…",Qst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Finalizing…",Xst=()=>"正在完成…",Zst=()=>"در حال نهایی‌سازی…",Jst=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=e=>`${e==null?void 0:e.size} free at target`,tit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,nit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,rit=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?tit(e):t==="fa"?nit(e):eit(e)}),sit=e=>`Move all orx data to: +رونوشت آن برای همیشه حذف خواهد شد.`,Qie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Xie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Zie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Jie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xie(e):t==="fa"?Zie(e):Yie(e)}),eae=()=>"Could not exit Plan mode. Try again.",tae=()=>"无法退出计划模式。请重试。",nae=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",rae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Expand tool activity",iae=()=>"展开工具活动",aae=()=>"باز کردن فعالیت ابزارها",oae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=()=>"experiments",cae=()=>"实验",uae=()=>"آزمایش‌ها",dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cae():t==="fa"?uae():lae()}),fae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,hae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,_ae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,pae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,gae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,vae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,bae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=e=>`Message not sent: ${e==null?void 0:e.error}`,xae=e=>`消息未发送:${e==null?void 0:e.error}`,wae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,Sae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xae(e):t==="fa"?wae(e):yae(e)}),kae=()=>"Model unavailable",Cae=()=>"模型不可用",Eae=()=>"مدل در دسترس نیست",Nae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),zae=()=>"New session",jae=()=>"新会话",Tae=()=>"نشست جدید",hE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jae():t==="fa"?Tae():zae()}),Aae=()=>"No active sessions",Rae=()=>"没有活跃会话",Mae=()=>"نشست فعالی وجود ندارد",Dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No activity",Oae=()=>"无活动",Iae=()=>"بدون فعالیت",Bae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No archived sessions",Pae=()=>"没有已归档的会话",Fae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"No sessions yet",Uae=()=>"还没有会话",Gae=()=>"هنوز نشستی وجود ندارد",Wae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"1 annotation",Kae=()=>"1 条批注",Qae=()=>"۱ یادداشت",Yae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"Open sub-agent transcript",Zae=()=>"打开子智能体记录",Jae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",eoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),toe=()=>"About this demo",noe=()=>"关于此演示",roe=()=>"دربارهٔ این نسخهٔ نمایشی",_E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?noe():t==="fa"?roe():toe()}),soe=()=>"Accept and auto mode",ioe=()=>"接受并使用自动模式",aoe=()=>"پذیرش و حالت خودکار",ooe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Accept and bypass all",coe=()=>"接受并跳过所有审批",uoe=()=>"پذیرش و عبور از همهٔ تأییدها",doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"Active",hoe=()=>"活跃",_oe=()=>"فعال",poe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"All",goe=()=>"全部",voe=()=>"همه",boe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Allow",xoe=()=>"允许",woe=()=>"اجازه دادن",Soe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Approval required",Coe=()=>"需要批准",Eoe=()=>"نیازمند تأیید",Noe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Archived",joe=()=>"已归档",Toe=()=>"بایگانی‌شده",pE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Aoe=()=>"Ask about this",Roe=()=>"询问此内容",Moe=()=>"دربارهٔ این بپرسید",Doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Loe=()=>"Attach a PDF or image",Ooe=()=>"附加 PDF 或图片",Ioe=()=>"پیوست PDF یا تصویر",mE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),Boe=()=>"Bash",$oe=()=>"Bash",Poe=()=>"Bash",xD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$oe():t==="fa"?Poe():Boe()}),Foe=()=>"Browsed the web",Hoe=()=>"已浏览网页",qoe=()=>"وب مرور شد",gE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hoe():t==="fa"?qoe():Foe()}),Uoe=()=>"Built the project",Goe=()=>"已构建项目",Woe=()=>"پروژه ساخته شد",Voe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancel",Qoe=()=>"取消",Yoe=()=>"لغو",Xoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Cancelled an experiment run",Joe=()=>"已取消实验运行",ele=()=>"اجرای آزمایش لغو شد",tle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked code style",rle=()=>"已检查代码风格",sle=()=>"سبک کد بررسی شد",ile=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked compute options",ole=()=>"已检查算力选项",lle=()=>"گزینه‌های رایانشی بررسی شد",cle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=()=>"Checked experiment status",dle=()=>"已检查实验状态",fle=()=>"وضعیت آزمایش بررسی شد",vE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dle():t==="fa"?fle():ule()}),hle=()=>"Checked Git status",_le=()=>"已检查 Git 状态",ple=()=>"وضعیت Git بررسی شد",mle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked local times",vle=()=>"已查询当地时间",ble=()=>"زمان‌های محلی بررسی شد",yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked market data",wle=()=>"已查询市场数据",Sle=()=>"داده‌های بازار بررسی شد",kle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked sports data",Ele=()=>"已查询体育数据",Nle=()=>"داده‌های ورزشی بررسی شد",zle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked the weather",Tle=()=>"已查询天气",Ale=()=>"آب‌وهوا بررسی شد",Rle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Checked types",Dle=()=>"已检查类型",Lle=()=>"نوع‌ها بررسی شد",Ole=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ile=()=>"Clear annotations",Ble=()=>"清除批注",$le=()=>"پاک کردن یادداشت‌ها",bE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Customize",Fle=()=>"自定义",Hle=()=>"سفارشی‌سازی",qle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),Ule=()=>"Data sources",Gle=()=>"数据源",Wle=()=>"منابع داده",x2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gle():t==="fa"?Wle():Ule()}),Vle=()=>"Delegated a task to a new agent",Kle=()=>"已将任务委派给新智能体",Qle=()=>"وظیفه به عامل جدید واگذار شد",Yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Xle=()=>"Delete",Zle=()=>"删除",Jle=()=>"حذف",wD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zle():t==="fa"?Jle():Xle()}),ece=()=>"Deny",tce=()=>"拒绝",nce=()=>"رد کردن",rce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),sce=()=>"Edit and re-send",ice=()=>"编辑并重新发送",ace=()=>"ویرایش و ارسال دوباره",yE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ice():t==="fa"?ace():sce()}),oce=()=>"Edit message",lce=()=>"编辑消息",cce=()=>"ویرایش پیام",uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),dce=()=>"Edited a file",fce=()=>"已编辑文件",hce=()=>"فایل ویرایش شد",xE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fce():t==="fa"?hce():dce()}),_ce=()=>"Exit Bash mode",pce=()=>"退出 Bash 模式",mce=()=>"خروج از حالت Bash",wE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pce():t==="fa"?mce():_ce()}),gce=()=>"Exit Plan mode",vce=()=>"退出计划模式",bce=()=>"خروج از حالت طرح",SE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vce():t==="fa"?bce():gce()}),yce=()=>"Failed:",xce=()=>"失败:",wce=()=>"ناموفق:",t6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xce():t==="fa"?wce():yce()}),Sce=()=>"Filter sessions",kce=()=>"筛选会话",Cce=()=>"فیلتر نشست‌ها",kE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"is unavailable.",Nce=()=>"不可用。",zce=()=>"در دسترس نیست.",jce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Later queued messages will wait until this is retried or removed.",Ace=()=>"后续排队的消息会等待此消息重试或移除。",Rce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Mce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Dce=()=>"Listed files",Lce=()=>"已列出文件",Oce=()=>"فایل‌ها فهرست شد",CE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lce():t==="fa"?Oce():Dce()}),Ice=()=>"Listed project runs",Bce=()=>"已列出项目运行",$ce=()=>"اجراهای پروژه فهرست شد",Pce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Listed projects",Hce=()=>"已列出项目",qce=()=>"پروژه‌ها فهرست شد",Uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"Loading conversation…",Wce=()=>"正在加载对话…",Vce=()=>"در حال بارگیری گفتگو…",Kce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"New Chat",Yce=()=>"新对话",Xce=()=>"گفتگوی جدید",Zce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Jce=()=>"Next version",eue=()=>"下一版本",tue=()=>"نسخهٔ بعدی",EE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),nue=()=>"Open the session this agent spawned",rue=()=>"打开此智能体创建的会话",sue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",iue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Opened web pages",oue=()=>"已打开网页",lue=()=>"صفحه‌های وب باز شد",cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan",due=()=>"计划",fue=()=>"طرح",hue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan approved",pue=()=>"计划已批准",mue=()=>"طرح تأیید شد",gue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan rejected",bue=()=>"计划已拒绝",yue=()=>"طرح رد شد",xue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan resolved",Sue=()=>"计划已处理",kue=()=>"طرح تعیین تکلیف شد",Cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Plan revision requested",Nue=()=>"已请求修改计划",zue=()=>"درخواست بازنگری طرح ثبت شد",jue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),Tue=()=>"Previous version",Aue=()=>"上一版本",Rue=()=>"نسخهٔ قبلی",NE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aue():t==="fa"?Rue():Tue()}),Mue=()=>"Ran a command",Due=()=>"已运行命令",Lue=()=>"فرمان اجرا شد",Oue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Ran tests",Bue=()=>"已运行测试",$ue=()=>"آزمون‌ها اجرا شد",Pue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read a file",Hue=()=>"已读取文件",que=()=>"فایل خوانده شد",Uue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read Git history",Wue=()=>"已读取 Git 历史",Vue=()=>"تاریخچهٔ Git خوانده شد",Kue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Read project details",Yue=()=>"已读取项目详情",Xue=()=>"جزئیات پروژه خوانده شد",Zue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Reject",ede=()=>"拒绝",tde=()=>"رد کردن",nde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove",sde=()=>"移除",ide=()=>"حذف",ade=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove annotation",lde=()=>"移除批注",cde=()=>"حذف یادداشت",ude=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),dde=()=>"Remove file",fde=()=>"移除文件",hde=()=>"حذف فایل",zE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),_de=()=>"Remove image",pde=()=>"移除图片",mde=()=>"حذف تصویر",jE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),gde=()=>"Remove queued message",vde=()=>"移除排队消息",bde=()=>"حذف پیام صف",TE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vde():t==="fa"?bde():gde()}),yde=()=>"Rename",xde=()=>"重命名",wde=()=>"تغییر نام",SD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xde():t==="fa"?wde():yde()}),Sde=()=>"Reviewed code changes",kde=()=>"已审查代码更改",Cde=()=>"تغییرات کد بازبینی شد",Ede=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Nde=()=>"Run",zde=()=>"运行",jde=()=>"اجرا",AE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zde():t==="fa"?jde():Nde()}),Tde=()=>"Selected chat text",Ade=()=>"已选聊天文本",Rde=()=>"متن انتخاب‌شدهٔ گفتگو",Mde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Selected text:",Lde=()=>"已选文本:",Ode=()=>"متن انتخاب‌شده:",Ide=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Send",$de=()=>"发送",Pde=()=>"ارسال",E4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"Session options",Hde=()=>"会话选项",qde=()=>"گزینه‌های نشست",RE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hde():t==="fa"?qde():Fde()}),Ude=()=>"Session title",Gde=()=>"会话标题",Wde=()=>"عنوان نشست",Vde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Kde=()=>"Show sidebar",Qde=()=>"显示侧边栏",Yde=()=>"نمایش نوار کناری",ME=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qde():t==="fa"?Yde():Kde()}),Xde=()=>"Started an experiment run",Zde=()=>"已启动实验运行",Jde=()=>"اجرای آزمایش آغاز شد",efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Reading the project to suggest where to start…",nfe=()=>"正在阅读项目以建议从哪里开始…",rfe=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",sfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Starter prompts",afe=()=>"入门提示",ofe=()=>"پیشنهادهای شروع",lfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),cfe=()=>"Stop",ufe=()=>"停止",dfe=()=>"توقف",DE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ufe():t==="fa"?dfe():cfe()}),ffe=()=>"Submit",hfe=()=>"提交",_fe=()=>"ارسال",pfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Tool failed",gfe=()=>"工具失败",vfe=()=>"ابزار ناموفق بود",bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),yfe=()=>"Used tools",xfe=()=>"已使用工具",wfe=()=>"ابزارها استفاده شد",kD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xfe():t==="fa"?wfe():yfe()}),Sfe=()=>"View full plan",kfe=()=>"查看完整计划",Cfe=()=>"مشاهدهٔ طرح کامل",Efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waited for an experiment run",zfe=()=>"已等待实验运行",jfe=()=>"برای اجرای آزمایش صبر شد",Tfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"Waiting for your input…",Rfe=()=>"正在等待你的输入…",Mfe=()=>"منتظر ورودی شما…",Dfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"What should we research?",Ofe=()=>"我们应该研究什么?",Ife=()=>"چه چیزی را پژوهش کنیم؟",Bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"You, mid-task",Pfe=()=>"你(任务进行中)",Ffe=()=>"شما، هنگام انجام وظیفه",Hfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Pasted image",Ufe=()=>"粘贴的图片",Gfe=()=>"تصویر جای‌گذاری‌شده",Wfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Vfe=()=>"Plan",Kfe=()=>"计划",Qfe=()=>"طرح",CD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kfe():t==="fa"?Qfe():Vfe()}),Yfe=()=>"Plan mode — ready to proceed?",Xfe=()=>"计划模式 — 准备好继续了吗?",Zfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Jfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),ehe=()=>"Proposed plan",the=()=>"提议的计划",nhe=()=>"طرح پیشنهادی",LE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),rhe=()=>"Question",she=()=>"问题",ihe=()=>"پرسش",ahe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Queued",lhe=()=>"已排队",che=()=>"در صف",uhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),dhe=()=>"Recents",fhe=()=>"最近",hhe=()=>"اخیر",ED=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fhe():t==="fa"?hhe():dhe()}),_he=()=>"Re-check its setup.",phe=()=>"请重新检查其设置。",mhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",ghe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not recover this turn. Try again.",bhe=()=>"无法恢复本轮。请重试。",yhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=()=>"Could not remove the queued message. Try again.",She=()=>"无法移除排队消息。请重试。",khe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Che=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?She():t==="fa"?khe():whe()}),Ehe=e=>`Could not re-send: ${e==null?void 0:e.error}`,Nhe=e=>`无法重新发送:${e==null?void 0:e.error}`,zhe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,jhe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),The=()=>"Resolved",Ahe=()=>"已处理",Rhe=()=>"رسیدگی شد",Mhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"Could not retry the queued message. Try again.",Lhe=()=>"无法重试排队消息。请重试。",Ohe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Ihe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"run logs",$he=()=>"运行日志",Phe=()=>"گزارش‌های اجرا",Fhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Hhe=()=>"Scroll to bottom",qhe=()=>"滚动到底部",Uhe=()=>"رفتن به پایین گفتگو",OE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qhe():t==="fa"?Uhe():Hhe()}),Ghe=()=>"The selected harness is unavailable",Whe=()=>"所选智能体工具不可用",Vhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",w2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Whe():t==="fa"?Vhe():Ghe()}),Khe=()=>"Session limit reached",Qhe=()=>"已达到会话使用限额",Yhe=()=>"به سقف مصرف نشست رسیده‌اید",Xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"The chat session was not created",Jhe=()=>"未能创建聊天会话",e_e=()=>"نشست گفت‌وگو ایجاد نشد",t_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>"Show full conversation",r_e=()=>"显示完整对话",s_e=()=>"نمایش کامل گفتگو",i_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>" · Spawned by another agent",o_e=()=>" · 由另一个智能体创建",l_e=()=>" · ساخته‌شده به‌دست عامل دیگر",c_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=()=>"Starting…",d_e=()=>"正在启动…",f_e=()=>"در حال شروع…",h_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d_e():t==="fa"?f_e():u_e()}),__e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,p_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,m_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,g_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p_e(e):t==="fa"?m_e(e):__e(e)}),v_e=()=>"Could not stop the turn. Try again.",b_e=()=>"无法停止本轮。请重试。",y_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",x_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b_e():t==="fa"?y_e():v_e()}),w_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,S_e=e=>`无法切换分支:${e==null?void 0:e.error}`,k_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,C_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S_e(e):t==="fa"?k_e(e):w_e(e)}),E_e=()=>"The agent",N_e=()=>"智能体",z_e=()=>"عامل",j_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Thinking",A_e=()=>"正在思考",R_e=()=>"در حال فکر کردن",M_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),D_e=()=>"Could not toggle Plan mode. Try again.",L_e=()=>"无法切换计划模式。请重试。",O_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",IE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=()=>"This turn did not finish.",B_e=()=>"本轮未完成。",$_e=()=>"این نوبت کامل نشد.",BE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),P_e=()=>"Type a custom answer…",F_e=()=>"输入自定义回答…",H_e=()=>"پاسخ دلخواه را بنویسید…",q_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Unarchive",G_e=()=>"取消归档",W_e=()=>"خارج کردن از بایگانی",V_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),K_e=()=>"Untitled",Q_e=()=>"未命名",Y_e=()=>"بدون عنوان",Ng=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q_e():t==="fa"?Y_e():K_e()}),X_e=()=>"Could not update permissions. Try again.",Z_e=()=>"无法更新权限。请重试。",J_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",e0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=()=>"Work details",n0e=()=>"工作详情",r0e=()=>"جزئیات کار",s0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),i0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,a0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,o0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,l0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=e=>`Worked for ${e==null?void 0:e.duration}`,u0e=e=>`已工作 ${e==null?void 0:e.duration}`,d0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,f0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u0e(e):t==="fa"?d0e(e):c0e(e)}),h0e=()=>"Working…",_0e=()=>"正在工作…",p0e=()=>"در حال کار…",n6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_0e():t==="fa"?p0e():h0e()}),m0e=()=>"Close tab",g0e=()=>"关闭标签页",v0e=()=>"بستن زبانه",b0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),y0e=()=>"Changes",x0e=()=>"更改",w0e=()=>"تغییرات",ND=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x0e():t==="fa"?w0e():y0e()}),S0e=()=>"Code browser view",k0e=()=>"代码浏览器视图",C0e=()=>"نمای مرورگر کد",E0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Files",z0e=()=>"文件",j0e=()=>"فایل‌ها",T0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Refresh",R0e=()=>"刷新",M0e=()=>"تازه‌سازی",$E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"listing truncated",L0e=()=>"列表已截断",O0e=()=>"فهرست کوتاه شده است",I0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"No files.",$0e=()=>"没有文件。",P0e=()=>"فایلی وجود ندارد.",F0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Refresh failed:",q0e=()=>"刷新失败:",U0e=()=>"تازه‌سازی ناموفق بود:",G0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Cancelling…",V0e=()=>"正在取消…",K0e=()=>"در حال لغو…",Q0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Y0e=()=>"Checking…",X0e=()=>"正在检查…",Z0e=()=>"در حال بررسی…",Xi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X0e():t==="fa"?Z0e():Y0e()}),J0e=()=>"Copied",epe=()=>"已复制",tpe=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),npe=e=>`Failed to load: ${e==null?void 0:e.error}`,rpe=e=>`加载失败:${e==null?void 0:e.error}`,spe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,zD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?rpe(e):t==="fa"?spe(e):npe(e)}),ipe=()=>"Loading…",ape=()=>"正在加载…",ope=()=>"در حال بارگیری…",jD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),lpe=e=>`+ ${e==null?void 0:e.count} more`,cpe=e=>`另有 ${e==null?void 0:e.count} 项`,upe=e=>`${e==null?void 0:e.count}+ مورد دیگر`,dpe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cpe(e):t==="fa"?upe(e):lpe(e)}),fpe=()=>"Rendered view",hpe=()=>"渲染视图",_pe=()=>"نمای رندرشده",nv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hpe():t==="fa"?_pe():fpe()}),ppe=()=>"Save",mpe=()=>"保存",gpe=()=>"ذخیره",no=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mpe():t==="fa"?gpe():ppe()}),vpe=()=>"Saving…",bpe=()=>"正在保存…",ype=()=>"در حال ذخیره…",Ei=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bpe():t==="fa"?ype():vpe()}),xpe=()=>"Show less",wpe=()=>"收起",Spe=()=>"نمایش کمتر",TD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wpe():t==="fa"?Spe():xpe()}),kpe=()=>"Show more",Cpe=()=>"展开",Epe=()=>"نمایش بیشتر",Npe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),zpe=()=>"Stop",jpe=()=>"停止",Tpe=()=>"توقف",AD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Ape=()=>"Stopping…",Rpe=()=>"正在停止…",Mpe=()=>"در حال توقف…",Dpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Lpe=()=>"View source",Ope=()=>"查看源代码",Ipe=()=>"نمایش متن منبع",rh=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ope():t==="fa"?Ipe():Lpe()}),Bpe=()=>"Runs as a remote Hugging Face Job",$pe=()=>"作为远程 Hugging Face Job 运行",Ppe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs as a Job on your Kubernetes cluster",qpe=()=>"作为 Kubernetes 集群上的 Job 运行",Upe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs directly on this computer",Vpe=()=>"直接在此计算机上运行",Kpe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs in a remote Modal sandbox",Xpe=()=>"在远程 Modal 沙箱中运行",Zpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on an ephemeral OpenResearch box",tme=()=>"在临时 OpenResearch 主机上运行",nme=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs on the connected Ray cluster",ime=()=>"在已连接的 Ray 集群上运行",ame=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs as a scheduled job on your Slurm cluster",cme=()=>"作为 Slurm 集群上的调度作业运行",ume=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs on a host from your SSH config",hme=()=>"在 SSH 配置中的主机上运行",_me=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"Runs through Tinker’s remote compute",gme=()=>"通过 Tinker 远程算力运行",vme=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"HF Jobs",xme=()=>"HF Jobs",wme=()=>"HF Jobs",Sme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"Kubernetes",Cme=()=>"Kubernetes",Eme=()=>"Kubernetes",Nme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"This machine",jme=()=>"此计算机",Tme=()=>"این رایانه",RD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jme():t==="fa"?Tme():zme()}),Ame=()=>"Modal",Rme=()=>"Modal",Mme=()=>"Modal",Dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"OpenResearch",Ome=()=>"OpenResearch",Ime=()=>"OpenResearch",Bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Ray",Pme=()=>"Ray",Fme=()=>"Ray",Hme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"Slurm",Ume=()=>"Slurm",Gme=()=>"Slurm",Wme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"SSH",Kme=()=>"SSH",Qme=()=>"SSH",Yme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"Tinker",Zme=()=>"Tinker",Jme=()=>"Tinker",ege=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",nge=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",rge=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",sge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",age=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",oge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",lge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",uge=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",dge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",fge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"This computer must stay awake and online while Tinker runs.",_ge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",pge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",mge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window",vge=()=>"上下文窗口",bge=()=>"پنجرهٔ زمینه",yge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=()=>"Context window used",wge=()=>"已使用的上下文窗口",Sge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",kge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wge():t==="fa"?Sge():xge()}),Cge=e=>`${e==null?void 0:e.value} tokens`,Ege=e=>`${e==null?void 0:e.value} 个 token`,Nge=e=>`${e==null?void 0:e.value} توکن`,zge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Age=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Rge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tge(e):t==="fa"?Age(e):jge(e)}),Mge=()=>"No runs yet — ask the agent to launch one.",Dge=()=>"尚无运行——让智能体启动一个。",Lge=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Oge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Ige=()=>"Run",Bge=()=>"运行",$ge=()=>"اجرا",PE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bge():t==="fa"?$ge():Ige()}),Pge=()=>"Switch run",Fge=()=>"切换运行",Hge=()=>"تغییر اجرا",qge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fge():t==="fa"?Hge():Pge()}),Uge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Gge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Wge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Qge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Yge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Xge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}m`,Jge=e=>`${e==null?void 0:e.value} 分钟`,e1e=e=>`${e==null?void 0:e.value} دقیقه`,t1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=e=>`${e==null?void 0:e.value}s`,r1e=e=>`${e==null?void 0:e.value} 秒`,s1e=e=>`${e==null?void 0:e.value} ثانیه`,i1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):n1e(e)}),a1e=()=>"Code",o1e=()=>"代码",l1e=()=>"کد",c1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"created",d1e=()=>"创建于",f1e=()=>"ایجادشده",h1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"from",p1e=()=>"来自",m1e=()=>"از",g1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Logs",b1e=()=>"日志",y1e=()=>"گزارش‌ها",x1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Latest run",S1e=()=>"最新运行",k1e=()=>"آخرین اجرا",C1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Code",N1e=()=>"代码",z1e=()=>"کد",j1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"Commit",A1e=()=>"提交",R1e=()=>"کامیت",M1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"created",L1e=()=>"创建于",O1e=()=>"ایجادشده",I1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Description",$1e=()=>"说明",P1e=()=>"توضیحات",F1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"Duration",q1e=()=>"时长",U1e=()=>"مدت",G1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"exit",V1e=()=>"退出码",K1e=()=>"خروج",Q1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"from",X1e=()=>"来自",Z1e=()=>"از",J1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Logs",tve=()=>"日志",nve=()=>"گزارش‌ها",rve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run",ive=()=>"运行",ave=()=>"اجرا",ove=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Run history",cve=()=>"运行历史",uve=()=>"تاریخچهٔ اجرا",dve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Started",hve=()=>"开始时间",_ve=()=>"آغاز",pve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Runs",gve=()=>"运行",vve=()=>"اجراها",bve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",xve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",wve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",Sve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No runs yet",Cve=()=>"还没有运行",Eve=()=>"هنوز اجرایی وجود ندارد",Nve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"No experiments yet.",jve=()=>"还没有实验。",Tve=()=>"هنوز آزمایشی وجود ندارد.",Ave=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Not run yet",Mve=()=>"尚未运行",Dve=()=>"هنوز اجرا نشده",Lve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"1 run",Ive=()=>"1 次运行",Bve=()=>"۱ اجرا",$ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"Open logs",Fve=()=>"打开日志",Hve=()=>"باز کردن گزارش‌ها",qve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fve():t==="fa"?Hve():Pve()}),Uve=e=>`${e==null?void 0:e.count} runs`,Gve=e=>`${e==null?void 0:e.count} 次运行`,Wve=e=>`${e==null?void 0:e.count} اجرا`,Vve=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gve(e):t==="fa"?Wve(e):Uve(e)}),Kve=()=>"Stop requested",Qve=()=>"已请求停止",Yve=()=>"درخواست توقف ثبت شد",Xve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Stop run",Jve=()=>"停止运行",ebe=()=>"توقف اجرا",tbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Code",rbe=()=>"代码",sbe=()=>"کد",ibe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Experiments",obe=()=>"实验",lbe=()=>"آزمایش‌ها",cbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Logs",dbe=()=>"日志",fbe=()=>"گزارش‌ها",hbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Stop failed:",pbe=()=>"停止失败:",mbe=()=>"توقف ناموفق بود:",gbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),vbe=()=>"Clipboard access is unavailable.",bbe=()=>"无法访问剪贴板。",ybe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",MD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bbe():t==="fa"?ybe():vbe()}),xbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,wbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,Sbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,kbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):xbe(e)}),Cbe=()=>"Duplicate",Ebe=()=>"创建副本",Nbe=()=>"ایجاد نسخهٔ تکراری",zbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),jbe=e=>`File actions for ${e==null?void 0:e.path}`,Tbe=e=>`${e==null?void 0:e.path} 的文件操作`,Abe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Rbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tbe(e):t==="fa"?Abe(e):jbe(e)}),Mbe=()=>"Open",Dbe=()=>"打开",Lbe=()=>"باز کردن",Obe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Mbe()}),Ibe=e=>`Rename ${e==null?void 0:e.path}`,Bbe=e=>`重命名 ${e==null?void 0:e.path}`,$be=e=>`تغییر نام ${e==null?void 0:e.path}`,Pbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Hbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,qbe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Ube=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Hbe(e):t==="fa"?qbe(e):Fbe(e)}),Gbe=()=>"Binary file — no inline preview.",Wbe=()=>"二进制文件——无法内嵌预览。",Vbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Kbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Qbe=()=>"This file changed on disk. Your edits have not been overwritten.",Ybe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Xbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",FE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Qbe()}),Zbe=()=>"Compile failed",Jbe=()=>"编译失败",eye=()=>"کامپایل ناموفق بود",tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),nye=()=>"Compile PDF",rye=()=>"编译 PDF",sye=()=>"کامپایل PDF",HE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rye():t==="fa"?sye():nye()}),iye=()=>"Compiled, but the engine reported errors — check the output below.",aye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",oye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",lye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy command",uye=()=>"复制命令",dye=()=>"کپی فرمان",fye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Copy install command",_ye=()=>"复制安装命令",pye=()=>"کپی فرمان نصب",mye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"This file was deleted on disk. Your edits have not been discarded.",vye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",bye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",qE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vye():t==="fa"?bye():gye()}),yye=()=>"Discard my edits and reload",xye=()=>"放弃我的编辑并重新加载",wye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Sye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),kye=()=>"Discard unsaved changes and close this file?",Cye=()=>"要丢弃未保存的更改并关闭此文件吗?",Eye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",UE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cye():t==="fa"?Eye():kye()}),Nye=()=>"Dismiss",zye=()=>"关闭",jye=()=>"بستن",Tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss compile message",Rye=()=>"关闭编译消息",Mye=()=>"بستن پیام کامپایل",Dye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Dismiss Overleaf message",Oye=()=>"关闭 Overleaf 消息",Iye=()=>"بستن پیام Overleaf",Bye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),$ye=()=>"Download",Pye=()=>"下载",Fye=()=>"بارگیری",DD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pye():t==="fa"?Fye():$ye()}),Hye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,qye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Uye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Gye=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qye(e):t==="fa"?Uye(e):Hye(e)}),Wye=()=>"Failed to load file:",Vye=()=>"加载文件失败:",Kye=()=>"بارگیری فایل ناموفق بود:",GE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vye():t==="fa"?Kye():Wye()}),Qye=()=>"File truncated — showing the first 512 KB.",Yye=()=>"文件已截断——仅显示前 512 KB。",Xye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Zye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=()=>"The page below stops partway — the full file could not be loaded.",exe=()=>"下方页面在中途结束——无法加载完整文件。",txe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",nxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?exe():t==="fa"?txe():Jye()}),rxe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,sxe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ixe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,axe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sxe(e):t==="fa"?ixe(e):rxe(e)}),oxe=()=>"Loading…",lxe=()=>"正在加载…",cxe=()=>"در حال بارگیری…",LD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lxe():t==="fa"?cxe():oxe()}),uxe=()=>"File not found.",dxe=()=>"找不到文件。",fxe=()=>"فایل پیدا نشد.",hxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dxe():t==="fa"?fxe():uxe()}),_xe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pxe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mxe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pxe(e):t==="fa"?mxe(e):_xe(e)}),vxe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,bxe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,yxe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,xxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bxe(e):t==="fa"?yxe(e):vxe(e)}),wxe=()=>"File not found on disk.",Sxe=()=>"磁盘上找不到此文件。",kxe=()=>"فایل روی دیسک پیدا نشد.",Cxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Nxe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,zxe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,jxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nxe(e):t==="fa"?zxe(e):Exe(e)}),Txe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Axe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Rxe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Mxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Axe(e):t==="fa"?Rxe(e):Txe(e)}),Dxe=()=>"Open in default editor",Lxe=()=>"在默认编辑器中打开",Oxe=()=>"باز کردن در ویرایشگر پیش‌فرض",WE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Ixe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Bxe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",$xe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Pxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Fxe=()=>"Overwrite disk file",Hxe=()=>"覆盖磁盘文件",qxe=()=>"بازنویسی فایل روی دیسک",Uxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hxe():t==="fa"?qxe():Fxe()}),Gxe=()=>"Compiled PDF is out of date",Wxe=()=>"已编译的 PDF 不是最新版本",Vxe=()=>"PDF کامپایل‌شده به‌روز نیست",Kxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wxe():t==="fa"?Vxe():Gxe()}),Qxe=()=>"project clone",Yxe=()=>"项目克隆",Xxe=()=>"کلون پروژه",zg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yxe():t==="fa"?Xxe():Qxe()}),Zxe=()=>"Recompile PDF",Jxe=()=>"重新编译 PDF",e2e=()=>"کامپایل دوبارهٔ PDF",VE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jxe():t==="fa"?e2e():Zxe()}),t2e=()=>"Reload from disk",n2e=()=>"从磁盘重新加载",r2e=()=>"بارگذاری مجدد از دیسک",s2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Save failed",a2e=()=>"保存失败",o2e=()=>"ذخیره ناموفق بود",l2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Saving…",u2e=()=>"正在保存…",d2e=()=>"در حال ذخیره…",f2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Selected — press ⌘C",_2e=()=>"已选中 — 按 ⌘C 复制",p2e=()=>"انتخاب شد — برای کپی ⌘C را بزنید",m2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"session’s worktree",v2e=()=>"会话工作树",b2e=()=>"درخت کاری نشست",jg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v2e():t==="fa"?b2e():g2e()}),y2e=()=>"Show compiled PDF",x2e=()=>"显示已编译的 PDF",w2e=()=>"نمایش PDF کامپایل‌شده",KE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x2e():t==="fa"?w2e():y2e()}),S2e=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",k2e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",C2e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",E2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"This session's worktree isn't available — showing the project clone's copy.",z2e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",j2e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",T2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z2e():t==="fa"?j2e():N2e()}),A2e=()=>"Unsaved",R2e=()=>"未保存",M2e=()=>"ذخیره نشده",OD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R2e():t==="fa"?M2e():A2e()}),D2e=()=>"Unsaved — ⌘S to save",L2e=()=>"未保存 — 按 ⌘S 保存",O2e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",I2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L2e():t==="fa"?O2e():D2e()}),B2e=()=>"Update orx on the remote machine to edit this file safely.",$2e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",P2e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",F2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$2e():t==="fa"?P2e():B2e()}),H2e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",q2e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",U2e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",G2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q2e():t==="fa"?U2e():H2e()}),W2e=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",V2e=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",K2e=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Q2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V2e():t==="fa"?K2e():W2e()}),Y2e=()=>"Back to preview",X2e=()=>"返回预览",Z2e=()=>"بازگشت به پیش‌نمایش",J2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),ewe=e=>`${e==null?void 0:e.count} changed files`,twe=e=>`${e==null?void 0:e.count} 个已更改文件`,nwe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,ID=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?twe(e):t==="fa"?nwe(e):ewe(e)}),rwe=()=>"Changed files",swe=()=>"已更改文件",iwe=()=>"فایل‌های تغییرکرده",awe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Diff preview truncated",lwe=()=>"差异预览已截断",cwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),dwe=e=>`${e==null?void 0:e.count} files shown (partial)`,fwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,_we=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fwe(e):t==="fa"?hwe(e):dwe(e)}),pwe=()=>"No changes.",mwe=()=>"没有更改。",gwe=()=>"تغییری وجود ندارد.",vwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No complete file preview was available before the cutoff.",ywe=()=>"在截断位置之前没有完整的文件预览。",xwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",wwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"No textual diff for this file.",kwe=()=>"此文件没有文本差异。",Cwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Ewe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"1 changed file",zwe=()=>"1 个已更改文件",jwe=()=>"۱ فایل تغییرکرده",BD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zwe():t==="fa"?jwe():Nwe()}),Twe=()=>"1 file shown (partial)",Awe=()=>"显示 1 个文件(部分)",Rwe=()=>"۱ فایل نمایش داده شده (ناقص)",Mwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=()=>"Unable to parse this diff.",Lwe=()=>"无法解析此差异。",Owe=()=>"خواندن این تفاوت ممکن نبود.",Iwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lwe():t==="fa"?Owe():Dwe()}),Bwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$we=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Pwe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Fwe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$we(e):t==="fa"?Pwe(e):Bwe(e)}),Hwe=()=>"View full diff",qwe=()=>"查看完整差异",Uwe=()=>"نمایش تفاوت کامل",Gwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"Create a token ↗",Vwe=()=>"创建令牌 ↗",Kwe=()=>"ساخت توکن ↗",Qwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Ywe=()=>"All projects",Xwe=()=>"所有项目",Zwe=()=>"همهٔ پروژه‌ها",QE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xwe():t==="fa"?Zwe():Ywe()}),Jwe=()=>"Configure Repository",e4e=()=>"配置仓库",t4e=()=>"پیکربندی مخزن",n4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Create a new project",s4e=()=>"新建项目",i4e=()=>"ایجاد پروژهٔ جدید",a4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"Hide sidebar",l4e=()=>"隐藏侧边栏",c4e=()=>"پنهان کردن نوار کناری",YE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),u4e=()=>"Project",d4e=()=>"项目",f4e=()=>"پروژه",h4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d4e():t==="fa"?f4e():u4e()}),_4e=e=>`${e==null?void 0:e.count} cancelled`,p4e=e=>`${e==null?void 0:e.count} 次取消`,m4e=e=>`${e==null?void 0:e.count} لغوشده`,g4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} done`,b4e=e=>`${e==null?void 0:e.count} 次完成`,y4e=e=>`${e==null?void 0:e.count} تمام‌شده`,x4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} failed`,S4e=e=>`${e==null?void 0:e.count} 次失败`,k4e=e=>`${e==null?void 0:e.count} ناموفق`,C4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count} files`,N4e=e=>`${e==null?void 0:e.count} 个文件`,z4e=e=>`${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count}+ files`,A4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,R4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,M4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=e=>`${e==null?void 0:e.count} live`,L4e=e=>`${e==null?void 0:e.count} 次进行中`,O4e=e=>`${e==null?void 0:e.count} فعال`,I4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L4e(e):t==="fa"?O4e(e):D4e(e)}),B4e=()=>"1 file",$4e=()=>"1 个文件",P4e=()=>"۱ فایل",F4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=()=>"1 run",q4e=()=>"1 次运行",U4e=()=>"۱ اجرا",G4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q4e():t==="fa"?U4e():H4e()}),W4e=e=>`${e==null?void 0:e.count} runs`,V4e=e=>`${e==null?void 0:e.count} 次运行`,K4e=e=>`${e==null?void 0:e.count} اجرا`,Q4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V4e(e):t==="fa"?K4e(e):W4e(e)}),Y4e=()=>"No instances yet.",X4e=()=>"还没有实例。",Z4e=()=>"هنوز نمونه‌ای وجود ندارد.",J4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Nothing running right now.",t3e=()=>"当前没有运行中的实例。",n3e=()=>"اکنون چیزی در حال اجرا نیست.",r3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its history.",i3e=()=>"请选择一个项目以查看其历史记录。",a3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"Select a project to see its runs.",c3e=()=>"请选择一个项目以查看其运行。",u3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",d3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=()=>"View history",h3e=()=>"查看历史记录",_3e=()=>"مشاهدهٔ تاریخچه",p3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h3e():t==="fa"?_3e():f3e()}),m3e=e=>`View history (${e==null?void 0:e.count})`,g3e=e=>`查看历史记录(${e==null?void 0:e.count})`,v3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,b3e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?g3e(e):t==="fa"?v3e(e):m3e(e)}),y3e=()=>"The engine exited without producing a PDF or a log.",x3e=()=>"引擎已退出,但没有生成 PDF 或日志。",w3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",S3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Loading…",C3e=()=>"正在加载…",E3e=()=>"در حال بارگیری…",N3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),z3e=()=>"Add local model",j3e=()=>"添加本地模型",T3e=()=>"افزودن مدل محلی",$D=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?j3e():t==="fa"?T3e():z3e()}),A3e=()=>"Local server address",R3e=()=>"本地服务器地址",M3e=()=>"نشانی سرور محلی",D3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"Find models",O3e=()=>"查找模型",I3e=()=>"یافتن مدل‌ها",B3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),$3e=()=>"(OpenAI compatible)",P3e=()=>"(兼容 OpenAI)",F3e=()=>"(سازگار با OpenAI)",PD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P3e():t==="fa"?F3e():$3e()}),H3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",q3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",U3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",G3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Connected",V3e=()=>"已连接",K3e=()=>"متصل شد",Q3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Context window",X3e=()=>"上下文窗口",Z3e=()=>"پنجرهٔ زمینه",J3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",t5e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",n5e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",r5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),s5e=()=>"Custom Endpoint",i5e=()=>"自定义端点",a5e=()=>"نقطهٔ اتصال سفارشی",r6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),o5e=e=>`Disconnect ${e==null?void 0:e.name}`,l5e=e=>`断开 ${e==null?void 0:e.name}`,c5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,u5e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?l5e(e):t==="fa"?c5e(e):o5e(e)}),d5e=()=>"Get OpenCode",f5e=()=>"获取 OpenCode",h5e=()=>"دریافت OpenCode",_5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",m5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",g5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",v5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"API key (optional)",y5e=()=>"API 密钥(可选)",x5e=()=>"کلید API (اختیاری)",w5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Save model",k5e=()=>"保存模型",C5e=()=>"ذخیرهٔ مدل",E5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Model server",z5e=()=>"模型服务器",j5e=()=>"سرور مدل",XE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Local models",A5e=()=>"本地模型",R5e=()=>"مدل‌های محلی",ZE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A5e():t==="fa"?R5e():T5e()}),M5e=()=>"API token (optional)",D5e=()=>"API 令牌(可选)",L5e=()=>"توکن API (اختیاری)",O5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),I5e=()=>"Copy",B5e=()=>"复制",$5e=()=>"کپی",s6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B5e():t==="fa"?$5e():I5e()}),P5e=()=>"Copy code",F5e=()=>"复制代码",H5e=()=>"کپی کد",q5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),U5e=()=>"Download",G5e=()=>"下载",W5e=()=>"بارگیری",FD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G5e():t==="fa"?W5e():U5e()}),V5e=()=>"This browser can’t preview this media format.",K5e=()=>"此浏览器无法预览该媒体格式。",Q5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Y5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>"Add Local Model",Z5e=()=>"添加本地模型",J5e=()=>"افزودن مدل محلی",e6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),t6e=()=>" · CLI configuration",n6e=()=>" · CLI 配置",r6e=()=>" · پیکربندی CLI",HD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),s6e=()=>"· Default",i6e=()=>"· 默认",a6e=()=>"· پیش‌فرض",qD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i6e():t==="fa"?a6e():s6e()}),o6e=()=>"Default model",l6e=()=>"默认模型",c6e=()=>"مدل پیش‌فرض",JE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l6e():t==="fa"?c6e():o6e()}),u6e=()=>"Detecting harnesses…",d6e=()=>"正在检测智能体工具…",f6e=()=>"در حال شناسایی ابزارهای عامل…",h6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Effort",p6e=()=>"推理强度",m6e=()=>"میزان استدلال",g6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Fast speed ·",b6e=()=>"快速 ·",y6e=()=>"سرعت بالا ·",x6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),w6e=()=>"Mode",S6e=()=>"模式",k6e=()=>"حالت",eN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),C6e=()=>"Model",E6e=()=>"模型",N6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E6e():t==="fa"?N6e():C6e()}),z6e=e=>`${e==null?void 0:e.count} more — search to find`,j6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,T6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,A6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?j6e(e):t==="fa"?T6e(e):z6e(e)}),R6e=()=>"Not available",M6e=()=>"不可用",D6e=()=>"در دسترس نیست",L6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),O6e=()=>"Search models…",I6e=()=>"搜索模型…",B6e=()=>"جست‌وجوی مدل‌ها…",UD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Sessions keep their harness. Start a new chat to switch.",P6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",F6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",H6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),q6e=()=>"Speed",U6e=()=>"速度",G6e=()=>"سرعت",tN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?U6e():t==="fa"?G6e():q6e()}),W6e=()=>"Unavailable",V6e=()=>"不可用",K6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V6e():t==="fa"?K6e():W6e()}),Q6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Y6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,X6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Z6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Y6e(e):t==="fa"?X6e(e):Q6e(e)}),J6e=()=>"Variant",eSe=()=>"变体",tSe=()=>"گونه",nSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced",sSe=()=>"高级",iSe=()=>"پیشرفته",aSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · Connect GitHub",lSe=()=>"高级 · 连接 GitHub",cSe=()=>"پیشرفته · اتصال GitHub",uSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Advanced · GitHub sync on",fSe=()=>"高级 · GitHub 同步已开启",hSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",_Se=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",mSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",gSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",vSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mSe():t==="fa"?gSe():pSe()}),bSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,ySe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,xSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,wSe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ySe(e):t==="fa"?xSe(e):bSe(e)}),SSe=()=>"Choose an existing project folder",kSe=()=>"选择现有项目文件夹",CSe=()=>"انتخاب پوشهٔ موجود پروژه",nN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kSe():t==="fa"?CSe():SSe()}),ESe=()=>"Choosing…",NSe=()=>"正在选择…",zSe=()=>"در حال انتخاب…",jSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone destination",ASe=()=>"克隆位置",RSe=()=>"مقصد کلون",MSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Clone paper project",LSe=()=>"克隆论文项目",OSe=()=>"کلون پروژهٔ مقاله",ISe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),BSe=()=>"Create project",$Se=()=>"创建项目",PSe=()=>"ایجاد پروژه",rN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Creating…",HSe=()=>"正在创建…",qSe=()=>"در حال ایجاد…",USe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),GSe=()=>"Choose a different destination. This path is a file, not a folder.",WSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",VSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",S2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WSe():t==="fa"?VSe():GSe()}),KSe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",QSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",YSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",sN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QSe():t==="fa"?YSe():KSe()}),XSe=()=>"Auto-apply repository topics",ZSe=()=>"自动添加仓库 topic",JSe=()=>"اعمال خودکار موضوع‌های مخزن",eke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.",nke=()=>"自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",rke=()=>"موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",ske=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Blank project",ake=()=>"空白项目",oke=()=>"پروژهٔ خالی",lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Cancel",uke=()=>"取消",dke=()=>"لغو",fke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Change",_ke=()=>"更改",pke=()=>"تغییر",mke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Change selected paper",vke=()=>"更改所选论文",bke=()=>"تغییر مقالهٔ انتخاب‌شده",yke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vke():t==="fa"?bke():gke()}),xke=()=>"Check out a Git branch before using this folder.",wke=()=>"使用此文件夹前,请先检出一个 Git 分支。",Ske=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",kke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wke():t==="fa"?Ske():xke()}),Cke=()=>"Checking project location.",Eke=()=>"正在检查项目位置。",Nke=()=>"در حال بررسی محل پروژه.",iN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),zke=()=>"Existing folder",jke=()=>"现有文件夹",Tke=()=>"پوشهٔ موجود",Ake=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"Experiment branches will be pushed to the remote GitHub repository.",Mke=()=>"实验分支将推送到远程 GitHub 仓库。",Dke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Oke=()=>"Extra topics (comma-separated), e.g. llm, benchmark",Ike=()=>"附加 topic(逗号分隔),例如 llm, benchmark",Bke=()=>"موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark",GD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),$ke=()=>"From a paper",Pke=()=>"从论文创建",Fke=()=>"از یک مقاله",Hke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Uke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Gke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Wke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"my-research",Kke=()=>"my-research",Qke=()=>"my-research",aN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Yke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Xke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Zke=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Jke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xke():t==="fa"?Zke():Yke()}),e7e=()=>"No public repository found on alphaXiv",t7e=()=>"在 alphaXiv 上未找到公开仓库",n7e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",r7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),s7e=()=>"OpenResearch will start a blank project with this paper's PDF.",i7e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",a7e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",o7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i7e():t==="fa"?a7e():s7e()}),l7e=()=>"Paper",c7e=()=>"论文",u7e=()=>"مقاله",d7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c7e():t==="fa"?u7e():l7e()}),f7e=()=>"Project location",h7e=()=>"项目位置",_7e=()=>"محل پروژه",k2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h7e():t==="fa"?_7e():f7e()}),p7e=()=>"Project name",m7e=()=>"项目名称",g7e=()=>"نام پروژه",oN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),v7e=()=>"Search for a paper by arXiv ID, URL, or title",b7e=()=>"按 arXiv ID、网址或标题搜索论文",y7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",x7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b7e():t==="fa"?y7e():v7e()}),w7e=()=>"Sync experiments to GitHub",S7e=()=>"将实验同步到 GitHub",k7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",C7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"That folder no longer exists. Choose it again.",N7e=()=>"该文件夹已不存在。请重新选择。",z7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",j7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),T7e=()=>"The selected folder contains an invalid Git repository.",A7e=()=>"所选文件夹包含无效的 Git 仓库。",R7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",M7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A7e():t==="fa"?R7e():T7e()}),D7e=()=>"The selected path is not a folder.",L7e=()=>"所选路径不是文件夹。",O7e=()=>"مسیر انتخاب‌شده پوشه نیست.",I7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L7e():t==="fa"?O7e():D7e()}),B7e=e=>`Checking ${e==null?void 0:e.repository}.`,$7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,P7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,F7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$7e(e):t==="fa"?P7e(e):B7e(e)}),H7e=e=>`Creates ${e==null?void 0:e.repository}.`,q7e=e=>`将创建 ${e==null?void 0:e.repository}。`,U7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,G7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?q7e(e):t==="fa"?U7e(e):H7e(e)}),W7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,V7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,K7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Q7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V7e(e):t==="fa"?K7e(e):W7e(e)}),Y7e=()=>"Project location is required.",X7e=()=>"必须填写项目位置。",Z7e=()=>"محل پروژه الزامی است.",lN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),J7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",eCe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",tCe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",cN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eCe():t==="fa"?tCe():J7e()}),nCe=()=>"A linked public code repository is cloned without credentials.",rCe=()=>"关联的公开代码仓库无需凭据即可克隆。",sCe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",iCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,oCe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,lCe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,cCe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oCe(e):t==="fa"?lCe(e):aCe(e)}),uCe=()=>"Searching alphaXiv…",dCe=()=>"正在搜索 alphaXiv…",fCe=()=>"در حال جست‌وجوی alphaXiv…",hCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Use folder",pCe=()=>"使用文件夹",mCe=()=>"استفاده از پوشه",gCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Can’t reach OpenResearch. This page is no longer live.",bCe=()=>"无法连接 OpenResearch。此页面已不再实时同步。",yCe=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",N4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"A workspace for your research agents",wCe=()=>"面向研究智能体的工作空间",SCe=()=>"فضای کاری برای عامل‌های پژوهشی شما",kCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Add papers that represent your research interests, including papers by other authors.",ECe=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",NCe=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",zCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"API key",TCe=()=>"API 密钥",ACe=()=>"کلید API",i6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),RCe=()=>"AI/ML",MCe=()=>"人工智能与机器学习",DCe=()=>"هوش مصنوعی و یادگیری ماشین",LCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MCe():t==="fa"?DCe():RCe()}),OCe=()=>"Biology",ICe=()=>"生物学",BCe=()=>"زیست‌شناسی",$Ce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),PCe=()=>"Other",FCe=()=>"其他",HCe=()=>"سایر",qCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FCe():t==="fa"?HCe():PCe()}),UCe=()=>"Physics",GCe=()=>"物理学",WCe=()=>"فیزیک",VCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GCe():t==="fa"?WCe():UCe()}),KCe=()=>"Back",QCe=()=>"返回",YCe=()=>"بازگشت",uN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QCe():t==="fa"?YCe():KCe()}),XCe=()=>"Check failed",ZCe=()=>"检查失败",JCe=()=>"بررسی ناموفق بود",e8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZCe():t==="fa"?JCe():XCe()}),t8e=()=>"Checking",n8e=()=>"正在检查",r8e=()=>"در حال بررسی",s8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"Checking Git…",a8e=()=>"正在检查 Git…",o8e=()=>"در حال بررسی Git…",l8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Choose a coding agent",u8e=()=>"选择编程智能体",d8e=()=>"یک عامل کدنویسی انتخاب کنید",f8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Choose a coding agent to continue.",_8e=()=>"选择一个编程智能体以继续。",p8e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",m8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Choose at least one research area to continue.",v8e=()=>"请至少选择一个研究领域后再继续。",b8e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",y8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Choose one or more.",w8e=()=>"请选择一项或多项。",S8e=()=>"یک یا چند مورد را انتخاب کنید.",k8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Choose your preferred coding agent",E8e=()=>"请选择首选编程智能体",N8e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",z8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Consolidate your research",T8e=()=>"集中管理研究",A8e=()=>"پژوهش خود را یکپارچه کنید",R8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Continue",D8e=()=>"继续",L8e=()=>"ادامه",dN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Describe your research area to continue.",I8e=()=>"请描述你的研究领域后再继续。",B8e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",$8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",F8e=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",H8e=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",q8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G8e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",W8e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",V8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Everything stays local",Q8e=()=>"一切都保留在本地",Y8e=()=>"همه‌چیز محلی می‌ماند",X8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Get started",J8e=()=>"开始使用",e9e=()=>"شروع",t9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J8e():t==="fa"?e9e():Z8e()}),n9e=()=>"Git is required for local experiments. Install Git, then re-check.",r9e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",s9e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",i9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Ground your agents",o9e=()=>"为智能体提供可靠依据",l9e=()=>"عامل‌هایتان را به منابع متصل کنید",c9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),u9e=()=>"Install broken",d9e=()=>"安装损坏",f9e=()=>"نصب خراب است",h9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d9e():t==="fa"?f9e():u9e()}),_9e=()=>"Install Git to continue",p9e=()=>"请安装 Git 后再继续",m9e=()=>"برای ادامه Git را نصب کنید",g9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p9e():t==="fa"?m9e():_9e()}),v9e=()=>"Local Git",b9e=()=>"本地 Git",y9e=()=>"Git محلی",x9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b9e():t==="fa"?y9e():v9e()}),w9e=()=>", and ",S9e=()=>" 和 ",k9e=()=>" و ",C9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Compatible with",N9e=()=>"兼容",z9e=()=>"سازگار با",j9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),T9e=()=>"Use your own local models",A9e=()=>"使用你自己的本地模型",R9e=()=>"از مدل‌های محلی خود استفاده کنید",M9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),D9e=()=>"Not detected",L9e=()=>"未检测到",O9e=()=>"شناسایی نشد",fN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),I9e=()=>"Not found",B9e=()=>"未找到",$9e=()=>"پیدا نشد",WD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Not signed in",F9e=()=>"未登录",H9e=()=>"وارد نشده",q9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),U9e=()=>"OpenResearch uses a coding agent already installed on this machine.",G9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",W9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",V9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G9e():t==="fa"?W9e():U9e()}),K9e=()=>"Other research area",Q9e=()=>"其他研究领域",Y9e=()=>"حوزهٔ پژوهشی دیگر",X9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q9e():t==="fa"?Y9e():K9e()}),Z9e=()=>"Re-check",J9e=()=>"重新检查",eEe=()=>"بررسی دوباره",VD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J9e():t==="fa"?eEe():Z9e()}),tEe=()=>"Ready",nEe=()=>"已就绪",rEe=()=>"آماده",a6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Re-check Git before continuing",iEe=()=>"请重新检查 Git 后再继续",aEe=()=>"پیش از ادامه Git را دوباره بررسی کنید",oEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Representative papers",cEe=()=>"代表性论文",uEe=()=>"مقاله‌های شاخص",dEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Research background",hEe=()=>"研究背景",_Ee=()=>"پیشینهٔ پژوهشی",pEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",vEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",hN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Search alphaXiv by title to link a paper…",yEe=()=>"按标题搜索 alphaXiv 以关联论文…",xEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Searching alphaXiv…",kEe=()=>"正在搜索 alphaXiv…",CEe=()=>"در حال جست‌وجوی alphaXiv…",EEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Selected",zEe=()=>"已选择",jEe=()=>"انتخاب‌شده",TEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Local model unavailable",REe=()=>"本地模型不可用",MEe=()=>"مدل محلی در دسترس نیست",KD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),DEe=()=>"Setting things up…",LEe=()=>"正在设置…",OEe=()=>"در حال راه‌اندازی…",IEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LEe():t==="fa"?OEe():DEe()}),BEe=()=>"Connect a local model or sign in to a coding agent to continue",$Ee=()=>"连接本地模型或登录编码智能体以继续",PEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",FEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ee():t==="fa"?PEe():BEe()}),HEe=()=>"Connect a local model or sign in to an agent to continue.",qEe=()=>"连接本地模型或登录一个智能体以继续。",UEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",GEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qEe():t==="fa"?UEe():HEe()}),WEe=()=>"Signed in",VEe=()=>"已登录",KEe=()=>"وارد شده",QEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VEe():t==="fa"?KEe():WEe()}),YEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",XEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",ZEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",JEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XEe():t==="fa"?ZEe():YEe()}),eNe=()=>"· Step 1 of 2",tNe=()=>"· 第 1 步,共 2 步",nNe=()=>"· مرحلهٔ ۱ از ۲",rNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tNe():t==="fa"?nNe():eNe()}),sNe=()=>"· Step 2 of 2",iNe=()=>"· 第 2 步,共 2 步",aNe=()=>"· مرحلهٔ ۲ از ۲",oNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Tell us about your research",cNe=()=>"介绍一下你的研究",uNe=()=>"از پژوهش خود بگویید",dNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),fNe=()=>"Tell us your other research area",hNe=()=>"告诉我们你的其他研究领域",_Ne=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",pNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hNe():t==="fa"?_Ne():fNe()}),mNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",gNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",vNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",bNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gNe():t==="fa"?vNe():mNe()}),yNe=()=>"Unable to verify",xNe=()=>"无法验证",wNe=()=>"تأیید ممکن نیست",SNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xNe():t==="fa"?wNe():yNe()}),kNe=()=>"Update required",CNe=()=>"需要更新",ENe=()=>"نیازمند به‌روزرسانی",NNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Waiting for the Git check",jNe=()=>"正在等待 Git 检查",TNe=()=>"در انتظار بررسی Git",ANe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jNe():t==="fa"?TNe():zNe()}),RNe=()=>"Waiting for the local tool checks",MNe=()=>"正在等待本地工具检查",DNe=()=>"در انتظار بررسی ابزارهای محلی",LNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MNe():t==="fa"?DNe():RNe()}),ONe=()=>"What areas are you interested in?",INe=()=>"你对哪些领域感兴趣?",BNe=()=>"به چه حوزه‌هایی علاقه دارید؟",$Ne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),PNe=()=>"Your code, data, and experiment history stay on your machine.",FNe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",HNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",qNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FNe():t==="fa"?HNe():PNe()}),UNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",GNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",WNe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",VNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GNe():t==="fa"?WNe():UNe()}),KNe=()=>"Add cookie",QNe=()=>"添加 cookie",YNe=()=>"افزودن کوکی",XNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Changed here and on Overleaf — choose which copy to keep",JNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",eze=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",tze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"Create a token ↗",rze=()=>"创建令牌 ↗",sze=()=>"ساخت توکن ↗",ize=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),aze=()=>"Overleaf Git token",oze=()=>"Overleaf Git 令牌",lze=()=>"توکن Git در Overleaf",_N=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oze():t==="fa"?lze():aze()}),cze=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",uze=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",dze=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",fze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Import from browser",_ze=()=>"从浏览器导入",pze=()=>"وارد کردن از مرورگر",mze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"In step with Overleaf",vze=()=>"已与 Overleaf 同步",bze=()=>"با Overleaf همگام است",QD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),yze=()=>"The last sync did not finish.",xze=()=>"上次同步未完成。",wze=()=>"آخرین همگام‌سازی کامل نشد.",Sze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xze():t==="fa"?wze():yze()}),kze=()=>"Link and sync",Cze=()=>"关联并同步",Eze=()=>"پیوند و همگام‌سازی",Nze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"Connecting to Overleaf…",jze=()=>"正在连接 Overleaf…",Tze=()=>"در حال اتصال به Overleaf…",Aze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Edits are live on Overleaf",Mze=()=>"编辑已在 Overleaf 实时同步",Dze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Lze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mze():t==="fa"?Dze():Rze()}),Oze=()=>"Retry",Ize=()=>"重试",Bze=()=>"تلاش دوباره",$ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Live sync stopped.",Fze=()=>"实时同步已停止。",Hze=()=>"همگام‌سازی زنده متوقف شد.",qze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Live sync starts once the paper is in step with Overleaf.",Gze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Wze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Vze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Kze=()=>"My projects ↗",Qze=()=>"我的项目 ↗",Yze=()=>"پروژه‌های من ↗",pN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qze():t==="fa"?Yze():Kze()}),Xze=()=>"Nothing could be synced.",Zze=()=>"没有内容可以同步。",Jze=()=>"هیچ موردی قابل همگام‌سازی نبود.",eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open Overleaf ↗",nje=()=>"打开 Overleaf ↗",rje=()=>"باز کردن Overleaf ↗",sje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Cancel",aje=()=>"取消",oje=()=>"لغو",YD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",cje=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",uje=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",dje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Keep this copy",hje=()=>"保留此副本",_je=()=>"نگه داشتن این نسخه",pje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Open in Overleaf",gje=()=>"在 Overleaf 中打开",vje=()=>"باز کردن در Overleaf",bje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),yje=()=>"Replace the Overleaf token",xje=()=>"替换 Overleaf 令牌",wje=()=>"جایگزینی توکن Overleaf",mN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xje():t==="fa"?wje():yje()}),Sje=()=>"Sync files",kje=()=>"同步文件",Cje=()=>"همگام‌سازی فایل‌ها",Eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Unlink",zje=()=>"取消关联",jje=()=>"قطع پیوند",Tje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=()=>"Upload a copy as a new project ↗",Rje=()=>"上传副本作为新项目 ↗",Mje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",XD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rje():t==="fa"?Mje():Aje()}),Dje=()=>"Use Overleaf's",Lje=()=>"使用 Overleaf 的副本",Oje=()=>"استفاده از نسخهٔ Overleaf",Ije=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"This paper stays in step with Overleaf.",$je=()=>"此论文将与 Overleaf 保持同步。",Pje=()=>"این مقاله با Overleaf همگام می‌ماند.",Fje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$je():t==="fa"?Pje():Bje()}),Hje=()=>"Paste it instead",qje=()=>"改为粘贴",Uje=()=>"به‌جایش بچسبانید",Gje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qje():t==="fa"?Uje():Hje()}),Wje=e=>`Pulled ${e==null?void 0:e.paths}.`,Vje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Kje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Qje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vje(e):t==="fa"?Kje(e):Wje(e)}),Yje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Xje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Zje=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Jje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),eTe=e=>`Pushed ${e==null?void 0:e.paths}.`,tTe=e=>`已推送 ${e==null?void 0:e.paths}。`,nTe=e=>`${e==null?void 0:e.paths} ارسال شد.`,rTe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tTe(e):t==="fa"?nTe(e):eTe(e)}),sTe=()=>"Add a fresh Overleaf session cookie to start following again.",iTe=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",aTe=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",oTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Save the file first",cTe=()=>"请先保存文件",uTe=()=>"ابتدا فایل را ذخیره کنید",dTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),fTe=()=>"Save this file to sync it with Overleaf",hTe=()=>"保存此文件以与 Overleaf 同步",_Te=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",ZD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),pTe=()=>"Save token",mTe=()=>"保存令牌",gTe=()=>"ذخیرهٔ توکن",vTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),bTe=()=>"Send this paper to Overleaf",yTe=()=>"将此论文发送到 Overleaf",xTe=()=>"ارسال مقاله به Overleaf",wTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yTe():t==="fa"?xTe():bTe()}),STe=()=>"Overleaf session cookie",kTe=()=>"Overleaf 会话 cookie",CTe=()=>"کوکی نشست Overleaf",z4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kTe():t==="fa"?CTe():STe()}),ETe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",NTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",zTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",jTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=()=>"Overleaf sync failed",ATe=()=>"Overleaf 同步失败",RTe=()=>"همگام‌سازی با Overleaf ناموفق بود",j4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ATe():t==="fa"?RTe():TTe()}),MTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",DTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",LTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",OTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Syncing with Overleaf…",BTe=()=>"正在与 Overleaf 同步…",$Te=()=>"در حال همگام‌سازی با Overleaf…",JD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),PTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",FTe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",HTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",qTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FTe():t==="fa"?HTe():PTe()}),UTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",GTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",WTe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",VTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GTe():t==="fa"?WTe():UTe()}),KTe=()=>"Toggle Plan mode for this chat",QTe=()=>"切换此聊天的计划模式",YTe=()=>"تغییر حالت طرح این گفت‌وگو",XTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QTe():t==="fa"?YTe():KTe()}),ZTe=()=>"Accept and auto mode",JTe=()=>"接受并使用自动模式",eAe=()=>"پذیرش و حالت خودکار",tAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JTe():t==="fa"?eAe():ZTe()}),nAe=()=>"Accept and bypass all",rAe=()=>"接受并跳过所有审批",sAe=()=>"پذیرش و عبور از همهٔ تأییدها",iAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rAe():t==="fa"?sAe():nAe()}),aAe=()=>"Accept plan",oAe=()=>"接受计划",lAe=()=>"پذیرش طرح",cAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oAe():t==="fa"?lAe():aAe()}),uAe=e=>`${e==null?void 0:e.agent} proposed a plan`,dAe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,fAe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,hAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dAe(e):t==="fa"?fAe(e):uAe(e)}),_Ae=e=>`${e==null?void 0:e.agent} is ready to proceed`,pAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,mAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,gAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pAe(e):t==="fa"?mAe(e):_Ae(e)}),vAe=()=>"Back",bAe=()=>"返回",yAe=()=>"بازگشت",xAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bAe():t==="fa"?yAe():vAe()}),wAe=()=>"More approval options",SAe=()=>"更多批准选项",kAe=()=>"گزینه‌های تأیید بیشتر",CAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Open plan",NAe=()=>"打开计划",zAe=()=>"باز کردن طرح",jAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),TAe=()=>"Reject",AAe=()=>"拒绝",RAe=()=>"رد کردن",MAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),DAe=()=>"Revise",LAe=()=>"修改",OAe=()=>"بازنگری",IAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LAe():t==="fa"?OAe():DAe()}),BAe=()=>"Revise…",$Ae=()=>"修改…",PAe=()=>"بازنگری…",FAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ae():t==="fa"?PAe():BAe()}),HAe=()=>"What should change? (optional)",qAe=()=>"需要更改什么?(可选)",UAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",GAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qAe():t==="fa"?UAe():HAe()}),WAe=e=>`${e==null?void 0:e.count} active`,VAe=e=>`${e==null?void 0:e.count} 个活跃`,KAe=e=>`${e==null?void 0:e.count} فعال`,QAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?VAe(e):t==="fa"?KAe(e):WAe(e)}),YAe=e=>`${e==null?void 0:e.count} total agents`,XAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,ZAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,JAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?XAe(e):t==="fa"?ZAe(e):YAe(e)}),eRe=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,tRe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,nRe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,rRe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tRe(e):t==="fa"?nRe(e):eRe(e)}),sRe=()=>"Agents",iRe=()=>"智能体",aRe=()=>"عامل‌ها",gN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),oRe=()=>"arXiv paper ID:",lRe=()=>"arXiv 论文 ID:",cRe=()=>"شناسهٔ مقالهٔ arXiv:",uRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Cancel",fRe=()=>"取消",hRe=()=>"لغو",_Re=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),pRe=()=>"Created",mRe=()=>"创建时间",gRe=()=>"ایجادشده",vRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mRe():t==="fa"?gRe():pRe()}),bRe=()=>"Delete project?",yRe=()=>"删除项目?",xRe=()=>"پروژه حذف شود؟",wRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"Delete project",kRe=()=>"删除项目",CRe=()=>"حذف پروژه",ERe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"Deleting…",zRe=()=>"正在删除…",jRe=()=>"در حال حذف…",TRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),ARe=()=>"Experiments",RRe=()=>"实验",MRe=()=>"آزمایش‌ها",vN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RRe():t==="fa"?MRe():ARe()}),DRe=()=>"The local folder and linked GitHub repository are kept.",LRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",ORe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",IRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"The local folder is kept.",$Re=()=>"本地文件夹会保留。",PRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",FRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"New project",qRe=()=>"新建项目",URe=()=>"پروژهٔ جدید",eL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"No projects yet — create one to get started.",WRe=()=>"尚无项目——新建一个即可开始。",VRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",KRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Project",YRe=()=>"项目",XRe=()=>"پروژه",ZRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),JRe=()=>"Projects",eMe=()=>"项目",tMe=()=>"پروژه‌ها",nMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eMe():t==="fa"?tMe():JRe()}),rMe=()=>"Repository",sMe=()=>"仓库",iMe=()=>"مخزن",bN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),aMe=()=>"Idle",oMe=()=>"空闲",lMe=()=>"بیکار",cMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Local",dMe=()=>"本地",fMe=()=>"محلی",o6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dMe():t==="fa"?fMe():uMe()}),hMe=()=>"1 total agent",_Me=()=>"共 1 个智能体",pMe=()=>"در مجموع ۱ عامل",mMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=e=>`${e==null?void 0:e.count} running`,vMe=e=>`${e==null?void 0:e.count} 个运行中`,bMe=e=>`${e==null?void 0:e.count} در حال اجرا`,yMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vMe(e):t==="fa"?bMe(e):gMe(e)}),xMe=e=>`${e==null?void 0:e.count} total`,wMe=e=>`共 ${e==null?void 0:e.count} 个`,SMe=e=>`در مجموع ${e==null?void 0:e.count}`,yN=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wMe(e):t==="fa"?SMe(e):xMe(e)}),kMe=()=>"Installing the compatible binary. This may take a few minutes.",CMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",EMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",NMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),zMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,jMe=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,TMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,AMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jMe(e):t==="fa"?TMe(e):zMe(e)}),RMe=()=>"Check again",MMe=()=>"再次检查",DMe=()=>"بررسی دوباره",xN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MMe():t==="fa"?DMe():RMe()}),LMe=()=>"Closing…",OMe=()=>"正在关闭…",IMe=()=>"در حال بستن…",BMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OMe():t==="fa"?IMe():LMe()}),$Me=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,PMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,FMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,HMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PMe(e):t==="fa"?FMe(e):$Me(e)}),qMe=()=>"Preparing your remote workspace…",UMe=()=>"正在准备远程工作区…",GMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",WMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UMe():t==="fa"?GMe():qMe()}),VMe=e=>`Connecting to ${e==null?void 0:e.host}`,KMe=e=>`正在连接到 ${e==null?void 0:e.host}`,QMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,YMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KMe(e):t==="fa"?QMe(e):VMe(e)}),XMe=()=>"Close remote host picker",ZMe=()=>"关闭远程主机选择器",JMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",eDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZMe():t==="fa"?JMe():XMe()}),tDe=()=>"Choose a configured SSH host.",nDe=()=>"选择已配置的 SSH 主机。",rDe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",sDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nDe():t==="fa"?rDe():tDe()}),iDe=()=>"Connect to remote",aDe=()=>"连接到远程主机",oDe=()=>"اتصال به میزبان راه‌دور",tL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aDe():t==="fa"?oDe():iDe()}),lDe=()=>"Disconnect",cDe=()=>"断开连接",uDe=()=>"قطع اتصال",T4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Your remote work is still running. Reconnect when you’re ready.",fDe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",hDe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",_De=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`Disconnected from ${e==null?void 0:e.host}`,mDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,gDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,nL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),vDe=e=>`Could not connect to ${e==null?void 0:e.host}`,bDe=e=>`无法连接到 ${e==null?void 0:e.host}`,yDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,xDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bDe(e):t==="fa"?yDe(e):vDe(e)}),wDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",SDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",kDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",CDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SDe():t==="fa"?kDe():wDe()}),EDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",NDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",zDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",jDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),TDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ADe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,RDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,MDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ADe(e):t==="fa"?RDe(e):TDe(e)}),DDe=()=>"OpenResearch binary",LDe=()=>"OpenResearch 二进制文件",ODe=()=>"فایل اجرایی OpenResearch",IDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LDe():t==="fa"?ODe():DDe()}),BDe=()=>"OpenResearch Database",$De=()=>"OpenResearch 数据库",PDe=()=>"پایگاه دادهٔ OpenResearch",FDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",qDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",UDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",GDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qDe():t==="fa"?UDe():HDe()}),WDe=()=>"Install OpenResearch?",VDe=()=>"安装 OpenResearch?",KDe=()=>"OpenResearch نصب شود؟",QDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VDe():t==="fa"?KDe():WDe()}),YDe=()=>"Installing…",XDe=()=>"正在安装…",ZDe=()=>"در حال نصب…",JDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),eLe=()=>"No matching SSH hosts",tLe=()=>"没有匹配的 SSH 主机",nLe=()=>"میزبان SSH منطبقی پیدا نشد",rLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iLe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aLe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=()=>"Open remote",cLe=()=>"打开远程工作区",uLe=()=>"باز کردن راه‌دور",dLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),fLe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",hLe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",_Le=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",pLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",gLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",vLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",bLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gLe():t==="fa"?vLe():mLe()}),yLe=()=>"Preparing remote workspace…",xLe=()=>"正在准备远程工作区…",wLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",SLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),kLe=()=>"Reconnect",CLe=()=>"重新连接",ELe=()=>"اتصال دوباره",wN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),NLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",zLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",jLe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",TLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zLe():t==="fa"?jLe():NLe()}),ALe=e=>`Reconnecting to ${e==null?void 0:e.host}`,RLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,MLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,DLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RLe(e):t==="fa"?MLe(e):ALe(e)}),LLe=()=>"Search SSH hosts",OLe=()=>"搜索 SSH 主机",ILe=()=>"جستجوی میزبان‌های SSH",SN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),BLe=e=>`SSH: ${e==null?void 0:e.host}`,$Le=e=>`SSH:${e==null?void 0:e.host}`,PLe=e=>`SSH: ${e==null?void 0:e.host}`,C2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),FLe=()=>"Start a new OpenResearch host",HLe=()=>"启动新的 OpenResearch 主机",qLe=()=>"راه‌اندازی میزبان جدید OpenResearch",ULe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HLe():t==="fa"?qLe():FLe()}),GLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,WLe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,VLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,KLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WLe(e):t==="fa"?VLe(e):GLe(e)}),QLe=()=>"Stop OpenResearch",YLe=()=>"停止 OpenResearch",XLe=()=>"توقف OpenResearch",ZLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,eOe=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,tOe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,nOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eOe(e):t==="fa"?tOe(e):JLe(e)}),rOe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,sOe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,iOe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,aOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sOe(e):t==="fa"?iOe(e):rOe(e)}),oOe=()=>"Stop OpenResearch on host",lOe=()=>"停止主机上的 OpenResearch",cOe=()=>"توقف OpenResearch روی میزبان",rL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>"This will also:",dOe=()=>"这还将:",fOe=()=>"این کار همچنین:",hOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"End 1 pending approval.",pOe=()=>"结束 1 个待审批请求。",mOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",gOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),vOe=()=>"Leave 1 submitted experiment running.",bOe=()=>"让 1 个已提交实验继续运行。",yOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bOe():t==="fa"?yOe():vOe()}),wOe=()=>"Disconnect 1 other client.",SOe=()=>"断开 1 个其他客户端。",kOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",COe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Keep 1 queued message saved.",NOe=()=>"保留 1 条排队消息。",zOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",jOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),TOe=()=>"Interrupt 1 active agent turn.",AOe=()=>"中断 1 个活动代理任务。",ROe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",MOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AOe():t==="fa"?ROe():TOe()}),DOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,LOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,OOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,IOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LOe(e):t==="fa"?OOe(e):DOe(e)}),BOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,$Oe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,POe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,FOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,qOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,UOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,GOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qOe(e):t==="fa"?UOe(e):HOe(e)}),WOe=()=>"Stopping host…",VOe=()=>"正在停止主机…",KOe=()=>"در حال توقف میزبان…",QOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Update",XOe=()=>"更新",ZOe=()=>"به‌روزرسانی",kN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,eIe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,tIe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,nIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eIe(e):t==="fa"?tIe(e):JOe(e)}),rIe=()=>"Update OpenResearch?",sIe=()=>"更新 OpenResearch?",iIe=()=>"OpenResearch به‌روزرسانی شود؟",aIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Updating…",lIe=()=>"正在更新…",cIe=()=>"در حال به‌روزرسانی…",uIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),dIe=()=>"Disable syncing",fIe=()=>"关闭同步",hIe=()=>"غیرفعال کردن همگام‌سازی",_Ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fIe():t==="fa"?hIe():dIe()}),pIe=()=>"Enable GitHub syncing",mIe=()=>"启用 GitHub 同步",gIe=()=>"فعال‌سازی همگام‌سازی GitHub",vIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mIe():t==="fa"?gIe():pIe()}),bIe=()=>"Enabling…",yIe=()=>"正在启用…",xIe=()=>"در حال فعال‌سازی…",wIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yIe():t==="fa"?xIe():bIe()}),SIe=()=>"Updating…",kIe=()=>"正在更新…",CIe=()=>"در حال به‌روزرسانی…",EIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,zIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,jIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,TIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zIe(e):t==="fa"?jIe(e):NIe(e)}),AIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,RIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,MIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,DIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RIe(e):t==="fa"?MIe(e):AIe(e)}),LIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,OIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,IIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,BIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OIe(e):t==="fa"?IIe(e):LIe(e)}),$Ie=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,PIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,FIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,HIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PIe(e):t==="fa"?FIe(e):$Ie(e)}),qIe=()=>"CLI is retrying…",UIe=()=>"CLI 正在重试…",GIe=()=>"CLI در حال تلاش دوباره است…",WIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UIe():t==="fa"?GIe():qIe()}),VIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,KIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,QIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,YIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KIe(e):t==="fa"?QIe(e):VIe(e)}),XIe=()=>"Sending again…",ZIe=()=>"正在重新发送…",JIe=()=>"در حال ارسال دوباره…",eBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,nBe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,rBe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,sBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Retrying…",aBe=()=>"正在重试…",oBe=()=>"در حال تلاش دوباره…",sL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),lBe=()=>"Default speed",cBe=()=>"默认速度",uBe=()=>"سرعت پیش‌فرض",dBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cBe():t==="fa"?uBe():lBe()}),fBe=()=>"Standard",hBe=()=>"标准",_Be=()=>"استاندارد",pBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hBe():t==="fa"?_Be():fBe()}),mBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,gBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,vBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,bBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gBe(e):t==="fa"?vBe(e):mBe(e)}),yBe=()=>"Appearance",xBe=()=>"外观",wBe=()=>"ظاهر",SBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check",CBe=()=>"检查",EBe=()=>"بررسی",NBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"Check again",jBe=()=>"再次检查",TBe=()=>"بررسی دوباره",Qp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),ABe=()=>"Check for updates",RBe=()=>"检查更新",MBe=()=>"بررسی به‌روزرسانی",DBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RBe():t==="fa"?MBe():ABe()}),LBe=()=>"Check now",OBe=()=>"立即检查",IBe=()=>"اکنون بررسی کن",BBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Check setup",PBe=()=>"检查设置",FBe=()=>"بررسی راه‌اندازی",HBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PBe():t==="fa"?FBe():$Be()}),qBe=()=>"orx checks a few times a day on its own.",UBe=()=>"orx 每天会自动检查几次。",GBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",WBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UBe():t==="fa"?GBe():qBe()}),VBe=()=>"Choose a flavor",KBe=()=>"选择配置",QBe=()=>"انتخاب پیکربندی",YBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KBe():t==="fa"?QBe():VBe()}),XBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,ZBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,JBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZBe(e):t==="fa"?JBe(e):XBe(e)}),t$e=()=>"clean",n$e=()=>"无更改",r$e=()=>"بدون تغییر",s$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>`Already linked at ${e==null?void 0:e.link}.`,a$e=e=>`已链接到 ${e==null?void 0:e.link}。`,o$e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=e=>`Linked ${e==null?void 0:e.link}.`,u$e=e=>`已链接 ${e==null?void 0:e.link}。`,d$e=e=>`${e==null?void 0:e.link} پیوند شد.`,f$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u$e(e):t==="fa"?d$e(e):c$e(e)}),h$e=()=>"Connect",_$e=()=>"连接",p$e=()=>"اتصال",l6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_$e():t==="fa"?p$e():h$e()}),m$e=()=>"Connected via GitHub CLI",g$e=()=>"已通过 GitHub CLI 连接",v$e=()=>"از طریق GitHub CLI متصل است",iL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g$e():t==="fa"?v$e():m$e()}),b$e=()=>"Connecting…",y$e=()=>"正在连接…",x$e=()=>"در حال اتصال…",aL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y$e():t==="fa"?x$e():b$e()}),w$e=e=>`CPU cores: ${e==null?void 0:e.count}`,S$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,k$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,C$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S$e(e):t==="fa"?k$e(e):w$e(e)}),E$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",N$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",z$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",j$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"the current project",A$e=()=>"当前项目",R$e=()=>"پروژهٔ فعلی",M$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),D$e=e=>`${e==null?void 0:e.value} (custom)`,L$e=e=>`${e==null?void 0:e.value}(自定义)`,O$e=e=>`${e==null?void 0:e.value} (سفارشی)`,I$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L$e(e):t==="fa"?O$e(e):D$e(e)}),B$e=()=>"detached",$$e=()=>"分离头指针",P$e=()=>"جدا از شاخه",c6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Disconnected",H$e=()=>"已断开连接",q$e=()=>"قطع اتصال",oL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),U$e=()=>"Environment tab",G$e=()=>"环境标签页",W$e=()=>"زبانهٔ محیط",V$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G$e():t==="fa"?W$e():U$e()}),K$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Y$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,X$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Q$e(e):t==="fa"?Y$e(e):K$e(e)}),Z$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",J$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",ePe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",tPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J$e():t==="fa"?ePe():Z$e()}),nPe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",rPe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",sPe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",iPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",oPe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",lPe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",cPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=e=>`GPU × ${e==null?void 0:e.count}`,dPe=e=>`${e==null?void 0:e.count} 个 GPU`,fPe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,hPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dPe(e):t==="fa"?fPe(e):uPe(e)}),_Pe=()=>"has changes",pPe=()=>"有更改",mPe=()=>"دارای تغییر",gPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),vPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,bPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,yPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,xPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bPe(e):t==="fa"?yPe(e):vPe(e)}),wPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",SPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",kPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",CPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"Install",NPe=()=>"安装",zPe=()=>"نصب",jPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),TPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,APe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,RPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,MPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?APe(e):t==="fa"?RPe(e):TPe(e)}),DPe=e=>`Install the ${e==null?void 0:e.command} command`,LPe=e=>`安装 ${e==null?void 0:e.command} 命令`,OPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,IPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LPe(e):t==="fa"?OPe(e):DPe(e)}),BPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",$Pe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",PPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",FPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Pe():t==="fa"?PPe():BPe()}),HPe=()=>"Install the new release now instead of waiting for the background update.",qPe=()=>"立即安装新版本,无需等待后台更新。",UPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qPe():t==="fa"?UPe():HPe()}),WPe=()=>"Discard your unsaved Kubernetes changes?",VPe=()=>"要放弃未保存的 Kubernetes 更改吗?",KPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",QPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VPe():t==="fa"?KPe():WPe()}),YPe=()=>"Key from",XPe=()=>"密钥来自",ZPe=()=>"کلید از",JPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XPe():t==="fa"?ZPe():YPe()}),eFe=()=>"Use current kubectl context",tFe=()=>"使用当前 kubectl 上下文",nFe=()=>"استفاده از کانتکست فعلی kubectl",rFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=e=>`Use current context (${e==null?void 0:e.context})`,iFe=e=>`使用当前上下文(${e==null?void 0:e.context})`,aFe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,oFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iFe(e):t==="fa"?aFe(e):sFe(e)}),lFe=()=>"Language",cFe=()=>"语言",uFe=()=>"زبان",dFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),fFe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,hFe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,_Fe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,pFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hFe(e):t==="fa"?_Fe(e):fFe(e)}),mFe=()=>"Make default",gFe=()=>"设为默认值",vFe=()=>"پیش‌فرض شود",bFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gFe():t==="fa"?vFe():mFe()}),yFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",xFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",wFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",SFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xFe():t==="fa"?wFe():yFe()}),kFe=()=>"Replace token ID",CFe=()=>"替换令牌 ID",EFe=()=>"جایگزینی شناسهٔ توکن",NFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Replace token secret",jFe=()=>"替换令牌密钥",TFe=()=>"جایگزینی رمز توکن",AFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jFe():t==="fa"?TFe():zFe()}),RFe=()=>"How to get a Modal token",MFe=()=>"如何获取 Modal 令牌",DFe=()=>"روش دریافت توکن Modal",LFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MFe():t==="fa"?DFe():RFe()}),OFe=()=>"Token ID",IFe=()=>"令牌 ID",BFe=()=>"شناسهٔ توکن",$Fe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Token secret",FFe=()=>"令牌密钥",HFe=()=>"رمز توکن",qFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FFe():t==="fa"?HFe():PFe()}),UFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,GFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,WFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,lL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?GFe(e):t==="fa"?WFe(e):UFe(e)}),VFe=e=>`Needs ${e==null?void 0:e.tool}`,KFe=e=>`需要 ${e==null?void 0:e.tool}`,QFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,YFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KFe(e):t==="fa"?QFe(e):VFe(e)}),XFe=()=>"Needs tools",ZFe=()=>"缺少工具",JFe=()=>"به ابزارها نیاز دارد",eHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZFe():t==="fa"?JFe():XFe()}),tHe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,nHe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,rHe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,sHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nHe(e):t==="fa"?rHe(e):tHe(e)}),iHe=()=>"New runs use SSH; choose a host when launching.",aHe=()=>"新运行将使用 SSH;启动时请选择主机。",oHe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"New token",uHe=()=>"新令牌",dHe=()=>"توکن جدید",fHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"No default flavor",_He=()=>"不设默认配置",pHe=()=>"بدون پیکربندی پیش‌فرض",mHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"none",vHe=()=>"无",bHe=()=>"هیچ‌کدام",u6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vHe():t==="fa"?bHe():gHe()}),yHe=()=>"Not connected",xHe=()=>"未连接",wHe=()=>"متصل نیست",cL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"not found on PATH",kHe=()=>"在 PATH 中未找到",CHe=()=>"در PATH پیدا نشد",EHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,zHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,jHe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,THe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"not initialized",RHe=()=>"尚未初始化",MHe=()=>"راه‌اندازی نشده",DHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Not set",OHe=()=>"未设置",IHe=()=>"تنظیم نشده",A4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"OAuth (subscription login)",$He=()=>"OAuth(订阅登录)",PHe=()=>"OAuth (ورود با اشتراک)",FHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,qHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,UHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,GHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):HHe(e)}),WHe=()=>"Setting up…",VHe=()=>"正在设置…",KHe=()=>"در حال راه‌اندازی…",QHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Account",XHe=()=>"账户",ZHe=()=>"حساب",d6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Add one with",eqe=()=>"使用以下命令添加:",tqe=()=>"یکی با این فرمان اضافه کنید:",nqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Add variable",sqe=()=>"添加变量",iqe=()=>"افزودن متغیر",aqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"Agent models",lqe=()=>"智能体模型",cqe=()=>"مدل‌های عامل",uqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),dqe=()=>"Anonymous usage analytics",fqe=()=>"匿名使用情况分析",hqe=()=>"تحلیل ناشناس استفاده",CN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fqe():t==="fa"?hqe():dqe()}),_qe=()=>"Auth",pqe=()=>"身份验证",mqe=()=>"احراز هویت",gqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),vqe=()=>"Authentication",bqe=()=>"身份验证",yqe=()=>"احراز هویت",uL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bqe():t==="fa"?yqe():vqe()}),xqe=()=>"Auto-apply GitHub topics for new projects",wqe=()=>"为新项目自动添加 GitHub topic",Sqe=()=>"اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید",R4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wqe():t==="fa"?Sqe():xqe()}),kqe=()=>"Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.",Cqe=()=>"为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",Eqe=()=>"مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",dL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cqe():t==="fa"?Eqe():kqe()}),Nqe=()=>"Back to Compute",zqe=()=>"返回算力设置",jqe=()=>"بازگشت به رایانش",fL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zqe():t==="fa"?jqe():Nqe()}),Tqe=()=>"Backend",Aqe=()=>"后端",Rqe=()=>"بک‌اند",Mqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aqe():t==="fa"?Rqe():Tqe()}),Dqe=()=>"Baseline",Lqe=()=>"基线",Oqe=()=>"خط مبنا",Iqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"Binary",$qe=()=>"可执行文件",Pqe=()=>"فایل اجرایی",Fqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Cancel",qqe=()=>"取消",Uqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qqe():t==="fa"?Uqe():Hqe()}),Gqe=()=>"Cancel new variable",Wqe=()=>"取消新变量",Vqe=()=>"لغو متغیر جدید",Kqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wqe():t==="fa"?Vqe():Gqe()}),Qqe=()=>"Checking compute targets…",Yqe=()=>"正在检查算力目标…",Xqe=()=>"در حال بررسی مقصدهای رایانشی…",Zqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Qqe()}),Jqe=()=>"Checking kubectl…",eUe=()=>"正在检查 kubectl…",tUe=()=>"در حال بررسی kubectl…",nUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eUe():t==="fa"?tUe():Jqe()}),rUe=()=>"Checking Modal…",sUe=()=>"正在检查 Modal…",iUe=()=>"در حال بررسی Modal…",aUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Choose a preset flavor",lUe=()=>"选择预设规格",cUe=()=>"یک پیکربندی آماده انتخاب کنید",EN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),uUe=()=>"cluster default",dUe=()=>"集群默认值",fUe=()=>"پیش‌فرض خوشه",NN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dUe():t==="fa"?fUe():uUe()}),hUe=()=>"cluster default (e.g. 4h, 30m)",_Ue=()=>"集群默认值(例如 4h、30m)",pUe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",mUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ue():t==="fa"?pUe():hUe()}),gUe=()=>"Cluster unreachable",vUe=()=>"无法连接集群",bUe=()=>"خوشه در دسترس نیست",yUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vUe():t==="fa"?bUe():gUe()}),xUe=()=>"Compute",wUe=()=>"算力",SUe=()=>"رایانش",hL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wUe():t==="fa"?SUe():xUe()}),kUe=()=>"Connect compute backends and choose where new runs execute.",CUe=()=>"连接算力后端,并选择新运行的执行位置。",EUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",NUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"Connected",jUe=()=>"已连接",TUe=()=>"متصل",AUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jUe():t==="fa"?TUe():zUe()}),RUe=()=>"Context",MUe=()=>"上下文",DUe=()=>"زمینه",LUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MUe():t==="fa"?DUe():RUe()}),OUe=()=>"Current",IUe=()=>"当前",BUe=()=>"فعلی",$Ue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),PUe=()=>"Currently off:",FUe=()=>"当前已关闭:",HUe=()=>"اکنون خاموش است:",qUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FUe():t==="fa"?HUe():PUe()}),UUe=()=>"Custom flavor",GUe=()=>"自定义规格",WUe=()=>"پیکربندی سفارشی",VUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GUe():t==="fa"?WUe():UUe()}),KUe=()=>"Custom flavor…",QUe=()=>"自定义规格…",YUe=()=>"پیکربندی سفارشی…",XUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QUe():t==="fa"?YUe():KUe()}),ZUe=()=>"Data directory",JUe=()=>"数据目录",eGe=()=>"پوشهٔ داده",tGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JUe():t==="fa"?eGe():ZUe()}),nGe=()=>"default",rGe=()=>"默认",sGe=()=>"پیش‌فرض",iGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rGe():t==="fa"?sGe():nGe()}),aGe=()=>"Default",oGe=()=>"默认",lGe=()=>"پیش‌فرض",_L=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oGe():t==="fa"?lGe():aGe()}),cGe=()=>"Default destination",uGe=()=>"默认目标",dGe=()=>"مقصد پیش‌فرض",fGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uGe():t==="fa"?dGe():cGe()}),hGe=()=>"Detecting hardware…",_Ge=()=>"正在检测硬件…",pGe=()=>"در حال شناسایی سخت‌افزار…",mGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Detecting harnesses…",vGe=()=>"正在检测智能体工具…",bGe=()=>"در حال شناسایی ابزارهای عامل…",yGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",wGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",SGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",kGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Effective URL",EGe=()=>"实际使用的网址",NGe=()=>"نشانی مؤثر",zGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Enable GitHub syncing for new projects",TGe=()=>"为新项目启用 GitHub 同步",AGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",zN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),RGe=()=>"Environment",MGe=()=>"环境",DGe=()=>"محیط",pL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MGe():t==="fa"?DGe():RGe()}),LGe=()=>"Failed",OGe=()=>"失败",IGe=()=>"ناموفق",f6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OGe():t==="fa"?IGe():LGe()}),BGe=()=>"General",$Ge=()=>"常规",PGe=()=>"عمومی",FGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ge():t==="fa"?PGe():BGe()}),HGe=()=>"GitHub publishing",qGe=()=>"GitHub 发布",UGe=()=>"انتشار در GitHub",GGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qGe():t==="fa"?UGe():HGe()}),WGe=()=>"Git token",VGe=()=>"Git 令牌",KGe=()=>"توکن Git",QGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VGe():t==="fa"?KGe():WGe()}),YGe=()=>"Harnesses",XGe=()=>"智能体工具",ZGe=()=>"ابزارهای عامل",JGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XGe():t==="fa"?ZGe():YGe()}),eWe=()=>"hf_…",tWe=()=>"hf_…",nWe=()=>"hf_…",rWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",iWe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",aWe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",oWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"Initialize Git",cWe=()=>"初始化 Git",uWe=()=>"راه‌اندازی Git",dWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),fWe=()=>"Install",hWe=()=>"安装",_We=()=>"نصب",mL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hWe():t==="fa"?_We():fWe()}),pWe=()=>"Install broken",mWe=()=>"安装损坏",gWe=()=>"نصب خراب است",vWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mWe():t==="fa"?gWe():pWe()}),bWe=()=>"Install GitHub CLI",yWe=()=>"安装 GitHub CLI",xWe=()=>"نصب GitHub CLI",wWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yWe():t==="fa"?xWe():bWe()}),SWe=()=>"Install updates automatically",kWe=()=>"自动安装更新",CWe=()=>"نصب خودکار به‌روزرسانی‌ها",jN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),EWe=()=>"Instance history",NWe=()=>"实例历史",zWe=()=>"تاریخچهٔ نمونه‌ها",jWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NWe():t==="fa"?zWe():EWe()}),TWe=()=>"Invalid Token",AWe=()=>"令牌无效",RWe=()=>"توکن نامعتبر",MWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AWe():t==="fa"?RWe():TWe()}),DWe=()=>"Jobs / Dashboard URL",LWe=()=>"Jobs / 控制台网址",OWe=()=>"نشانی Jobs / داشبورد",IWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"kubectl not found",$We=()=>"未找到 kubectl",PWe=()=>"kubectl پیدا نشد",FWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$We():t==="fa"?PWe():BWe()}),HWe=()=>"Latest",qWe=()=>"最新版本",UWe=()=>"جدیدترین",GWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qWe():t==="fa"?UWe():HWe()}),WWe=()=>"Loading…",VWe=()=>"正在加载…",KWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VWe():t==="fa"?KWe():WWe()}),QWe=()=>"Loading Ray settings…",YWe=()=>"正在加载 Ray 设置…",XWe=()=>"در حال بارگیری تنظیمات Ray…",ZWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YWe():t==="fa"?XWe():QWe()}),JWe=()=>"Loading slurm settings…",eVe=()=>"正在加载 Slurm 设置…",tVe=()=>"در حال بارگیری تنظیمات Slurm…",nVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eVe():t==="fa"?tVe():JWe()}),rVe=()=>"Loading status…",sVe=()=>"正在加载状态…",iVe=()=>"در حال بارگیری وضعیت…",aVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sVe():t==="fa"?iVe():rVe()}),oVe=()=>"Local only",lVe=()=>"仅本地",cVe=()=>"فقط محلی",uVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lVe():t==="fa"?cVe():oVe()}),dVe=()=>"Local repository",fVe=()=>"本地仓库",hVe=()=>"مخزن محلی",_Ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fVe():t==="fa"?hVe():dVe()}),pVe=()=>"Login node",mVe=()=>"登录节点",gVe=()=>"گرهٔ ورود",vVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mVe():t==="fa"?gVe():pVe()}),bVe=()=>"Make GitHub syncing the default?",yVe=()=>"将 GitHub 同步设为默认值?",xVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",wVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yVe():t==="fa"?xVe():bVe()}),SVe=()=>"Missing bash/tar",kVe=()=>"缺少 bash/tar",CVe=()=>"bash/tar موجود نیست",EVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kVe():t==="fa"?CVe():SVe()}),NVe=()=>"More compute options",zVe=()=>"更多算力选项",jVe=()=>"گزینه‌های رایانشی بیشتر",TVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zVe():t==="fa"?jVe():NVe()}),AVe=()=>"Move failed:",RVe=()=>"移动失败:",MVe=()=>"انتقال ناموفق بود:",DVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RVe():t==="fa"?MVe():AVe()}),LVe=()=>"Moved. orx is now using the new location.",OVe=()=>"已移动。orx 现在使用新位置。",IVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",BVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OVe():t==="fa"?IVe():LVe()}),$Ve=()=>"Namespace",PVe=()=>"命名空间",FVe=()=>"فضای نام",HVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PVe():t==="fa"?FVe():$Ve()}),qVe=()=>"New location",UVe=()=>"新位置",GVe=()=>"محل جدید",WVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UVe():t==="fa"?GVe():qVe()}),VVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",KVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",QVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",YVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KVe():t==="fa"?QVe():VVe()}),XVe=()=>"New variable key",ZVe=()=>"新变量键名",JVe=()=>"کلید متغیر جدید",eKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZVe():t==="fa"?JVe():XVe()}),tKe=()=>"New variable value",nKe=()=>"新变量值",rKe=()=>"مقدار متغیر جدید",sKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nKe():t==="fa"?rKe():tKe()}),iKe=()=>"No code, prompts, file contents, or account identifiers are sent.",aKe=()=>"不会发送代码、提示词、文件内容或账户标识符。",oKe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",lKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aKe():t==="fa"?oKe():iKe()}),cKe=()=>"No hosts found in ~/.ssh/config.",uKe=()=>"在 ~/.ssh/config 中未找到主机。",dKe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",fKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uKe():t==="fa"?dKe():cKe()}),hKe=()=>"No job-create permission",_Ke=()=>"没有创建 Job 的权限",pKe=()=>"مجوز ساخت Job وجود ندارد",mKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ke():t==="fa"?pKe():hKe()}),gKe=()=>"No Write Permissions",vKe=()=>"无写入权限",bKe=()=>"بدون مجوز نوشتن",yKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vKe():t==="fa"?bKe():gKe()}),xKe=()=>"No key on this computer to register — load a registered key with",wKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",SKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",kKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wKe():t==="fa"?SKe():xKe()}),CKe=()=>"No key on this computer yet — create one with",EKe=()=>"此计算机上还没有密钥——使用以下命令创建:",NKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",zKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EKe():t==="fa"?NKe():CKe()}),jKe=()=>"No Slurm CLI",TKe=()=>"无 Slurm CLI",AKe=()=>"بدون CLI اسلورم",RKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TKe():t==="fa"?AKe():jKe()}),MKe=()=>"None registered",DKe=()=>"未注册任何密钥",LKe=()=>"هیچ‌کدام ثبت نشده",OKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DKe():t==="fa"?LKe():MKe()}),IKe=()=>"Not checked",BKe=()=>"未检查",$Ke=()=>"بررسی نشده",gL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BKe():t==="fa"?$Ke():IKe()}),PKe=()=>"Not configured",FKe=()=>"未配置",HKe=()=>"پیکربندی نشده",eb=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FKe():t==="fa"?HKe():PKe()}),qKe=()=>"Not installed",UKe=()=>"未安装",GKe=()=>"نصب نیست",WKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UKe():t==="fa"?GKe():qKe()}),VKe=()=>"Not now",KKe=()=>"暂不",QKe=()=>"اکنون نه",YKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KKe():t==="fa"?QKe():VKe()}),XKe=()=>"Not on this computer",ZKe=()=>"不在此计算机上",JKe=()=>"روی این رایانه نیست",eQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZKe():t==="fa"?JKe():XKe()}),tQe=()=>"Not set (pass --host per launch)",nQe=()=>"未设置(每次启动时传入 --host)",rQe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",sQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Not signed in",aQe=()=>"未登录",oQe=()=>"وارد نشده",vL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),lQe=()=>"On this computer",cQe=()=>"在此计算机上",uQe=()=>"روی این رایانه",dQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cQe():t==="fa"?uQe():lQe()}),fQe=()=>"Open a project to inspect its repository and GitHub publication state.",hQe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",_Qe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",pQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hQe():t==="fa"?_Qe():fQe()}),mQe=()=>"Open job page",gQe=()=>"打开作业页面",vQe=()=>"باز کردن صفحهٔ کار",TN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gQe():t==="fa"?vQe():mQe()}),bQe=()=>"Open on GitHub",yQe=()=>"在 GitHub 上打开",xQe=()=>"باز کردن در GitHub",AN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yQe():t==="fa"?xQe():bQe()}),wQe=()=>", or create one with",SQe=()=>",或使用以下命令创建:",kQe=()=>"، یا با این فرمان یکی بسازید:",CQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SQe():t==="fa"?kQe():wQe()}),EQe=()=>"Org",NQe=()=>"组织",zQe=()=>"سازمان",jQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"Orgs",AQe=()=>"组织",RQe=()=>"سازمان‌ها",MQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),DQe=()=>"orx can't update this install",LQe=()=>"orx 无法更新此安装",OQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",IQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LQe():t==="fa"?OQe():DQe()}),BQe=()=>"Overleaf",$Qe=()=>"Overleaf",PQe=()=>"Overleaf",bL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),FQe=()=>"Overleaf Git authentication token",HQe=()=>"Overleaf Git 身份验证令牌",qQe=()=>"توکن احراز هویت Git در Overleaf",UQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HQe():t==="fa"?qQe():FQe()}),GQe=()=>"Overridden by env",WQe=()=>"已被环境变量覆盖",VQe=()=>"بازنویسی‌شده توسط محیط",KQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WQe():t==="fa"?VQe():GQe()}),QQe=()=>"Partition",YQe=()=>"分区",XQe=()=>"پارتیشن",ZQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YQe():t==="fa"?XQe():QQe()}),JQe=()=>"Path",eYe=()=>"路径",tYe=()=>"مسیر",nYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eYe():t==="fa"?tYe():JQe()}),rYe=()=>"Plan",sYe=()=>"方案",iYe=()=>"سطح اشتراک",aYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sYe():t==="fa"?iYe():rYe()}),oYe=()=>"Project",lYe=()=>"项目",cYe=()=>"پروژه",uYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lYe():t==="fa"?cYe():oYe()}),dYe=()=>"Ray version",fYe=()=>"Ray 版本",hYe=()=>"نسخهٔ Ray",_Ye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),pYe=()=>"Reachable",mYe=()=>"可访问",gYe=()=>"در دسترس",vYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mYe():t==="fa"?gYe():pYe()}),bYe=()=>"Reading ~/.ssh/config…",yYe=()=>"正在读取 ~/.ssh/config…",xYe=()=>"در حال خواندن ‎~/.ssh/config…",yL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yYe():t==="fa"?xYe():bYe()}),wYe=()=>"Ready",SYe=()=>"就绪",kYe=()=>"آماده",Yp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),CYe=()=>"Ready to move",EYe=()=>"可以移动",NYe=()=>"آمادهٔ انتقال",zYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EYe():t==="fa"?NYe():CYe()}),jYe=()=>"Configured",TYe=()=>"已配置",AYe=()=>"پیکربندی‌شده",h6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),RYe=()=>"Refresh",MYe=()=>"刷新",DYe=()=>"تازه‌سازی",Xp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MYe():t==="fa"?DYe():RYe()}),LYe=()=>"Remotes",OYe=()=>"远程仓库",IYe=()=>"مخزن‌های دوردست",BYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OYe():t==="fa"?IYe():LYe()}),$Ye=()=>"Repository",PYe=()=>"仓库",FYe=()=>"مخزن",HYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PYe():t==="fa"?FYe():$Ye()}),qYe=()=>"Repository topics",UYe=()=>"仓库 topic",GYe=()=>"موضوع‌های مخزن",RN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UYe():t==="fa"?GYe():qYe()}),WYe=()=>"Restart to finish updating",VYe=()=>"重新启动以完成更新",KYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",QYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VYe():t==="fa"?KYe():WYe()}),YYe=()=>"Running instances",XYe=()=>"正在运行的实例",ZYe=()=>"نمونه‌های در حال اجرا",JYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),eXe=()=>"Runtime",tXe=()=>"运行时间",nXe=()=>"زمان اجرا",rXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>". Save it under that key if it's meant for HF Jobs.",iXe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",aXe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",oXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>"Session cookie",cXe=()=>"会话 cookie",uXe=()=>"کوکی نشست",dXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),fXe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",hXe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",_Xe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",pXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hXe():t==="fa"?_Xe():fXe()}),mXe=()=>"Settings",gXe=()=>"设置",vXe=()=>"تنظیمات",_6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gXe():t==="fa"?vXe():mXe()}),bXe=()=>"Signed in",yXe=()=>"已登录",xXe=()=>"وارد شده",wXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yXe():t==="fa"?xXe():bXe()}),SXe=()=>"Source",kXe=()=>"来源",CXe=()=>"منبع",xL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kXe():t==="fa"?CXe():SXe()}),EXe=()=>"SSH Key",NXe=()=>"SSH 密钥",zXe=()=>"کلید SSH",jXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NXe():t==="fa"?zXe():EXe()}),TXe=()=>"Started",AXe=()=>"开始时间",RXe=()=>"آغاز",MXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),DXe=()=>"State",LXe=()=>"状态",OXe=()=>"وضعیت",IXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LXe():t==="fa"?OXe():DXe()}),BXe=()=>"Status",$Xe=()=>"状态",PXe=()=>"وضعیت",l_=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),FXe=()=>"Storage",HXe=()=>"存储",qXe=()=>"ذخیره‌سازی",UXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HXe():t==="fa"?qXe():FXe()}),GXe=()=>"Sync",WXe=()=>"同步",VXe=()=>"همگام‌سازی",KXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"Syncing off",YXe=()=>"同步已关闭",XXe=()=>"همگام‌سازی خاموش",ZXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Test connection",eZe=()=>"测试连接",tZe=()=>"آزمایش اتصال",nZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Testing…",sZe=()=>"正在测试…",iZe=()=>"در حال آزمایش…",aZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),oZe=()=>", then add it with",lZe=()=>",然后使用以下命令添加:",cZe=()=>"، سپس با این فرمان اضافه‌اش کنید:",uZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lZe():t==="fa"?cZe():oZe()}),dZe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",fZe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",hZe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",_Ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fZe():t==="fa"?hZe():dZe()}),pZe=()=>"This saved destination is not configured. Set it up below or choose another backend.",mZe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",gZe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",vZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mZe():t==="fa"?gZe():pZe()}),bZe=()=>"This value looks like a Hugging Face token — compute runs only read it from",yZe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",xZe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",wZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yZe():t==="fa"?xZe():bZe()}),SZe=()=>"Time limit",kZe=()=>"时间限制",CZe=()=>"محدودیت زمانی",EZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Unable to verify",zZe=()=>"无法验证",jZe=()=>"تأیید ممکن نیست",M4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),TZe=()=>"Unknown",AZe=()=>"未知",RZe=()=>"نامشخص",wL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AZe():t==="fa"?RZe():TZe()}),MZe=()=>"Update required",DZe=()=>"需要更新",LZe=()=>"نیازمند به‌روزرسانی",OZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DZe():t==="fa"?LZe():MZe()}),IZe=()=>"Updates",BZe=()=>"更新",$Ze=()=>"به‌روزرسانی‌ها",MN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BZe():t==="fa"?$Ze():IZe()}),PZe=()=>"Usage analytics",FZe=()=>"使用情况分析",HZe=()=>"تحلیل استفاده",qZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FZe():t==="fa"?HZe():PZe()}),UZe=()=>"value",GZe=()=>"值",WZe=()=>"مقدار",SL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GZe():t==="fa"?WZe():UZe()}),VZe=()=>"Variables available to runs and the research agent (API keys, tokens).",KZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",QZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",YZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZe():t==="fa"?QZe():VZe()}),XZe=()=>"Version",ZZe=()=>"版本",JZe=()=>"نسخه",kL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZe():t==="fa"?JZe():XZe()}),eJe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",tJe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",nJe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",rJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tJe():t==="fa"?nJe():eJe()}),sJe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",iJe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",aJe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",oJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iJe():t==="fa"?aJe():sJe()}),lJe=()=>"Pick a login node first",cJe=()=>"请先选择登录节点",uJe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",dJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cJe():t==="fa"?uJe():lJe()}),fJe=()=>"Providers",hJe=()=>"提供商",_Je=()=>"ارائه‌دهندگان",pJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hJe():t==="fa"?_Je():fJe()}),mJe=()=>"Reconnect",gJe=()=>"重新连接",vJe=()=>"اتصال دوباره",CL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gJe():t==="fa"?vJe():mJe()}),bJe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yJe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,xJe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,wJe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yJe(e):t==="fa"?xJe(e):bJe(e)}),SJe=()=>"Reinstall with the orx installer to get automatic updates.",kJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",CJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",EJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kJe():t==="fa"?CJe():SJe()}),NJe=()=>"Re-link",zJe=()=>"重新链接",jJe=()=>"پیوند دوباره",TJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zJe():t==="fa"?jJe():NJe()}),AJe=()=>"Remove cookie",RJe=()=>"移除 cookie",MJe=()=>"حذف کوکی",DJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RJe():t==="fa"?MJe():AJe()}),LJe=()=>"Remove token",OJe=()=>"移除令牌",IJe=()=>"حذف توکن",BJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OJe():t==="fa"?IJe():LJe()}),$Je=()=>"Removing…",PJe=()=>"正在移除…",FJe=()=>"در حال حذف…",DN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PJe():t==="fa"?FJe():$Je()}),HJe=()=>"Replace anyway",qJe=()=>"仍要替换",UJe=()=>"به‌هرحال جایگزین کن",GJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qJe():t==="fa"?UJe():HJe()}),WJe=()=>"Replace key",VJe=()=>"替换密钥",KJe=()=>"جایگزینی کلید",QJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJe():t==="fa"?KJe():WJe()}),YJe=()=>"Replace token",XJe=()=>"替换令牌",ZJe=()=>"جایگزینی توکن",JJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XJe():t==="fa"?ZJe():YJe()}),eet=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,tet=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,net=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,ret=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tet(e):t==="fa"?net(e):eet(e)}),set=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,iet=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,aet=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,oet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iet(e):t==="fa"?aet(e):set(e)}),cet=()=>"Run `gh auth login` in your terminal.",uet=()=>"请在终端中运行 `gh auth login`。",det=()=>"در پایانه `gh auth login` را اجرا کنید.",fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uet():t==="fa"?det():cet()}),het=()=>"Saved",_et=()=>"已保存",pet=()=>"ذخیره شده",LN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_et():t==="fa"?pet():het()}),met=()=>"Set up",get=()=>"设置",vet=()=>"راه‌اندازی",bet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?get():t==="fa"?vet():met()}),yet=()=>"Set up SSH key",xet=()=>"设置 SSH 密钥",wet=()=>"راه‌اندازی کلید SSH",ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"Sign in",Eet=()=>"登录",Net=()=>"ورود",EL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),zet=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,jet=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Tet=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,NL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jet(e):t==="fa"?Tet(e):zet(e)}),Aet=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Ret=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Met=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Det=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ret():t==="fa"?Met():Aet()}),Let=()=>"The terminal disconnected before setup completed. Try again.",Oet=()=>"设置完成前终端连接已断开。请重试。",Iet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",ON=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oet():t==="fa"?Iet():Let()}),Bet=()=>"Dark",$et=()=>"深色",Pet=()=>"تیره",Fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$et():t==="fa"?Pet():Bet()}),Het=()=>"Theme",qet=()=>"主题",Uet=()=>"پوسته",IN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qet():t==="fa"?Uet():Het()}),Get=()=>"Light",Wet=()=>"浅色",Vet=()=>"روشن",Ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wet():t==="fa"?Vet():Get()}),Qet=()=>"System",Yet=()=>"系统",Xet=()=>"سیستم",Zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=()=>"Set up billing in the Tinker console",ett=()=>"在 Tinker 控制台设置账单",ttt=()=>"تنظیم پرداخت در کنسول Tinker",ntt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ett():t==="fa"?ttt():Jet()}),rtt=()=>"Billing setup required",stt=()=>"需要设置账单",itt=()=>"تنظیم پرداخت لازم است",att=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",ltt=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",ctt=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",utt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"Invalid Key",ftt=()=>"密钥无效",htt=()=>"کلید نامعتبر",_tt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Token from",mtt=()=>"令牌来自",gtt=()=>"توکن از",vtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),btt=()=>"Update now",ytt=()=>"立即更新",xtt=()=>"اکنون به‌روزرسانی کن",wtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ytt():t==="fa"?xtt():btt()}),Stt=e=>`Update to ${e==null?void 0:e.version}`,ktt=e=>`更新到 ${e==null?void 0:e.version}`,Ctt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Ett=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ktt(e):t==="fa"?Ctt(e):Stt(e)}),Ntt=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",ztt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",jtt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Ttt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ztt():t==="fa"?jtt():Ntt()}),Att=()=>"Updating default destination…",Rtt=()=>"正在更新默认运行位置…",Mtt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Dtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rtt():t==="fa"?Mtt():Att()}),Ltt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",Ott=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Itt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Btt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ott():t==="fa"?Itt():Ltt()}),$tt=()=>"Validating…",Ptt=()=>"正在验证…",Ftt=()=>"در حال اعتبارسنجی…",zL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ptt():t==="fa"?Ftt():$tt()}),Htt=()=>"View settings",qtt=()=>"查看设置",Utt=()=>"مشاهدهٔ تنظیمات",Gtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qtt():t==="fa"?Utt():Htt()}),Wtt=()=>"Skill",Vtt=()=>"技能",Ktt=()=>"مهارت",Qtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vtt():t==="fa"?Ktt():Wtt()}),Ytt=()=>"Loading skill…",Xtt=()=>"正在加载技能…",Ztt=()=>"در حال بارگیری مهارت…",Jtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xtt():t==="fa"?Ztt():Ytt()}),ent=()=>"Personal",tnt=()=>"个人",nnt=()=>"شخصی",rnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Alternatively, tell your agent to save a reusable skill for you.",int=()=>"或者,请你的智能体为你保存可重复使用的技能。",ant=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",ont=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,cnt=e=>`删除技能“${e==null?void 0:e.name}”?`,unt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,dnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cnt(e):t==="fa"?unt(e):lnt(e)}),fnt=e=>`Delete skill ${e==null?void 0:e.name}`,hnt=e=>`删除技能 ${e==null?void 0:e.name}`,_nt=e=>`حذف مهارت ${e==null?void 0:e.name}`,pnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hnt(e):t==="fa"?_nt(e):fnt(e)}),mnt=e=>`Delete the “${e==null?void 0:e.name}” template?`,gnt=e=>`删除模板“${e==null?void 0:e.name}”?`,vnt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,bnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gnt(e):t==="fa"?vnt(e):mnt(e)}),ynt=e=>`Delete template ${e==null?void 0:e.name}`,xnt=e=>`删除模板 ${e==null?void 0:e.name}`,wnt=e=>`حذف قالب ${e==null?void 0:e.name}`,Snt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xnt(e):t==="fa"?wnt(e):ynt(e)}),knt=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",Cnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Ent=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Nnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cnt():t==="fa"?Ent():knt()}),znt=()=>"Drop a SKILL.md or .zip here, or click to choose",jnt=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Tnt=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Ant=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jnt():t==="fa"?Tnt():znt()}),Rnt=()=>"Drop a .tex or .zip here, or click to choose",Mnt=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Dnt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Lnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mnt():t==="fa"?Dnt():Rnt()}),Ont=()=>"File too large (max 20 MB).",Int=()=>"文件过大(最大 20 MB)。",Bnt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",jL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Int():t==="fa"?Bnt():Ont()}),$nt=()=>" + 1 file",Pnt=()=>" + 1 个文件",Fnt=()=>" + ۱ فایل",Hnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pnt():t==="fa"?Fnt():$nt()}),qnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Unt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Gnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Wnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Remove from OpenResearch",Knt=()=>"从 OpenResearch 移除",Qnt=()=>"حذف از OpenResearch",Ynt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,Znt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,Jnt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,ert=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Znt(e):t==="fa"?Jnt(e):Xnt(e)}),trt=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,nrt=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,rrt=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,srt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nrt(e):t==="fa"?rrt(e):trt(e)}),irt=e=>` + ${e==null?void 0:e.count} files`,art=e=>` + ${e==null?void 0:e.count} 个文件`,ort=e=>` + ${e==null?void 0:e.count} فایل`,lrt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?art(e):t==="fa"?ort(e):irt(e)}),crt=()=>"Could not load skills:",urt=()=>"无法加载技能:",drt=()=>"بارگیری مهارت‌ها ممکن نشد:",frt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?urt():t==="fa"?drt():crt()}),hrt=()=>"Could not load templates:",_rt=()=>"无法加载模板:",prt=()=>"بارگیری قالب‌ها ممکن نشد:",mrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"Customize",vrt=()=>"自定义",brt=()=>"سفارشی‌سازی",yrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"Delete skill",wrt=()=>"删除技能",Srt=()=>"حذف مهارت",krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Delete template",Ert=()=>"删除模板",Nrt=()=>"حذف قالب",zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"LaTeX templates",Trt=()=>"LaTeX 模板",Art=()=>"قالب‌های LaTeX",Rrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"Loading skills…",Drt=()=>"正在加载技能…",Lrt=()=>"در حال بارگیری مهارت‌ها…",Ort=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Loading templates…",Brt=()=>"正在加载模板…",$rt=()=>"در حال بارگیری قالب‌ها…",Prt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"No skills yet.",Hrt=()=>"尚无技能。",qrt=()=>"هنوز مهارتی وجود ندارد.",Urt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"No templates yet.",Wrt=()=>"尚无模板。",Vrt=()=>"هنوز قالبی وجود ندارد.",Krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"Skills",Yrt=()=>"技能",Xrt=()=>"مهارت‌ها",Zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Uploading…",est=()=>"正在上传…",tst=()=>"در حال بارگذاری…",nst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",sst=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",ist=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ast=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"Upload a SKILL.md file or a .zip of a skill folder.",lst=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",cst=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",ust=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Upload a .tex file or a .zip of a template folder.",fst=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",hst=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",_st=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),pst=()=>"Close SSH config",mst=()=>"关闭 SSH 配置",gst=()=>"بستن پیکربندی SSH",vst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mst():t==="fa"?gst():pst()}),bst=()=>"Discard your unsaved SSH config changes?",yst=()=>"要放弃未保存的 SSH 配置更改吗?",xst=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",wst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yst():t==="fa"?xst():bst()}),Sst=()=>"Loading SSH config…",kst=()=>"正在加载 SSH 配置…",Cst=()=>"در حال بارگیری پیکربندی SSH…",Est=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kst():t==="fa"?Cst():Sst()}),Nst=()=>"SSH config saved",zst=()=>"SSH 配置已保存",jst=()=>"پیکربندی SSH ذخیره شد",Tst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zst():t==="fa"?jst():Nst()}),Ast=()=>"SSH config",Rst=()=>"SSH 配置",Mst=()=>"پیکربندی SSH",Dst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rst():t==="fa"?Mst():Ast()}),Lst=()=>"Configure SSH hosts…",Ost=()=>"配置 SSH 主机…",Ist=()=>"پیکربندی میزبان‌های SSH…",TL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ost():t==="fa"?Ist():Lst()}),Bst=()=>"Cancelled",$st=()=>"已取消",Pst=()=>"لغوشده",Fst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$st():t==="fa"?Pst():Bst()}),Hst=()=>"Cancelling",qst=()=>"正在取消",Ust=()=>"در حال لغو",Gst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Done",Vst=()=>"已完成",Kst=()=>"انجام‌شده",Qst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Editing",Xst=()=>"正在编辑",Zst=()=>"در حال ویرایش",Jst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=()=>"Failed",tit=()=>"失败",nit=()=>"ناموفق",rit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tit():t==="fa"?nit():eit()}),sit=()=>"Idle",iit=()=>"空闲",ait=()=>"بی‌کار",oit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iit():t==="fa"?ait():sit()}),lit=()=>"Running",cit=()=>"运行中",uit=()=>"در حال اجرا",dit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Starting",hit=()=>"正在启动",_it=()=>"در حال آغاز",pit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Copying…",git=()=>"正在复制…",vit=()=>"در حال کپی…",bit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>"Finalizing…",xit=()=>"正在完成…",wit=()=>"در حال نهایی‌سازی…",Sit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=e=>`${e==null?void 0:e.size} free at target`,Cit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,Eit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,Nit=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Cit(e):t==="fa"?Eit(e):kit(e)}),zit=e=>`Move all orx data to: ${e==null?void 0:e.path} -The store is copied to the new location and activated there. Active runs or chats will block the move.`,iit=e=>`将所有 orx 数据移动到: +The store is copied to the new location and activated there. Active runs or chats will block the move.`,jit=e=>`将所有 orx 数据移动到: ${e==null?void 0:e.path} -存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,ait=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ +存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,Tit=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ ${e==null?void 0:e.path} -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,oit=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?iit(e):t==="fa"?ait(e):sit(e)}),lit=()=>"Move data here",cit=()=>"将数据移动到此处",uit=()=>"انتقال داده به اینجا",dit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Moving…",hit=()=>"正在移动…",_it=()=>"در حال جابه‌جایی…",pit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Preparing…",git=()=>"正在准备…",vit=()=>"در حال آماده‌سازی…",bit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>" (same disk, instant)",xit=()=>"(同一磁盘,可立即完成)",wit=()=>" (روی همان دیسک، فوری)",Sit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=()=>"default location",Cit=()=>"默认位置",Eit=()=>"محل پیش‌فرض",Nit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cit():t==="fa"?Eit():kit()}),zit=()=>"ORX_DATA_DIR environment variable",jit=()=>"ORX_DATA_DIR 环境变量",Tit=()=>"متغیر محیطی ORX_DATA_DIR",Ait=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jit():t==="fa"?Tit():zit()}),Rit=()=>"your saved setting",Mit=()=>"已保存的设置",Dit=()=>"تنظیم ذخیره‌شدهٔ شما",Lit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"XDG_DATA_HOME",Iit=()=>"XDG_DATA_HOME",Bit=()=>"XDG_DATA_HOME",$it=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Verifying…",Fit=()=>"正在验证…",Hit=()=>"در حال بررسی…",qit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>"Loading…",Git=()=>"正在加载…",Wit=()=>"در حال بارگیری…",Vit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"This sub-agent is no longer available.",Qit=()=>"此子智能体已不可用。",Yit=()=>"این عامل فرعی دیگر در دسترس نیست.",Xit=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Jit=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,eat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,tat=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Jit(e):t==="fa"?eat(e):Zit(e)}),nat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,rat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,sat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,iat=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?rat(e):t==="fa"?sat(e):nat(e)}),aat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",oat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",lat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",cat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>", a repo for training a mini-GPT from scratch.",dat=()=>",一个从零训练迷你 GPT 的仓库。",fat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",hat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Close",pat=()=>"关闭",mat=()=>"بستن",gat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"Create a new project",bat=()=>"新建项目",yat=()=>"ایجاد پروژهٔ جدید",xat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=()=>"Demo project",Sat=()=>"演示项目",kat=()=>"پروژهٔ نمایشی",Cat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sat():t==="fa"?kat():wat()}),Eat=()=>"Explore the demo",Nat=()=>"探索演示项目",zat=()=>"دیدن پروژهٔ نمایشی",jat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nat():t==="fa"?zat():Eat()}),Tat=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",Aat=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",Rat=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",Mat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>"nanochat",Lat=()=>"nanochat",Oat=()=>"nanochat",Iat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Couldn’t save your progress. Try again.",$at=()=>"无法保存进度。请重试。",Pat=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",Fat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",qat=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",Uat=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",Gat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Welcome to OpenResearch",Vat=()=>"欢迎使用 OpenResearch",Kat=()=>"به OpenResearch خوش آمدید",Qat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Baseline",Xat=()=>"基线",Zat=()=>"مبنا",Jat=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Experiment",tot=()=>"实验",not=()=>"آزمایش",Cl=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tot():t==="fa"?not():eot()}),rot=e=>`${e==null?void 0:e.count} experiments`,sot=e=>`${e==null?void 0:e.count} 个实验`,iot=e=>`${e==null?void 0:e.count} آزمایش`,aot=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?sot(e):t==="fa"?iot(e):rot(e)}),oot=()=>"1 experiment",lot=()=>"1 个实验",cot=()=>"۱ آزمایش",uot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lot():t==="fa"?cot():oot()}),dot=()=>"Running",fot=()=>"运行中",hot=()=>"در حال اجرا",_ot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fot():t==="fa"?hot():dot()}),pot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",mot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",got=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",vot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mot():t==="fa"?got():pot()}),bot=()=>"Ask the agent in chat to create and run your first experiment.",yot=()=>"在聊天中让智能体创建并运行你的第一个实验。",xot=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",wot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yot():t==="fa"?xot():bot()}),Sot=()=>"Code",kot=()=>"代码",Cot=()=>"کد",Eot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kot():t==="fa"?Cot():Sot()}),Not=()=>"Logs",zot=()=>"日志",jot=()=>"گزارش‌ها",NL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zot():t==="fa"?jot():Not()}),Tot=()=>"No experiments from the current task yet",Aot=()=>"当前任务尚无实验",Rot=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",Mot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Aot():t==="fa"?Rot():Tot()}),Dot=()=>"No experiments yet",Lot=()=>"尚无实验",Oot=()=>"هنوز آزمایشی وجود ندارد",Iot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lot():t==="fa"?Oot():Dot()}),Bot=()=>"no runs",$ot=()=>"无运行",Pot=()=>"بدون اجرا",Fot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$ot():t==="fa"?Pot():Bot()}),Hot=()=>"Open logs",qot=()=>"打开日志",Uot=()=>"باز کردن گزارش‌ها",Got=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qot():t==="fa"?Uot():Hot()}),Wot=()=>"other tasks",Vot=()=>"其他任务",Kot=()=>"وظایف دیگر",Qot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vot():t==="fa"?Kot():Wot()}),Yot=()=>"Runs",Xot=()=>"运行",Zot=()=>"اجراها",Jot=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xot():t==="fa"?Zot():Yot()}),elt=()=>"Switch to Entire project to see all experiments",tlt=()=>"切换到“整个项目”以查看所有实验",nlt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",rlt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,ilt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,alt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,olt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ilt(e):t==="fa"?alt(e):slt(e)}),llt=()=>"Dismiss",clt=()=>"关闭",ult=()=>"بستن",dlt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Restart now",hlt=()=>"立即重新启动",_lt=()=>"هم‌اکنون دوباره راه‌اندازی کن",zL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),plt=e=>`Could not restart: ${e==null?void 0:e.error}`,mlt=e=>`无法重新启动:${e==null?void 0:e.error}`,glt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,jL=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mlt(e):t==="fa"?glt(e):plt(e)}),vlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",blt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",ylt=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",xlt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?blt():t==="fa"?ylt():vlt()}),wlt=()=>"Restarting…",Slt=()=>"正在重新启动…",klt=()=>"در حال راه‌اندازی مجدد…",TL=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Slt():t==="fa"?klt():wlt()}),Clt=()=>"macOS app",Elt=()=>"macOS 应用",Nlt=()=>"برنامهٔ macOS",zlt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Elt():t==="fa"?Nlt():Clt()}),jlt=()=>"Installed with cargo",Tlt=()=>"通过 cargo 安装",Alt=()=>"نصب‌شده با cargo",Rlt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tlt():t==="fa"?Alt():jlt()}),Mlt=()=>"Installed with Homebrew",Dlt=()=>"通过 Homebrew 安装",Llt=()=>"نصب‌شده با Homebrew",Olt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dlt():t==="fa"?Llt():Mlt()}),Ilt=()=>"Installed with the orx installer",Blt=()=>"通过 orx 安装程序安装",$lt=()=>"نصب‌شده با نصب‌کنندهٔ orx",Plt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Blt():t==="fa"?$lt():Ilt()}),Flt=()=>"Managed by Nix",Hlt=()=>"由 Nix 管理",qlt=()=>"مدیریت‌شده با Nix",Ult=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hlt():t==="fa"?qlt():Flt()}),Glt=()=>"Portable orx.exe",Wlt=()=>"便携版 orx.exe",Vlt=()=>"orx.exe قابل‌حمل",Klt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wlt():t==="fa"?Vlt():Glt()}),Qlt=()=>"Unknown install",Ylt=()=>"未知安装方式",Xlt=()=>"روش نصب نامشخص",Zlt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Re-run your cargo install to update.",ect=()=>"重新运行 cargo 安装命令以更新。",tct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",nct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Run brew upgrade to update.",sct=()=>"运行 brew upgrade 以更新。",ict=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",act=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Update it through your Nix configuration.",lct=()=>"通过 Nix 配置进行更新。",cct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",uct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Active Experiments",fct=()=>"活跃实验",hct=()=>"آزمایش‌های فعال",_ct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Default compute",mct=()=>"默认计算目标",gct=()=>"محاسبات پیش‌فرض",vct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"This worktree",yct=()=>"当前工作树",xct=()=>"این درخت کاری",wct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Workspace",kct=()=>"工作区",Cct=()=>"فضای کاری",Cx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Ect=e=>`Current worktree · ${e==null?void 0:e.branch}`,Nct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,jct=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Nct(e):t==="fa"?zct(e):Ect(e)}),Tct=e=>`Default branch · ${e==null?void 0:e.branch}`,Act=e=>`默认分支 · ${e==null?void 0:e.branch}`,Rct=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,Mct=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Act(e):t==="fa"?Rct(e):Tct(e)}),Dct=e=>`detached at ${e==null?void 0:e.branch}`,Lct=e=>`分离于 ${e==null?void 0:e.branch}`,Oct=e=>`جدا در ${e==null?void 0:e.branch}`,Ict=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Lct(e):t==="fa"?Oct(e):Dct(e)}),Bct=()=>"Listing truncated.",$ct=()=>"列表已截断。",Pct=()=>"فهرست کوتاه شده است.",Fct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$ct():t==="fa"?Pct():Bct()}),Hct=()=>"Loading…",qct=()=>"正在加载…",Uct=()=>"در حال بارگیری…",Gct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qct():t==="fa"?Uct():Hct()}),Wct=()=>"No changes yet.",Vct=()=>"尚无更改。",Kct=()=>"هنوز تغییری وجود ندارد.",Qct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vct():t==="fa"?Kct():Wct()}),Yct=()=>"No files.",Xct=()=>"没有文件。",Zct=()=>"فایلی وجود ندارد.",Jct=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xct():t==="fa"?Zct():Yct()}),eut=()=>"Refresh failed:",tut=()=>"刷新失败:",nut=()=>"تازه‌سازی ناموفق بود:",rut=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tut():t==="fa"?nut():eut()}),Ne=e=>`⁦${e}⁩`,Do=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(j()).format(e),Ex="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",h6="chat_demo_nanochat_figures_v1",_6="chat_demo_nanochat_literature_v1",sut={[O0]:"cpu_end_to_end",[h6]:"figures",[_6]:"literature"},w1="cpu-apple-silicon-pipeline-results.md",iut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class R4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Gi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const AL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new R4(s,a,i.exists)}}catch(i){if(i instanceof R4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=AL.get(e);if(t&&!Pn(t))throw new DOMException("Workspace changed","AbortError");return n}const Tt=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Pn(t))throw new DOMException("Workspace changed","AbortError");return AL.set(r,t),r.ok&&KV(e,t),r}const St=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),l_=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),RL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),aut=e=>Tt("/api/projects",e).then(n=>n.projects),out=e=>Tt("/api/projects/activity",e).then(n=>n.activity),lut=e=>Tt("/api/settings/ui-state",e),cut=(e,n)=>Tt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),uut=(e,n,t=!1)=>St(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),dut=(e,n=!1)=>St("/api/settings/ui-state",{workspace:e},n),fut=e=>St("/api/settings/ui-state",e),hut=(e,n)=>St("/api/onboarding/complete",{...e,...n}),_ut=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Tt(`/api/project-path/status${t}`,n)},put=()=>St("/api/project-path/pick").then(e=>e.path),mut=e=>St("/api/projects",e),gut=(e,n)=>Tt(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),vut=e=>Tt("/api/github/account",e),but=(e,n)=>Tt(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),yut=(e,n,t)=>Tt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),xut=(e,n)=>Tt(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),wut=e=>St("/api/projects/starter-prompts/prewarm",e),Sut=(e,n,t,r,s)=>Tt(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),kut=e=>St(`/api/projects/${e}/open`).then(n=>n.project),Cut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}WV(e)}),Eut=(e,n)=>Tt(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Nut=(e,n)=>Tt(`/api/projects/${e}/runs`,n).then(t=>t.runs),ML=e=>St(`/api/runs/${e}/cancel`).then(()=>{}),zut=(e,n)=>Tt(`/api/runs/${e}/log?offset=${n}`),jut=(e,n)=>Tt(`/api/runs/${e}/diff`,n),Tut=(e,n)=>Tt(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),Aut=(e,n,t={},r)=>Tt(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),ON=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,Rut=(e,n)=>Tt(`/api/files/abs?path=${encodeURIComponent(e)}`,n),Mut=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,Dut=(e,n,t,r)=>RL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),Lut=(e,n,t,r={})=>l_(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),Out=(e,n,t={})=>St(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),Iut=e=>Tt("/api/latex/engine",e),But=(e,n,t={})=>St(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),$ut=e=>Tt("/api/overleaf/settings",e),DL=e=>St("/api/overleaf/token",{token:e}),Put=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),LL=(e,n={})=>St("/api/overleaf/session",{session:e,host:n.host}),Fut=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),Hut=(e={})=>St("/api/overleaf/session/import",{host:e.host}),qut=(e,n,t={})=>St(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),Uut=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),Gut=(e,n,t={},r)=>Tt(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),Wut=(e,n,t)=>St(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),Vut=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),Kut=(e,n,t={})=>St(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),Qut=(e,n,t={},r)=>Tt(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),Yut=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,Xut=(e,n={},t)=>{const r=wu(n).toString();return Tt(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Zut=(e,n)=>Tt(`/api/chat/sessions/${e}/worktree`,n),eb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,Jut=e=>Tt("/api/settings/hf",e),edt=e=>St("/api/settings/hf",{token:e}),tdt=e=>Tt("/api/settings/tinker",e),ndt=e=>St("/api/settings/tinker",{key:e}),rdt=e=>Tt("/api/update",e),sdt=()=>St("/api/update/apply"),idt=()=>St("/api/update/restart"),adt=e=>St("/api/update/auto",{enabled:e}),odt=(e=!1)=>St("/api/update/install-cli",{force:e}),ldt=e=>Tt("/api/settings/k8s",e),cdt=e=>St("/api/settings/k8s",e),udt=e=>Tt("/api/settings/modal",e),ddt=(e,n)=>St("/api/settings/modal",{tokenId:e,tokenSecret:n}),fdt=e=>Tt("/api/settings/env",e).then(n=>n.vars),OL=(e,n)=>St("/api/settings/env",{key:e,value:n}).then(t=>t.vars),hdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),_dt=e=>Tt("/api/settings/data-dir",e),pdt=e=>St("/api/settings/data-dir/validate",{path:e}),mdt=e=>St("/api/settings/data-dir/move",{path:e}),gdt=e=>Tt("/api/settings/ssh",e).then(n=>n.hosts),vdt=e=>Tt("/api/settings/ssh/config",e),bdt=(e,n)=>RL("/api/settings/ssh/config",{content:e,previousContent:n}),ydt=(e,n)=>Tt(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),xdt=e=>Tt("/_orx/runtime",e),wdt=e=>Tt("/api/remote/sessions",e).then(n=>n.sessions),Sdt=(e,n)=>St("/api/remote/sessions",{host:e,uiPreferences:n}),kdt=e=>St("/_orx/install",e),Cdt=()=>St("/_orx/reconnect"),IL=()=>St("/_orx/disconnect"),Edt=()=>St("/_orx/start-host"),BL=()=>Tt("/_orx/stop-host"),$L=e=>St("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Ndt=e=>Tt("/api/settings/slurm",e),zdt=e=>St("/api/settings/slurm",e),jdt=e=>Tt("/api/settings/ray",e),Tdt=e=>St("/api/settings/ray",e),Adt=e=>St("/api/settings/ray/preflight",{address:e??null}),Rdt=(e,n)=>Tt(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),Mdt=e=>St("/api/settings/compute/default",e),Ddt=e=>Tt("/api/settings/local",e),Ldt=e=>Tt("/api/settings/openresearch",e),Odt=(e,n)=>Tt(`/api/projects/${e}/files`,n),Idt=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Bdt=(e,n,t)=>l_(`/api/projects/${e}/files`,{path:n,...t}),Ph=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,PL=512e3,$dt=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},Pdt=(e,n,t)=>fetch(Ph(e,n),{signal:t,headers:{Range:`bytes=0-${PL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>$dt(a,Number.isFinite(s)&&s>a.byteLength))}),Fdt=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",Hdt=(e,n,t)=>fetch(Ph(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:Fdt(s)?s:"download"}}),qdt=e=>Tt("/api/settings/profile",e),Udt=e=>Tt("/api/settings/lit-sources",e),Gdt=e=>St("/api/settings/lit-sources",e),Wdt=e=>Tt("/api/settings/projects",e),FL=(e,n)=>St("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubDefaultPromptSeen:n}}),Vdt=(e,n)=>Tt(`/api/projects/${e}/git`,n),Kdt=e=>St(`/api/projects/${e}/git/init`),Qdt=e=>St(`/api/projects/${e}/github`),Ydt=e=>St(`/api/projects/${e}/github/disable`),Xdt=e=>Tt("/api/settings/telemetry",e),Zdt=e=>St("/api/settings/telemetry",{enabled:e}),Vc=e=>{St("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??D4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?t6():n,r=D4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const nv="default";function tb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===nv)?nv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const M4="default";function HL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:M4,label:eBe(),description:YIe()},...t]:[]}function rv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=HL(e,n);return s.length===0?M4:t!=null&&s.some(a=>a.id===t)?t:M4}function qL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=tb(e,n);return r.length===0?nv:t&&r.some(i=>i.id===t)?t:s}const UL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return Tt(`/api/harnesses${s}`,t).then(i=>i.harnesses)},Jdt=(e,n)=>Tt(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),eft=(e,n,t,r)=>Tt(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),tft=e=>Tt("/api/latex-templates",e).then(n=>n.templates),nft=e=>St("/api/latex-templates",e).then(n=>n.template),rft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),sft=e=>Tt("/api/user-skills",e),ift=e=>St("/api/user-skills",e).then(n=>n.skill),aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function D4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const oft=(e,n)=>Tt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),lft=(e,n,t={})=>St("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),cft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(Zv(e),t))),uft=(e,n)=>l_(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),dft=(e,n)=>l_(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),fft=(e,n)=>l_(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),hft=(e,n)=>l_(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),_ft=(e,n)=>Tt(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),mft=(e,n)=>St(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),gft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,IN=(e,n,t={},r,s,i,a)=>St(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),vft=(e,n)=>St(`/api/chat/sessions/${e}/shell`,{command:n}),bft=(e,n,t,r={})=>St(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),yft=(e,n,t)=>St(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),xft=(e,n)=>St(`/api/chat/sessions/${e}/branch`,{leafId:n}),wft=e=>St(`/api/chat/sessions/${e}/interrupt`),Sft=(e,n)=>St(`/api/chat/sessions/${e}/respond`,n);function Io(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(j(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return t1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return Xge({value:Wt(t)});const r=Math.floor(t/60);return r<24?Vge({hours:Wt(r),minutes:Wt(t%60)}):qge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Ml(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rTt("/api/local-models",e),Eft=e=>St("/api/local-models/discover",e),Nft=e=>St("/api/local-models",e),zft=e=>St(`/api/local-models/${encodeURIComponent(e)}/check`,{}),jft=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),BN=()=>({queryKey:Nt("getHfSettings"),queryFn:({signal:e})=>Jut(e),staleTime:3e5}),$N=()=>({queryKey:Nt("getTinkerSettings"),queryFn:({signal:e})=>tdt(e),staleTime:3e5}),PN=()=>({queryKey:Nt("getK8sSettings"),queryFn:({signal:e})=>ldt(e),staleTime:3e4}),FN=()=>({queryKey:Nt("getModalSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),Tft=()=>({queryKey:Nt("getSlurmSettings"),queryFn:({signal:e})=>Ndt(e),staleTime:3e5}),Aft=()=>({queryKey:Nt("getRaySettings"),queryFn:({signal:e})=>jdt(e),staleTime:3e5}),GL=e=>({queryKey:Nt("getComputeSettings",e??null),queryFn:({signal:n})=>Rdt(e,n),staleTime:3e4}),Rft=()=>({queryKey:Nt("getLocalMachine"),queryFn:({signal:e})=>Ddt(e),staleTime:3e5}),Mft=()=>({queryKey:Nt("getOpenResearchSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e4}),Dft=()=>({queryKey:Nt("getEnvVars"),queryFn:({signal:e})=>fdt(e),staleTime:3e5}),Lft=()=>({queryKey:Nt("getDataDir"),queryFn:({signal:e})=>_dt(e),staleTime:3e5}),WL=()=>({queryKey:Nt("getSshHosts"),queryFn:({signal:e})=>gdt(e),staleTime:3e5}),Oft=()=>({queryKey:Nt("getSshConfig"),queryFn:({signal:e})=>vdt(e),staleTime:3e5}),HN=e=>({queryKey:Nt("getSshMasterStatus",e),queryFn:({signal:n})=>ydt(e,n),staleTime:5e3}),Ift=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>xdt(e),staleTime:2e3}),Bft=()=>({queryKey:Nt("listRemoteSessions"),queryFn:({signal:e})=>wdt(e),staleTime:3e4}),sv=()=>({queryKey:Nt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>a_(n,t,()=>rdt(e)),staleTime:3e4}),$ft=()=>({queryKey:Nt("getProfile"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),Pft=()=>({queryKey:Nt("getLitSources"),queryFn:({signal:e})=>Udt(e),staleTime:3e5}),m6=()=>({queryKey:Nt("getProjectDefaults"),queryFn:({signal:e})=>Wdt(e),staleTime:3e5}),Fft=e=>({queryKey:Nt("getProjectGitStatus",e),queryFn:({signal:n})=>Vdt(e,n),staleTime:3e4}),Hft=()=>({queryKey:Nt("getTelemetry"),queryFn:({signal:e})=>Xdt(e),staleTime:3e5}),hu=()=>({queryKey:Nt("getHarnesses"),queryFn:({signal:e})=>UL(!1,!1,e),staleTime:3e5}),qft=e=>({queryKey:Nt("getSkills",e??null),queryFn:({signal:n})=>Jdt(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),Uft=(e,n,t)=>({queryKey:Nt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>eft(e,n,r,t),staleTime:3e5}),Gft=()=>({queryKey:Nt("listLatexTemplates"),queryFn:({signal:e})=>tft(e),refetchInterval:3e4,staleTime:3e5}),Wft=()=>({queryKey:Nt("listUserSkills"),queryFn:({signal:e})=>sft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function nb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await UL(e,n);return Pn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const Vft=()=>({queryKey:Nt("getLocalModels"),queryFn:({signal:e})=>Cft(e),staleTime:3e4}),Ea=e=>({queryKey:Nt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>a_(t,r,async()=>{const s=await oft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Vp),staleTime:3e4}),Bl=e=>({queryKey:Nt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await a_(t,r,()=>_ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Vp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",VL="bash";function qN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function Kft(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:qN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:VL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?qN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let KL=0;function QL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{QL(e)&&KL++});const Qft=e=>nt.getQueryCache().subscribe(n=>{QL(n)&&e()}),Yft=()=>KL;function Xft(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function YL(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=Kft(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Zft(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(Qft,Yft),i=R.useMemo(()=>Xft(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Pn(["workspace",a])&&YL(e,l)},[e,a]);return[i,o,r]}const S1=new Map;function Jft(e,n){let t=S1.get(e);return t||(t=new Set,S1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&S1.delete(e)}}function eht(e){var n;(n=S1.get(e.runId))==null||n.forEach(t=>t(e))}const L4=new Set;function iv(e){return L4.add(e),()=>{L4.delete(e)}}function vl(e){L4.forEach(n=>n(e))}const O4=new Set;function tht(e){return O4.add(e),()=>{O4.delete(e)}}function bl(){O4.forEach(e=>e())}const I4=new Set;function nht(e){return I4.add(e),()=>{I4.delete(e)}}function UN(e){I4.forEach(n=>n(e))}const B4=new Set;function XL(e){return B4.add(e),()=>{B4.delete(e)}}function Nx(e){B4.forEach(n=>n(e))}const $4=new Set;function rht(e){return $4.add(e),()=>{$4.delete(e)}}function GN(e){$4.forEach(n=>n(e))}const P4=new Set;function sht(e){return P4.add(e),()=>{P4.delete(e)}}function iht(e){P4.forEach(n=>n(e))}let F4=!0;const H4=new Set;function aht(e){return H4.add(e),()=>{H4.delete(e)}}function WN(){return F4}function VN(e){e!==F4&&(F4=e,H4.forEach(n=>n()))}const oht=8e3,lht=3e3;function cht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>VN(!1),oht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},lht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,VN(!0),a&&(vl({type:"reconnected"}),bl(),UN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;vl({type:"reconnected"}),bl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(bl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(bl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(bl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&eht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(bl(),vl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(bl(),vl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(bl(),vl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(bl(),vl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&vl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&vl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&vl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&UN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&Nx({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&Nx({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&Nx({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&iht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&GN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&GN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const av=new Set;function uht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return av.add(t),()=>{av.delete(t)}},[])}const KN={onRun:e=>av.forEach(n=>n.onRun(e)),onReconnect:()=>av.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:Nt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>a_(n,t,()=>aut(e),Vp),staleTime:3e4}),dht=()=>({queryKey:Nt("listProjectActivity"),queryFn:({signal:e})=>out(e),staleTime:3e4}),Xp=()=>({queryKey:Nt("getUiState"),queryFn:({signal:e})=>lut(e),staleTime:3e5}),g6=e=>({queryKey:Nt("getProjectUiState",e),queryFn:({signal:n})=>cut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:Nt("getProjectPathStatus",e),queryFn:({signal:n})=>_ut(e,n),staleTime:3e4}),ZL=e=>({queryKey:Nt("searchPapers",e),queryFn:({signal:n})=>gut(e,n),staleTime:3e5}),fht=()=>({queryKey:Nt("githubAccount"),queryFn:({signal:e})=>vut(e),staleTime:3e5}),hht=e=>({queryKey:Nt("githubProjectRepoPreview",e),queryFn:({signal:n})=>but(e,n),staleTime:3e4}),QN=(e,n)=>({queryKey:Nt("repoAccess",e,n),queryFn:({signal:t})=>yut(e,n,t),staleTime:3e4}),q4=e=>({queryKey:Nt("resolvePaper",e),queryFn:({signal:n})=>xut(e,n),staleTime:36e5}),_ht=(e,n,t,r)=>({queryKey:Nt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Sut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),U4=e=>({queryKey:Nt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>a_(t,r,()=>Eut(e,n),Vp),staleTime:3e4}),iu=e=>({queryKey:Nt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>a_(t,r,()=>Nut(e,n),Vp),staleTime:3e4});function Tg(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function YN(){const e=za();return cht({onRun(n){var r;if(!Pn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Tg(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),KN.onRun(n)},onExperiment(n){Pn(e)&&(Ga(nt,U4(n.projectId).queryKey,n.id),nt.setQueryData(U4(n.projectId).queryKey,t=>Tg(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Pn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Tg(t,n)))},onArtifacts(n){Pn(e)&&(xa(Q5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Pn(e)&&(xa(UV,e),KN.onReconnect())}}),R.useEffect(()=>{let n;const t=tht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=XL(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=iv(o=>{Pn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&YL("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Tg(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?Zv(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=nht(()=>{Pn(e)&&nb(!0).catch(()=>{})}),a=sht(o=>{Pn(e)&&(Ga(nt,sv().queryKey),nt.setQueryData(sv().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const G4=new Set;function JL(e){if(e!==j()){lD(e,{reload:!1}),document.documentElement.lang=e;for(const n of G4)n()}}function pht(e){return G4.add(e),()=>G4.delete(e)}function Qd(){return R.useSyncExternalStore(pht,j,j)}const eO="orx:theme";function mht(){try{const e=localStorage.getItem(eO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Fh=mht();const W4=new Set;function ght(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function v6(){document.documentElement.dataset.theme=ght(Fh)}function tO(e){Fh=e;try{localStorage.setItem(eO,e)}catch{}v6();for(const n of W4)n()}function vht(){return Fh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Fh==="system"&&v6()});v6();function bht(e){return W4.add(e),()=>W4.delete(e)}function nO(){return[R.useSyncExternalStore(bht,()=>Fh,()=>Fh),tO]}const yht=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),rO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),ov="-",XN=[],wht="arbitrary..",Sht=e=>{const n=Cht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return kht(a);const o=a.split(ov),l=o[0]===""&&o.length>1?1:0;return sO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?yht(u,l):l:u||XN}return t[a]||XN}}},sO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=sO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(ov):e.slice(n).join(ov),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?wht+r:void 0})(),Cht=e=>{const{theme:n,classGroups:t}=e;return Eht(t,n)},Eht=(e,n)=>{const t=rO();for(const r in e){const s=e[r];b6(s,t,r,n)}return t},b6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){zht(e,n,t);return}if(typeof e=="function"){jht(e,n,t,r);return}Tht(e,n,t,r)},zht=(e,n,t)=>{const r=e===""?n:iO(n,e);r.classGroupId=t},jht=(e,n,t,r)=>{if(Aht(e)){b6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(xht(t,e))},Tht=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(ov),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,Rht=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},V4="!",ZN=":",Mht=[],JN=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),Dht=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ZN){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(V4)?(p=d.slice(0,-1),m=!0):d.startsWith(V4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return JN(i,m,p,x)};if(n){const s=n+ZN,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):JN(Mht,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},Lht=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},Oht=e=>({cache:Rht(e.cacheSize),parseClassName:Dht(e),sortModifiers:Lht(e),postfixLookupClassGroupIds:Iht(e),...Sht(e)}),Iht=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(Bht);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const z=w&&a[w]?r(S):void 0;z&&z!==w&&(w=z,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+V4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},Pht=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=Oht(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=$ht(l,t);return s(l,_),_};return i=a,(...l)=>i(Pht(...l))},Fht=[],fs=e=>{const n=t=>t[e]||Fht;return n.isThemeGetter=!0,n},oO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Hht=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qht=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Uht=/\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$/,Ght=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wht=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vht=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>Hht.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),vo=e=>!!e&&Number.isInteger(Number(e)),zx=e=>e.endsWith("%")&&dn(e.slice(0,-1)),yl=e=>qht.test(e),cO=()=>!0,Kht=e=>Uht.test(e)&&!Ght.test(e),y6=()=>!1,Qht=e=>Wht.test(e),Yht=e=>Vht.test(e),Xht=e=>!dt(e)&&!_t(e),Zht=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Jht=e=>Su(e,fO,y6),dt=e=>oO.test(e),Qu=e=>Su(e,hO,Kht),tz=e=>Su(e,o_t,dn),e_t=e=>Su(e,pO,cO),t_t=e=>Su(e,_O,y6),nz=e=>Su(e,uO,y6),n_t=e=>Su(e,dO,Yht),Ag=e=>Su(e,mO,Qht),_t=e=>lO.test(e),c0=e=>Yd(e,hO),r_t=e=>Yd(e,_O),rz=e=>Yd(e,uO),s_t=e=>Yd(e,fO),i_t=e=>Yd(e,dO),Rg=e=>Yd(e,mO,!0),a_t=e=>Yd(e,pO,!0),Su=(e,n,t)=>{const r=oO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Yd=(e,n,t=!1)=>{const r=lO.exec(e);return r?r[1]?n(r[1]):t:!1},uO=e=>e==="position"||e==="percentage",dO=e=>e==="image"||e==="url",fO=e=>e==="length"||e==="size"||e==="bg-size",hO=e=>e==="length",o_t=e=>e==="number",_O=e=>e==="family-name",pO=e=>e==="number"||e==="weight",mO=e=>e==="shadow",sz=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),_t,dt],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],z=()=>[_t,dt,l],M=()=>[Ic,"full","auto",...z()],O=()=>[vo,"none","subgrid",_t,dt],B=()=>["auto",{span:["full",vo,_t,dt]},vo,_t,dt],$=()=>[vo,"auto",_t,dt],U=()=>["auto","min","max","fr",_t,dt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...z()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...z()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],L=()=>[e,_t,dt],F=()=>[...C(),rz,nz,{position:[_t,dt]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",s_t,Jht,{size:[_t,dt]}],ee=()=>[zx,c0,Qu],ce=()=>["","none","full",u,_t,dt],oe=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,zx,rz,nz],ae=()=>["","none",x,_t,dt],ue=()=>["none",dn,_t,dt],pe=()=>["none",dn,_t,dt],Se=()=>[dn,_t,dt],ye=()=>[Ic,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yl],breakpoint:[yl],color:[cO],container:[yl],"drop-shadow":[yl],ease:["in","out","in-out"],font:[Xht],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yl],shadow:[yl],spacing:["px",dn],text:[yl],"text-shadow":[yl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,dt,_t,v]}],container:["container"],"container-type":[{"@container":["","normal","size",_t,dt]}],"container-named":[Zht],columns:[{columns:[dn,dt,_t,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[vo,"auto",_t,dt]}],basis:[{basis:[Ic,"full","auto",o,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",dt]}],grow:[{grow:["",dn,_t,dt]}],shrink:[{shrink:["",dn,_t,dt]}],order:[{order:[vo,"first","last","none",_t,dt]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,a_t,e_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zx,dt]}],"font-family":[{font:[r_t,t_t,n]}],"font-features":[{"font-features":[dt]}],"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:[s,_t,dt]}],"line-clamp":[{"line-clamp":[dn,"none",_t,tz]}],leading:[{leading:[i,...z()]}],"list-image":[{"list-image":["none",_t,dt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_t,dt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",_t,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",_t,dt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"tab-size":[{tab:[vo,_t,dt]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_t,dt]}],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",_t,dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vo,_t,dt],radial:["",_t,dt],conic:[vo,_t,dt]},i_t,n_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,_t,dt]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Rg,Ag]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Rg,Ag]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Rg,Ag]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,_t,dt]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[_t,dt]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_t,dt]}],filter:[{filter:["","none",_t,dt]}],blur:[{blur:ae()}],brightness:[{brightness:[dn,_t,dt]}],contrast:[{contrast:[dn,_t,dt]}],"drop-shadow":[{"drop-shadow":["","none",m,Rg,Ag]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,_t,dt]}],"hue-rotate":[{"hue-rotate":[dn,_t,dt]}],invert:[{invert:["",dn,_t,dt]}],saturate:[{saturate:[dn,_t,dt]}],sepia:[{sepia:["",dn,_t,dt]}],"backdrop-filter":[{"backdrop-filter":["","none",_t,dt]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[dn,_t,dt]}],"backdrop-contrast":[{"backdrop-contrast":[dn,_t,dt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,_t,dt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,_t,dt]}],"backdrop-invert":[{"backdrop-invert":["",dn,_t,dt]}],"backdrop-opacity":[{"backdrop-opacity":[dn,_t,dt]}],"backdrop-saturate":[{"backdrop-saturate":[dn,_t,dt]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,_t,dt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_t,dt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",_t,dt]}],ease:[{ease:["linear","initial",b,_t,dt]}],delay:[{delay:[dn,_t,dt]}],animate:[{animate:["none",w,_t,dt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,_t,dt]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[_t,dt,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[vo,_t,dt]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",_t,dt]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",_t,dt]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,tz]}],stroke:[{stroke:["none",...L()]}],"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"]}},l_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Yf(e,"cacheSize",n),Yf(e,"prefix",t),Yf(e,"experimentalParseClassName",r),Mg(e.theme,i.theme),Mg(e.classGroups,i.classGroups),Mg(e.conflictingClassGroups,i.conflictingClassGroups),Mg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Yf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Yf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Dg(e.theme,s.theme),Dg(e.classGroups,s.classGroups),Dg(e.conflictingClassGroups,s.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),K4(e,s,"postfixLookupClassGroups"),K4(e,s,"orderSensitiveModifiers"),e),Yf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Mg=(e,n)=>{if(n)for(const t in n)Yf(e,t,n[t])},Dg=(e,n)=>{if(n)for(const t in n)K4(e,n,t)},K4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},c_t=(e,...n)=>typeof e=="function"?ez(sz,e,...n):ez(()=>l_t(sz(),e),...n),u_t=c_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return u_t(...e)}const d_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Ft({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",d_t[e],t),...r})}const f_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),h_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},__t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function gO(e,n,t,r){return Ds(f_t,h_t[e],__t[n],t&&"active",r)}function Oe({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:gO(n,t,e,r),...s})}function Hh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:gO(n,t,e,r),...s})}const p_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),m_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},g_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function vO(e,n,t,r){return Ds(p_t,m_t[e],g_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:vO(r,t,n,s),...i})});function rb({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:vO(t,n,e,r),...s})}const v_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function rs({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",v_t[e],n),...t})}function sr({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function Lt({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const b_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function sb({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",b_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const y_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function bO(e,n){return Ds(y_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function x6({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:bO(e,n),...r,children:t??f.jsx("span",{})})}function x_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:bO(e,n),...t,children:f.jsx("span",{})})}var no=CM();const w_t=Gp(no);function S_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const k_t=e=>{switch(e){case"success":return N_t;case"info":return j_t;case"warning":return z_t;case"error":return T_t;default:return null}},C_t=Array(12).fill(0),E_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},C_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),N_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),j_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),T_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),A_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),R_t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let M_t=1;const D_t=100,iz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:M_t++};class L_t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-D_t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=iz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(I_t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=iz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new L_t,O_t=(e,n)=>wi.message(e,n),I_t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",B_t=O_t,$_t=()=>wi.toasts,P_t=()=>wi.getActiveToasts(),F_t=Object.assign(B_t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:$_t,getToasts:P_t});S_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Lg(e){return e.label!==void 0}const H_t=3,q_t="24px",U_t="16px",az=4e3,G_t=356,W_t=14,V_t=45,K_t=200;function bo(...e){return e.filter(Boolean).join(" ")}function Q_t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const Y_t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:z,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:U,gap:H,expandByDefault:Y,classNames:V,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,q]=Je.useState(null),[G,ee]=Je.useState(!1),[ce,oe]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,ae]=Je.useState(!1),[ue,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),ze=Je.useRef(d.duration||$||az),at=Je.useRef(null),bt=Je.useRef(null),$t=b===0,Pt=b+1<=S,zt=d.type,ot=zt??"default",ft=d.dismissible!==!1,It=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(vt=>vt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var vt;return(vt=d.closeButton)!=null?vt:N},[d.closeButton,N]),ht=Je.useMemo(()=>d.duration||$||az,[d.duration,$]),xt=Je.useRef(0),Vt=Je.useRef(0),Ve=Je.useRef(0),Ht=Je.useRef(null),[sn,fn]=U.split("-"),Zt=Je.useMemo(()=>v.reduce((vt,un,Cn)=>Cn>=Re?vt:vt+un.height,0),[v,Re]),Qn=R_t(),Jt=Je.useMemo(()=>{var vt;return(vt=e.swipeDirections)!=null?vt:Q_t(U)},[e.swipeDirections,U]),bn=d.invert||_,or=zt==="loading";Vt.current=Je.useMemo(()=>Re*H+Zt,[Re,Zt]),Je.useEffect(()=>{ze.current=ht},[ht]),Je.useEffect(()=>{ee(!0)},[]),Je.useEffect(()=>{const vt=bt.current;if(vt){const un=vt.getBoundingClientRect().height;return Ie(un),x(Cn=>[{toastId:d.id,height:un,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(en=>en.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!G)return;const vt=bt.current,un=vt.style.height;vt.style.height="auto";const Cn=vt.getBoundingClientRect().height;vt.style.height=un,Ie(Cn),x(en=>en.find(hn=>hn.toastId===d.id)?en.map(hn=>hn.toastId===d.id?{...hn,height:Cn}:hn):[{toastId:d.id,height:Cn,position:d.position},...en])},[G,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const lr=Je.useCallback(()=>{oe(!0),ye(Vt.current),x(vt=>vt.filter(un=>un.toastId!==d.id)),setTimeout(()=>{C(d)},K_t)},[d,C,x,Vt]);Je.useEffect(()=>{if(d.promise&&zt==="loading"||d.duration===1/0||d.type==="loading")return;let vt;return y||m||Qn?(()=>{if(Ve.current{ze.current!==1/0&&(xt.current=new Date().getTime(),vt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),lr()},ze.current))})(),()=>clearTimeout(vt)},[y,m,d,zt,Qn,lr]),Je.useEffect(()=>{d.delete&&(lr(),d.onDismiss==null||d.onDismiss.call(d,d))},[lr,d.delete]);function br(){var vt;if(X!=null&&X.loading){var un;return Je.createElement("div",{className:bo(V==null?void 0:V.loader,d==null||(un=d.classNames)==null?void 0:un.loader,"sonner-loader"),"data-visible":zt==="loading"},X.loading)}return Je.createElement(E_t,{className:bo(V==null?void 0:V.loader,d==null||(vt=d.classNames)==null?void 0:vt.loader),visible:zt==="loading"})}const Dn=d.icon||(X==null?void 0:X[zt])||k_t(zt);var Wr,Nr;return Je.createElement("li",{tabIndex:0,ref:bt,className:bo(O,It,V==null?void 0:V.toast,d==null||(n=d.classNames)==null?void 0:n.toast,V==null?void 0:V[ot],d==null||(t=d.classNames)==null?void 0:t[ot]),"data-sonner-toast":"","data-rich-colors":(Wr=d.richColors)!=null?Wr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":G,"data-promise":!!d.promise,"data-swiped":ue,"data-removed":ce,"data-visible":Pt,"data-y-position":sn,"data-x-position":fn,"data-index":b,"data-front":$t,"data-swiping":ne,"data-dismissible":ft,"data-type":zt,"data-invert":bn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&G),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${ce?Se:Vt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Ht.current=null},onPointerDown:vt=>{vt.button!==2&&(or||!ft||(at.current=new Date,ye(Vt.current),vt.target.setPointerCapture(vt.pointerId),vt.target.tagName!=="BUTTON"&&(Q(!0),Ht.current={x:vt.clientX,y:vt.clientY})))},onPointerUp:()=>{var vt,un,Cn;if(le||!ft)return;Ht.current=null;const en=Number(((vt=bt.current)==null?void 0:vt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jn=Number(((un=bt.current)==null?void 0:un.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),hn=new Date().getTime()-((Cn=at.current)==null?void 0:Cn.getTime()),En=I==="x"?en:Jn,ln=Math.abs(En)/hn;if((I==="x"?Jt.includes(en>0?"right":"left"):Jt.includes(Jn>0?"bottom":"top"))&&(Math.abs(En)>=V_t||ln>.11)){ye(Vt.current),d.onDismiss==null||d.onDismiss.call(d,d),q(I==="x"?en>0?"right":"left":Jn>0?"down":"up"),lr(),ae(!0);return}else{var kt,Ge;(kt=bt.current)==null||kt.style.setProperty("--swipe-amount-x","0px"),(Ge=bt.current)==null||Ge.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:vt=>{var un,Cn,en;if(!Ht.current||!ft||((un=window.getSelection())==null?void 0:un.toString().length)>0)return;const hn=vt.clientY-Ht.current.y,En=vt.clientX-Ht.current.x;!I&&(Math.abs(En)>1||Math.abs(hn)>1)&&L(Math.abs(En)>Math.abs(hn)?"x":"y");let ln={x:0,y:0};const pt=kt=>1/(1.5+Math.abs(kt)/20);if(I==="y"){if(Jt.includes("top")||Jt.includes("bottom"))if(Jt.includes("top")&&hn<0||Jt.includes("bottom")&&hn>0)ln.y=hn;else{const kt=hn*pt(hn);ln.y=Math.abs(kt)0)ln.x=En;else{const kt=En*pt(En);ln.x=Math.abs(kt)0||Math.abs(ln.y)>0)&&pe(!0),(Cn=bt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${ln.x}px`),(en=bt.current)==null||en.style.setProperty("--swipe-amount-y",`${ln.y}px`)}},Ze&&!d.jsx&&zt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":or,"data-close-button":!0,onClick:or||!ft?()=>{}:()=>{lr(),d.onDismiss==null||d.onDismiss.call(d,d)},className:bo(V==null?void 0:V.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:A_t):null,(zt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[zt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:bo(V==null?void 0:V.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},zt==="loading"?d.icon||br():d.promise?br():null,zt!=="loading"?Dn:null):null,Je.createElement("div",{"data-content":"",className:bo(V==null?void 0:V.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:bo(V==null?void 0:V.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:bo(B,we,V==null?void 0:V.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Lg(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||z,onClick:vt=>{Lg(d.cancel)&&ft&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,vt),lr())},className:bo(V==null?void 0:V.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Lg(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:vt=>{Lg(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,vt),!vt.defaultPrevented&&lr())},className:bo(V==null?void 0:V.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function oz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function X_t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?U_t:q_t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const Z_t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=H_t,toastOptions:b,dir:w=oz(),gap:y=W_t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,z]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(ee=>ee.toasterId===r):T.filter(ee=>!ee.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(ee=>ee.position).map(ee=>ee.position)))),[M,i]),[B,$]=Je.useState([]),[U,H]=Je.useState(!1),[Y,V]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),q=Je.useRef(!1),G=Je.useCallback(ee=>{z(ce=>{var oe;return(oe=ce.find(ne=>ne.id===ee.id))!=null&&oe.delete||wi.dismiss(ee.id),ce.filter(({id:ne})=>ne!==ee.id)})},[]);return Je.useEffect(()=>wi.subscribe(ee=>{if(ee.dismiss){requestAnimationFrame(()=>{z(ce=>ce.map(oe=>oe.id===ee.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{w_t.flushSync(()=>{z(ce=>{const oe=ce.findIndex(ne=>ne.id===ee.id);return oe!==-1?[...ce.slice(0,oe),{...ce[oe],...ee},...ce.slice(oe+1)]:[ee,...ce]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:ce})=>{te(ce?"dark":"light")})}catch{ee.addListener(({matches:oe})=>{try{te(oe?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&H(!1)},[T]),Je.useEffect(()=>{const ee=ce=>{var oe;if(a.length>0&&a.every(le=>ce[le]||ce.code===le)){var Q;H(!0),(Q=I.current)==null||Q.focus()}ce.code==="Escape"&&(document.activeElement===I.current||(oe=I.current)!=null&&oe.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,q.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((ee,ce)=>{var oe;const[ne,Q]=ee.split("-");return M.length?Je.createElement("ol",{key:ee,dir:w==="auto"?oz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((oe=B[0])==null?void 0:oe.height)||0}px`,"--width":`${G_t}px`,"--gap":`${y}px`,...S,...X_t(_,d)},onBlur:le=>{q.current&&!le.currentTarget.contains(le.relatedTarget)&&(q.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||q.current||(q.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{Y||H(!1)},onDragEnd:()=>H(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(le=>!le.position&&ce===0||le.position===ee).map((le,ae)=>{var ue,pe;return Je.createElement(Y_t,{key:le.id,icons:C,index:ae,toast:le,defaultRichColors:m,duration:(ue=b==null?void 0:b.duration)!=null?ue:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:ee,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:G,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:U,swipeDirections:n.swipeDirections})})):null}))});function J_t(e){const[n]=nO();return f.jsx(Z_t,{theme:n,...e})}function Kn(e,n,t){F_t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function w6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const e0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ib(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(e0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function yO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?vOe():TOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?nOe():MLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?uOe():wOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?_Oe():EOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?aOe():GLe({count:Wt(n.activeRunCount)})),ib(a,s),no.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:FLe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:ZLe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Oe,{disabled:r,onClick:s,children:Ad()}),f.jsx(Oe,{variant:"danger",disabled:r,onClick:i,children:r?DOe():ILe()})]})]})}),document.body)}var jx={exports:{}},lz;function t0t(){return lz||(lz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(jx)),jx.exports}var n0t=t0t(),Tx={exports:{}},cz;function r0t(){return cz||(cz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[z,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||z===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:z+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(Tx)),Tx.exports}var s0t=r0t(),Ax={exports:{}},uz;function i0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,z=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(z=(T<3?N(z):T>3?N(y,C,z):N(y,C))||z);return T>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",E2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),N2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",p6="chat_demo_nanochat_figures_v1",m6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[p6]:"figures",[m6]:"literature"},S1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class D4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new D4(s,a,i.exists)}}catch(i){if(i instanceof D4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),tb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??O4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?r6():n,r=O4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const rv="default";function nb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===rv)?rv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const L4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:L4,label:pBe(),description:dBe()},...t]:[]}function sv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?L4:t!=null&&s.some(a=>a.id===t)?t:L4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=nb(e,n);return r.length===0?rv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function O4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(Jv(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),iv=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),v6=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function rb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const k1=new Map;function kht(e,n){let t=k1.get(e);return t||(t=new Set,k1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&k1.delete(e)}}function Cht(e){var n;(n=k1.get(e.runId))==null||n.forEach(t=>t(e))}const I4=new Set;function av(e){return I4.add(e),()=>{I4.delete(e)}}function bl(e){I4.forEach(n=>n(e))}const B4=new Set;function Eht(e){return B4.add(e),()=>{B4.delete(e)}}function yl(){B4.forEach(e=>e())}const $4=new Set;function Nht(e){return $4.add(e),()=>{$4.delete(e)}}function WN(e){$4.forEach(n=>n(e))}const P4=new Set;function tO(e){return P4.add(e),()=>{P4.delete(e)}}function z2(e){P4.forEach(n=>n(e))}const F4=new Set;function zht(e){return F4.add(e),()=>{F4.delete(e)}}function VN(e){F4.forEach(n=>n(e))}const H4=new Set;function jht(e){return H4.add(e),()=>{H4.delete(e)}}function Tht(e){H4.forEach(n=>n(e))}let q4=!0;const U4=new Set;function Aht(e){return U4.add(e),()=>{U4.delete(e)}}function KN(){return q4}function QN(e){e!==q4&&(q4=e,U4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&z2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&z2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&z2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const ov=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return ov.add(t),()=>{ov.delete(t)}},[])}const YN={onRun:e=>ov.forEach(n=>n.onRun(e)),onReconnect:()=>ov.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),G4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),W4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,W4(n.projectId).queryKey,n.id),nt.setQueryData(W4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(X5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=av(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?Jv(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&rb(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,iv().queryKey),nt.setQueryData(iv().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const V4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of V4)n()}}function Pht(e){return V4.add(e),()=>V4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const K4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of K4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return K4.add(e),()=>K4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),lv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(lv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(lv):e.slice(n).join(lv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(lv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Q4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Q4)?(p=d.slice(0,-1),m=!0):d.startsWith(Q4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Q4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),j2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],H=()=>["auto","min","max","fr",pt,ht],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],ee=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],P=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],te=()=>[j2,c0,Qu],de=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,j2,iz,sz],oe=()=>["","none",x,pt,ht],ce=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...ee()]}],"min-inline-size":[{"min-inline":["auto",...ee()]}],"max-inline-size":[{"max-inline":["none",...ee()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",j2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Y4(e,s,"postfixLookupClassGroups"),Y4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)Y4(e,n,t)},Y4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function sb({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ib({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:H,gap:q,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:ee="Close toast"}=e,[I,L]=Je.useState(null),[P,W]=Je.useState(null),[U,te]=Je.useState(!1),[de,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ce,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=H.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(H)},[e.swipeDirections,H]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*q+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{te(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!U)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ce,"data-removed":de,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":P,"data-expanded":!!(y||Y&&U),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${de?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":ee,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(te=>te.toasterId===r):T.filter(te=>!te.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(te=>te.position).map(te=>te.position)))),[M,i]),[B,$]=Je.useState([]),[H,q]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,ee]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Je.useRef(null),W=Je.useRef(!1),U=Je.useCallback(te=>{j(de=>{var re;return(re=de.find(ne=>ne.id===te.id))!=null&&re.delete||wi.dismiss(te.id),de.filter(({id:ne})=>ne!==te.id)})},[]);return Je.useEffect(()=>wi.subscribe(te=>{if(te.dismiss){requestAnimationFrame(()=>{j(de=>de.map(re=>re.id===te.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(de=>{const re=de.findIndex(ne=>ne.id===te.id);return re!==-1?[...de.slice(0,re),{...de[re],...te},...de.slice(re+1)]:[te,...de]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){ee(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ee("dark"):ee("light")),typeof window>"u")return;const te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:de})=>{ee(de?"dark":"light")})}catch{te.addListener(({matches:re})=>{try{ee(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&q(!1)},[T]),Je.useEffect(()=>{const te=de=>{var re;if(a.length>0&&a.every(le=>de[le]||de.code===le)){var Q;q(!0),(Q=I.current)==null||Q.focus()}de.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[a]),Je.useEffect(()=>{if(I.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((te,de)=>{var re;const[ne,Q]=te.split("-");return M.length?Je.createElement("ol",{key:te,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,P.current=le.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Y||q(!1)},onDragEnd:()=>q(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&de===0||le.position===te).map((le,oe)=>{var ce,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ce=b==null?void 0:b.duration)!=null?ce:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:te,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:H,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ab(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),ab(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var T2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(T2)),T2.exports}var N0t=E0t(),A2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(A2)),A2.exports}var j0t=z0t(),R2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),z=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,z))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,z)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const z=this._createAccessibilityTreeNode();this._rowElements.unshift(z),this._rowContainer.insertAdjacentElement("afterbegin",z)}else{const z=this._createAccessibilityTreeNode();this._rowElements.push(z),this._rowContainer.appendChild(z)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let U=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get($);if(!H)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++U,Y=0),{row:U,column:Y}},T=N(y),z=N(C);if(T&&z){if(T.row>z.row||T.row===z.row&&T.column>=z.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(z.row-T.row)*this._terminal.cols-T.column+z.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var z=b.length-1;z>=0;z--)(E=b[z])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(z=>{var O,B;if(this._isMouseOut)return;const M=z==null?void 0:z.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=z;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(z.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(z){y=!0,this._handleNewLink(z);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,z=!1;for(let O=0;Oy?y.activate(H,Y,$):x(0,Y),hover:(H,Y)=>{var V;return(V=y==null?void 0:y.hover)==null?void 0:V.call(y,H,Y,$)},leave:(H,Y)=>{var V;return(V=y==null?void 0:y.leave)==null?void 0:V.call(y,H,Y,$)}})}z=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let H=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const q=this._rowColumns.get($);if(!q)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++H,Y=0),{row:H,column:Y}},T=N(y),j=N(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var O,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=j;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let O=0;Oy?y.activate(q,Y,$):x(0,Y),hover:(q,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,q,Y,$)},leave:(q,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,q,Y,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? -WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=l(3614),_=l(3656),d=l(3551),p=l(9042),m=l(3730),x=l(1680),S=l(3107),v=l(5744),b=l(2950),w=l(1296),y=l(428),C=l(4269),E=l(5114),N=l(8934),T=l(3230),z=l(9312),M=l(4725),O=l(6731),B=l(8055),$=l(8969),U=l(8460),H=l(844),Y=l(6114),V=l(8437),X=l(2584),te=l(7399),I=l(5941),L=l(9074),F=l(2585),q=l(5435),G=l(4567),ee=l(779);class ce extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ne={}){super(ne),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((Q,le)=>this.refresh(Q,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((Q=>this._reportWindowsOptions(Q)))),this.register(this._inputHandler.onColor((Q=>this._handleColorEvent(Q)))),this.register((0,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((Q=>this._afterResize(Q.cols,Q.rows)))),this.register((0,H.toDisposable)((()=>{var Q,le;this._customKeyEventHandler=void 0,(le=(Q=this.element)==null?void 0:Q.parentNode)==null||le.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const Q of ne){let le,ae="";switch(Q.index){case 256:le="foreground",ae="10";break;case 257:le="background",ae="11";break;case 258:le="cursor",ae="12";break;default:le="ansi",ae="4;"+Q.index}switch(Q.type){case 0:const ue=B.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[Q.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ae};${(0,I.toRgbString)(ue)}${X.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((pe=>pe.ansi[Q.index]=B.channels.toColor(...Q.color)));else{const pe=le;this._themeService.modifyColors((Se=>Se[pe]=B.channels.toColor(...Q.color)))}break;case 2:this._themeService.restoreColor(Q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ne=this.buffer.ybase+this.buffer.y,Q=this.buffer.lines.get(ne);if(!Q)return;const le=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,ue=Q.getWidth(le),pe=this._renderService.dimensions.css.cell.width*ue,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,ye=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ye+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(Q=>{this.hasSelection()&&(0,u.copyHandler)(Q,this._selectionService)})));const ne=Q=>(0,u.handlePasteEvent)(Q,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,_.addDisposableDomListener)(this.element,"paste",ne)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(Q=>{Q.button===2&&(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(Q=>{(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(Q=>{Q.button===1&&(0,u.moveTextAreaUnderMouseCursor)(Q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var le;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((le=this.element)==null?void 0:le.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ne.appendChild(this.element);const Q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(ae=>this.updateCursorStyle(ae)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(z.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,Q=this.element;function le(pe){const Se=ne._mouseService.getMouseReportCoords(pe,ne.screenElement);if(!Se)return!1;let ye,qe;switch(pe.overrideType||pe.type){case"mousemove":qe=32,pe.buttons===void 0?(ye=3,pe.button!==void 0&&(ye=pe.button<3?pe.button:3)):ye=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":qe=0,ye=pe.button<3?pe.button:3;break;case"mousedown":qe=1,ye=pe.button<3?pe.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(pe)===!1||ne.viewport.getLinesScrolled(pe)===0)return!1;qe=pe.deltaY<0?0:1,ye=4;break;default:return!1}return!(qe===void 0||ye===void 0||ye>4)&&ne.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:ye,action:qe,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ue={mouseup:pe=>(le(pe),pe.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(pe)),wheel:pe=>(le(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&le(pe)},mousemove:pe=>{pe.buttons||le(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?ae.mousemove||(Q.addEventListener("mousemove",ue.mousemove),ae.mousemove=ue.mousemove):(Q.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&pe?ae.wheel||(Q.addEventListener("wheel",ue.wheel,{passive:!1}),ae.wheel=ue.wheel):(Q.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&pe?ae.mouseup||(ae.mouseup=ue.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&pe?ae.mousedrag||(ae.mousedrag=ue.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(Q,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return le(pe),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(pe)}))),this.register((0,_.addDisposableDomListener)(Q,"wheel",(pe=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(pe);if(Se===0)return;const ye=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let qe="";for(let Ie=0;Ie{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(Q,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(ne,Q){var le;(le=this._renderService)==null||le.refreshRows(ne,Q)}updateCursorStyle(ne){var Q;(Q=this._selectionService)!=null&&Q.shouldColumnSelect(ne)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ne,Q,le=0){var ae;le===1?(super.scrollLines(ne,Q,le),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(ne)}paste(ne){(0,u.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const Q=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),Q}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,Q,le){this._selectionService.setSelection(ne,Q,le)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,Q){var le;(le=this._selectionService)==null||le.selectLines(ne,Q)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const Q=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!Q&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;Q||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,te.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),le.type===3||le.type===2){const ae=this.rows-1;return this.scrollLines(le.type===2?-ae:ae),this.cancel(ne,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(le.cancel&&this.cancel(ne,!0),!le.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==X.C0.ETX&&le.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,Q){const le=ne.isMac&&!this.options.macOptionIsMeta&&Q.altKey&&!Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.altKey&&Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.getModifierState("AltGraph");return Q.type==="keypress"?le:le&&(!Q.keyCode||Q.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(Q){return Q.keyCode===16||Q.keyCode===17||Q.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let Q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)Q=ne.charCode;else if(ne.which===null||ne.which===void 0)Q=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;Q=ne.which}return!(!Q||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(Q=String.fromCharCode(Q),this._onKey.fire({key:Q,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(Q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const Q=ne.data;return this.coreService.triggerDataEvent(Q,!0),this.cancel(ne),!0}return!1}resize(ne,Q){ne!==this.cols||Q!==this.rows?super.resize(ne,Q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,Q){var le,ae;(le=this._charSizeService)==null||le.measure(),(ae=this.viewport)==null||ae.syncScrollArea(!0)}clear(){var ne;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Q=1;Q{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,u=1e3){this._renderCallback=l,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=d-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u)}}},1680:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var z=b.length-1;z>=0;z--)(E=b[z])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),p=l(4725),m=l(8460),x=l(844),S=l(2585);let v=o.Viewport=class extends x.Disposable{constructor(b,w,y,C,E,N,T,z){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=E,this._renderService=N,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(z.colors),this.register(z.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=$),C=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let w=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(b,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const w=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(b,w))}};o.Viewport=v=u([_(2,S.IBufferService),_(3,S.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],v)},3107:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),p=l(844),m=l(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(S,v,b,w,y){super(),this._screenElement=S,this._bufferService=v,this._coreBrowserService=b,this._decorationService=w,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),v.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=S.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(S,v),v}_refreshStyle(S){const v=S.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let b=this._decorationElements.get(S);b||(b=this._createElement(S),S.element=b,this._decorationElements.set(S,b),this._container.appendChild(b),S.onDispose((()=>{this._decorationElements.delete(S),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(b)}}_refreshXPosition(S,v=S.element){if(!v)return;const b=S.options.x??0;(S.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var v;(v=this._decorationElements.get(S))==null||v.remove(),this._decorationElements.delete(S),S.dispose()}};o.BufferDecorationRenderer=x=u([_(1,m.IBufferService),_(2,d.ICoreBrowserService),_(3,m.IDecorationService),_(4,d.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const u of this._zones)if(u.color===l.options.overviewRulerOptions.color&&u.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,l.marker.line))return;if(this._lineAdjacentToZone(u,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(u,l.marker.line)}if(this._zonePoolIndex=l.startBufferLine&&u<=l.endBufferLine}_lineAdjacentToZone(l,u,_){return u>=l.startBufferLine-this._linePadding[_||"full"]&&u<=l.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(l,u){l.startBufferLine=Math.min(l.startBufferLine,u),l.endBufferLine=Math.max(l.endBufferLine,u)}}},5744:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,z=arguments.length,M=z<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(z<3?T(M):z>3?T(C,E,M):T(C,E))||M);return z>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),p=l(4725),m=l(844),x=l(2585),S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let w=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,E,N,T,z,M){var B;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=E,this._decorationService=N,this._renderService=T,this._optionsService=z,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=w=u([_(2,x.IBufferService),_(3,x.IDecorationService),_(4,p.IRenderService),_(5,x.IOptionsService),_(6,p.ICoreBrowserService)],w)},2950:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),p=l(2585),m=l(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,v,b,w,y,C){this._textarea=S,this._compositionView=v,this._bufferService=b,this._optionsService=w,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(S,"");this._dataAlreadySent=b,v.length>S.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,d.IRenderService)],x)},9806:(a,o)=>{function l(u,_,d){const p=d.getBoundingClientRect(),m=u.getComputedStyle(d),x=parseInt(m.getPropertyValue("padding-left")),S=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-x,_.clientY-p.top-S]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(u,_,d,p,m,x,S,v,b){if(!x)return;const w=l(u,_,d);return w?(w[0]=Math.ceil((w[0]+(b?S/2:0))/S),w[1]=Math.ceil(w[1]/v),w[0]=Math.min(Math.max(w[0],1),p+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),m),w):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=l(2584);function _(v,b,w,y){const C=v-d(v,w),E=b-d(b,w),N=Math.abs(C-E)-(function(T,z,M){let O=0;const B=T-d(T,M),$=z-d(z,M);for(let U=0;U=0&&vb?"A":"B"}function m(v,b,w,y,C,E){let N=v,T=b,z="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>E.cols-1?(z+=E.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(z+=E.buffer.translateBufferLineToString(T,!1,0,v+1),N=E.cols-1,v=N,T--);return z+E.buffer.translateBufferLineToString(T,!1,v,N)}function x(v,b){const w=b?"O":"[";return u.C0.ESC+w+v}function S(v,b){v=Math.floor(v);let w="";for(let y=0;y0?B-d(B,$):M;const Y=B,V=(function(X,te,I,L,F,q){let G;return G=_(I,L,F,q).length>0?L-d(L,F):te,X=I&&Gv?"D":"C",S(Math.abs(C-v),x(N,y));N=E>b?"D":"C";const T=Math.abs(E-b);return S((function(z,M){return M.cols-z})(E>b?v:C,w)+(T-1)*w.cols+1+((E>b?C:v)-1),x(N,y))}},1296:function(a,o,l){var u=this&&this.__decorate||function(U,H,Y,V){var X,te=arguments.length,I=te<3?H:V===null?V=Object.getOwnPropertyDescriptor(H,Y):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(U,H,Y,V);else for(var L=U.length-1;L>=0;L--)(X=U[L])&&(I=(te<3?X(I):te>3?X(H,Y,I):X(H,Y))||I);return te>3&&I&&Object.defineProperty(H,Y,I),I},_=this&&this.__param||function(U,H){return function(Y,V){H(Y,V,U)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),p=l(2550),m=l(2223),x=l(6171),S=l(6052),v=l(4725),b=l(8055),w=l(8460),y=l(844),C=l(2585),E="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",z="xterm-bg-",M="xterm-focus",O="xterm-selection";let B=1,$=o.DomRenderer=class extends y.Disposable{constructor(U,H,Y,V,X,te,I,L,F,q,G,ee,ce){super(),this._terminal=U,this._document=H,this._element=Y,this._screenElement=V,this._viewportElement=X,this._helperContainer=te,this._linkifier2=I,this._charSizeService=F,this._optionsService=q,this._bufferService=G,this._coreBrowserService=ee,this._themeService=ce,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((oe=>this._injectCss(oe)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((oe=>this._handleLinkHover(oe)))),this.register(this._linkifier2.onHideLinkUnderline((oe=>this._handleLinkLeave(oe)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${N} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(U.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;H+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${V} { 50% { box-shadow: none; }}`,H+=`@keyframes ${X} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,H+=`${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[te,I]of U.ansi.entries())H+=`${this._terminalSelector} .${T}${te} { color: ${I.css}; }${this._terminalSelector} .${T}${te}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${z}${te} { background-color: ${I.css}; }`;H+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(U.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${z}${m.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,H){for(let Y=this._rowElements.length;Y<=H;Y++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,H){this._refreshRowElements(U,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,H,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,H,Y),this.renderRows(0,this._bufferService.rows-1),!U||!H)return;this._selectionRenderModel.update(this._terminal,U,H,Y);const V=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(Y){const F=U[0]>H[0];L.appendChild(this._createSelectionElement(te,F?H[0]:U[0],F?U[0]:H[0],I-te+1))}else{const F=V===te?U[0]:0,q=te===X?H[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(te,F,q));const G=I-te-1;if(L.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,G)),te!==I){const ee=X===I?H[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,ee))}}this._selectionContainer.appendChild(L)}_createSelectionElement(U,H,Y,V=1){const X=this._document.createElement("div"),te=H*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(Y-H);return te+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-te),X.style.height=V*this.dimensions.css.cell.height+"px",X.style.top=U*this.dimensions.css.cell.height+"px",X.style.left=`${te}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const U of this._rowElements)U.replaceChildren()}renderRows(U,H){const Y=this._bufferService.buffer,V=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=U;F<=H;F++){const q=F+Y.ydisp,G=this._rowElements[F],ee=Y.lines.get(q);if(!G||!ee)break;G.replaceChildren(...this._rowFactory.createRow(ee,q,q===V,I,L,X,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,H,Y,V,X,te){Y<0&&(U=0),V<0&&(H=0);const I=this._bufferService.rows-1;Y=Math.max(Math.min(Y,I),0),V=Math.max(Math.min(V,I),0),X=Math.min(X,this._bufferService.cols);const L=this._bufferService.buffer,F=L.ybase+L.y,q=Math.min(L.x,X-1),G=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let oe=Y;oe<=V;++oe){const ne=oe+L.ydisp,Q=this._rowElements[oe],le=L.lines.get(ne);if(!Q||!le)break;Q.replaceChildren(...this._rowFactory.createRow(le,ne,ne===F,ee,ce,q,G,this.dimensions.css.cell.width,this._widthCache,te?oe===Y?U:0:-1,te?(oe===V?H:X)-1:-1))}}};o.DomRenderer=$=u([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],$)},3787:function(a,o,l){var u=this&&this.__decorate||function(N,T,z,M){var O,B=arguments.length,$=B<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,z):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,T,z,M);else for(var U=N.length-1;U>=0;U--)(O=N[U])&&($=(B<3?O($):B>3?O(T,z,$):O(T,z))||$);return B>3&&$&&Object.defineProperty(T,z,$),$},_=this&&this.__param||function(N,T){return function(z,M){T(z,M,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),p=l(643),m=l(511),x=l(2585),S=l(8055),v=l(4725),b=l(4269),w=l(6171),y=l(3734);let C=o.DomRendererRowFactory=class{constructor(N,T,z,M,O,B,$){this._document=N,this._characterJoinerService=T,this._optionsService=z,this._coreBrowserService=M,this._coreService=O,this._decorationService=B,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,z){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=z}createRow(N,T,z,M,O,B,$,U,H,Y,V){const X=[],te=this._characterJoinerService.getJoinedCharacters(T),I=this._themeService.colors;let L,F=N.getNoBgTrimmedLength();z&&F0&&Se===te[0][0]){qe=!0;const Ve=te.shift();ze=new b.JoinedCellData(this._workCell,N.translateToString(!0,Ve[0],Ve[1]),Ve[1]-Ve[0]),Ie=Ve[1]-1,ye=ze.getWidth()}const at=this._isCellInSelection(Se,T),bt=z&&Se===B,$t=pe&&Se>=Y&&Se<=V;let Pt=!1;this._decorationService.forEachDecorationAtCell(Se,T,void 0,(Ve=>{Pt=!0}));let zt=ze.getChars()||p.WHITESPACE_CELL_CHAR;if(zt===" "&&(ze.isUnderline()||ze.isOverline())&&(zt=" "),ae=ye*U-H.get(zt,ze.isBold(),ze.isItalic()),L){if(q&&(at&&le||!at&&!le&&ze.bg===ee)&&(at&&le&&I.selectionForeground||ze.fg===ce)&&ze.extended.ext===oe&&$t===ne&&ae===Q&&!bt&&!qe&&!Pt){ze.isInvisible()?G+=p.WHITESPACE_CELL_CHAR:G+=zt,q++;continue}q&&(L.textContent=G),L=this._document.createElement("span"),q=0,G=""}else L=this._document.createElement("span");if(ee=ze.bg,ce=ze.fg,oe=ze.extended.ext,ne=$t,Q=ae,le=at,qe&&B>=Se&&B<=Ie&&(B=Se),!this._coreService.isCursorHidden&&bt&&this._coreService.isCursorInitialized){if(ue.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ue.push("xterm-cursor-blink"),ue.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ue.push("xterm-cursor-outline");break;case"block":ue.push("xterm-cursor-block");break;case"bar":ue.push("xterm-cursor-bar");break;case"underline":ue.push("xterm-cursor-underline")}}if(ze.isBold()&&ue.push("xterm-bold"),ze.isItalic()&&ue.push("xterm-italic"),ze.isDim()&&ue.push("xterm-dim"),G=ze.isInvisible()?p.WHITESPACE_CELL_CHAR:ze.getChars()||p.WHITESPACE_CELL_CHAR,ze.isUnderline()&&(ue.push(`xterm-underline-${ze.extended.underlineStyle}`),G===" "&&(G=" "),!ze.isUnderlineColorDefault()))if(ze.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(ze.getUnderlineColor()).join(",")})`;else{let Ve=ze.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ze.isBold()&&Ve<8&&(Ve+=8),L.style.textDecorationColor=I.ansi[Ve].css}ze.isOverline()&&(ue.push("xterm-overline"),G===" "&&(G=" ")),ze.isStrikethrough()&&ue.push("xterm-strikethrough"),$t&&(L.style.textDecoration="underline");let ot=ze.getFgColor(),ft=ze.getFgColorMode(),It=ze.getBgColor(),we=ze.getBgColorMode();const Re=!!ze.isInverse();if(Re){const Ve=ot;ot=It,It=Ve;const Ht=ft;ft=we,we=Ht}let Ze,ht,xt,Vt=!1;switch(this._decorationService.forEachDecorationAtCell(Se,T,void 0,(Ve=>{Ve.options.layer!=="top"&&Vt||(Ve.backgroundColorRGB&&(we=50331648,It=Ve.backgroundColorRGB.rgba>>8&16777215,Ze=Ve.backgroundColorRGB),Ve.foregroundColorRGB&&(ft=50331648,ot=Ve.foregroundColorRGB.rgba>>8&16777215,ht=Ve.foregroundColorRGB),Vt=Ve.options.layer==="top")})),!Vt&&at&&(Ze=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,It=Ze.rgba>>8&16777215,we=50331648,Vt=!0,I.selectionForeground&&(ft=50331648,ot=I.selectionForeground.rgba>>8&16777215,ht=I.selectionForeground)),Vt&&ue.push("xterm-decoration-top"),we){case 16777216:case 33554432:xt=I.ansi[It],ue.push(`xterm-bg-${It}`);break;case 50331648:xt=S.channels.toColor(It>>16,It>>8&255,255&It),this._addStyle(L,`background-color:#${E((It>>>0).toString(16),"0",6)}`);break;default:Re?(xt=I.foreground,ue.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):xt=I.background}switch(Ze||ze.isDim()&&(Ze=S.color.multiplyOpacity(xt,.5)),ft){case 16777216:case 33554432:ze.isBold()&&ot<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ot+=8),this._applyMinimumContrast(L,xt,I.ansi[ot],ze,Ze,void 0)||ue.push(`xterm-fg-${ot}`);break;case 50331648:const Ve=S.channels.toColor(ot>>16&255,ot>>8&255,255&ot);this._applyMinimumContrast(L,xt,Ve,ze,Ze,ht)||this._addStyle(L,`color:#${E(ot.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,xt,I.foreground,ze,Ze,ht)||Re&&ue.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ue.length&&(L.className=ue.join(" "),ue.length=0),bt||qe||Pt?L.textContent=G:q++,ae!==this.defaultSpacing&&(L.style.letterSpacing=`${ae}px`),X.push(L),Se=Ie}return L&&q&&(L.textContent=G),X}_applyMinimumContrast(N,T,z,M,O,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let U;if(O||B||(U=$.getColor(T.rgba,z.rgba)),U===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);U=S.color.ensureContrastRatio(O||T,B||z,H),$.setColor((O||T).rgba,(B||z).rgba,U??null)}return!!U&&(this._addStyle(N,`color:${U.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const z=this._selectionStart,M=this._selectionEnd;return!(!z||!M)&&(this._columnSelectMode?z[0]<=M[0]?N>=z[0]&&T>=z[1]&&N=z[1]&&N>=M[0]&&T<=M[1]:T>z[1]&&T=z[0]&&N=z[0])}};function E(N,T,z){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=l.createElement("span");_.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=l.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,d,p,m],this._container.appendChild(_),this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(m),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,u,_,d){l===this._font&&u===this._fontSize&&_===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=u,this._weight=_,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,u,_){let d=0;if(!u&&!_&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const x=this._measure(l,0);return x>0&&(this._flat[d]=x),x}let p=l;u&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),_&&(x|=2),m=this._measure(l,x),m>0&&this._holey.set(p,m)}return m}_measure(l,u){const _=this._measureElements[u];return _.textContent=l.repeat(32),_.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(_){return 57508<=_&&_<=57558}function u(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=u,o.allowRescaling=function(_,d,p,m){return d===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!u(_)&&!l(_)&&!(function(x){return 57344<=x&&x<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return l(_)||(function(d){return 9472<=d&&d<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,d,p=0){return(_-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,d,p,m=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const x=_.buffers.active.ydisp,S=d[1]-x,v=p[1]-x,b=Math.max(S,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=S,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=d[0],this.endCol=p[0])}isCellSelected(_,d,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,u=this.selectionEnd;return!(!l||!u)&&(l[1]>u[1]||l[1]===u[1]&&l[0]>u[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,z=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(z=(T<3?N(z):T>3?N(y,C,z):N(y,C))||z);return T>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),p=l(8460),m=l(844);let x=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=u([_(2,d.IOptionsService)],x);class S extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class v extends S{constructor(y,C,E){super(),this._document=y,this._parentElement=C,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var z=b.length-1;z>=0;z--)(E=b[z])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),p=l(643),m=l(511),x=l(2585);class S extends d.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=S;let v=o.CharacterJoinerService=class xO{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const $=this._getJoinedRanges(E,z,T,y,N);for(let U=0;U<$.length;U++)C.push($[U])}N=B,z=T,M=this._workCell.fg,O=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const B=this._getJoinedRanges(E,z,T,y,N);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=l(844),_=l(8460),d=l(3656);class p extends u.Disposable{constructor(S,v,b){super(),this._textarea=S,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=l(844);class _ extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=_},8934:function(a,o,l){var u=this&&this.__decorate||function(x,S,v,b){var w,y=arguments.length,C=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,S,v,b);else for(var E=x.length-1;E>=0;E--)(w=x[E])&&(C=(y<3?w(C):y>3?w(S,v,C):w(S,v))||C);return y>3&&C&&Object.defineProperty(S,v,C),C},_=this&&this.__param||function(x,S){return function(v,b){S(v,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),p=l(9806);let m=o.MouseService=class{constructor(x,S){this._renderService=x,this._charSizeService=S}getCoords(x,S,v,b,w){return(0,p.getCoords)(window,x,S,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(x,S){const v=(0,p.getCoordsRelativeToElement)(window,x,S);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([_(0,d.IRenderService),_(1,d.ICharSizeService)],m)},3230:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,z=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(z=(T<3?N(z):T>3?N(y,C,z):N(y,C))||z);return T>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),p=l(4725),m=l(8460),x=l(844),S=l(7226),v=l(2585);let b=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,E,N,T,z,M){super(),this._rowCount=w,this._charSizeService=E,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((O,B)=>this._renderRows(O,B)),z),this.register(this._renderDebouncer),this.register(z.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(z.window,y),this.register(z.onWindowChange((O=>this._registerIntersectionObserver(O,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,x.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var E;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(E=this._renderer.value)==null||E.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};o.RenderService=b=u([_(2,v.IOptionsService),_(3,p.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],b)},9312:function(a,o,l){var u=this&&this.__decorate||function(z,M,O,B){var $,U=arguments.length,H=U<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,O):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(z,M,O,B);else for(var Y=z.length-1;Y>=0;Y--)($=z[Y])&&(H=(U<3?$(H):U>3?$(M,O,H):$(M,O))||H);return U>3&&H&&Object.defineProperty(M,O,H),H},_=this&&this.__param||function(z,M){return function(O,B){M(O,B,z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),p=l(9504),m=l(456),x=l(4725),S=l(8460),v=l(844),b=l(6114),w=l(4841),y=l(511),C=l(2585),E=" ",N=new RegExp(E,"g");let T=o.SelectionService=class extends v.Disposable{constructor(z,M,O,B,$,U,H,Y,V){super(),this._element=z,this._screenElement=M,this._linkifier=O,this._bufferService=B,this._coreService=$,this._mouseService=U,this._optionsService=H,this._renderService=Y,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const z=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!z||!M||z[0]===M[0]&&z[1]===M[1])}get selectionText(){const z=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!z||!M)return"";const O=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(z[0]===M[0])return"";const $=z[0]$.replace(N," "))).join(b.isWindows?`\r +WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=l(3614),_=l(3656),d=l(3551),p=l(9042),m=l(3730),x=l(1680),S=l(3107),v=l(5744),b=l(2950),w=l(1296),y=l(428),C=l(4269),E=l(5114),N=l(8934),T=l(3230),j=l(9312),M=l(4725),O=l(6731),B=l(8055),$=l(8969),H=l(8460),q=l(844),Y=l(6114),G=l(8437),X=l(2584),ee=l(7399),I=l(5941),L=l(9074),P=l(2585),W=l(5435),U=l(4567),te=l(779);class de extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ne={}){super(ne),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new q.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(te.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((Q,le)=>this.refresh(Q,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((Q=>this._reportWindowsOptions(Q)))),this.register(this._inputHandler.onColor((Q=>this._handleColorEvent(Q)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((Q=>this._afterResize(Q.cols,Q.rows)))),this.register((0,q.toDisposable)((()=>{var Q,le;this._customKeyEventHandler=void 0,(le=(Q=this.element)==null?void 0:Q.parentNode)==null||le.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const Q of ne){let le,oe="";switch(Q.index){case 256:le="foreground",oe="10";break;case 257:le="background",oe="11";break;case 258:le="cursor",oe="12";break;default:le="ansi",oe="4;"+Q.index}switch(Q.type){case 0:const ce=B.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[Q.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${oe};${(0,I.toRgbString)(ce)}${X.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((pe=>pe.ansi[Q.index]=B.channels.toColor(...Q.color)));else{const pe=le;this._themeService.modifyColors((Se=>Se[pe]=B.channels.toColor(...Q.color)))}break;case 2:this._themeService.restoreColor(Q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ne=this.buffer.ybase+this.buffer.y,Q=this.buffer.lines.get(ne);if(!Q)return;const le=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ce=Q.getWidth(le),pe=this._renderService.dimensions.css.cell.width*ce,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,ye=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ye+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(Q=>{this.hasSelection()&&(0,u.copyHandler)(Q,this._selectionService)})));const ne=Q=>(0,u.handlePasteEvent)(Q,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,_.addDisposableDomListener)(this.element,"paste",ne)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(Q=>{Q.button===2&&(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(Q=>{(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(Q=>{Q.button===1&&(0,u.moveTextAreaUnderMouseCursor)(Q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var le;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((le=this.element)==null?void 0:le.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ne.appendChild(this.element);const Q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,Q=this.element;function le(pe){const Se=ne._mouseService.getMouseReportCoords(pe,ne.screenElement);if(!Se)return!1;let ye,qe;switch(pe.overrideType||pe.type){case"mousemove":qe=32,pe.buttons===void 0?(ye=3,pe.button!==void 0&&(ye=pe.button<3?pe.button:3)):ye=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":qe=0,ye=pe.button<3?pe.button:3;break;case"mousedown":qe=1,ye=pe.button<3?pe.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(pe)===!1||ne.viewport.getLinesScrolled(pe)===0)return!1;qe=pe.deltaY<0?0:1,ye=4;break;default:return!1}return!(qe===void 0||ye===void 0||ye>4)&&ne.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:ye,action:qe,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:pe=>(le(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(le(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&le(pe)},mousemove:pe=>{pe.buttons||le(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?oe.mousemove||(Q.addEventListener("mousemove",ce.mousemove),oe.mousemove=ce.mousemove):(Q.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(Q.addEventListener("wheel",ce.wheel,{passive:!1}),oe.wheel=ce.wheel):(Q.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(Q,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return le(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,_.addDisposableDomListener)(Q,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(pe);if(Se===0)return;const ye=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let qe="";for(let Ie=0;Ie{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(Q,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(ne,Q){var le;(le=this._renderService)==null||le.refreshRows(ne,Q)}updateCursorStyle(ne){var Q;(Q=this._selectionService)!=null&&Q.shouldColumnSelect(ne)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ne,Q,le=0){var oe;le===1?(super.scrollLines(ne,Q,le),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(ne)}paste(ne){(0,u.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const Q=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),Q}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,Q,le){this._selectionService.setSelection(ne,Q,le)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,Q){var le;(le=this._selectionService)==null||le.selectLines(ne,Q)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const Q=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!Q&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;Q||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,ee.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),le.type===3||le.type===2){const oe=this.rows-1;return this.scrollLines(le.type===2?-oe:oe),this.cancel(ne,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(le.cancel&&this.cancel(ne,!0),!le.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==X.C0.ETX&&le.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,Q){const le=ne.isMac&&!this.options.macOptionIsMeta&&Q.altKey&&!Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.altKey&&Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.getModifierState("AltGraph");return Q.type==="keypress"?le:le&&(!Q.keyCode||Q.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(Q){return Q.keyCode===16||Q.keyCode===17||Q.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let Q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)Q=ne.charCode;else if(ne.which===null||ne.which===void 0)Q=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;Q=ne.which}return!(!Q||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(Q=String.fromCharCode(Q),this._onKey.fire({key:Q,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(Q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const Q=ne.data;return this.coreService.triggerDataEvent(Q,!0),this.cancel(ne),!0}return!1}resize(ne,Q){ne!==this.cols||Q!==this.rows?super.resize(ne,Q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,Q){var le,oe;(le=this._charSizeService)==null||le.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var ne;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Q=1;Q{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,u=1e3){this._renderCallback=l,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=d-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u)}}},1680:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),p=l(4725),m=l(8460),x=l(844),S=l(2585);let v=o.Viewport=class extends x.Disposable{constructor(b,w,y,C,E,N,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=E,this._renderService=N,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=$),C=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let w=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(b,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const w=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(b,w))}};o.Viewport=v=u([_(2,S.IBufferService),_(3,S.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],v)},3107:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),p=l(844),m=l(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(S,v,b,w,y){super(),this._screenElement=S,this._bufferService=v,this._coreBrowserService=b,this._decorationService=w,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),v.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=S.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(S,v),v}_refreshStyle(S){const v=S.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let b=this._decorationElements.get(S);b||(b=this._createElement(S),S.element=b,this._decorationElements.set(S,b),this._container.appendChild(b),S.onDispose((()=>{this._decorationElements.delete(S),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(b)}}_refreshXPosition(S,v=S.element){if(!v)return;const b=S.options.x??0;(S.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var v;(v=this._decorationElements.get(S))==null||v.remove(),this._decorationElements.delete(S),S.dispose()}};o.BufferDecorationRenderer=x=u([_(1,m.IBufferService),_(2,d.ICoreBrowserService),_(3,m.IDecorationService),_(4,d.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const u of this._zones)if(u.color===l.options.overviewRulerOptions.color&&u.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,l.marker.line))return;if(this._lineAdjacentToZone(u,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(u,l.marker.line)}if(this._zonePoolIndex=l.startBufferLine&&u<=l.endBufferLine}_lineAdjacentToZone(l,u,_){return u>=l.startBufferLine-this._linePadding[_||"full"]&&u<=l.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(l,u){l.startBufferLine=Math.min(l.startBufferLine,u),l.endBufferLine=Math.max(l.endBufferLine,u)}}},5744:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),p=l(4725),m=l(844),x=l(2585),S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let w=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,E,N,T,j,M){var B;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=E,this._decorationService=N,this._renderService=T,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=w=u([_(2,x.IBufferService),_(3,x.IDecorationService),_(4,p.IRenderService),_(5,x.IOptionsService),_(6,p.ICoreBrowserService)],w)},2950:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),p=l(2585),m=l(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,v,b,w,y,C){this._textarea=S,this._compositionView=v,this._bufferService=b,this._optionsService=w,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(S,"");this._dataAlreadySent=b,v.length>S.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,d.IRenderService)],x)},9806:(a,o)=>{function l(u,_,d){const p=d.getBoundingClientRect(),m=u.getComputedStyle(d),x=parseInt(m.getPropertyValue("padding-left")),S=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-x,_.clientY-p.top-S]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(u,_,d,p,m,x,S,v,b){if(!x)return;const w=l(u,_,d);return w?(w[0]=Math.ceil((w[0]+(b?S/2:0))/S),w[1]=Math.ceil(w[1]/v),w[0]=Math.min(Math.max(w[0],1),p+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),m),w):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=l(2584);function _(v,b,w,y){const C=v-d(v,w),E=b-d(b,w),N=Math.abs(C-E)-(function(T,j,M){let O=0;const B=T-d(T,M),$=j-d(j,M);for(let H=0;H=0&&vb?"A":"B"}function m(v,b,w,y,C,E){let N=v,T=b,j="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>E.cols-1?(j+=E.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(j+=E.buffer.translateBufferLineToString(T,!1,0,v+1),N=E.cols-1,v=N,T--);return j+E.buffer.translateBufferLineToString(T,!1,v,N)}function x(v,b){const w=b?"O":"[";return u.C0.ESC+w+v}function S(v,b){v=Math.floor(v);let w="";for(let y=0;y0?B-d(B,$):M;const Y=B,G=(function(X,ee,I,L,P,W){let U;return U=_(I,L,P,W).length>0?L-d(L,P):ee,X=I&&Uv?"D":"C",S(Math.abs(C-v),x(N,y));N=E>b?"D":"C";const T=Math.abs(E-b);return S((function(j,M){return M.cols-j})(E>b?v:C,w)+(T-1)*w.cols+1+((E>b?C:v)-1),x(N,y))}},1296:function(a,o,l){var u=this&&this.__decorate||function(H,q,Y,G){var X,ee=arguments.length,I=ee<3?q:G===null?G=Object.getOwnPropertyDescriptor(q,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(H,q,Y,G);else for(var L=H.length-1;L>=0;L--)(X=H[L])&&(I=(ee<3?X(I):ee>3?X(q,Y,I):X(q,Y))||I);return ee>3&&I&&Object.defineProperty(q,Y,I),I},_=this&&this.__param||function(H,q){return function(Y,G){q(Y,G,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),p=l(2550),m=l(2223),x=l(6171),S=l(6052),v=l(4725),b=l(8055),w=l(8460),y=l(844),C=l(2585),E="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",j="xterm-bg-",M="xterm-focus",O="xterm-selection";let B=1,$=o.DomRenderer=class extends y.Disposable{constructor(H,q,Y,G,X,ee,I,L,P,W,U,te,de){super(),this._terminal=H,this._document=q,this._element=Y,this._screenElement=G,this._viewportElement=X,this._helperContainer=ee,this._linkifier2=I,this._charSizeService=P,this._optionsService=W,this._bufferService=U,this._coreBrowserService=te,this._themeService=de,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((re=>this._injectCss(re)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((re=>this._handleLinkHover(re)))),this.register(this._linkifier2.onHideLinkUnderline((re=>this._handleLinkLeave(re)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const q=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let q=`${this._terminalSelector} .${N} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;q+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(H.foreground,.5).css};}`,q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;q+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,q+=`@keyframes ${X} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,q+=`${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,q+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,I]of H.ansi.entries())q+=`${this._terminalSelector} .${T}${ee} { color: ${I.css}; }${this._terminalSelector} .${T}${ee}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${j}${ee} { background-color: ${I.css}; }`;q+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(H.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${j}${m.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=q}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,q){for(let Y=this._rowElements.length;Y<=q;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,q){this._refreshRowElements(H,q),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,q,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,q,Y),this.renderRows(0,this._bufferService.rows-1),!H||!q)return;this._selectionRenderModel.update(this._terminal,H,q,Y);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(Y){const P=H[0]>q[0];L.appendChild(this._createSelectionElement(ee,P?q[0]:H[0],P?H[0]:q[0],I-ee+1))}else{const P=G===ee?H[0]:0,W=ee===X?q[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(ee,P,W));const U=I-ee-1;if(L.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,U)),ee!==I){const te=X===I?q[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,te))}}this._selectionContainer.appendChild(L)}_createSelectionElement(H,q,Y,G=1){const X=this._document.createElement("div"),ee=q*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(Y-q);return ee+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-ee),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=H*this.dimensions.css.cell.height+"px",X.style.left=`${ee}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,q){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=H;P<=q;P++){const W=P+Y.ydisp,U=this._rowElements[P],te=Y.lines.get(W);if(!U||!te)break;U.replaceChildren(...this._rowFactory.createRow(te,W,W===G,I,L,X,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,q,Y,G,X,ee){Y<0&&(H=0),G<0&&(q=0);const I=this._bufferService.rows-1;Y=Math.max(Math.min(Y,I),0),G=Math.max(Math.min(G,I),0),X=Math.min(X,this._bufferService.cols);const L=this._bufferService.buffer,P=L.ybase+L.y,W=Math.min(L.x,X-1),U=this._optionsService.rawOptions.cursorBlink,te=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=Y;re<=G;++re){const ne=re+L.ydisp,Q=this._rowElements[re],le=L.lines.get(ne);if(!Q||!le)break;Q.replaceChildren(...this._rowFactory.createRow(le,ne,ne===P,te,de,W,U,this.dimensions.css.cell.width,this._widthCache,ee?re===Y?H:0:-1,ee?(re===G?q:X)-1:-1))}}};o.DomRenderer=$=u([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],$)},3787:function(a,o,l){var u=this&&this.__decorate||function(N,T,j,M){var O,B=arguments.length,$=B<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,T,j,M);else for(var H=N.length-1;H>=0;H--)(O=N[H])&&($=(B<3?O($):B>3?O(T,j,$):O(T,j))||$);return B>3&&$&&Object.defineProperty(T,j,$),$},_=this&&this.__param||function(N,T){return function(j,M){T(j,M,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),p=l(643),m=l(511),x=l(2585),S=l(8055),v=l(4725),b=l(4269),w=l(6171),y=l(3734);let C=o.DomRendererRowFactory=class{constructor(N,T,j,M,O,B,$){this._document=N,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=M,this._coreService=O,this._decorationService=B,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,j){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=j}createRow(N,T,j,M,O,B,$,H,q,Y,G){const X=[],ee=this._characterJoinerService.getJoinedCharacters(T),I=this._themeService.colors;let L,P=N.getNoBgTrimmedLength();j&&P0&&Se===ee[0][0]){qe=!0;const We=ee.shift();Te=new b.JoinedCellData(this._workCell,N.translateToString(!0,We[0],We[1]),We[1]-We[0]),Ie=We[1]-1,ye=Te.getWidth()}const vt=this._isCellInSelection(Se,T),Dt=j&&Se===B,Ut=pe&&Se>=Y&&Se<=G;let Ft=!1;this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{Ft=!0}));let mt=Te.getChars()||p.WHITESPACE_CELL_CHAR;if(mt===" "&&(Te.isUnderline()||Te.isOverline())&&(mt=" "),oe=ye*H-q.get(mt,Te.isBold(),Te.isItalic()),L){if(W&&(vt&&le||!vt&&!le&&Te.bg===te)&&(vt&&le&&I.selectionForeground||Te.fg===de)&&Te.extended.ext===re&&Ut===ne&&oe===Q&&!Dt&&!qe&&!Ft){Te.isInvisible()?U+=p.WHITESPACE_CELL_CHAR:U+=mt,W++;continue}W&&(L.textContent=U),L=this._document.createElement("span"),W=0,U=""}else L=this._document.createElement("span");if(te=Te.bg,de=Te.fg,re=Te.extended.ext,ne=Ut,Q=oe,le=vt,qe&&B>=Se&&B<=Ie&&(B=Se),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ce.push("xterm-cursor-blink"),ce.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(Te.isBold()&&ce.push("xterm-bold"),Te.isItalic()&&ce.push("xterm-italic"),Te.isDim()&&ce.push("xterm-dim"),U=Te.isInvisible()?p.WHITESPACE_CELL_CHAR:Te.getChars()||p.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(ce.push(`xterm-underline-${Te.extended.underlineStyle}`),U===" "&&(U=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let We=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&We<8&&(We+=8),L.style.textDecorationColor=I.ansi[We].css}Te.isOverline()&&(ce.push("xterm-overline"),U===" "&&(U=" ")),Te.isStrikethrough()&&ce.push("xterm-strikethrough"),Ut&&(L.style.textDecoration="underline");let rt=Te.getFgColor(),ut=Te.getFgColorMode(),Ct=Te.getBgColor(),we=Te.getBgColorMode();const Re=!!Te.isInverse();if(Re){const We=rt;rt=Ct,Ct=We;const Gt=ut;ut=we,we=Gt}let Ze,_t,wt,Zt=!1;switch(this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{We.options.layer!=="top"&&Zt||(We.backgroundColorRGB&&(we=50331648,Ct=We.backgroundColorRGB.rgba>>8&16777215,Ze=We.backgroundColorRGB),We.foregroundColorRGB&&(ut=50331648,rt=We.foregroundColorRGB.rgba>>8&16777215,_t=We.foregroundColorRGB),Zt=We.options.layer==="top")})),!Zt&&vt&&(Ze=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ct=Ze.rgba>>8&16777215,we=50331648,Zt=!0,I.selectionForeground&&(ut=50331648,rt=I.selectionForeground.rgba>>8&16777215,_t=I.selectionForeground)),Zt&&ce.push("xterm-decoration-top"),we){case 16777216:case 33554432:wt=I.ansi[Ct],ce.push(`xterm-bg-${Ct}`);break;case 50331648:wt=S.channels.toColor(Ct>>16,Ct>>8&255,255&Ct),this._addStyle(L,`background-color:#${E((Ct>>>0).toString(16),"0",6)}`);break;default:Re?(wt=I.foreground,ce.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):wt=I.background}switch(Ze||Te.isDim()&&(Ze=S.color.multiplyOpacity(wt,.5)),ut){case 16777216:case 33554432:Te.isBold()&&rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(rt+=8),this._applyMinimumContrast(L,wt,I.ansi[rt],Te,Ze,void 0)||ce.push(`xterm-fg-${rt}`);break;case 50331648:const We=S.channels.toColor(rt>>16&255,rt>>8&255,255&rt);this._applyMinimumContrast(L,wt,We,Te,Ze,_t)||this._addStyle(L,`color:#${E(rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,wt,I.foreground,Te,Ze,_t)||Re&&ce.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ce.length&&(L.className=ce.join(" "),ce.length=0),Dt||qe||Ft?L.textContent=U:W++,oe!==this.defaultSpacing&&(L.style.letterSpacing=`${oe}px`),X.push(L),Se=Ie}return L&&W&&(L.textContent=U),X}_applyMinimumContrast(N,T,j,M,O,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let H;if(O||B||(H=$.getColor(T.rgba,j.rgba)),H===void 0){const q=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);H=S.color.ensureContrastRatio(O||T,B||j,q),$.setColor((O||T).rgba,(B||j).rgba,H??null)}return!!H&&(this._addStyle(N,`color:${H.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?N>=j[0]&&T>=j[1]&&N=j[1]&&N>=M[0]&&T<=M[1]:T>j[1]&&T=j[0]&&N=j[0])}};function E(N,T,j){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=l.createElement("span");_.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=l.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,d,p,m],this._container.appendChild(_),this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(m),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,u,_,d){l===this._font&&u===this._fontSize&&_===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=u,this._weight=_,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,u,_){let d=0;if(!u&&!_&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const x=this._measure(l,0);return x>0&&(this._flat[d]=x),x}let p=l;u&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),_&&(x|=2),m=this._measure(l,x),m>0&&this._holey.set(p,m)}return m}_measure(l,u){const _=this._measureElements[u];return _.textContent=l.repeat(32),_.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(_){return 57508<=_&&_<=57558}function u(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=u,o.allowRescaling=function(_,d,p,m){return d===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!u(_)&&!l(_)&&!(function(x){return 57344<=x&&x<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return l(_)||(function(d){return 9472<=d&&d<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,d,p=0){return(_-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,d,p,m=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const x=_.buffers.active.ydisp,S=d[1]-x,v=p[1]-x,b=Math.max(S,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=S,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=d[0],this.endCol=p[0])}isCellSelected(_,d,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,u=this.selectionEnd;return!(!l||!u)&&(l[1]>u[1]||l[1]===u[1]&&l[0]>u[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),p=l(8460),m=l(844);let x=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=u([_(2,d.IOptionsService)],x);class S extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class v extends S{constructor(y,C,E){super(),this._document=y,this._parentElement=C,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),p=l(643),m=l(511),x=l(2585);class S extends d.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=S;let v=o.CharacterJoinerService=class CO{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const $=this._getJoinedRanges(E,j,T,y,N);for(let H=0;H<$.length;H++)C.push($[H])}N=B,j=T,M=this._workCell.fg,O=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const B=this._getJoinedRanges(E,j,T,y,N);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=l(844),_=l(8460),d=l(3656);class p extends u.Disposable{constructor(S,v,b){super(),this._textarea=S,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=l(844);class _ extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=_},8934:function(a,o,l){var u=this&&this.__decorate||function(x,S,v,b){var w,y=arguments.length,C=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,S,v,b);else for(var E=x.length-1;E>=0;E--)(w=x[E])&&(C=(y<3?w(C):y>3?w(S,v,C):w(S,v))||C);return y>3&&C&&Object.defineProperty(S,v,C),C},_=this&&this.__param||function(x,S){return function(v,b){S(v,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),p=l(9806);let m=o.MouseService=class{constructor(x,S){this._renderService=x,this._charSizeService=S}getCoords(x,S,v,b,w){return(0,p.getCoords)(window,x,S,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(x,S){const v=(0,p.getCoordsRelativeToElement)(window,x,S);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([_(0,d.IRenderService),_(1,d.ICharSizeService)],m)},3230:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),p=l(4725),m=l(8460),x=l(844),S=l(7226),v=l(2585);let b=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,E,N,T,j,M){super(),this._rowCount=w,this._charSizeService=E,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((O,B)=>this._renderRows(O,B)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((O=>this._registerIntersectionObserver(O,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,x.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var E;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(E=this._renderer.value)==null||E.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};o.RenderService=b=u([_(2,v.IOptionsService),_(3,p.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],b)},9312:function(a,o,l){var u=this&&this.__decorate||function(j,M,O,B){var $,H=arguments.length,q=H<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,O):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(j,M,O,B);else for(var Y=j.length-1;Y>=0;Y--)($=j[Y])&&(q=(H<3?$(q):H>3?$(M,O,q):$(M,O))||q);return H>3&&q&&Object.defineProperty(M,O,q),q},_=this&&this.__param||function(j,M){return function(O,B){M(O,B,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),p=l(9504),m=l(456),x=l(4725),S=l(8460),v=l(844),b=l(6114),w=l(4841),y=l(511),C=l(2585),E=" ",N=new RegExp(E,"g");let T=o.SelectionService=class extends v.Disposable{constructor(j,M,O,B,$,H,q,Y,G){super(),this._element=j,this._screenElement=M,this._linkifier=O,this._bufferService=B,this._coreService=$,this._mouseService=H,this._optionsService=q,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const O=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const $=j[0]$.replace(N," "))).join(b.isWindows?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(z){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&z&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(z){const M=this._getMouseBufferCoords(z),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(z,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([z,M],O,B)}_areCoordsInSelection(z,M,O){return z[1]>M[1]&&z[1]=M[0]&&z[0]=M[0]}_selectWordAtCursor(z,M){var $,U;const O=(U=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:U.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(z);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(z,M){this._model.clearSelection(),z=Math.max(z,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,z],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(z){this._model.handleTrim(z)&&this.refresh()}_getMouseBufferCoords(z){const M=this._mouseService.getCoords(z,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(z){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,z,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(z){return b.isMac?z.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:z.shiftKey}handleMouseDown(z){if(this._mouseDownTimeStamp=z.timeStamp,(z.button!==2||!this.hasSelection)&&z.button===0){if(!this._enabled){if(!this.shouldForceSelection(z))return;z.stopPropagation()}z.preventDefault(),this._dragScrollAmount=0,this._enabled&&z.shiftKey?this._handleIncrementalClick(z):z.detail===1?this._handleSingleClick(z):z.detail===2?this._handleDoubleClick(z):z.detail===3&&this._handleTripleClick(z),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(z){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(z))}_handleSingleClick(z){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(z)?3:0,this._model.selectionStart=this._getMouseBufferCoords(z),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(z){this._selectWordAtCursor(z,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(z){const M=this._getMouseBufferCoords(z);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(z){return z.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(z){if(z.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(z),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(z.ydisp+this._bufferService.rows,z.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=z.ydisp),this.refresh()}}_handleMouseUp(z){const M=z.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&z.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(z,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const z=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!z||!M||z[0]===M[0]&&z[1]===M[1]);O?z&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&z[0]===this._oldSelectionStart[0]&&z[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(z,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(z,M,O)}_fireOnSelectionChange(z,M,O){this._oldSelectionStart=z,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(z){this.clearSelection(),this._trimListener.dispose(),this._trimListener=z.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(z,M){let O=M;for(let B=0;M>=B;B++){const $=z.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(z,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[z,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(z){this._isClickInSelection(z)||(this._selectWordAtCursor(z,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(z,M,O=!0,B=!0){if(z[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,U=$.lines.get(z[1]);if(!U)return;const H=$.translateBufferLineToString(z[1],!1);let Y=this._convertViewportColToCharacterIndex(U,z[0]),V=Y;const X=z[0]-Y;let te=0,I=0,L=0,F=0;if(H.charAt(Y)===" "){for(;Y>0&&H.charAt(Y-1)===" ";)Y--;for(;V1&&(F+=oe-1,V+=oe-1);ee>0&&Y>0&&!this._isCharWordSeparator(U.loadCell(ee-1,this._workCell));){U.loadCell(ee-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,ee--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,ee--}for(;ce1&&(F+=ne-1,V+=ne-1),V++,ce++}}V++;let q=Y+X-te+L,G=Math.min(this._bufferService.cols,V-Y+te+I-L-F);if(M||H.slice(Y,V).trim()!==""){if(O&&q===0&&U.getCodePoint(0)!==32){const ee=$.lines.get(z[1]-1);if(ee&&U.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,z[1]-1],!1,!0,!1);if(ce){const oe=this._bufferService.cols-ce.start;q-=oe,G+=oe}}}if(B&&q+G===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const ee=$.lines.get(z[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const ce=this._getWordAt([0,z[1]+1],!1,!1,!0);ce&&(G+=ce.length)}}return{start:q,length:G}}}_selectWordAt(z,M){const O=this._getWordAt(z,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,z[1]--;this._model.selectionStart=[O.start,z[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(z){const M=this._getWordAt(z,!0);if(M){let O=z[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(z){return z.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(z.getChars())>=0}_selectLineAt(z){const M=this._bufferService.buffer.getWrappedRangeForLine(z),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,z,M,O){var B,$=arguments.length,U=$<3?z:O===null?O=Object.getOwnPropertyDescriptor(z,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(T,z,M,O);else for(var H=T.length-1;H>=0;H--)(B=T[H])&&(U=($<3?B(U):$>3?B(z,M,U):B(z,M))||U);return $>3&&U&&Object.defineProperty(z,M,U),U},_=this&&this.__param||function(T,z){return function(M,O){z(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],z=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=z[M/36%6|0],B=z[M/6%6|0],$=z[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const z=this._colors;if(z.foreground=N(T.foreground,v),z.background=N(T.background,b),z.cursor=N(T.cursor,w),z.cursorAccent=N(T.cursorAccent,y),z.selectionBackgroundTransparent=N(T.selectionBackground,C),z.selectionBackgroundOpaque=p.color.blend(z.background,z.selectionBackgroundTransparent),z.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,z.selectionBackgroundTransparent),z.selectionInactiveBackgroundOpaque=p.color.blend(z.background,z.selectionInactiveBackgroundTransparent),z.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,z.selectionForeground===p.NULL_COLOR&&(z.selectionForeground=void 0),p.color.isOpaque(z.selectionBackgroundTransparent)&&(z.selectionBackgroundTransparent=p.color.opacity(z.selectionBackgroundTransparent,.3)),p.color.isOpaque(z.selectionInactiveBackgroundTransparent)&&(z.selectionInactiveBackgroundTransparent=p.color.opacity(z.selectionInactiveBackgroundTransparent,.3)),z.ansi=o.DEFAULT_ANSI_COLORS.slice(),z.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),z.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),z.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),z.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),z.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),z.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),z.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),z.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),z.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),z.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),z.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),z.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),z.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),z.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),z.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),z.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(z.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,z=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((z-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const z=v.ensureContrastRatio(E.rgba,N.rgba,T);if(z)return p.toColor(z>>24&255,z>>16&255,z>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const z=E/255,M=N/255,O=T/255;return .2126*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,z){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,U=T>>16&255,H=T>>8&255,Y=w(S.relativeLuminance2($,U,H),S.relativeLuminance2(M,O,B));for(;Y0||U>0||H>0);)$-=Math.max(0,Math.ceil(.1*$)),U-=Math.max(0,Math.ceil(.1*U)),H-=Math.max(0,Math.ceil(.1*H)),Y=w(S.relativeLuminance2($,U,H),S.relativeLuminance2(M,O,B));return($<<24|U<<16|H<<8|255)>>>0}function E(N,T,z){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,U=T>>16&255,H=T>>8&255,Y=w(S.relativeLuminance2($,U,H),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const z=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,U=N>>8&255;return l=B+Math.round((z-B)*d),u=$+Math.round((M-$)*d),_=U+Math.round((O-U)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,z){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(Hw(M,S.relativeLuminance(Y>>8))?U:Y}return U}const B=E(N,T,z),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(U>>8))?B:U}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let z=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,U)=>this._inputHandler.parse($,U)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!z&&(this._logService.warn("writeSync is unreliable and will be removed soon."),z=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,U){this._bufferService.scrollLines(B,$,U)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(te,I,L,F){var q,G=arguments.length,ee=G<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(te,I,L,F);else for(var ce=te.length-1;ce>=0;ce--)(q=te[ce])&&(ee=(G<3?q(ee):G>3?q(I,L,ee):q(I,L))||ee);return G>3&&ee&&Object.defineProperty(I,L,ee),ee},_=this&&this.__param||function(te,I){return function(L,F){I(L,F,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),z=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var U;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(o.WindowsOptionsReportType=U={}));let H=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,F,q,G,ee,ce,oe,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=F,this._logService=q,this._optionsService=G,this._oscLinkService=ee,this._coreMouseService=ce,this._unicodeService=oe,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:ae})})),this._parser.setDcsHandlerFallback(((Q,le,ae)=>{le==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:ae})})),this._parser.setPrintHandler(((Q,le,ae)=>this.print(Q,le,ae))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new z.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,F,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=q}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let F,q=this._activeBuffer.x,G=this._activeBuffer.y,ee=0;const ce=this._parseStack.paused;if(ce){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;q=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(ee=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=ee;Q0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ue=this._parser.precedingJoinState;for(let pe=L;peoe){if(ne){const Ie=ae;let ze=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&ae instanceof v.BufferLine&&ae.copyCellsFrom(Ie,ze,0,qe,!1);ze=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(ae.insertCells(this._activeBuffer.x,G-qe,this._activeBuffer.getNullCell(le)),ae.getWidth(oe-1)===2&&ae.setCellFromCodepoint(oe-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),ae.setCellFromCodepoint(this._activeBuffer.x++,q,G,le),G>0)for(;--G;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ue,this._activeBuffer.x0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new z.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,F,q=!1,G=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);ee.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),G),q&&(ee.isWrapped=!1)}_resetBufferLine(I,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),F.isWrapped=!1)}eraseInDisplay(I,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=oe;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ue=I.params[0];return pe=ue,Se=L?ue===2?4:ue===4?ae(ee.modes.insertMode):ue===12?3:ue===20?ae(le.convertEol):0:ue===1?ae(F.applicationCursorKeys):ue===3?le.windowOptions.setWinLines?oe===80?2:oe===132?1:0:0:ue===6?ae(F.origin):ue===7?ae(F.wraparound):ue===8?3:ue===9?ae(q==="X10"):ue===12?ae(le.cursorBlink):ue===25?ae(!ee.isCursorHidden):ue===45?ae(F.reverseWraparound):ue===66?ae(F.applicationKeypad):ue===67?4:ue===1e3?ae(q==="VT200"):ue===1002?ae(q==="DRAG"):ue===1003?ae(q==="ANY"):ue===1004?ae(F.sendFocus):ue===1005?4:ue===1006?ae(G==="SGR"):ue===1015?4:ue===1016?ae(G==="SGR_PIXELS"):ue===1048?1:ue===47||ue===1047||ue===1049?ae(ne===Q):ue===2004?ae(F.bracketedPasteMode):0,ee.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,F,q,G){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([F,q,G])):L===5&&(I&=-50331904,I|=33554432|255&F),I}_extractColor(I,L,F){const q=[0,0,-1,0,0,0];let G=0,ee=0;do{if(q[ee+G]=I.params[L+ee],I.hasSubParams(L+ee)){const ce=I.getSubParams(L+ee);let oe=0;do q[1]===5&&(G=1),q[ee+oe+1+G]=ce[oe];while(++oe=2||q[1]===2&&ee+G>=5)break;q[1]&&(G=1)}while(++ee+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let F;const q=this._curAttrData;for(let G=0;G=30&&F<=37?(q.fg&=-50331904,q.fg|=16777216|F-30):F>=40&&F<=47?(q.bg&=-50331904,q.bg|=16777216|F-40):F>=90&&F<=97?(q.fg&=-50331904,q.fg|=16777224|F-90):F>=100&&F<=107?(q.bg&=-50331904,q.bg|=16777224|F-100):F===0?this._processSGR0(q):F===1?q.fg|=134217728:F===3?q.bg|=67108864:F===4?(q.fg|=268435456,this._processUnderline(I.hasSubParams(G)?I.getSubParams(G)[0]:1,q)):F===5?q.fg|=536870912:F===7?q.fg|=67108864:F===8?q.fg|=1073741824:F===9?q.fg|=2147483648:F===2?q.bg|=134217728:F===21?this._processUnderline(2,q):F===22?(q.fg&=-134217729,q.bg&=-134217729):F===23?q.bg&=-67108865:F===24?(q.fg&=-268435457,this._processUnderline(0,q)):F===25?q.fg&=-536870913:F===27?q.fg&=-67108865:F===28?q.fg&=-1073741825:F===29?q.fg&=2147483647:F===39?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?G+=this._extractColor(I,G,q):F===53?q.bg|=1073741824:F===55?q.bg&=-1073741825:F===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):F===100?(q.fg&=-67108864,q.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${F}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(I){const L=I.params[0]||1;let F;return(I.length<2||(F=I.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],F=I.split(";");for(;F.length>1;){const q=F.shift(),G=F.shift();if(/^\d+$/.exec(q)){const ee=parseInt(q);if(X(ee))if(G==="?")L.push({type:0,index:ee});else{const ce=(0,M.parseColor)(G);ce&&L.push({type:1,index:ee,color:ce})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=I.split(":");let q;const G=F.findIndex((ee=>ee.startsWith("id=")));return G!==-1&&(q=F[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const F=I.split(";");for(let q=0;q=this._specialColors.length);++q,++L)if(F[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const G=(0,M.parseColor)(F[q]);G&&this._onColor.fire([{type:1,index:this._specialColors[L],color:G}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],F=I.split(";");for(let q=0;q=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${G}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let V=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(H=te,te=I,I=H),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(te){return 0<=te&&te<256}V=u([_(0,E.IBufferService)],V)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let z=this._rows;z>y;z--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(z),this.ybase=Math.max(this.ybase-z,0),this.ydisp=Math.max(this.ydisp-z,0),this.savedY=Math.max(this.savedY-z,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let z=this.lines.get(T);if(!z||!z.isWrapped&&z.getTrimmedLength()<=w)continue;const M=[z];for(;z.isWrapped&&T>0;)z=this.lines.get(--T),M.unshift(z);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let V=$.length-1,X=$[V];X===0&&(V--,X=$[V]);let te=M.length-U-1,I=B;for(;te>=0;){const F=Math.min(I,X);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[te],I-F,X-F,F,!0),X-=F,X===0&&(V--,X=$[V]),I-=F,I===0){te--;const q=Math.max(te,0);I=(0,m.getWrappedLineTrimmedLength)(M,q,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],z=[];for(let V=0;V=0;V--)if($&&$.start>O+U){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(V--,$.newLines[X]);V++,T.push({index:O+1,amount:$.newLines.length}),U+=$.newLines.length,$=E[++B]}else this.lines.set(V,z[O--]);let H=0;for(let V=T.length-1;V>=0;V--)T[V].index+=H,this.lines.onInsertEmitter.fire(T[V]),H+=T[V].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let z=0;z<3;z++)this._data[3*(w+T)+z]=E[3*(b+T)+z];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[z-b+w]=v._combined[z])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(z>y||w[z].getTrimmedLength()===0);z--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` -`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const z=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=z-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(z===2?E<128?b--:u[S++]=E:z===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ez)),w=(T,z)=>b.slice(T,z),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const z=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=z[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=z[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let z=T;z>4){case 2:for(let U=z+1;;++U){if(U>=w||(E=b[U])<32||E>126&&E=w||(E=b[U])<32||E>126&&E=w||(E=b[U])<32||E>126&&E=w||(E=b[U])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,z),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++z47&&E<60);z--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,z),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let U=z+1;;++U)if(U>=w||(E=b[U])===24||E===26||E===27||E>127&&E=w||(E=b[U])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,z=arguments.length,M=z<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(z<3?T(M):z>3?T(C,E,M):T(C,E))||M);return z>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,z=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(z=(T<3?N(z):T>3?N(y,C,z):N(y,C))||z);return T>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r -`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(Ax)),Ax.exports}var a0t=i0t();function S6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new a0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new n0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new s0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const wO="overflow-hidden rounded-md bg-terminal p-2";function Zp(e){return typeof e=="object"&&e!==null}function SO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function o0t(e){return Zp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||SO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function l0t(e){return Zp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&SO(e.partitions)&&(e.error===null||typeof e.error=="string")}function c0t(e){return!Zp(e)||e.type!=="complete"?null:e.backend==="ssh"&&o0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&l0t(e.result)?{backend:"slurm",result:e.result}:null}function u0t(e){return Zp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function k6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(kO,{path:`${t}?${a}`,label:SL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=c0t(o);return l?(s(l),!0):!1}})}function d0t({login:e,onComplete:n,onError:t}){return f.jsx(kO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Zp(r)||r.type!=="complete"?!1:(n(),!0)})}function kO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=S6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=z=>{var M;y||(y=!0,C||m.writeln(z),m.options.disableStdin=!0,m.blur(),d(z),(M=u.current)==null||M.call(u,z))},N=m.onData(z=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(z))}),T=m.onResize(({cols:z,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:z,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=z=>{if(z.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(z.data));return}if(typeof z.data!="string")return;let M;try{M=JSON.parse(z.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=u0t(M);O&&E(O)},b.onerror=()=>E(DN()),b.onclose=()=>{!w&&!y&&E(DN())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${wO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function f0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=S6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${wO}`,role:"group","aria-label":SL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const h0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],_0t=e=>h0t.some(n=>n===e),p0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Bi=e=>typeof e=="string"&&e.length>0,Og=e=>e==null||Bi(e);function C6(e){if(!p0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&Bi(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Og(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...Bi(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&Bi(e.path)&&Og(e.sessionId)&&Og(e.ref)&&Og(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...Bi(e.sessionId)?{sessionId:e.sessionId}:{},...Bi(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...Bi(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&Bi(e.experimentId)&&Bi(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&Bi(e.sessionId)&&Bi(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&Bi(e.sessionId)&&Bi(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&_0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function ab(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!C6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function k1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const dz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function CO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let lv=null,C0=0;const E6=()=>lv;function EO(){const e=C0;return CO(async(n,t)=>{if(e!==C0)return;const r=await dut(n,t);e===C0&&nt.setQueryData(Xp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Kn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Ui(),onClick:()=>void ob.retry()}})})}let C1=EO();function m0t(){C0++,lv=null,C1=EO()}const ob={flush:(e=!1)=>C1.flush(e),retry:()=>C1.retry(),queue(e,n=0){const t=lv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(lv=e,C1.queue(e,n))}};window.addEventListener("pagehide",()=>void ob.flush(!0));function Dl(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function NO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Ct(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Ct(e.rightTab);return{tabs:[...r,...a].map(u=>Dl(u,Ct(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Dl(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Ct(e.previewTab):null,history:e.tabHistory.map(Ct),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Ct(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function g0t(e,n){const t=z6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Ct(Wa(a))===Ct(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Ct(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Ct(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Ct(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,jO(t,n)}const Rx=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,N6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${N6(t)}`,zO=e=>({...e,lineScrollRequest:void 0});function Ig(e){return typeof e=="object"&&"path"in e?zO(e):e}const Hf=(e,n)=>e.branch===n.branch;function Ct(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${N6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Ct(r)!==n);return t.length===e.length?e:t}function v0t(e){return e!==void 0}function z6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:w1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Ct(r)],panelOpen:!0}}if(e===h6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Ct),panelOpen:!0}}if(e===_6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Ct),panelOpen:!0}}return t}function j6(e,n){const t=z6(e,n);return t.panelOpen?NO(t,{},{}):void 0}function jO(e,n){if(!n)return e;const t=Wa(n),r=Ct(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Ct(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Ct(d)===r);return _<0?[...l,u]:JSON.stringify(Dl(l[_]))===JSON.stringify(Dl(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Ct(o)===r&&JSON.stringify(Dl(o))===JSON.stringify(Dl(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Ct(l)!==r),t]),a}let Va=0;const sp=new Map,cv=new Map,Q4=new Set,Y4=()=>{for(const e of Q4)e()},b0t=e=>(Q4.add(e),()=>{Q4.delete(e)}),ip=new Map,Ka=new Map,TO=e=>Ka.get(e);function y0t(){Va++,Ka.clear(),ip.clear(),sp.clear(),cv.clear(),Y4()}function x0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ip.set(e,n),Ka.set(e,{...t,tasks:i})}function w0t(e){let n=sp.get(e);if(!n){const t=Va;n=CO(async(r,s)=>{if(t!==Va)return;const i=await uut(e,r,s);t===Va&&nt.setQueryData(g6(e).queryKey,i),t===Va&&cv.delete(e)&&Y4()},r=>{t===Va&&(cv.set(e,r instanceof Error?r.message:String(r)),Y4())}),sp.set(e,n)}return n}function Mx(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ip.has(e))return;const i=ab(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),w0t(e).queue(l,u?250:0)}function fz(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=NO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Ct(Wa(l)):null;return o.active=o.tabs.find(_=>Ct(Wa(_))===u)??null,o}function S0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(dz()),m=R.useSyncExternalStore(b0t,()=>n?cv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),z=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const H=z.current;if(!H)return;const Y=fz({...M.current,state:H.state,pane:H.pane},cu(Ka.get(H.projectId),H.taskKey),H.projectId,H.taskKey);Mx(H.projectId,H.location,H.taskKey,Y)},[]);R.useEffect(()=>{let H=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(g6(n)).then(V=>{!H||Y!==Va||(Ka.set(n,V??dz()),y(n))}).catch(V=>{H&&Y===Va&&S(V instanceof Error?V.message:String(V))}),()=>{H=!1}},[n,v]),R.useLayoutEffect(()=>{if(z.current&&z.current.scope!==O){const V=z.current.projectId;$(),ip.get(V)===t&&ip.delete(V),z.current=null}if(!n||w!==n)return;const H=Ka.get(n);if(!H)return;if(p.current=H,N.current!==O){if(N.current=O,T.current=B,i){const V=cu(H,t)??(Wc(n)?j6(t,a):void 0);l(g0t(V,s),V,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=jO(o,s),l(Y,void 0,!1))),i?(Mx(n,r,t,fz({state:Y,pane:s,getScroll:u,sourceModes:_},cu(H,t),n,t)),z.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):Mx(n,r),p.current=Ka.get(n)??H},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const H=Va,Y=X=>{if(H===Va){$();for(const te of sp.values())te.flush(X)}},V=()=>Y(!0);return window.addEventListener("pagehide",V),()=>{window.removeEventListener("pagehide",V),Y(!1)}},[$]);const U=R.useCallback(()=>{var H;n&&(x?b(Y=>Y+1):(H=sp.get(n))==null||H.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:U,capture:$,workspace:p}}const k0t="data:image/svg+xml,"+encodeURIComponent(''),X4=R.createContext(null);function C0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function AO(){const e=R.useContext(X4);if(!e)throw new Error("Runtime is not connected");return e}function E0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?k0t:"/favicon.svg")}function hz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function N0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!hz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&tO(n),!hz("orx:locale")&&t&&cD(t)&&JL(t)}function z0t(e){return e.includes("ssh ")&&e.includes("failed")}function _z({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:JD({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:E4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:uDe()})]})})}function pz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await kdt(i)}catch($){Kn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Cdt()}catch(U){Kn(U instanceof Error?U.message:String(U),"error")}finally{l(!1)}}async function m(){l(!0);try{await IL()}catch($){Kn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await BL())}catch($){Kn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await $L(u),_(null)}catch($){_(null),Kn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Edt()}catch($){Kn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&z0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?DDe():y?GOe():s.status==="applying"?mMe({host:Ne(s.host)}):s.status==="reconnecting"?bLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?aDe({host:Ne(s.host)}):s.canStartNewHost?vDe({host:Ne(s.host)}):JD({host:Ne(s.host)}):LMe({host:Ne(s.host)}),z=s.error??(s.canStartNewHost?_De():w?WDe({user:Ne(s.user??""),host:Ne(s.host)}):y?FOe({host:Ne(s.host)}):s.status==="applying"?fMe():s.status==="reconnecting"?pLe():s.status==="disconnected"?JMe():AMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(Lt,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:z})]})]}),N&&f.jsx(k6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:TDe()}),[["binary",wDe()],["database",EDe()]].map(([$,U])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[U,f.jsx(rs,{value:i[$],onChange:H=>a({...i,[$]:H.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Oe,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(Lt,{})," ",BDe()]}):y?SN():fL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Oe,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(Lt,{})," ",QOe()]}):SN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Oe,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(Lt,{}):null,s.error?xN():jLe()]}):f.jsxs(Oe,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(Lt,{}):null,xN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Oe,{disabled:o,onClick:()=>void m(),children:j4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Oe,{disabled:o,onClick:()=>void m(),children:j4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(Lt,{}):null,yN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(Lt,{}):null,eL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Oe,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(Lt,{}):null,yN()]})})]})}),u&&f.jsx(yO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function j0t({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function T0t(){R.useSyncExternalStore(h9,BG),R.useEffect(()=>h9(()=>{m0t(),y0t()}),[]);const e=qV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...Ift(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=C0t(x);$G(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,N0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";E0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(Lt,{})," ",lLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Oe,{onClick:()=>location.reload(),children:Ui()})]}):f.jsx(Lt,{})});if(n.kind==="local")return f.jsxs(X4,{value:n,children:[f.jsx(YN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(_z,{host:n.session.host}):f.jsx(pz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(X4,{value:n,children:[f.jsx(YN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(j0t,{children:r?f.jsx(_z,{host:n.session.host,overlay:!0}):f.jsx(pz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const lb=EV()({component:T0t}),T6="orx:demo-read-sessions";function RO(){try{const e=JSON.parse(sessionStorage.getItem(T6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function A0t(e){try{const n=RO();n.add(e),sessionStorage.setItem(T6,JSON.stringify([...n]))}catch{}}function R0t(){try{sessionStorage.removeItem(T6)}catch{}}function MO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function M0t(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Xp()),e.fetchQuery(rp())]),r=ab((i=E6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!MO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function D0t(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(g6(e)),n.fetchQuery(Ea(e))]),s=TO(e)??t,i=ab(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&MO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?j6(a==null?void 0:a.id,!(await n.fetchQuery(Xp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return k1(e,(a==null?void 0:a.id)??null,u)}/** +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(j){const M=this._getMouseBufferCoords(j),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(j,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([j,M],O,B)}_areCoordsInSelection(j,M,O){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,H;const O=(H=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:H.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(j);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);O?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,O)}_fireOnSelectionChange(j,M,O){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let O=M;for(let B=0;M>=B;B++){const $=j.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(j,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,O=!0,B=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,H=$.lines.get(j[1]);if(!H)return;const q=$.translateBufferLineToString(j[1],!1);let Y=this._convertViewportColToCharacterIndex(H,j[0]),G=Y;const X=j[0]-Y;let ee=0,I=0,L=0,P=0;if(q.charAt(Y)===" "){for(;Y>0&&q.charAt(Y-1)===" ";)Y--;for(;G1&&(P+=re-1,G+=re-1);te>0&&Y>0&&!this._isCharWordSeparator(H.loadCell(te-1,this._workCell));){H.loadCell(te-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,te--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,te--}for(;de1&&(P+=ne-1,G+=ne-1),G++,de++}}G++;let W=Y+X-ee+L,U=Math.min(this._bufferService.cols,G-Y+ee+I-L-P);if(M||q.slice(Y,G).trim()!==""){if(O&&W===0&&H.getCodePoint(0)!==32){const te=$.lines.get(j[1]-1);if(te&&H.isWrapped&&te.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(de){const re=this._bufferService.cols-de.start;W-=re,U+=re}}}if(B&&W+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const te=$.lines.get(j[1]+1);if(te!=null&&te.isWrapped&&te.getCodePoint(0)!==32){const de=this._getWordAt([0,j[1]+1],!1,!1,!0);de&&(U+=de.length)}}return{start:W,length:U}}}_selectWordAt(j,M){const O=this._getWordAt(j,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[O.start,j[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let O=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,j,M,O){var B,$=arguments.length,H=$<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(T,j,M,O);else for(var q=T.length-1;q>=0;q--)(B=T[q])&&(H=($<3?B(H):$>3?B(j,M,H):B(j,M))||H);return $>3&&H&&Object.defineProperty(j,M,H),H},_=this&&this.__param||function(T,j){return function(M,O){j(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=j[M/36%6|0],B=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((j-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const j=v.ensureContrastRatio(E.rgba,N.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const j=E/255,M=N/255,O=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y0||H>0||q>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),q-=Math.max(0,Math.ceil(.1*q)),Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));return($<<24|H<<16|q<<8|255)>>>0}function E(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,H=N>>8&255;return l=B+Math.round((j-B)*d),u=$+Math.round((M-$)*d),_=H+Math.round((O-H)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,j){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(qw(M,S.relativeLuminance(Y>>8))?H:Y}return H}const B=E(N,T,j),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(H>>8))?B:H}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,H)=>this._inputHandler.parse($,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,H){this._bufferService.scrollLines(B,$,H)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(ee,I,L,P){var W,U=arguments.length,te=U<3?I:P===null?P=Object.getOwnPropertyDescriptor(I,L):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(ee,I,L,P);else for(var de=ee.length-1;de>=0;de--)(W=ee[de])&&(te=(U<3?W(te):U>3?W(I,L,te):W(I,L))||te);return U>3&&te&&Object.defineProperty(I,L,te),te},_=this&&this.__param||function(ee,I){return function(L,P){I(L,P,ee)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),j=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(ee,I){if(ee>24)return I.setWinLines||!1;switch(ee){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var H;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let q=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,P,W,U,te,de,re,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=P,this._logService=W,this._optionsService=U,this._oscLinkService=te,this._coreMouseService=de,this._unicodeService=re,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:oe})})),this._parser.setDcsHandlerFallback(((Q,le,oe)=>{le==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:oe})})),this._parser.setPrintHandler(((Q,le,oe)=>this.print(Q,le,oe))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,P,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=P,this._parseStack.position=W}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let P,W=this._activeBuffer.x,U=this._activeBuffer.y,te=0;const de=this._parseStack.paused;if(de){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(P),P;W=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(te=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=te;Q0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ce=this._parser.precedingJoinState;for(let pe=L;pere){if(ne){const Ie=oe;let Te=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(Ie,Te,0,qe,!1);Te=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(oe.insertCells(this._activeBuffer.x,U-qe,this._activeBuffer.getNullCell(le)),oe.getWidth(re-1)===2&&oe.setCellFromCodepoint(re-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,U,le),U>0)for(;--U;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ce,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(P=>!$(P.params[0],this._optionsService.rawOptions.windowOptions)||L(P)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new j.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,P,W=!1,U=!1){const te=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);te.replaceCells(L,P,this._activeBuffer.getNullCell(this._eraseAttrData()),U),W&&(te.isWrapped=!1)}_resetBufferLine(I,L=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),P.isWrapped=!1)}eraseInDisplay(I,L=!1){let P;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);P=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,L);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=re;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ce=I.params[0];return pe=ce,Se=L?ce===2?4:ce===4?oe(te.modes.insertMode):ce===12?3:ce===20?oe(le.convertEol):0:ce===1?oe(P.applicationCursorKeys):ce===3?le.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ce===6?oe(P.origin):ce===7?oe(P.wraparound):ce===8?3:ce===9?oe(W==="X10"):ce===12?oe(le.cursorBlink):ce===25?oe(!te.isCursorHidden):ce===45?oe(P.reverseWraparound):ce===66?oe(P.applicationKeypad):ce===67?4:ce===1e3?oe(W==="VT200"):ce===1002?oe(W==="DRAG"):ce===1003?oe(W==="ANY"):ce===1004?oe(P.sendFocus):ce===1005?4:ce===1006?oe(U==="SGR"):ce===1015?4:ce===1016?oe(U==="SGR_PIXELS"):ce===1048?1:ce===47||ce===1047||ce===1049?oe(ne===Q):ce===2004?oe(P.bracketedPasteMode):0,te.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,P,W,U){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([P,W,U])):L===5&&(I&=-50331904,I|=33554432|255&P),I}_extractColor(I,L,P){const W=[0,0,-1,0,0,0];let U=0,te=0;do{if(W[te+U]=I.params[L+te],I.hasSubParams(L+te)){const de=I.getSubParams(L+te);let re=0;do W[1]===5&&(U=1),W[te+re+1+U]=de[re];while(++re=2||W[1]===2&&te+U>=5)break;W[1]&&(U=1)}while(++te+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let P;const W=this._curAttrData;for(let U=0;U=30&&P<=37?(W.fg&=-50331904,W.fg|=16777216|P-30):P>=40&&P<=47?(W.bg&=-50331904,W.bg|=16777216|P-40):P>=90&&P<=97?(W.fg&=-50331904,W.fg|=16777224|P-90):P>=100&&P<=107?(W.bg&=-50331904,W.bg|=16777224|P-100):P===0?this._processSGR0(W):P===1?W.fg|=134217728:P===3?W.bg|=67108864:P===4?(W.fg|=268435456,this._processUnderline(I.hasSubParams(U)?I.getSubParams(U)[0]:1,W)):P===5?W.fg|=536870912:P===7?W.fg|=67108864:P===8?W.fg|=1073741824:P===9?W.fg|=2147483648:P===2?W.bg|=134217728:P===21?this._processUnderline(2,W):P===22?(W.fg&=-134217729,W.bg&=-134217729):P===23?W.bg&=-67108865:P===24?(W.fg&=-268435457,this._processUnderline(0,W)):P===25?W.fg&=-536870913:P===27?W.fg&=-67108865:P===28?W.fg&=-1073741825:P===29?W.fg&=2147483647:P===39?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):P===49?(W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?U+=this._extractColor(I,U,W):P===53?W.bg|=1073741824:P===55?W.bg&=-1073741825:P===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):P===100?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${P}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${P}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=L%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(I){const L=I.params[0]||1;let P;return(I.length<2||(P=I.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],P=I.split(";");for(;P.length>1;){const W=P.shift(),U=P.shift();if(/^\d+$/.exec(W)){const te=parseInt(W);if(X(te))if(U==="?")L.push({type:0,index:te});else{const de=(0,M.parseColor)(U);de&&L.push({type:1,index:te,color:de})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const P=I.split(":");let W;const U=P.findIndex((te=>te.startsWith("id=")));return U!==-1&&(W=P[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const P=I.split(";");for(let W=0;W=this._specialColors.length);++W,++L)if(P[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const U=(0,M.parseColor)(P[W]);U&&this._onColor.fire([{type:1,index:this._specialColors[L],color:U}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],P=I.split(";");for(let W=0;W=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${U}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let G=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){eethis.end&&(this.end=ee)}markRangeDirty(ee,I){ee>I&&(q=ee,ee=I,I=q),eethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(ee){return 0<=ee&&ee<256}G=u([_(0,E.IBufferService)],G)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let G=$.length-1,X=$[G];X===0&&(G--,X=$[G]);let ee=M.length-H-1,I=B;for(;ee>=0;){const P=Math.min(I,X);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[ee],I-P,X-P,P,!0),X-=P,X===0&&(G--,X=$[G]),I-=P,I===0){ee--;const W=Math.max(ee,0);I=(0,m.getWrappedLineTrimmedLength)(M,W,this._cols)}}for(let P=0;P0;)this.ybase===0?this.y0){const T=[],j=[];for(let G=0;G=0;G--)if($&&$.start>O+H){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(G--,$.newLines[X]);G++,T.push({index:O+1,amount:$.newLines.length}),H+=$.newLines.length,$=E[++B]}else this.lines.set(G,j[O--]);let q=0;for(let G=T.length-1;G>=0;G--)T[G].index+=q,this.lines.onInsertEmitter.fire(T[G]),q+=T[G].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=E[3*(b+T)+j];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` +`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(j===2?E<128?b--:u[S++]=E:j===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ej)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let H=j+1;;++H){if(H>=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,j),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++j47&&E<60);j--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,j),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let H=j+1;;++H)if(H>=w||(E=b[H])===24||E===26||E===27||E>127&&E=w||(E=b[H])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r +`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(R2)),R2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function ob(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function C1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let cv=null,C0=0;const N6=()=>cv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void lb.retry()}})})}let E1=TO();function F0t(){C0++,cv=null,E1=TO()}const lb={flush:(e=!1)=>E1.flush(e),retry:()=>E1.retry(),queue(e,n=0){const t=cv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(cv=e,E1.queue(e,n))}};window.addEventListener("pagehide",()=>void lb.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const M2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:S1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===p6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,uv=new Map,X4=new Set,Z4=()=>{for(const e of X4)e()},U0t=e=>(X4.add(e),()=>{X4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),uv.clear(),Z4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&uv.delete(e)&&Z4()},r=>{t===Va&&(uv.set(e,r instanceof Error?r.message:String(r)),Z4())}),ip.set(e,n)}return n}function D2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=ob(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?uv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const q=j.current;if(!q)return;const Y=_z({...M.current,state:q.state,pane:q.pane},cu(Ka.get(q.projectId),q.taskKey),q.projectId,q.taskKey);D2(q.projectId,q.location,q.taskKey,Y)},[]);R.useEffect(()=>{let q=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!q||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{q&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{q=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const q=Ka.get(n);if(!q)return;if(p.current=q,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(q,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(D2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(q,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):D2(n,r),p.current=Ka.get(n)??q},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const q=Va,Y=X=>{if(q===Va){$();for(const ee of ip.values())ee.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const H=R.useCallback(()=>{var q;n&&(x?b(Y=>Y+1):(q=ip.get(n))==null||q.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:H,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),J4=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(J4);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:N4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(H){Qn(H instanceof Error?H.message:String(H),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,H])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[H,f.jsx(Gr,{value:i[$],onChange:q=>a({...i,[$]:q.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const cb=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=ob((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=ob(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return C1(e,(a==null?void 0:a.id)??null,u)}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DO=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();/** + */const BO=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const L0t=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const apt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const O0t=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** + */const opt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mz=e=>{const n=O0t(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** + */const vz=e=>{const n=opt(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var Dx={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"};/** + */var L2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const I0t=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},B0t=R.createContext({}),$0t=()=>R.useContext(B0t),P0t=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=$0t()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...Dx,width:n??u??Dx.width,height:n??u??Dx.height,stroke:e??p,strokeWidth:x,className:DO("lucide",m,s),...!i&&!I0t(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** + */const lpt=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cpt=R.createContext({}),upt=()=>R.useContext(cpt),dpt=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=upt()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...L2,width:n??u??L2.width,height:n??u??L2.height,stroke:e??p,strokeWidth:x,className:BO("lucide",m,s),...!i&&!lpt(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const st=(e,n)=>{const t=R.forwardRef(({className:r,...s},i)=>R.createElement(P0t,{ref:i,iconNode:n,className:DO(`lucide-${L0t(mz(e))}`,`lucide-${e}`,r),...s}));return t.displayName=mz(e),t};/** + */const it=(e,n)=>{const t=R.forwardRef(({className:r,...s},i)=>R.createElement(dpt,{ref:i,iconNode:n,className:BO(`lucide-${apt(vz(e))}`,`lucide-${e}`,r),...s}));return t.displayName=vz(e),t};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const F0t=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],H0t=st("arrow-down",F0t);/** + */const fpt=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],hpt=it("arrow-down",fpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q0t=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ap=st("arrow-left",q0t);/** + */const _pt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],op=it("arrow-left",_pt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const U0t=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],E1=st("arrow-right",U0t);/** + */const ppt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],N1=it("arrow-right",ppt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G0t=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],W0t=st("arrow-up-right",G0t);/** + */const mpt=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],gpt=it("arrow-up-right",mpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V0t=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],LO=st("blocks",V0t);/** + */const vpt=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],$O=it("blocks",vpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const K0t=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],OO=st("book-open",K0t);/** + */const bpt=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],PO=it("book-open",bpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q0t=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Y0t=st("calendar-days",Q0t);/** + */const ypt=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],xpt=it("calendar-days",ypt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X0t=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],Z0t=st("chart-spline",X0t);/** + */const wpt=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],Spt=it("chart-spline",wpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const J0t=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Na=st("check",J0t);/** + */const kpt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Na=it("check",kpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ept=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qo=st("chevron-down",ept);/** + */const Cpt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Uo=it("chevron-down",Cpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tpt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],IO=st("chevron-left",tpt);/** + */const Ept=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],FO=it("chevron-left",Ept);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const npt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ta=st("chevron-right",npt);/** + */const Npt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ta=it("chevron-right",Npt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],BO=st("circle-alert",rpt);/** + */const zpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],HO=it("circle-alert",zpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const spt=[["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"}]],ipt=st("circle-question-mark",spt);/** + */const jpt=[["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"}]],Tpt=it("circle-question-mark",jpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const apt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],$O=st("circle-stop",apt);/** + */const Apt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],qO=it("circle-stop",Apt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const opt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],PO=st("circle-x",opt);/** + */const Rpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],UO=it("circle-x",Rpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],cpt=st("clock-3",lpt);/** + */const Mpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Dpt=it("clock-3",Mpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const upt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dpt=st("clock",upt);/** + */const Lpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Opt=it("clock",Lpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fpt=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],hpt=st("cloud-upload",fpt);/** + */const Ipt=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Bpt=it("cloud-upload",Ipt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _pt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Z4=st("code",_pt);/** + */const $pt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],e3=it("code",$pt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ppt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],cb=st("copy",ppt);/** + */const Ppt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ub=it("copy",Ppt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mpt=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],FO=st("corner-down-left",mpt);/** + */const Fpt=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],GO=it("corner-down-left",Fpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gpt=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],HO=st("cpu",gpt);/** + */const Hpt=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],WO=it("cpu",Hpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vpt=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],bpt=st("download",vpt);/** + */const qpt=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Upt=it("download",qpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ypt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],A6=st("ellipsis",ypt);/** + */const Gpt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],R6=it("ellipsis",Gpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xpt=[["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"}]],Md=st("external-link",xpt);/** + */const Wpt=[["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"}]],Md=it("external-link",Wpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wpt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],qO=st("file-code",wpt);/** + */const Vpt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],VO=it("file-code",Vpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Spt=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],kpt=st("file-output",Spt);/** + */const Kpt=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Qpt=it("file-output",Kpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cpt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ub=st("file-text",Cpt);/** + */const Ypt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],db=it("file-text",Ypt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ept=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],db=st("flask-conical",Ept);/** + */const Xpt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],fb=it("flask-conical",Xpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Npt=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],UO=st("folder-git-2",Npt);/** + */const Zpt=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],KO=it("folder-git-2",Zpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zpt=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Dd=st("folder-open",zpt);/** + */const Jpt=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Dd=it("folder-open",Jpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jpt=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Tpt=st("folder-plus",jpt);/** + */const emt=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],tmt=it("folder-plus",emt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Apt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],fb=st("folder-tree",Apt);/** + */const nmt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],hb=it("folder-tree",nmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rpt=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Mpt=st("funnel",Rpt);/** + */const rmt=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],smt=it("funnel",rmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dpt=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Lpt=st("gauge",Dpt);/** + */const imt=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],amt=it("gauge",imt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Opt=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Jp=st("git-branch",Opt);/** + */const omt=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],em=it("git-branch",omt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ipt=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],Bpt=st("git-commit-horizontal",Ipt);/** + */const lmt=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],cmt=it("git-commit-horizontal",lmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $pt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ppt=st("globe",$pt);/** + */const umt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],dmt=it("globe",umt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fpt=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Hpt=st("history",Fpt);/** + */const fmt=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],hmt=it("history",fmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],R6=st("info",qpt);/** + */const _mt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],M6=it("info",_mt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Upt=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],Gpt=st("laptop",Upt);/** + */const pmt=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],mmt=it("laptop",pmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wpt=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Vpt=st("lightbulb",Wpt);/** + */const gmt=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],vmt=it("lightbulb",gmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kpt=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],GO=st("link-2",Kpt);/** + */const bmt=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],QO=it("link-2",bmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qpt=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],WO=st("list-checks",Qpt);/** + */const ymt=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],YO=it("list-checks",ymt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ypt=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],gz=st("lock",Ypt);/** + */const xmt=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],bz=it("lock",xmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xpt=[["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"}]],Zpt=st("maximize-2",Xpt);/** + */const wmt=[["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"}]],Smt=it("maximize-2",wmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jpt=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],VO=st("message-square-quote",Jpt);/** + */const kmt=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],XO=it("message-square-quote",kmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const emt=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],tmt=st("minimize-2",emt);/** + */const Cmt=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Emt=it("minimize-2",Cmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nmt=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],rmt=st("monitor",nmt);/** + */const Nmt=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],zmt=it("monitor",Nmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const smt=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],imt=st("moon",smt);/** + */const jmt=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Tmt=it("moon",jmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const amt=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],omt=st("mouse-pointer-click",amt);/** + */const Amt=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Rmt=it("mouse-pointer-click",Amt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lmt=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],M6=st("package",lmt);/** + */const Mmt=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],D6=it("package",Mmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cmt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],KO=st("panel-left",cmt);/** + */const Dmt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ZO=it("panel-left",Dmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const umt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],QO=st("panel-right",umt);/** + */const Lmt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],JO=it("panel-right",Lmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dmt=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],fmt=st("paperclip",dmt);/** + */const Omt=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Imt=it("paperclip",Omt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hmt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],D6=st("pencil",hmt);/** + */const Bmt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],L6=it("pencil",Bmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _mt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],em=st("plus",_mt);/** + */const $mt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tm=it("plus",$mt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pmt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Aa=st("refresh-cw",pmt);/** + */const Pmt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Aa=it("refresh-cw",Pmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mmt=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],gmt=st("rotate-cw",mmt);/** + */const Fmt=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Hmt=it("rotate-cw",Fmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vmt=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],L6=st("scroll-text",vmt);/** + */const qmt=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],O6=it("scroll-text",qmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bmt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],YO=st("search",bmt);/** + */const Umt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],eI=it("search",Umt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ymt=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],vz=st("server",ymt);/** + */const Gmt=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],yz=it("server",Gmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xmt=[["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"}]],XO=st("settings",xmt);/** + */const Wmt=[["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"}]],tI=it("settings",Wmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wmt=[["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"}]],ZO=st("sliders-horizontal",wmt);/** + */const Vmt=[["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"}]],nI=it("sliders-horizontal",Vmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Smt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],c_=st("square-terminal",Smt);/** + */const Kmt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],c_=it("square-terminal",Kmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kmt=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Cmt=st("sun",kmt);/** + */const Qmt=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ymt=it("sun",Qmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Emt=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],qh=st("terminal",Emt);/** + */const Xmt=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Uh=it("terminal",Xmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nmt=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],zmt=st("toggle-right",Nmt);/** + */const Zmt=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Jmt=it("toggle-right",Zmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jmt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xd=st("trash-2",jmt);/** + */const egt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Zd=it("trash-2",egt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tmt=[["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"}]],O6=st("triangle-alert",Tmt);/** + */const tgt=[["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"}]],I6=it("triangle-alert",tgt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Amt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Rmt=st("upload",Amt);/** + */const ngt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],rgt=it("upload",ngt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mmt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],I6=st("users",Mmt);/** + */const sgt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],B6=it("users",sgt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dmt=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],JO=st("wand-sparkles",Dmt);/** + */const igt=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],rI=it("wand-sparkles",igt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lmt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qr=st("x",Lmt);/** + */const agt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ur=it("x",agt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Omt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Imt=st("zap",Omt);function B6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Lx(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx(B6,{}),"OpenResearch"]})}function Bmt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():PK({value:Ne(e)}),title:n?tp():n6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(cb,{size:11})})]})}function tm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(Bmt,{cmd:n},t):n):null}function J4({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const eI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",tI="/assets/ollama-logo-Bt9O-2K_.png",nI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",$mt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function op({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",$mt[e],n),...t})}const bz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),lp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),yz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),rI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),xz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),Pmt=[{id:"AI/ML",label:y8e},{id:"Biology",label:k8e},{id:"Physics",label:R8e},{id:"Other",label:z8e}],Fmt=["welcome","environment","profile"];function Hmt({onDone:e,preferredAgent:n}){var le;const t=gn({mutationFn:ae=>hut(...ae)}),[r,s]=R.useState(0);R.useEffect(()=>{const ae=Fmt[r];ae&&Vc({name:"onboarding_step_viewed",step:ae})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,z]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[U,H]=R.useState(!1),Y=R.useRef(0),[V,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(ae=>ae.agentReady))??!1,F=l!=null,q=R.useRef(0),G=(ae,ue=!1)=>{const pe=++q.current;v(!0),X(!1),I(!1);const Se=()=>pe===q.current;Promise.allSettled([nb(ae,ue),nt.fetchQuery({...B0(),staleTime:ae?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>G(!1),[]),R.useEffect(()=>{if(o===null)return;const ae=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&ae.some(ye=>ye.id===ue))return ue;const pe=n&&ae.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=ae[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery($ft()).then(ae=>{w(ae.researchAreas),C(ae.otherArea??""),N(ae.background??""),z(ae.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const ae=M.trim();if(ae.length<3){$([]),H(!1);return}const ue=++Y.current;H(!0);const pe=setTimeout(()=>{nt.fetchQuery(ZL(ae)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&H(!1))},350);return()=>clearTimeout(pe)},[M]);const ee=ae=>{const ue=T.some(pe=>pe.paperId===ae.paperId);z(pe=>pe.some(Se=>Se.paperId===ae.paperId)?pe:[...pe,{paperId:ae.paperId,title:wz(ae.title)}]),O(""),$([]),ue||nt.fetchQuery(q4(ae.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&z(qe=>qe.map(Ie=>Ie.paperId===ae.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=ae=>z(ue=>ue.filter(pe=>pe.paperId!==ae)),oe=ae=>{w(ue=>ue.includes(ae)?ue.filter(pe=>pe!==ae):[...ue,ae])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const ae=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!ae||u)return;const ue=Umt(ae,((pe=ae.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(Lx,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:c8e()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:gCe()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:sNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:KCe()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:BEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:OCe()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:zNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Oe,{variant:"primary",size:"large",onClick:()=>s(1),children:[uN()," ",f.jsx(E1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(Lx,{}),f.jsx("span",{children:HEe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:X8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:R9e()}),o!==null&&!L&&f.jsx("p",{className:bz,children:TEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:bz,children:tCe()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(Vmt,{gitVersion:l,error:te}),te?f.jsx("p",{className:yz,children:fN()}):f.jsx("p",{className:yz,children:UCe()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(ae=>f.jsx(Wmt,{h:ae,selected:m===ae.id,onSelect:()=>x(ae.id)},ae.id)):V?f.jsx("div",{className:lp,children:fN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(Lt,{})," ",zCe()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Oe,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(ap,{size:12})," ",cN()]}),f.jsxs(Oe,{variant:"ghost",onClick:()=>G(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",UD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Oe,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?yNe():L?m===null?hCe():te?W9e():l===void 0?mNe():l===null?n9e():void 0:EEe(),children:[uN()," ",f.jsx(E1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(Lx,{}),f.jsx("span",{children:WEe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:YEe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:rI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:kNe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:cCe()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:Pmt.map(ae=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(ae.id),onChange:()=>oe(ae.id),disabled:u}),f.jsx("span",{children:ae.label()})]},ae.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:ae=>C(ae.target.value),disabled:u,placeholder:eNe(),"aria-label":O9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:eEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:ae=>N(ae.target.value),disabled:u,rows:4,placeholder:RCe()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:Y9e()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:h8e()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:ae=>O(ae.target.value),disabled:u,placeholder:oEe()}),U?f.jsx("div",{className:lp,children:dEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(ae=>f.jsxs("button",{type:"button",onClick:()=>ee(ae),disabled:u,children:[f.jsx(op,{children:wz(ae.title)}),f.jsx("span",{className:"id",children:ae.paperId})]},ae.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(ae=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(op,{children:ae.title||ae.paperId}),f.jsx("span",{className:"id",children:ae.paperId}),f.jsx("button",{type:"button","aria-label":eY({name:Ne(ae.paperId)}),onClick:()=>ce(ae.paperId),disabled:u,children:f.jsx(qr,{size:12})})]},ae.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?iCe():kCe()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Oe,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(ap,{size:12})," ",cN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Oe,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(Lt,{})," ",wEe()]}):f.jsxs(f.Fragment,{children:[PCe()," ",f.jsx(E1,{size:13})]})})]}),m===null&&f.jsx("p",{className:xz,children:RNe()}),d&&f.jsx("p",{className:xz,children:d})]})})})}function wz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function qmt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?s6():DEe()}:e.installed?e.installBroken?{tone:"warning",label:ZCe()}:e.authMethod==="local"?{tone:"warning",label:GD()}:e.authState==="unknown"?{tone:"warning",label:lNe()}:e.authState==="unsupported"?{tone:"warning",label:fNe()}:e.installed?{tone:"warning",label:z9e()}:{tone:"neutral",label:dN()}:{tone:"neutral",label:dN()}}function Umt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:tb(e,n).defaultId}}function Gmt({harness:e}){return f.jsx(J4,{harness:e,size:26})}function Wmt({h:e,selected:n,onSelect:t}){var u;const r=qmt(e),s=n?{tone:"success",label:pEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&iL({count:Wt(e.models.length),models:new Intl.ListFormat(j()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(Gmt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(sb,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:v9e()}),f.jsxs("div",{children:[_9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:eI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:tI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),u9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:nI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??r6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${lp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:lp,children:tm(e.agentNote)}),l]})}function Vmt({gitVersion:e,error:n}){return f.jsxs("div",{className:rI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:a9e()}),f.jsx(sb,{tone:e?"success":n||e===null?"danger":"warning",children:e?s6():n?$8e():e===null?qD():q8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:lp,children:e??V8e()})]})}const Kmt="/assets/slurm-logo-aGSXVZcE.svg",Qmt="/assets/thinking-machines-BOdslTfm.png";function Ymt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return TD();case"tinker_job":return"Tinker";default:return e||"—"}}function Xmt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Zmt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Jmt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function egt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function tgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:Qmt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function rgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:Kmt,width:e,height:e,alt:"","aria-hidden":"true"})}function hb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Zmt,{size:n});case"hf_job":return f.jsx(Xmt,{size:n});case"k8s_job":return f.jsx(Jmt,{size:n});case"ssh_job":return f.jsx(vz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(rgt,{size:n});case"ray_job":return f.jsx(egt,{size:n});case"openresearch_job":return f.jsx(tgt,{size:n});case"tinker_job":return f.jsx(ngt,{size:n});case"local_job":return f.jsx(Gpt,{size:n,strokeWidth:1.5});default:return f.jsx(vz,{size:n})}}function $6({backend:e}){const n=p6(e),t=kft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:Ymt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function Ox(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function Bg(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function sgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function igt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function agt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function ogt({onCreated:e,onCancel:n,remote:t=!1}){var Jn,hn,En,ln;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,z]=R.useState(""),[M,O]=R.useState(null),[B,$]=R.useState(!1),U=R.useRef(0),H=R.useRef(0),Y=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),V=r==="paper"?igt(M==null?void 0:M.repoUrl):null,X=i.trim()?`~/OpenResearch/${Bg(i,48)}`:"",te=`~/OpenResearch/${Bg(i||(M==null?void 0:M.title)||(M==null?void 0:M.paperId)||"")}`,I=r==="blank"&&!d?X:r==="paper"&&M&&!d?te:u,L=Ox(I.trim(),200),F=ct({...B0(L),enabled:!!L&&L===I.trim()}),q=L===I.trim()?F.data??null:null,G=L===I.trim()?((Jn=F.error)==null?void 0:Jn.message)??null:null,ee=!!I.trim()&&(L!==I.trim()||F.isFetching),ce=V??(r==="folder"&&(q!=null&&q.githubOwner)&&q.githubRepo?{owner:q.githubOwner,repo:q.githubRepo}:null),oe=ct(fht()),ne=((hn=oe.data)==null?void 0:hn.login)??(oe.isPending?void 0:null),Q=ct(m6()),le=R.useRef(!1);R.useEffect(()=>{le.current||!Q.data||(le.current=!0,N(Q.data.githubForNewProjects))},[Q.data]);const ae=Ox(i.trim(),150),ue=ct({...hht(ae),enabled:ae===i.trim()}),pe=ae===i.trim()?((En=ue.data)==null?void 0:En.repo)??Bg(i,48):Bg(i,48),Se=ae!==i.trim()||ue.isFetching,ye=ct({...QN((ce==null?void 0:ce.owner)??"",(ce==null?void 0:ce.repo)??""),enabled:!!ce,subscribed:!!ce}),qe=!!ce&&ye.isFetching,Ie=ce&&((ln=ye.data)!=null&&ln.canPush)?`github.com/${ce.owner}/${ce.repo}`:null,ze=Ox(T.trim(),350),at=sgt(ze),bt=r==="paper"&&!M&&ze===T.trim(),$t=ct({...ZL(ze),enabled:bt&&!at&&ze.length>=3,subscribed:bt&&!at&&ze.length>=3}),Pt=ct({...q4(at??""),enabled:bt&&!!at,subscribed:bt&&!!at}),zt=bt&&!at?$t.data??[]:[],ot=bt&&$t.isSuccess?ze:"",ft=B||r==="paper"&&!M&&(ze!==T.trim()||(at?Pt.isFetching:$t.isFetching));R.useEffect(()=>{var pt;!bt||!at||!Pt.data||(O(Pt.data),o||a(((pt=Pt.data.title)==null?void 0:pt.trim())||Pt.data.paperId))},[bt,at,Pt.data,o]),R.useEffect(()=>{const pt=at?Pt.error:$t.error;bt&&pt&&w(pt.message)},[bt,at,Pt.error,$t.error]);const It=gn({mutationFn:mut});async function we(pt){var Ge;const kt=++U.current;$(!0),w(null);try{const mt=await nt.fetchQuery(q4(pt));if(kt!==U.current)return;O(mt),o||a(((Ge=mt.title)==null?void 0:Ge.trim())||mt.paperId)}catch(mt){kt===U.current&&w(mt instanceof Error?mt.message:String(mt))}finally{kt===U.current&&$(!1)}}function Re(){U.current+=1,H.current+=1,O(null),z(""),$(!1),x(!1),_(""),p(!1),Y.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function Ze(pt){if(pt===r)return;U.current+=1,H.current+=1,Y.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const kt=Y.current[pt];s(pt),w(null),$(!1),x(!1),a(kt.name),l(kt.nameTouched),_(kt.path),p(kt.pathTouched)}async function ht(){if(m)return;const pt=++H.current;x(!0),w(null);try{const kt=await put();if(pt!==H.current||!kt)return;if(p(!0),_(kt),nt.invalidateQueries(B0(kt)),r==="folder"&&!o){const Ge=kt.replace(/[\\/]+$/,"").split(/[\\/]/).pop();Ge&&a(Ge)}}catch(kt){pt===H.current&&w(kt instanceof Error?kt.message:String(kt))}finally{pt===H.current&&x(!1)}}async function xt(pt){if(pt.preventDefault(),!!vt){v(!0),w(null);try{const kt=await nt.fetchQuery({...B0(I.trim()),staleTime:0});if(kt.exists&&kt.directory===!1)throw new Error(wx());if(r==="blank"&&kt.exists)throw new Error(rN());if(r==="paper"&&kt.empty===!1)throw new Error(lN());E&&ce&&await nt.fetchQuery({...QN(ce.owner,ce.repo),staleTime:0}).catch(()=>null);const Ge=await It.mutateAsync({name:i.trim(),path:I.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,locale:j(),...r==="paper"&&M?{paperId:M.paperId,cloneUrl:M.repoUrl??void 0}:{}});e(Ge.project,Ge.githubPublicationError)}catch(kt){w(kt instanceof Error?kt.message:String(kt))}finally{v(!1)}}}const Vt=i.trim(),Ve=r==="paper"&&M&&!M.repoUrl?M.paperId:null,Ht=r==="folder"&&(q==null?void 0:q.gitState)==="ready"?q.resolvedPath??null:null,sn=Vt!==""&&(r==="blank"||Ve!==null||Ht!==null);R.useEffect(()=>{if(!sn)return;const pt=window.setTimeout(()=>{wut({name:Vt,paperId:Ve??void 0,path:Ht??void 0,locale:j()}).catch(()=>{})},1200);return()=>window.clearTimeout(pt)},[sn,Vt,Ve,Ht]);const fn=(q==null?void 0:q.gitVersion)===null,Zt=r==="folder"&&!!I.trim()&&q!==null&&q.exists===!1,Qn=r==="blank"&&(q==null?void 0:q.exists)===!0,Jt=!!I.trim()&&(q==null?void 0:q.exists)===!0&&q.directory===!1,bn=r==="paper"&&!!(M!=null&&M.repoUrl)&&(q==null?void 0:q.empty)===!1,or=r==="paper"&&!!M&&!(M!=null&&M.repoUrl)&&(q==null?void 0:q.empty)===!1,lr=r==="folder"&&((q==null?void 0:q.gitState)==="detached"||(q==null?void 0:q.gitState)==="invalid"),br=d&&!I.trim()||Jt||bn||or,Dn=d&&!I.trim()||Jt||Qn,Wr=d&&!I.trim()?oN():Jt?wx():Qn?rN():null,Nr=d&&!I.trim()?oN():Jt?wx():bn?lN():or?_Se():null,vt=!!(i.trim()&&I.trim())&&!S&&!m&&!ee&&q!==null&&!G&&!fn&&!Zt&&!Qn&&!Jt&&!bn&&!or&&!lr&&(r!=="paper"||!!M)&&(!E||typeof ne=="string"&&!Se&&!qe),un=Ie??`github.com/${ne??"you"}/${pe}`,Cn=ne===void 0||Se||qe,en=r==="paper"&&!M&&T.trim().length>=3&&ot===T.trim()&&!ft&&zt.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:xt,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>Ze("blank"),children:YSe()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>Ze("folder"),children:bke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>Ze("paper"),children:Nke()})]}),r==="paper"&&!M&&f.jsxs("label",{className:"!font-normal",children:[Yke(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:T,onChange:pt=>{w(null),z(pt.target.value)},placeholder:a7e()}),!en&&f.jsx("span",{className:"repo-hint",children:ft?Z7e():U7e()}),en&&f.jsx("span",{className:"project-path-notice block",children:Bke()}),zt.length>0&&f.jsx("div",{className:"paper-results",children:zt.map(pt=>f.jsxs("button",{type:"button",onClick:()=>void we(pt.paperId),children:[f.jsx(op,{children:pt.title}),f.jsx("span",{className:"id",children:pt.paperId})]},pt.paperId))})]}),M&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(op,{className:"block",children:M.title||M.paperId}),M.repoUrl&&f.jsx("div",{className:"id",children:agt(M.repoUrl)})]}),f.jsx(Oe,{size:"small",type:"button","aria-label":lke(),onClick:Re,children:ske()})]}),!M.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(BO,{size:16})," ",Hke()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:Wke()})]})]}),(r!=="paper"||M)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:aN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:pt=>{l(!0),a(pt.target.value)},placeholder:iN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:M!=null&&M.repoUrl?jSe():Sx()}),f.jsx("input",{className:"text-sm font-normal",value:I,onChange:pt=>{p(!0),_(pt.target.value)},"aria-describedby":br?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),ee&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:sN()}),br&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Nr})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?vSe({path:Ne(u)}):tN(),disabled:m,title:u||void 0,onClick:()=>void ht(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?CSe():u||tN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:Sx()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:pt=>{p(!0),_(pt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:Sx()}),f.jsx("input",{className:"text-sm font-normal",value:I,onChange:pt=>{p(!0),_(pt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":Dn?"blank-destination-description":void 0,spellCheck:!1}),ee&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:sN()}),Dn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Wr})]}):null,r!=="blank"&&I&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:aN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:pt=>{l(!0),a(pt.target.value)},placeholder:iN()})]}),fn&&f.jsx("div",{className:"project-path-notice error",children:Ake()}),!fn&&r==="folder"&&u.trim()&&!ee&&(q==null?void 0:q.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:_7e()}),!fn&&r==="folder"&&u.trim()&&!ee&&Jt&&f.jsx("div",{className:"project-path-notice error",children:w7e()}),!fn&&r==="folder"&&!ee&&(q==null?void 0:q.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:fke()}),!fn&&r==="folder"&&!ee&&(q==null?void 0:q.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:v7e()}),G&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:G})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||M)&&I&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ne===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(pt=>!pt),children:[E?ne===null?aSe():uSe():nSe(),f.jsx(qo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:pt=>N(pt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:u7e()})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Cn?E7e({repository:Ne(un)}):Ie?D7e({repository:Ne(un)}):T7e({repository:Ne(un)})}),f.jsx("span",{children:Ske()}),ne===null&&f.jsx("span",{children:K7e({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Oe,{type:"button",onClick:n,children:eke()}),f.jsx(Oe,{variant:"primary",className:"ms-auto",disabled:!vt,children:S?PSe():r==="paper"?M!=null&&M.repoUrl?MSe():nN():r==="folder"?n8e():nN()})]})]})}function sI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:XD()}),f.jsx(ogt,{onCancel:e,onCreated:n,remote:t})]})})}function lgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:oRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:HAe({name:Do(e.name)})}),f.jsx("p",{className:"m-0",children:l?wRe():ERe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Oe,{disabled:n,onClick:r,children:JAe()}),f.jsx(Oe,{variant:"danger",disabled:n,onClick:s,children:n?pRe():dRe()})]})]})})}function Sz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function cgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(dht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Cut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:FRe()}),f.jsxs(Oe,{onClick:()=>a(!0),children:[f.jsx(em,{size:15})," ",XD()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:IRe()}),f.jsx("span",{children:mN()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:MRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):i6(),C=b?b.activeAgents>0?DAe({count:Wt(b.activeAgents)}):KRe():"—",E=b?b.totalAgents===1?tMe():BAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?iMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?l6():bN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?bN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":NQ({name:Do(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[rRe()," ",Io(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[QAe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":S4({name:Do(v.name)}),disabled:o===v.id,onClick:z=>{z.stopPropagation(),_(null),p(v)},children:f.jsx(Xd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:mN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Sz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Sz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:vN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":J1({name:Do(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(hb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(sI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(lgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function iI(){const e=R.useSyncExternalStore(aht,WN,WN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":E4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(BO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:E4()})]})]})}const aI={id:"lmstudio",label:"LM Studio",icon:eI,url:"http://127.0.0.1:1234/v1"},N1=[aI,{id:"omlx",label:"oMLX",icon:nI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:tI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function oI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=i_(),i=ct({...Vft(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=N1.find(I=>I.id===d)??aI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},z=gn({mutationFn:Eft}),M=gn({mutationFn:async I=>{var q;const L=await Nft(I);if(!((q=(await s.fetchQuery({...hu(),staleTime:0})).find(G=>G.id==="opencode"))!=null&&q.models.some(G=>G.id===L.model)))throw new Error(F3e());return L}}),O=gn({mutationFn:jft}),B=Number(C),$=z.isPending||M.isPending,U=(I={})=>T({models:[],model:null,error:null,...I}),H=async()=>{U();try{const I=await z.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},V=async I=>{try{await O.mutateAsync(I)}catch(L){Kn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":XE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:XE()}),f.jsxs(Oe,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(em,{size:14}),ID()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(ugt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void V(I.id)},I.id))})]}),l&&f.jsx(dgt,{busy:$,onClose:_,footer:f.jsxs(Oe,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():H()),children:[$&&f.jsx(Lt,{}),w.length>0?w5e():D3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:_5e()}),f.jsx(Hh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:u5e()})]}),f.jsx(Ld,{choices:N1,value:d,title:YE(),header:YE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?t6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:BD()})]}),renderIcon:I=>{var F;const L=(F=N1.find(q=>q.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(GO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:T3e()}),f.jsx(rs,{value:b,disabled:$,onChange:I=>{U({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:oL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?R5e():v5e()}),f.jsx(rs,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>U({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:HD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:Q3e()}),f.jsx(rs,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:J3e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function ugt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=gn({mutationFn:async()=>{try{await zft(e.id)}finally{await nb(!0)}}}),l=N1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(GO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?t6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:BD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Ft,{variant:d||p?"default":m?"success":"warning",children:d?Yi():p?vL():m?G3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Oe,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),UD()]}),f.jsx(Qt,{"aria-label":a5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Xd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function dgt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ib(s,i,"input"),no.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:ID()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(qr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Oe,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const lI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),kz=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function fgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:rv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:tb(n,t).defaultId}}function ro(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function hgt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,ae,ue,pe,Se;const{data:_=_gt}=ct(hu()),d=i_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=ro(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const z=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let ze=Ie.models;return ye?ze=ze.filter(at=>`${at.id} ${I0(at)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(ze=ze.slice(0,5)),{harness:Ie,models:ze,hidden:ye?0:Ie.models.length-ze.length}})},[_,y,l,e]),M=(ye,qe)=>{var ze;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:rv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((ze=ye.options)==null?void 0:ze.defaultPermissionMode)??null,reasoningLevel:qL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):D4(e.model):ZE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),U=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,H=(e==null?void 0:e.permissionMode)??r??((ae=t[0])==null?void 0:ae.id),Y=(ue=t.find(ye=>ye.id===H))==null?void 0:ue.label,V=(e==null?void 0:e.harness)==="opencode"?Z6e():h6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=HL(X,e==null?void 0:e.model),I=rv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},q=ye=>{s==null||s(ye),T()},G=ye=>{e&&n({...e,serviceTier:ye}),T()},ee=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(IO,{size:15}),ye]}),oe=(ye,qe,Ie,ze)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(at=>f.jsxs(sr,{onClick:()=>ze(at.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[at.label,at.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",FD()]})]}),at.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:at.description})]}),at.id===qe&&f.jsx(Na,{size:13})]},at.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:kK({label:`${B}${U?` · ${U}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(Imt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(J4,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[g6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,U&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:U})]}),f.jsx(qo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[ee(L0(),B,"models"),i.length>0&&ee(V,U,"reasoning"),te.length>0&&ee(eN(),L,"speed"),t.length>0&&ee(JE(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:HD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[z.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:lI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(J4,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(gz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(sr,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[ZE(),f.jsx("span",{className:"model-id",children:PD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(ze=>f.jsxs(sr,{title:ze.id,onClick:()=>M(ye,ze.id),children:[f.jsx("span",{children:I0(ze)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===ze.id&&f.jsx(Na,{size:13})]},ze.id)),y.trim().length>0&&!ye.models.some(ze=>ze.id===y.trim())&&f.jsx(sr,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:K6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?tm(ye.agentNote):A6e()}),ye.id==="opencode"&&f.jsx(sr,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var ze;T(),(ze=x.current)==null||ze.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[Y5e(),f.jsx(em,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:kz,children:N6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:kz,children:c6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(gz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),B6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(V),oe(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(JE()),oe(t,H,r,q)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(eN()),oe(te,I??void 0,"default",G)]})]}),p&&f.jsx(oI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(ze=>ze.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,V;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=ro(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),q=window.innerHeight-F.bottom-12,G=F.top-12,ee=Math.min(380,X.scrollHeight),ce=i?q>=ee||q>=G:GG;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?q:G))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,z=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===nv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),U=(z==null?void 0:z.label)??((V=e[0])==null?void 0:V.label)??"",H=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[z&&(d==null?void 0:d(z)),f.jsx("span",{className:"truncate",children:z?(p==null?void 0:p(z))??U:U})]}),f.jsx(qo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:lI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(sr,{type:"button",onClick:()=>H(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:PD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(sr,{type:"button",onClick:()=>H(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",FD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const _gt=[];function e3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function uv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=ro();async function d(){if(l){o(!0);try{await $L(l),u(null)}catch(p){u(null),Kn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:NMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(sr,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await IL(),_.setOpen(!1)}catch(p){Kn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?SMe():j4()}),f.jsx(w6,{content:eLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(R6,{size:15})})]}),f.jsx(sr,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await BL()),_.setOpen(!1)}catch(p){Kn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:eL()})]}),n?f.jsxs(Oe,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(e3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:kx({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":kx({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(e3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:kx({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(yO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function P6(e=!0){var r;const n=sv(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Gr(n.queryKey,s)}}const pgt=6e4,mgt=500;function cI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=sv(),u=()=>i.current||!Pn(l.queryKey);t(!0),s(null),(async()=>{try{if(await idt(),u())return;const _=Date.now()+pgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,mgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(xlt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function uI({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=cI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?jL({error:i}):olt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Oe,{type:"button",size:"small",disabled:s,onClick:a,children:s?TL():zL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":dlt(),disabled:s,onClick:()=>t(r),children:f.jsx(qr,{size:13})})]})}function F6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(Lt,{})})}function ggt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Yv,{to:"/projects",children:D0()})]})}function H6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Oe,{onClick:n,children:Ui()}),f.jsx(Yv,{to:"/projects",children:D0()})]})}function dI({projectId:e}){const{queryClient:n}=K5({from:"__root__"}),t=Qv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?D0t(e,n):M0t(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(wG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(H6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(F6,{})}function vgt(){return f.jsx(dI,{})}function bgt({projectId:e}){return f.jsx(dI,{projectId:e})}function ygt(){const e=AO(),n=Qv(),t=rp(),r=ct(t),s=ct(Xp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=P6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&ob.queue({...E6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(iI,{}),f.jsx(uI,{status:u})]}),o&&(!i||!a)?f.jsx(H6,{error:o,reset:l}):!i||!a?f.jsx(F6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(Hmt,{preferredAgent:a.preferredAgent,onDone:d=>{R0t(),_(d.id)}}):f.jsx(cgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Kn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Gr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(uv,{runtime:e,corner:!0})]})}const xgt=Fo()({component:vgt}),wgt=Fo()({component:Z0}),Sgt=Fo()({}),kgt=Fo()({component:ygt}),Cgt=e=>({queryKey:Nt("getRunDiff",e),queryFn:({signal:n})=>jut(e,n),staleTime:3e4}),fI=e=>({queryKey:Nt("getExperimentDiff",e),queryFn:({signal:n})=>Tut(e,n),staleTime:3e4}),dv=(e,n,t={})=>({queryKey:Nt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>Aut(e,n,t,r),staleTime:t.ref?$h(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),hI=e=>({queryKey:Nt("getAbsoluteFile",e),queryFn:({signal:n})=>Rut(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),_I=(e,n={})=>({queryKey:Nt("getCodeTree",e,{...n}),queryFn:({signal:t})=>Xut(e,n,t),staleTime:n.ref&&$h(n.ref)?1/0:3e4}),fv=e=>({queryKey:Nt("getSessionWorktree",e),queryFn:({signal:n})=>Zut(e,n),staleTime:3e4}),Egt=e=>({queryKey:Nt("getArtifacts",e),queryFn:({signal:n})=>Odt(e,n),staleTime:3e4}),q6=(e,n)=>({queryKey:Nt("getArtifactFileText",e,n),queryFn:({signal:t})=>Pdt(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),pI=(e,n)=>({queryKey:Nt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>Hdt(e,n,t),staleTime:2e3}),Ngt=()=>({queryKey:Nt("getLatexEngine"),queryFn:({signal:e})=>Iut(e),staleTime:3e5}),zgt=()=>({queryKey:Nt("getOverleafSettings"),queryFn:({signal:e})=>$ut(e),staleTime:3e5}),jgt=(e,n,t={})=>({queryKey:Nt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>Gut(e,n,t,r),staleTime:3e5}),Tgt=(e,n,t={})=>({queryKey:Nt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>Qut(e,n,t,r),staleTime:3e4}),mI=(e,n,t,r,s)=>({queryKey:Nt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!$h(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(pI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(q6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(dv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(hI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(dv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function Agt(e,n,t,r,s){if($h(s))return;const i=mI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[hI(n).queryKey]:[dv(e,n,{sessionId:r,ref:s}).queryKey,dv(e,`artifacts/${n}`,{sessionId:r}).queryKey,q6(e,n).queryKey,pI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function Rgt(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Cz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function Mgt(e){return Cz[e]??Cz.idle}const Dgt={done:Cst,failed:Mst,running:Fst,starting:Gst,cancelling:xst,cancelled:gst,editing:jst,idle:Ist};function U6(e){const n=Dgt[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=Mgt(e);return f.jsx(sb,{tone:r.tone,live:r.live,className:t,children:n??U6(e)})}const Od={local:TD,tinker:Yme,hf:bme,modal:Tme,k8s:Sme,ssh:Wme,slurm:Hme,ray:Bme,openresearch:Dme};function Ez(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Fn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return vI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||_b(e,n)||yI()}function gI(e){return vI(e)||bI(e)||_b(e)||yI()}function Wi(e){return(function(n){if(Array.isArray(n))return n3(n)})(e)||bI(e)||_b(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function vI(e){if(Array.isArray(e))return e}function bI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _b(e,n){if(e){if(typeof e=="string")return n3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n3(e,n):void 0}}function n3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,i=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var $g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nm(e,n){return e(n={exports:{}},n.exports),n.exports}var qi=nm((function(e){/*! + */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function O2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():s6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(ub,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function t3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[ee,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,P=l!=null,W=R.useRef(0),U=(oe,ce=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([rb(oe,ce),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ce=>ce.agentReady);x(ce=>{var Se;if(ce&&oe.some(ye=>ye.id===ce))return ce;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ce=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ce===Y.current&&$(Se)).catch(()=>ce===Y.current&&$([])).finally(()=>ce===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const te=oe=>{const ce=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ce||nt.fetchQuery(G4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},de=oe=>j(ce=>ce.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ce=>ce.includes(oe)?ce.filter(pe=>pe!==oe):[...ce,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ce=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ce,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(O2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(N1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||ee)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:ee}),ee?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!P,title:S?LNe():L?m===null?z8e():ee?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(N1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>te(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>de(oe.paperId),disabled:u,children:f.jsx(Ur,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(N1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?a6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:nb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(t3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ib,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??i6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ib,{tone:e?"success":n||e===null?"danger":"warning",children:e?a6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function _b({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=g6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function I2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),ee=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,P=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?P:r==="paper"&&H&&!d?W:u,te=I2(U.trim(),200),de=ct({...B0(te),enabled:!!te&&te===U.trim()}),re=te===U.trim()?de.data??null:null,ne=te===U.trim()?((rr=de.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(te!==U.trim()||de.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ce=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(v6()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=I2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=I2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...G4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(G4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,ee.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,ee.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++ee.current;x(!0),w(null);try{const ft=await $ut();if(lt!==ee.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===ee.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===ee.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(S2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?S2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?S2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ce=="string"&&!Te&&!Dt),un=Ut??`github.com/${ce??"you"}/${Ie}`,Mn=ce===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():k2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ce===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ce===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ce===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):o6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?u6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":k4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":ev({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(_b,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":N4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:N4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},z1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,ee;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=z1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(ee=i.data)==null?void 0:ee.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:z1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?r6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var P;const L=(P=z1.find(W=>W.id===I.id))==null?void 0:P.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Gr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await rb(!0)}}}),l=z1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?r6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ab(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:sv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:nb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ce,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:sv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):O4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ce=t.find(ye=>ye.id===q))==null?void 0:ce.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),ee=WL(X,e==null?void 0:e.model),I=sv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=ee.find(ye=>ye.id===I))==null?void 0:pe.label,P=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},te=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),de=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(t3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[te(L0(),B,"models"),i.length>0&&te(G,H,"reasoning"),ee.length>0&&te(tN(),L,"speed"),t.length>0&&te(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[de(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(t3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[de(G),re(i,$,a,P)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[de(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[de(tN()),re(ee,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,ee=y.current;if(!b||!m||!X||!ee)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const P=ee.getBoundingClientRect(),W=window.innerHeight-P.bottom-12,U=P.top-12,te=Math.min(380,X.scrollHeight),de=i?W>=te||W>=U:UU;X.style.width=`${P.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,de?W:U))}px`,X.style.left=`${P.left}px`,X.style.top=`${de?P.bottom+4:P.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===rv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var ee;x(X),w(!1),(ee=v.current)==null||ee.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,ee)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:ee+1})]},X.id))]})]})]})}const Pgt=[];function n3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function dv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():T4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(n3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:C2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":C2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:C2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=iv(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Vr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=iv(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Ur,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=Y5({from:"__root__"}),t=Yv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Yv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&lb.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Vr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),fv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),hv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(fv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(fv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[fv(e,n,{sessionId:r,ref:s}).queryKey,fv(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ib,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||pb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||pb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return s3(n)})(e)||SI(e)||pb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pb(e,n){if(e){if(typeof e=="string")return s3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s3(e,n):void 0}}function s3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,i=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var Pg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rm(e,n){return e(n={exports:{}},n.exports),n.exports}var Ui=rm((function(e){/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var z=b.slice(y+1);z.indexOf("from")===0?a.oldPath=z.slice(5):a.newPath=z.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),U={content:v.slice(1)};switch($){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=u,u++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=l,l++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=l,U.newLineNumber=u,l++,u++;break;case"\\":var H=o.changes[o.changes.length-1];H.isDelete||(a.newEndingNewLine=!1),H.isInsert||(a.oldEndingNewLine=!1)}U.type&&o.changes.push(U)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Vi(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function Bgt(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Vi(a)&&Vi(_)?d:o]):(u.push(a),[u,a,Vi(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Fn(Fn({},e),{},{isPlain:!1,changes:t})}function r3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` +*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),H={content:v.slice(1)};switch($){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=u,u++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=l,l++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=l,H.newLineNumber=u,l++,u++;break;case"\\":var q=o.changes[o.changes.length-1];q.isDelete||(a.newEndingNewLine=!1),q.isInsert||(a.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function i3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` `),i=r.indexOf(` `,s+1),a=r.slice(0,s),o=r.slice(s+1,i),l=a.split(" ").slice(1,-3).join(" "),u=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(l," b/").concat(u),"index 1111111..2222222 100644","--- a/".concat(l),"+++ b/".concat(u),r.slice(i+1)].join(` -`)})(e.trimStart());return Igt.parse(t).map((function(r){return(function(s,i){var a=s.hunks.map((function(o){return Bgt(o,i)}));return Fn(Fn({},s),{},{hunks:a})})(r,n)}))}function $gt(e){return e[0]}function Pgt(e){return e[e.length-1]}function s3(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function cp(e){return e==="old"?function(n){return ku(n)?-1:Hl(n)?n.oldLineNumber:n.lineNumber}:function(n){return Vi(n)?-1:Hl(n)?n.newLineNumber:n.lineNumber}}function wI(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},Kgt=function(e,n){var t=this.__data__,r=pb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Xf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new A1t:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var V1t=function(e){return Uh(e)&&V6(e.length)&&!!vr[d_(e)]},K1t=function(e){return function(n){return e(n)}},Dz=nm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&CI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Lz=Dz&&Dz.isTypedArray,K6=Lz?K1t(Lz):V1t,Q1t=Object.prototype.hasOwnProperty,Y1t=function(e,n){var t=Xi(e),r=!t&&bb(e),s=!t&&!r&&hv(e),i=!t&&!r&&!s&&K6(e),a=t||r||s||i,o=a?H1t(e.length,String):[],l=o.length;for(var u in e)!Q1t.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||AI(u,l))||o.push(u);return o},X1t=Object.prototype,RI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||X1t)},Z1t=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),J1t=Object.prototype.hasOwnProperty,MI=function(e){if(!RI(e))return Z1t(e);var n=[];for(var t in Object(e))J1t.call(e,t)&&t!="constructor"&&n.push(t);return n},yb=function(e){return e!=null&&V6(e.length)&&!NI(e)},Q6=function(e){return yb(e)?Y1t(e):MI(e)},Oz=function(e){return I1t(e,Q6,F1t)},evt=Object.prototype.hasOwnProperty,tvt=function(e,n,t,r,s,i){var a=1&t,o=Oz(e),l=o.length;if(l!=Oz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function qvt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,Fvt),a=s?function(o,l){return s(o,Fz,l)}:Fz;return f.jsx("td",Fn(Fn({},i),{},{"data-change-key":n,children:r?Hvt(r)?" ":r.map(a):t||" "}))}var FI=R.memo(qvt);function HI(e,n){return function(){var t=n==="old"?Cb(e):Eb(e);return t===-1?void 0:t}}function qI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function _v(e,n){return n?function(t){e(),n(t)}:e}function Hz(e,n,t,r){return R.useMemo((function(){var s=PI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=_v(t,s.onMouseEnter),s.onMouseLeave=_v(r,s.onMouseLeave),s}),[e,t,r,n])}function qz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:HI(n,r),wrapInAnchor:qI(s,i)};return f.jsx("td",Fn(Fn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function Uvt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],z=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Hz(d,O,z,M),$=Hz(p,O,z,M),U=S(s),H=l({changes:[s],defaultGenerate:function(){return o}}),Y=qi("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),V=qi("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:U,className:qi("diff-line",H),children:[!m&&qz(Y,s,C,"old",x,U,B,T,b),!m&&qz(Y,s,C,"new",x,U,B,T,b),f.jsx(FI,Fn({className:V,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var Gvt=R.memo(Uvt);function Wvt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var Vvt=["hideGutter","selectedChanges","tokens","lineClassName"],Kvt=["hunk","widgets","className"];function Qvt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Kvt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:qi("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,Vvt);if(_==="change"){var w=Vi(p)?"old":"new",y=Vi(p)?Cb(p):Eb(p),C=S?S[w][y-1]:null;return f.jsx(Gvt,Fn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(Wvt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var UI=0;function Fg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=PI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=_v(s,a.onMouseEnter),a.onMouseLeave=_v(i,a.onMouseLeave),a}),[t,r,s,e,i])}function $x(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=qi("diff-gutter","diff-gutter-omit",i),b=qi("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===UI?"old":"new",N=Fn({id:u||void 0,className:qi("diff-gutter","diff-gutter-".concat(w),t3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:HI(n,E),wrapInAnchor:qI(_,d)})},o),T=qi("diff-code","diff-code-".concat(w),t3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Fn(Fn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(FI,Fn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function Yvt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Fg("old",E,t,d),T=Fg("new",E,r,d),z=Fg("old",E,t,p),M=Fg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),U={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},H=Fn(Fn({},U),{},{change:t,side:UI,selected:s,tokens:a,gutterEvents:N,codeEvents:z,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Fn(Fn({},U),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:qi("diff-line",$),children:$x(t?H:Y)});var V=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:qi("diff-line",V,$),children:[$x(H),$x(Y)]})}var Xvt=R.memo(Yvt);function Zvt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Jvt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],ebt=["hunk","widgets","className"];function Hg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function tbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=mb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&yb(e),s=!t&&!r&&_v(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},xb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return xb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?Eb(e):Nb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function pv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=pv(t,s.onMouseEnter),s.onMouseLeave=pv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),H=S(s),q=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:H,className:Ui("diff-line",q),children:[!m&&Gz(Y,s,C,"old",x,H,B,T,b),!m&&Gz(Y,s,C,"new",x,H,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?Eb(p):Nb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=pv(s,a.onMouseEnter),a.onMouseLeave=pv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function P2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),r3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),r3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),H={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},q=Hn(Hn({},H),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},H),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:P2(t?q:Y)});var G=(function(X,ee){return X&&!ee?"diff-line-old-only":!X&&ee?"diff-line-new-only":X===ee?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[P2(q),P2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=(i==null?void 0:i.value.length))return[e];var o=function(d,p){var m=i.value.slice(d,p);return[].concat(Wi(s),[Fn(Fn({},i),{},{value:m})])};if(n>0){var l=o(0,n);a.push(rh(l))}var u=o(Math.max(n,0),t);if(a.push(r?(function(d,p){return[p].concat(Wi(rh(d)))})(u,r):rh(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=_u(e,xbt);t.push(s);var i,a=G6(r);try{for(a.s();!(i=a.n()).done;)KI(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(rh([].concat(Wi(t.slice(1)),[e])));return n}function wbt(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(l){var u=eS(l);return u.value.includes(` +`)})(n.oldSource,e),r=n.highlight?function(l){return n.refractor.highlight(l,n.language)}:function(l){return[{type:"text",value:l}]};return[Ug(r(n.oldSource)),Ug(r(t))]}var s=kn(Hbt(e),2),i=s[0],a=s[1],o=n.highlight?function(l){return Ug(n.refractor.highlight(l,n.language))}:function(l){return Ug([{type:"text",value:l}])};return[o(i),o(a)]}function sh(e){return e.map((function(n){return Hn({},n)}))}function Ubt(e,n){return[].concat(Vi(sh(e.slice(0,-1))),[n])}function Gbt(e){return e.type==="text"}function tS(e){var n=e[e.length-1];if(Gbt(n))return n;throw new Error("Invalid token path with leaf of type ".concat(n.type))}function Wbt(e,n,t,r){var s=e.slice(0,-1),i=tS(e),a=[];if(t<=0||n>=(i==null?void 0:i.value.length))return[e];var o=function(d,p){var m=i.value.slice(d,p);return[].concat(Vi(s),[Hn(Hn({},i),{},{value:m})])};if(n>0){var l=o(0,n);a.push(sh(l))}var u=o(Math.max(n,0),t);if(a.push(r?(function(d,p){return[p].concat(Vi(sh(d)))})(u,r):sh(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=_u(e,Vbt);t.push(s);var i,a=W6(r);try{for(a.s();!(i=a.n()).done;)ZI(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(sh([].concat(Vi(t.slice(1)),[e])));return n}function Kbt(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(l){var u=tS(l);return u.value.includes(` `)?u.value.split(` -`).map((function(_){return vbt(l,Fn(Fn({},u),{},{value:_}))})):[l]})(t),i=gI(s),a=i[0],o=i.slice(1);return[].concat(Wi(n.slice(0,-1)),[[].concat(Wi(r),[a])],Wi(o.map((function(l){return[l]}))))}),[[]])}function Vz(e){return wbt(KI(e))}var Sbt=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?xb(e,n,void 0,t):!!r},kbt=function(e,n){return xb(e,n)},Cbt=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function Ebt(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=Cbt(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&Sbt(t,r,(function(i,a,o){return o==="chlidren"||kbt(i,a)}))))?e.children[e.children.length-1]=(function(i,a){return"value"in i&&"value"in a?Fn(Fn({},i),{},{value:"".concat(i.value).concat(a.value)}):i})(s,n):e.children.push(n),e.children[e.children.length-1]}function Kz(e){var n,t={type:"root",children:[]},r=G6(e);try{var s=function(){var i=n.value;i.reduce((function(a,o,l){return Ebt(a,l===i.length-1?Fn({},o):Fn(Fn({},o),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(i){r.e(i)}finally{r.f()}return t}var Nbt=Object.prototype.hasOwnProperty,zbt=WI((function(e,n,t){Nbt.call(e,t)?e[t].push(n):Z6(e,t,[n])})),jbt=Object.prototype.hasOwnProperty,Tbt=function(e){if(e==null)return!0;if(yb(e)&&(Xi(e)||typeof e=="string"||typeof e.splice=="function"||hv(e)||K6(e)||bb(e)))return!e.length;var n=c3(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(RI(e))return!MI(e).length;for(var t in e)if(jbt.call(e,t))return!1;return!0},Abt=function(e,n){var t=n.start,r=n.length,s=t+r,i=e.reduce((function(a,o){var l=kn(a,2),u=l[0],_=l[1],d=_+eS(o).value.length;if(_>s||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(z=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var z,M=l+T,O=(z=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(z=i-z))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=S.length?[w,y,C,E,z]:null}var l,u,_,d,p,m=o(s,i,Math.ceil(s.length/4)),x=o(s,i,Math.ceil(s.length/2));return m||x?(l=x?m&&m[4].length>x[4].length?m:x:m,t.length>r.length?(u=l[0],_=l[1],d=l[2],p=l[3]):(d=l[0],p=l[1],u=l[2],_=l[3]),[u,_,d,p,l[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=0,u=0,_=0,d=0;o0?s[i-1]:-1,l=0,u=0,_=0,d=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=S?(x>=p.length/2||x>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,x))),t[o-1][1]=p.substring(0,p.length-x),t[o+1][1]=m.substring(x),o++):(S>=p.length/2||S>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,S))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-S),t[o+1][0]=-1,t[o+1][1]=p.substring(S),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(S,v){if(!S||!v)return 6;var b=S.charAt(S.length-1),w=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=w.match(n.nonAlphaNumericRegex_),E=y&&b.match(n.whitespaceRegex_),N=C&&w.match(n.whitespaceRegex_),T=E&&b.match(n.linebreakRegex_),z=N&&w.match(n.linebreakRegex_),M=T&&S.match(n.blanklineEndRegex_),O=z&&v.match(n.blanklineStartRegex_);return M||O?5:T||z?4:y&&!E&&N?3:E||N?2:y||C?1:0}for(var s=1;s=m&&(m=x,_=i,d=a,p=o)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=d,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=!1,u=!1,_=!1,d=!1;o0?s[i-1]:-1,_=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",l="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(l,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=l.substring(0,r):(t.splice(0,0,new n.Diff(0,l.substring(0,r))),s++),l=l.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(l,o))!==0&&(t[s][1]=l.substring(l.length-r)+t[s][1],l=l.substring(0,l.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),l.length&&(t.splice(s,0,new n.Diff(1,l)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",l=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,l=a;return t.length!=s&&t[s][0]===-1?l:l+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,l=0;l");switch(u){case 1:r[l]=''+_+"";break;case-1:r[l]=''+_+"";break;case 0:r[l]=""+_+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(N,T){var z=N/r.length,M=Math.abs(s-T);return a.Match_Distance?z+M/a.Match_Distance:M?1:z}var l=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(l=Math.min(o(0,u),l),(u=t.lastIndexOf(r,s+r.length))!=-1&&(l=Math.min(o(0,u),l)));var _,d,p=1<=v;y--){var C=i[t.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(m[y+1]|m[y])<<1|1|m[y+1],w[y]&p){var E=o(S,y-1);if(E<=l){if(l=E,!((u=y-1)>s))break;v=Math.max(1,2*s-u)}}}if(o(S+1,s)>l)break;m=w}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],l=new n.patch_obj,u=0,_=0,d=0,p=i,m=i,x=0;x=2*this.Patch_Margin&&u&&(this.patch_addContext_(l,p),o.push(l),l=new n.patch_obj,u=0,p=m,_=d)}S!==1&&(_+=v.length),S!==-1&&(d+=v.length)}return u&&(this.patch_addContext_(l,p),o.push(l)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(l=this.match_main(r,d.substring(0,this.Match_MaxBits),_))!=-1&&((p=this.match_main(r,d.substring(d.length-this.Match_MaxBits),_+d.length-this.Match_MaxBits))==-1||l>=p)&&(l=-1):l=this.match_main(r,d,_),l==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=l-_,d==(u=p==-1?r.substring(l,l+d.length):r.substring(l,p+this.Match_MaxBits)))r=r.substring(0,l)+this.diff_text2(t[o].diffs)+r.substring(l+d.length);else{var m=this.diff_main(d,u,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(m)/d.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var x,S=0,v=0;vo[0][1].length){var l=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=l,a.start2-=l,a.length1+=l,a.length2+=l}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(l=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,l),a.length1+=l,a.length2+=l),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,_=!1,u.diffs.push(new n.Diff(d,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,d===0?(u.length2+=p.length,o+=p.length):_=!1,u.diffs.push(new n.Diff(d,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(u.diffs)).substring(l.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),_||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;ss||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(j=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=l+T,O=(j=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(j=i-j))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=S.length?[w,y,C,E,j]:null}var l,u,_,d,p,m=o(s,i,Math.ceil(s.length/4)),x=o(s,i,Math.ceil(s.length/2));return m||x?(l=x?m&&m[4].length>x[4].length?m:x:m,t.length>r.length?(u=l[0],_=l[1],d=l[2],p=l[3]):(d=l[0],p=l[1],u=l[2],_=l[3]),[u,_,d,p,l[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=0,u=0,_=0,d=0;o0?s[i-1]:-1,l=0,u=0,_=0,d=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=S?(x>=p.length/2||x>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,x))),t[o-1][1]=p.substring(0,p.length-x),t[o+1][1]=m.substring(x),o++):(S>=p.length/2||S>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,S))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-S),t[o+1][0]=-1,t[o+1][1]=p.substring(S),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(S,v){if(!S||!v)return 6;var b=S.charAt(S.length-1),w=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=w.match(n.nonAlphaNumericRegex_),E=y&&b.match(n.whitespaceRegex_),N=C&&w.match(n.whitespaceRegex_),T=E&&b.match(n.linebreakRegex_),j=N&&w.match(n.linebreakRegex_),M=T&&S.match(n.blanklineEndRegex_),O=j&&v.match(n.blanklineStartRegex_);return M||O?5:T||j?4:y&&!E&&N?3:E||N?2:y||C?1:0}for(var s=1;s=m&&(m=x,_=i,d=a,p=o)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=d,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=!1,u=!1,_=!1,d=!1;o0?s[i-1]:-1,_=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",l="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(l,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=l.substring(0,r):(t.splice(0,0,new n.Diff(0,l.substring(0,r))),s++),l=l.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(l,o))!==0&&(t[s][1]=l.substring(l.length-r)+t[s][1],l=l.substring(0,l.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),l.length&&(t.splice(s,0,new n.Diff(1,l)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",l=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,l=a;return t.length!=s&&t[s][0]===-1?l:l+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,l=0;l");switch(u){case 1:r[l]=''+_+"";break;case-1:r[l]=''+_+"";break;case 0:r[l]=""+_+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(N,T){var j=N/r.length,M=Math.abs(s-T);return a.Match_Distance?j+M/a.Match_Distance:M?1:j}var l=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(l=Math.min(o(0,u),l),(u=t.lastIndexOf(r,s+r.length))!=-1&&(l=Math.min(o(0,u),l)));var _,d,p=1<=v;y--){var C=i[t.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(m[y+1]|m[y])<<1|1|m[y+1],w[y]&p){var E=o(S,y-1);if(E<=l){if(l=E,!((u=y-1)>s))break;v=Math.max(1,2*s-u)}}}if(o(S+1,s)>l)break;m=w}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],l=new n.patch_obj,u=0,_=0,d=0,p=i,m=i,x=0;x=2*this.Patch_Margin&&u&&(this.patch_addContext_(l,p),o.push(l),l=new n.patch_obj,u=0,p=m,_=d)}S!==1&&(_+=v.length),S!==-1&&(d+=v.length)}return u&&(this.patch_addContext_(l,p),o.push(l)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(l=this.match_main(r,d.substring(0,this.Match_MaxBits),_))!=-1&&((p=this.match_main(r,d.substring(d.length-this.Match_MaxBits),_+d.length-this.Match_MaxBits))==-1||l>=p)&&(l=-1):l=this.match_main(r,d,_),l==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=l-_,d==(u=p==-1?r.substring(l,l+d.length):r.substring(l,p+this.Match_MaxBits)))r=r.substring(0,l)+this.diff_text2(t[o].diffs)+r.substring(l+d.length);else{var m=this.diff_main(d,u,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(m)/d.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var x,S=0,v=0;vo[0][1].length){var l=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=l,a.start2-=l,a.length1+=l,a.length2+=l}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(l=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,l),a.length1+=l,a.length2+=l),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,_=!1,u.diffs.push(new n.Diff(d,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,d===0?(u.length2+=p.length,o+=p.length):_=!1,u.diffs.push(new n.Diff(d,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(u.diffs)).substring(l.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),_||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?Ibt:Bbt,r=J6(e.map((function(o){return o.changes})),QI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return Rbt(Yz(i),Yz(a))}var Pbt=["enhancers"],ej=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(gbt(e,_u(t,Pbt)),2),a=i[0],o=i[1],l=[Vz(a),Vz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Kz),p.map(Kz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Uo.displayName="clike";Uo.aliases=[];function Uo(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}rm.displayName="c";rm.aliases=[];function rm(e){e.register(Uo),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}zb.displayName="cpp";zb.aliases=[];function zb(e){e.register(rm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}tS.displayName="arduino";tS.aliases=["ino"];function tS(e){e.register(zb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}nS.displayName="bash";nS.aliases=["sh","shell"];function nS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(q,G){return"(?:"+F[+G]+")"})}function r(L,F,q){return RegExp(t(L,F),"")}function s(L,F){for(var q=0;q>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,z=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[z]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var H=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),V=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,H]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,H]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,H]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[V]),lookbehind:!0,greedy:!0,inside:I(V,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}sm.displayName="markup";sm.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function sm(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}sS.displayName="diff";sS.aliases=[];function sS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`:"")+_.content]}),["",""]),t=kn(n,2),r=kn(eB(t[0],t[1]),2),s=r[0],i=r[1];if(s.length===0&&i.length===0)return[[],[]];var a=function(u){if(u&&!Hl(u))return u.lineNumber},o=a(e.find(Ki)),l=a(e.find(ku));if(o===void 0||l===void 0)throw new Error("Could not find start line number for edit");return[tj(ej(s),o),tj(ej(i),l)]}function uyt(e){var n=e.reduce((function(r,s){var i=kn(r,3),a=i[0],o=i[1],l=i[2];if(!l||!Ki(l)||!ku(s))return[a,o,s];var u=kn(eB(l.content,s.content),2),_=u[0],d=u[1];return[a.concat(f3(_,l.lineNumber)),o.concat(f3(d,s.lineNumber)),s]}),[[],[],null]),t=kn(n,2);return[t[0],t[1]]}function dyt(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}jb.displayName="cpp";jb.aliases=[];function jb(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(jb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,U){return"(?:"+P[+U]+")"})}function r(L,P,W){return RegExp(t(L,P),"")}function s(L,P){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var q=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,q]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),ee=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,q]);function I(L,P){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[P,q]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[ee]),lookbehind:!0,greedy:!0,inside:I(ee,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}iS.displayName="go";iS.aliases=[];function iS(e){e.register(Uo),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}aS.displayName="ini";aS.aliases=[];function aS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}oS.displayName="java";oS.aliases=[];function oS(e){e.register(Uo),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}lS.displayName="regex";lS.aliases=[];function lS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}cS.displayName="json";cS.aliases=["webmanifest"];function cS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}uS.displayName="kotlin";uS.aliases=["kt","kts"];function uS(e){e.register(Uo),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}dS.displayName="less";dS.aliases=[];function dS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}fS.displayName="lua";fS.aliases=[];function fS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}hS.displayName="makefile";hS.aliases=[];function hS(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}_S.displayName="yaml";_S.aliases=["yml"];function _S(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}pS.displayName="markdown";pS.aliases=["md"];function pS(e){e.register(sm),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}gS.displayName="perl";gS.aliases=[];function gS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Tb.displayName="markup-templating";Tb.aliases=[];function Tb(e){e.register(sm),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}vS.displayName="php";vS.aliases=[];function vS(e){e.register(Tb),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}bS.displayName="python";bS.aliases=["py"];function bS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}yS.displayName="r";yS.aliases=[];function yS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}xS.displayName="ruby";xS.aliases=["rb"];function xS(e){e.register(Uo),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}wS.displayName="rust";wS.aliases=[];function wS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}SS.displayName="sass";SS.aliases=[];function SS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}kS.displayName="scss";kS.aliases=[];function kS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}CS.displayName="sql";CS.aliases=[];function CS(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}ES.displayName="swift";ES.aliases=[];function ES(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}NS.displayName="typescript";NS.aliases=["ts"];function NS(e){e.register(jb),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Ab.displayName="basic";Ab.aliases=[];function Ab(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}zS.displayName="vbnet";zS.aliases=[];function zS(e){e.register(Ab),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class im{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}im.prototype.normal={};im.prototype.property={};im.prototype.space=void 0;function XI(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new im(t,r,n)}function hp(e){return e.toLowerCase()}class Ei{constructor(n,t){this.attribute=t,this.property=n}}Ei.prototype.attribute="";Ei.prototype.booleanish=!1;Ei.prototype.boolean=!1;Ei.prototype.commaOrSpaceSeparated=!1;Ei.prototype.commaSeparated=!1;Ei.prototype.defined=!1;Ei.prototype.mustUseProperty=!1;Ei.prototype.number=!1;Ei.prototype.overloadedBoolean=!1;Ei.prototype.property="";Ei.prototype.spaceSeparated=!1;Ei.prototype.space=void 0;let Fbt=0;const Kt=ef(),es=ef(),d3=ef(),Qe=ef(),rr=ef(),Ed=ef(),$i=ef();function ef(){return 2**++Fbt}const f3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:es,commaOrSpaceSeparated:$i,commaSeparated:Ed,number:Qe,overloadedBoolean:d3,spaceSeparated:rr},Symbol.toStringTag,{value:"Module"})),Px=Object.keys(f3);class jS extends Ei{constructor(n,t,r,s){let i=-1;if(super(n,t),tj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&Wbt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(nj,Kbt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!nj.test(i)){let a=i.replace(Gbt,Vbt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=jS}return new s(r,n)}function Vbt(e){return"-"+e.toLowerCase()}function Kbt(e){return e.charAt(1).toUpperCase()}const iB=XI([ZI,Hbt,tB,nB,rB],"html"),Rb=XI([ZI,qbt,tB,nB,rB],"svg");function rj(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function Qbt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const sj=/[#.]/g;function Ybt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function iyt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function lj(e){return ayt(e)||lB(e)}const cj=document.createElement("i");function _p(e){const n="&"+e+";";cj.innerHTML=n;const t=cj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const oyt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function lyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const U=e.charCodeAt(C);U===88||U===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",z="";const M=E==="named"?lj:E==="decimal"?lB:iyt;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!M(U))break;z+=String.fromCharCode(U),E==="named"&&syt.includes(z)&&(N=z,T=_p(z))}let O=e.charCodeAt(C)===59;if(O){C++;const U=E==="named"?_p(z):!1;U&&(N=z,T=U)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!z)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==z&&(C=y+N.length,B=1+C-y,O=!1),!O){const U=N?1:3;if(t.attribute){const H=e.charCodeAt(C);H===61?(S(U,B),T=""):lj(H)?T="":S(U,B)}else S(U,B)}$=T}else{O||S(2,B);let U=Number.parseInt(z,E==="hexadecimal"?16:10);if(cyt(U))S(7,B),$="�";else if(U in oj)S(6,B),$=oj[U];else{let H="";uyt(U)&&S(6,B),U>65535&&(U-=65536,H+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),$=H+String.fromCharCode(U)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const U=x();U.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:U},e.slice(w-1,C)),p=U}else z=e.slice(w-1,C),o+=z,d+=z.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,oyt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function cyt(e){return e>=55296&&e<=57343||e>1114111}function uyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var dyt=0,Ug={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++dyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Ug,plaintext:Ug,text:Ug,txt:Ug,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new fyt;return T1(s,s.head,e),cB(e,s,n,s.head,0),_yt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function uj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function cB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=uj(S,b,e,d),!C||C.index>=e.length)break;var z=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;z>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var U=v.prev;O&&(U=T1(n,U,O),b+=O.length),hyt(n,U,y);var H=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=T1(n,U,H),B&&T1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};cB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function fyt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function T1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function hyt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),kyt=2e3,Cyt={highlight(e,n){return jt.highlight(e,n).children}};function Eyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Mb(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Nyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function g3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function zyt(e){const n=[$bt(e.hunks,{type:"line"})],t=TS(Nyt(e));return t&&jt.registered(t)?ej(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Cyt}):ej(e.hunks,{enhancers:n,highlight:!1})}function fB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:r3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:r3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const jyt=({change:e,side:n})=>n==="old"?null:Eyt(e);function hB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:awe()}),f.jsx("p",{children:Iwe({limit:Ne(Ml(n)),read:Ne(Ml(e))})})]})}function _B({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Mb(e),[e]),a=t&&s+i<=kyt,o=R.useMemo(()=>{if(a)try{return zyt(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(qo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:g3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:wwe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(obt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:jyt,tokens:o,viewType:"unified"})}))]})}function Tyt({files:e,className:n}){return f.jsx("div",{className:n?`${m3} ${n}`:m3,children:e.map((t,r)=>f.jsx(_B,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function Ayt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function pB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>fB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Mb(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?vwe():Mwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:_we()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?jwe():uwe({count:Wt(s.length)}):s.length===1?OD():LD({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?Qxe():Fwe()})]}),u?f.jsx(Tyt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":nwe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:Ayt(m.file)}),f.jsx("code",{title:g3(m.file),children:g3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${m3} diff-explorer-preview min-w-0`,children:d&&f.jsx(_B,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function Ryt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=Rgt(n,t,l),S=ct({...GL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():T4(),w=[{id:"files",label:k4(),Icon:Dd,onClick:d},{id:"artifacts",label:pD(),Icon:M6,onClick:p},{id:"experiments",label:mD(),Icon:db,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":Cx(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Cx()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:z})=>f.jsx(sr,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:z,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(sr,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(HO,{size:15,className:"shrink-0"}),vct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:wct()}),f.jsx(sr,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),k4()]})}),l&&f.jsx(Myt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(sb,{tone:"success",live:!0})}),f.jsx("span",{children:_ct()})]}),x.map(E=>f.jsx(sr,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${U6(Gi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":Cx(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:z})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:z,children:f.jsx(T,{size:15})},E))})})}function Myt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({...fv(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=fB(a.diff.diff,!1);return _.failed?null:_.files.map(Mb).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(sr,{className:"min-h-7 py-1",onClick:t,title:a.branch??o6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(Jp,{size:15,className:"shrink-0"}),f.jsx("span",{children:CD()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?OD():LD({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function Dyt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function dj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Lyt=(e,n)=>Math.abs(e-n)<1.01,Oyt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const Fx=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},fj=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},Iyt=e=>e,mB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(fj(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(fj(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},pv={passive:!0},$yt=typeof window>"u"?!0:"onscrollend"in window,Pyt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&$yt;let a=0;const o=i?null:Oyt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,pv),i&&r.addEventListener("scrollend",_,pv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},Fyt=(e,n)=>Pyt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),Hyt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},qyt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},Uyt=qyt;class Gyt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Iyt,rangeExtractor:mB,onChange:()=>{},measureElement:Hyt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=qf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!Fx()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,pv),i.addEventListener("touchend",o,pv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(Fx()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=qf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let U=1;Uthis.options.debug}),this.calculateRange=qf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=Vyt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=qf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=gB(0,r.length-1,i?o=>s[o*2]:o=>dj(r[o]).start,t);return dj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(Fx()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&Lyt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const gB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function Wyt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function Vyt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=Wyt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const Hx=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Kyt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?no.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new Gyt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),Hx(()=>u._didMount(),[]),Hx(()=>(a(u),u._willUpdate())),Hx(()=>{o(u)}),u}function Qyt(e){return Kyt({observeElementRect:Byt,observeElementOffset:Fyt,scrollToFn:Uyt,...e})}function Yyt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Xyt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function Zyt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Xyt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Gh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function am(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function vB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||am(r)||!Gh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function bB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=vB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Jyt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||am(r)))return r.type==="text"&&!!r.text}return!1}function e2t(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function t2t(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Gh(r))||!e.slice(0,t).some(r=>Gh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function yB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function v3(e){var t,r,s;if(yB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const xo=e=>new Intl.NumberFormat(j()).format(e);function n2t(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?AIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?SIe({attempt:xo(e.attempt),maximum:xo(e.maximum),seconds:xo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?bIe({attempt:xo(e.attempt),maximum:xo(e.maximum)}):typeof e.attempt=="number"&&t!=null?NIe({attempt:xo(e.attempt),seconds:xo(t)}):typeof e.attempt=="number"?pIe({attempt:xo(e.attempt)}):t!=null?LIe({seconds:xo(t)}):tL()}function r2t(e,n){if(typeof e!="number")return $Ie();const t=Math.max(0,Math.ceil((e-n)/1e3));return qIe({seconds:xo(t)})}function xB(e){return e==="retry"||e==="continue"?e:null}function s2t(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function i2t(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function hj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function a2t(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function AS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ab.displayName="markup-templating";Ab.aliases=[];function Ab(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Ab),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Tb),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Rb.displayName="basic";Rb.aliases=[];function Rb(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Rb),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),h3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const _3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:h3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),F2=Object.keys(_3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Mb=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const H=e.charCodeAt(C);H===88||H===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const H=e.charCodeAt(C);if(!M(H))break;j+=String.fromCharCode(H),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const H=E==="named"?pp(j):!1;H&&(N=j,T=H)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const H=N?1:3;if(t.attribute){const q=e.charCodeAt(C);q===61?(S(H,B),T=""):uj(q)?T="":S(H,B)}else S(H,B)}$=T}else{O||S(2,B);let H=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(H))S(7,B),$="�";else if(H in cj)S(6,B),$=cj[H];else{let q="";Oyt(H)&&S(6,B),H>65535&&(H-=65536,q+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),$=q+String.fromCharCode(H)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const H=x();H.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:H},e.slice(w-1,C)),p=H}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return A1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var H=v.prev;O&&(H=A1(n,H,O),b+=O.length),$yt(n,H,y);var q=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=A1(n,H,q),B&&A1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function A1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Db(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function b3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:i3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:i3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Db(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:b3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${v3} ${n}`:v3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Db(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:b3(m.file),children:b3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${v3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():A4(),w=[{id:"files",label:C4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:fb,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":E2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:E2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),C4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ib,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":E2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({...hv(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Db).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??c6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const H2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},mv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,mv),i&&r.addEventListener("scrollend",_,mv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!H2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,mv),i.addEventListener("touchend",o,mv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let H=1;Hthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const q2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),q2(()=>u._didMount(),[]),q2(()=>(a(u),u._willUpdate())),q2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function y3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function o2t(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=AS(e);if(t.length===1)return t[0]}return e}function l2t(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function Wh(e){return l2t(typeof e=="string"?AS(e):e)}function c2t(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function u2t(e,n){const t=Wh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function d2t(e){var l;const n=Wh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u +`&&(t+=l,r=!0);continue}if(s){o===s?s=null:t+=o,r=!0;continue}if(o==='"'||o==="'"){s=o,r=!0;continue}if(o==="|"||o===";"||o===">"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Mxt(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=RS(e);if(t.length===1)return t[0]}return e}function Dxt(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function Vh(e){return Dxt(typeof e=="string"?RS(e):e)}function Lxt(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function Oxt(e,n){const t=Vh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function Ixt(e){var l;const n=Vh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u -`,h2t='',_2t=` +`,$xt='',Pxt=` -`,wB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},p2t={alphaxiv:f2t,openalex:_2t,biorxiv:h2t};function SB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":wB[e]},dangerouslySetInnerHTML:{__html:p2t[e]}})}function m2t(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function g2t(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=m2t(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const v2t=["alphaxiv","openalex","biorxiv"];function b2t(){const e=Pft(),{data:n}=ct(e),t=gn({mutationFn:Gdt,onSuccess:i=>Gr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:v2t.map(i=>{const a=n[i];return f.jsxs(sr,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(SB,{source:i,size:16,decorative:!0}),wB[i]]}),f.jsx(x_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:S3e()})}function qx(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function y2t(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function x2t(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` -`}]}function w2t(e,n){const t=n.value?n.value+` -`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function S2t(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function k2t(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),C2t=Cu(/[#-'*+\--9=?A-Z^-~]/);function mv(e){return e!==null&&(e<32||e===127)}const b3=Cu(/\d/),E2t=Cu(/[\dA-Fa-f]/),N2t=Cu(/[!-/:-@[-`{-~]/);function wt(e){return e!==null&&e<-2}function ir(e){return e!==null&&(e<0||e===32)}function vn(e){return e===-2||e===-1||e===32}const Db=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function z2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function j2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function T2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function kB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function A2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return kB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function R2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function M2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function D2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return kB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function L2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function O2t(e,n,t){const r=e.all(n),s=t?I2t(t):CB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++oVr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:Uxt.map(i=>{const a=n[i];return f.jsxs(or,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(NB,{source:i,size:16,decorative:!0}),EB[i]]}),f.jsx(W_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:N3e()})}function U2(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Wxt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Vxt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` +`}]}function Kxt(e,n){const t=n.value?n.value+` +`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Qxt(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Yxt(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),Xxt=Cu(/[#-'*+\--9=?A-Z^-~]/);function gv(e){return e!==null&&(e<32||e===127)}const x3=Cu(/\d/),Zxt=Cu(/[\dA-Fa-f]/),Jxt=Cu(/[!-/:-@[-`{-~]/);function St(e){return e!==null&&e<-2}function lr(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const Lb=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function e2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function t2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function n2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function zB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function r2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function s2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function i2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function a2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function o2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function l2t(e,n,t){const r=e.all(n),s=t?c2t(t):jB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function B2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function H2t(e){const n=RS(e),t=EB(e);if(n&&t)return{start:n,end:t}}function q2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=RS(n.children[1]),l=EB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function U2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(mj(n.slice(s),s>0,!1)),i.join("")}function mj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===_j||i===pj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===_j||i===pj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function V2t(e,n){const t={type:"text",value:W2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function K2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Q2t={blockquote:y2t,break:x2t,code:w2t,delete:S2t,emphasis:k2t,footnoteReference:z2t,heading:j2t,html:T2t,imageReference:A2t,image:R2t,inlineCode:M2t,linkReference:D2t,link:L2t,listItem:O2t,list:B2t,paragraph:$2t,root:P2t,strong:F2t,table:q2t,tableCell:G2t,tableRow:U2t,text:V2t,thematicBreak:K2t,toml:Gg,yaml:Gg,definition:Gg,footnoteDefinition:Gg};function Gg(){}const zB=-1,Lb=0,P0=1,gv=2,MS=3,DS=4,LS=5,OS=6,jB=7,TB=8,Y2t=typeof self=="object"?self:globalThis,gj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Y2t[e](n)},X2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Lb:case zB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case gv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case MS:return t(new Date(a),s);case DS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case LS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case OS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case jB:{const{name:o,message:l}=a;return t(gj(o,l),s)}case TB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(gj(i,a),s)};return r},vj=e=>X2t(new Map,e)(0),nd="",{toString:Z2t}={},{keys:J2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Lb,n];const t=Z2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[gv,nd];case"Date":return[MS,nd];case"RegExp":return[DS,nd];case"Map":return[LS,nd];case"Set":return[OS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[jB,t]:[gv,t]},Wg=([e,n])=>e===Lb&&(n==="function"||n==="symbol"),ext=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Lb:{let _=a;switch(l){case"bigint":o=TB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([zB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case gv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of J2t(a))(e||!Wg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case MS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case DS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case LS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Wg(h0(p))||Wg(h0(m))))&&_.push([i(p),i(m)]);return d}case OS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Wg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},bj=(e,{json:n,lossy:t}={})=>{const r=[];return ext(!(n||t),!!n,new Map,r)(e),r},vv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?vj(bj(e,n)):structuredClone(e):(e,n)=>vj(bj(e,n));function txt(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function nxt(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function rxt(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||txt,r=e.options.footnoteBackLabel||nxt,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...vv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(n,u),e.applyData(n,u)}function c2t(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r1}function u2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _2t(e){const n=MS(e),t=TB(e);if(n&&t)return{start:n,end:t}}function p2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=MS(n.children[1]),l=TB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function m2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(vj(n.slice(s),s>0,!1)),i.join("")}function vj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===mj||i===gj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===mj||i===gj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function b2t(e,n){const t={type:"text",value:v2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function y2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const x2t={blockquote:Wxt,break:Vxt,code:Kxt,delete:Qxt,emphasis:Yxt,footnoteReference:e2t,heading:t2t,html:n2t,imageReference:r2t,image:s2t,inlineCode:i2t,linkReference:a2t,link:o2t,listItem:l2t,list:u2t,paragraph:d2t,root:f2t,strong:h2t,table:p2t,tableCell:g2t,tableRow:m2t,text:b2t,thematicBreak:y2t,toml:Wg,yaml:Wg,definition:Wg,footnoteDefinition:Wg};function Wg(){}const RB=-1,Ob=0,P0=1,vv=2,DS=3,LS=4,OS=5,IS=6,MB=7,DB=8,w2t=typeof self=="object"?self:globalThis,bj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new w2t[e](n)},S2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Ob:case RB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case vv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case DS:return t(new Date(a),s);case LS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case OS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case IS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case MB:{const{name:o,message:l}=a;return t(bj(o,l),s)}case DB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(bj(i,a),s)};return r},yj=e=>S2t(new Map,e)(0),nd="",{toString:k2t}={},{keys:C2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Ob,n];const t=k2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[vv,nd];case"Date":return[DS,nd];case"RegExp":return[LS,nd];case"Map":return[OS,nd];case"Set":return[IS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[MB,t]:[vv,t]},Vg=([e,n])=>e===Ob&&(n==="function"||n==="symbol"),E2t=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Ob:{let _=a;switch(l){case"bigint":o=DB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([RB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case vv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of C2t(a))(e||!Vg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case DS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case LS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case OS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Vg(h0(p))||Vg(h0(m))))&&_.push([i(p),i(m)]);return d}case IS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Vg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xj=(e,{json:n,lossy:t}={})=>{const r=[];return E2t(!(n||t),!!n,new Map,r)(e),r},bv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?yj(xj(e,n)):structuredClone(e):(e,n)=>yj(xj(e,n));function N2t(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function z2t(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function j2t(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||N2t,r=e.options.footnoteBackLabel||z2t,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const om=(function(e){if(e==null)return oxt;if(typeof e=="function")return Ob(e);if(typeof e=="object")return Array.isArray(e)?sxt(e):ixt(e);if(typeof e=="string")return axt(e);throw new Error("Expected function, string, or object as test")});function sxt(e){const n=[];let t=-1;for(;++t":""))+")"})}return p;function p(){let m=AB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=uxt(t(l,_)),m[0]===y3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==RB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S":""))+")"})}return p;function p(){let m=LB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=O2t(t(l,_)),m[0]===w3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==OB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S0&&t.push({type:"text",value:` -`}),t}function yj(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function xj(e,n){const t=fxt(e,n),r=t.one(e,void 0),s=rxt(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function bv(e,n){return e&&"run"in e?async function(t,r){const s=xj(t,{file:r,...n});await e.run(s,r)}:function(t,r){return xj(t,{file:r,...e||n})}}function wj(e){if(e)throw e}var Ux,Sj;function gxt(){if(Sj)return Ux;Sj=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},i=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var _=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!_&&!d)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return Ux=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?kj(e.position):"start"in e||"end"in e?kj(e):"line"in e||"column"in e?S3(e):""}function S3(e){return Cj(e&&e.line)+":"+Cj(e&&e.column)}function kj(e){return S3(e&&e.start)+"-"+S3(e&&e.end)}function Cj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const wo={basename:xxt,dirname:wxt,extname:Sxt,join:kxt,sep:"/"};function xxt(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');lm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function wxt(e){if(lm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Sxt(e){lm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function kxt(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Ext(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function lm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Nxt={cwd:zxt};function zxt(){return"/"}function k3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jxt(e){if(typeof e=="string")e=new URL(e);else if(!k3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Txt(e)}function Txt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];w3(S)&&w3(m)&&(m=Gx(!0,S,m)),r[p]=[u,m,...x]}}}}const PS=new $S().freeze();function Qx(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Yx(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xx(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Nj(e){if(!w3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Vg(e){return Dxt(e)?e:new MB(e)}function Dxt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Lxt(e){return typeof e=="string"||Oxt(e)}function Oxt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var jj=Object.prototype.hasOwnProperty;function Tj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Tj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Tj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(jj.call(e,t)&&++r&&!jj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const Ixt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bxt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$xt={};function Aj(e,n){return($xt.jsx?Bxt:Ixt).test(e)}const Pxt=/[ \t\n\f\r]/g;function Fxt(e){return typeof e=="object"?e.type==="text"?Rj(e.value):!1:Rj(e)}function Rj(e){return e.replace(Pxt,"")===""}var Uf={},Zx,Mj;function Hxt(){if(Mj)return Zx;Mj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` -`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(H){var Y=H.match(n);Y&&(w+=Y.length);var V=H.lastIndexOf(l);y=~V?H.length-V:y+H.length}function E(){var H={line:w,column:y};return function(Y){return Y.position=new N(H),M(),Y}}function N(H){this.start=H,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(H){var Y=new Error(b.source+":"+w+":"+y+": "+H);if(Y.reason=H,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function z(H){var Y=H.exec(v);if(Y){var V=Y[0];return C(V),v=v.slice(V.length),Y}}function M(){z(t)}function O(H){var Y;for(H=H||[];Y=B();)Y!==!1&&H.push(Y);return H}function B(){var H=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var V=v.slice(2,Y-2);return y+=2,C(V),v=v.slice(Y),y+=2,H({type:p,comment:V})}}function $(){var H=E(),Y=z(r);if(Y){if(B(),!z(s))return T("property missing ':'");var V=z(i),X=H({type:m,property:S(Y[0].replace(e,d)),value:V?S(V[0].replace(e,d)):d});return z(a),X}}function U(){var H=[];O(H);for(var Y;Y=$();)Y!==!1&&(H.push(Y),O(H));return H}return M(),U()}function S(v){return v?v.replace(o,d):d}return Zx=x,Zx}var Dj;function qxt(){if(Dj)return Uf;Dj=1;var e=Uf&&Uf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.default=t;const n=e(Hxt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Uf}var _0={},Lj;function Uxt(){if(Lj)return _0;Lj=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Oj;function Gxt(){if(Oj)return p0;Oj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(qxt()),t=Uxt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var Wxt=Gxt();const Vxt=Gp(Wxt),FS={}.hasOwnProperty,Kxt=new Map,Qxt=/[A-Z]/g,Yxt=new Set(["table","tbody","thead","tfoot","tr"]),Xxt=new Set(["td","th"]),DB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function LB(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=iwt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=swt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Rb:iB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=OB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function OB(e,n,t){if(n.type==="element")return Zxt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Jxt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return twt(e,n,t);if(n.type==="mdxjsEsm")return ewt(e,n);if(n.type==="root")return nwt(e,n,t);if(n.type==="text")return rwt(e,n)}function Zxt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Rb,e.schema=s),e.ancestors.push(n);const i=BB(e,n.tagName,!1),a=awt(e,n);let o=qS(e,n);return Yxt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!Fxt(l):!0})),IB(e,a,i,n),HS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Jxt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pp(e,n.position)}function ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);pp(e,n.position)}function twt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Rb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:BB(e,n.name,!0),a=owt(e,n),o=qS(e,n);return IB(e,a,i,n),HS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function nwt(e,n,t){const r={};return HS(r,qS(e,n)),e.create(n,e.Fragment,r,t)}function rwt(e,n){return n.value}function IB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function HS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function swt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function iwt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=RS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function awt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&FS.call(n.properties,s)){const i=lwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Xxt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function owt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else pp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else pp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function qS(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:Kxt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=$B(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&mwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&hwt.has(e.tagName)?a.filter(y=>typeof y!="string"||!_wt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=LB({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function mwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function dh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Ki(e,e.length,0,n),e):n}const Bj={}.hasOwnProperty;function FB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function _n(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return vn(l)?(e.enter(t),o(l)):n(l)}function o(l){return vn(l)&&i++a))return;const T=n.events.length;let z=T,M,O;for(;z--;)if(n.events[z][0]==="exit"&&n.events[z][1].type==="chunkFlow"){if(M){O=n.events[z][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Cwt(e,n,t){return _n(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Vh(e){if(e===null||ir(e)||Id(e))return 1;if(Db(e))return 2}function Ib(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Pj(d,-l),Pj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,Ib(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Ki(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&vn(N)?_n(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||wt(N)?e.check(Fj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||wt(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,z){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),vn(Y)?_n(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),U(Y)):z(Y)}function U(Y){return Y===o?(M++,N.consume(Y),U):M>=a?(N.exit("codeFencedFenceSequence"),vn(Y)?_n(N,H,"whitespace")(Y):H(Y)):z(Y)}function H(Y){return Y===null||wt(Y)?(N.exit("codeFencedFence"),T(Y)):z(Y)}}}function Iwt(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const Jx={name:"codeIndented",tokenize:$wt},Bwt={partial:!0,tokenize:Pwt};function $wt(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),_n(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):wt(u)?e.attempt(Bwt,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||wt(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function Pwt(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):wt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):_n(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):wt(a)?s(a):t(a)}}const Fwt={name:"codeText",previous:qwt,resolve:Hwt,tokenize:Uwt};function Hwt(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function VB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||mv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||wt(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||ir(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):wt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||wt(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!vn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function QB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):wt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),_n(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||wt(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return wt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):vn(s)?_n(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const Zwt={name:"definition",tokenize:e4t},Jwt={partial:!0,tokenize:t4t};function e4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return KB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return ir(m)?q0(e,u)(m):u(m)}function u(m){return VB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(Jwt,d,d)(m)}function d(m){return vn(m)?_n(e,p,"whitespace")(m):p(m)}function p(m){return m===null||wt(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function t4t(e,n,t){return r;function r(o){return ir(o)?q0(e,s)(o):t(o)}function s(o){return QB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return vn(o)?_n(e,a,"whitespace")(o):a(o)}function a(o){return o===null||wt(o)?n(o):t(o)}}const n4t={name:"hardBreakEscape",tokenize:r4t};function r4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return wt(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const s4t={name:"headingAtx",resolve:i4t,tokenize:a4t};function i4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Ki(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function a4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||ir(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||wt(_)?(e.exit("atxHeading"),n(_)):vn(_)?_n(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||ir(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const o4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qj=["pre","script","style","textarea"],l4t={concrete:!0,name:"htmlFlow",resolveTo:d4t,tokenize:f4t},c4t={partial:!0,tokenize:_4t},u4t={partial:!0,tokenize:h4t};function d4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function f4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(G){return _(G)}function _(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),d}function d(G){return G===33?(e.consume(G),p):G===47?(e.consume(G),i=!0,S):G===63?(e.consume(G),s=3,r.interrupt?n:L):ai(G)?(e.consume(G),a=String.fromCharCode(G),v):t(G)}function p(G){return G===45?(e.consume(G),s=2,m):G===91?(e.consume(G),s=5,o=0,x):ai(G)?(e.consume(G),s=4,r.interrupt?n:L):t(G)}function m(G){return G===45?(e.consume(G),r.interrupt?n:L):t(G)}function x(G){const ee="CDATA[";return G===ee.charCodeAt(o++)?(e.consume(G),o===ee.length?r.interrupt?n:$:x):t(G)}function S(G){return ai(G)?(e.consume(G),a=String.fromCharCode(G),v):t(G)}function v(G){if(G===null||G===47||G===62||ir(G)){const ee=G===47,ce=a.toLowerCase();return!ee&&!i&&qj.includes(ce)?(s=1,r.interrupt?n(G):$(G)):o4t.includes(a.toLowerCase())?(s=6,ee?(e.consume(G),b):r.interrupt?n(G):$(G)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(G):i?w(G):y(G))}return G===45||Vs(G)?(e.consume(G),a+=String.fromCharCode(G),v):t(G)}function b(G){return G===62?(e.consume(G),r.interrupt?n:$):t(G)}function w(G){return vn(G)?(e.consume(G),w):O(G)}function y(G){return G===47?(e.consume(G),O):G===58||G===95||ai(G)?(e.consume(G),C):vn(G)?(e.consume(G),y):O(G)}function C(G){return G===45||G===46||G===58||G===95||Vs(G)?(e.consume(G),C):E(G)}function E(G){return G===61?(e.consume(G),N):vn(G)?(e.consume(G),E):y(G)}function N(G){return G===null||G===60||G===61||G===62||G===96?t(G):G===34||G===39?(e.consume(G),l=G,T):vn(G)?(e.consume(G),N):z(G)}function T(G){return G===l?(e.consume(G),l=null,M):G===null||wt(G)?t(G):(e.consume(G),T)}function z(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||ir(G)?E(G):(e.consume(G),z)}function M(G){return G===47||G===62||vn(G)?y(G):t(G)}function O(G){return G===62?(e.consume(G),B):t(G)}function B(G){return G===null||wt(G)?$(G):vn(G)?(e.consume(G),B):t(G)}function $(G){return G===45&&s===2?(e.consume(G),V):G===60&&s===1?(e.consume(G),X):G===62&&s===4?(e.consume(G),F):G===63&&s===3?(e.consume(G),L):G===93&&s===5?(e.consume(G),I):wt(G)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(c4t,q,U)(G)):G===null||wt(G)?(e.exit("htmlFlowData"),U(G)):(e.consume(G),$)}function U(G){return e.check(u4t,H,q)(G)}function H(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),Y}function Y(G){return G===null||wt(G)?U(G):(e.enter("htmlFlowData"),$(G))}function V(G){return G===45?(e.consume(G),L):$(G)}function X(G){return G===47?(e.consume(G),a="",te):$(G)}function te(G){if(G===62){const ee=a.toLowerCase();return qj.includes(ee)?(e.consume(G),F):$(G)}return ai(G)&&a.length<8?(e.consume(G),a+=String.fromCharCode(G),te):$(G)}function I(G){return G===93?(e.consume(G),L):$(G)}function L(G){return G===62?(e.consume(G),F):G===45&&s===2?(e.consume(G),L):$(G)}function F(G){return G===null||wt(G)?(e.exit("htmlFlowData"),q(G)):(e.consume(G),F)}function q(G){return e.exit("htmlFlow"),n(G)}}function h4t(e,n,t){const r=this;return s;function s(a){return wt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function _4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(cm,n,t)}}const p4t={name:"htmlText",tokenize:m4t};function m4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),z):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):wt(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?V(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):wt(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?V(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?V(L):wt(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):wt(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?V(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return wt(L)?(a=T,X(L)):vn(L)?(e.consume(L),T):V(L)}function z(L){return L===45||Vs(L)?(e.consume(L),z):L===47||L===62||ir(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),V):L===58||L===95||ai(L)?(e.consume(L),O):wt(L)?(a=M,X(L)):vn(L)?(e.consume(L),M):V(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):wt(L)?(a=B,X(L)):vn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,U):wt(L)?(a=$,X(L)):vn(L)?(e.consume(L),$):(e.consume(L),H)}function U(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):wt(L)?(a=U,X(L)):(e.consume(L),U)}function H(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||ir(L)?M(L):(e.consume(L),H)}function Y(L){return L===47||L===62||ir(L)?M(L):t(L)}function V(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return vn(L)?_n(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const GS={name:"labelEnd",resolveAll:y4t,resolveTo:x4t,tokenize:w4t},g4t={tokenize:S4t},v4t={tokenize:k4t},b4t={tokenize:C4t};function y4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||wt(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),vn(u)?_n(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:L4t},exit:I4t,name:"list",tokenize:D4t},R4t={partial:!0,tokenize:B4t},M4t={partial:!0,tokenize:O4t};function D4t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:b3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(A1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return b3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(cm,r.interrupt?t:_,e.attempt(R4t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return vn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function L4t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(cm,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_n(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!vn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(M4t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,_n(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function O4t(e,n,t){const r=this;return _n(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function I4t(e){e.exit(this.containerState.type)}function B4t(e,n,t){const r=this;return _n(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!vn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Uj={name:"setextUnderline",resolveTo:$4t,tokenize:P4t};function $4t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function P4t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),vn(u)?_n(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||wt(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const F4t={tokenize:H4t};function H4t(e){const n=this,t=e.attempt(cm,r,e.attempt(this.parser.constructs.flowInitial,s,_n(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Vwt,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const q4t={resolveAll:XB()},U4t=YB("string"),G4t=YB("text");function YB(e){return{resolveAll:XB(e==="text"?W4t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function i3t(e,n){let t=-1;const r=[];let s;for(;++t"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return G2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ej(e.position):"start"in e||"end"in e?Ej(e):"line"in e||"column"in e?C3(e):""}function C3(e){return Nj(e&&e.line)+":"+Nj(e&&e.column)}function Ej(e){return C3(e&&e.start)+"-"+C3(e&&e.end)}function Nj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:V2t,dirname:K2t,extname:Q2t,join:Y2t,sep:"/"};function V2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function K2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Q2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Y2t(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Z2t(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J2t={cwd:ewt};function ewt(){return"/"}function E3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function twt(e){if(typeof e=="string")e=new URL(e);else if(!E3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nwt(e)}function nwt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];k3(S)&&k3(m)&&(m=W2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function Y2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function X2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Z2(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jj(e){if(!k3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return awt(e)?e:new IB(e)}function awt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function owt(e){return typeof e=="string"||lwt(e)}function lwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Aj=Object.prototype.hasOwnProperty;function Rj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Rj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Rj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Aj.call(e,t)&&++r&&!Aj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const cwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uwt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dwt={};function Mj(e,n){return(dwt.jsx?uwt:cwt).test(e)}const fwt=/[ \t\n\f\r]/g;function hwt(e){return typeof e=="object"?e.type==="text"?Dj(e.value):!1:Dj(e)}function Dj(e){return e.replace(fwt,"")===""}var Gf={},J2,Lj;function _wt(){if(Lj)return J2;Lj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` +`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(q){var Y=q.match(n);Y&&(w+=Y.length);var G=q.lastIndexOf(l);y=~G?q.length-G:y+q.length}function E(){var q={line:w,column:y};return function(Y){return Y.position=new N(q),M(),Y}}function N(q){this.start=q,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(q){var Y=new Error(b.source+":"+w+":"+y+": "+q);if(Y.reason=q,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(q){var Y=q.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(q){var Y;for(q=q||[];Y=B();)Y!==!1&&q.push(Y);return q}function B(){var q=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,q({type:p,comment:G})}}function $(){var q=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=q({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function H(){var q=[];O(q);for(var Y;Y=$();)Y!==!1&&(q.push(Y),O(q));return q}return M(),H()}function S(v){return v?v.replace(o,d):d}return J2=x,J2}var Oj;function pwt(){if(Oj)return Gf;Oj=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(_wt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Mb:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Lb(e))return 2}function Bb(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,Bb(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),H(Y)):j(Y)}function H(Y){return Y===o?(M++,N.consume(Y),H):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,q,"whitespace")(Y):q(Y)):j(Y)}function q(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const ew={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||gv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(U){return _(U)}function _(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),p):U===47?(e.consume(U),i=!0,S):U===63?(e.consume(U),s=3,r.interrupt?n:L):ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function p(U){return U===45?(e.consume(U),s=2,m):U===91?(e.consume(U),s=5,o=0,x):ai(U)?(e.consume(U),s=4,r.interrupt?n:L):t(U)}function m(U){return U===45?(e.consume(U),r.interrupt?n:L):t(U)}function x(U){const te="CDATA[";return U===te.charCodeAt(o++)?(e.consume(U),o===te.length?r.interrupt?n:$:x):t(U)}function S(U){return ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function v(U){if(U===null||U===47||U===62||lr(U)){const te=U===47,de=a.toLowerCase();return!te&&!i&&Gj.includes(de)?(s=1,r.interrupt?n(U):$(U)):M4t.includes(a.toLowerCase())?(s=6,te?(e.consume(U),b):r.interrupt?n(U):$(U)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(U):i?w(U):y(U))}return U===45||Vs(U)?(e.consume(U),a+=String.fromCharCode(U),v):t(U)}function b(U){return U===62?(e.consume(U),r.interrupt?n:$):t(U)}function w(U){return gn(U)?(e.consume(U),w):O(U)}function y(U){return U===47?(e.consume(U),O):U===58||U===95||ai(U)?(e.consume(U),C):gn(U)?(e.consume(U),y):O(U)}function C(U){return U===45||U===46||U===58||U===95||Vs(U)?(e.consume(U),C):E(U)}function E(U){return U===61?(e.consume(U),N):gn(U)?(e.consume(U),E):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(e.consume(U),l=U,T):gn(U)?(e.consume(U),N):j(U)}function T(U){return U===l?(e.consume(U),l=null,M):U===null||St(U)?t(U):(e.consume(U),T)}function j(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||lr(U)?E(U):(e.consume(U),j)}function M(U){return U===47||U===62||gn(U)?y(U):t(U)}function O(U){return U===62?(e.consume(U),B):t(U)}function B(U){return U===null||St(U)?$(U):gn(U)?(e.consume(U),B):t(U)}function $(U){return U===45&&s===2?(e.consume(U),G):U===60&&s===1?(e.consume(U),X):U===62&&s===4?(e.consume(U),P):U===63&&s===3?(e.consume(U),L):U===93&&s===5?(e.consume(U),I):St(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,H)(U)):U===null||St(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),$)}function H(U){return e.check(O4t,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),Y}function Y(U){return U===null||St(U)?H(U):(e.enter("htmlFlowData"),$(U))}function G(U){return U===45?(e.consume(U),L):$(U)}function X(U){return U===47?(e.consume(U),a="",ee):$(U)}function ee(U){if(U===62){const te=a.toLowerCase();return Gj.includes(te)?(e.consume(U),P):$(U)}return ai(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),ee):$(U)}function I(U){return U===93?(e.consume(U),L):$(U)}function L(U){return U===62?(e.consume(U),P):U===45&&s===2?(e.consume(U),L):$(U)}function P(U){return U===null||St(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),P)}function W(U){return e.exit("htmlFlow"),n(U)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const P="CDATA[";return L===P.charCodeAt(i++)?(e.consume(L),i===P.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,H):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),q)}function H(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=H,X(L)):(e.consume(L),H)}function q(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),q)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ee}function ee(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:x3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(R1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return x3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t0){const Vt=Ze.tokenStack[Ze.tokenStack.length-1];(Vt[1]||Wj).call(Ze,void 0,Vt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},xt=-1;++xt0&&(Fe(this,ru,de(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Vj(t)),de(this,ru)+N3t(t,r)}}ru=new WeakMap;const m3t=new Set(["*","**","_","__"]);function Vj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Kj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,ue(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Qj(t)),ue(this,ru)+J3t(t,r)}}ru=new WeakMap;const H3t=new Set(["*","**","_","__"]);function Qj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(E3t(n)){Kj(n,t,r);continue}const i=x3t(n,e,t);if(i>t){t=i-1;continue}const a=w3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Kj(n,t,r)}return n}function g3t(e,n,t){const r=n[t];return r==="`"?v3t(e,n,t):r==="$"?b3t(e,n,t):r==="~"?y3t(e,n,t):t}function v3t(e,n,t){const r=VS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&yv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&yv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function b3t(e,n,t){const r=VS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function y3t(e,n,t){const r=VS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(yv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!yv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function x3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!n$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` -`)return e.pendingHtml=null,s+1;return n.length}function w3t(e,n,t){const r=S3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(k3t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function S3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function k3t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Xj(s)||!Xj(r)}function Kj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function C3t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function E3t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function N3t(e,n){n.pendingHtml!==null&&(e=e.slice(0,T3t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return yo(z3t(e,t));const r=j3t(n);if(r)return yo(sh(e,r));const s=M3t(n);return s?s.kind==="delim"?yo(E3(e,s.start,s.token.length)?e$(e,s.token):e.slice(0,s.start)):E3(e,s.start,s.token.length)?s.kind==="fence"?yo(e):s.kind==="code"?yo(sh(e,s.token)):s.token==="$$"?yo(sh(e,(e.endsWith(` +`){X3t(n),n.exclusive||(n.commitIndex=t+1);continue}const s=q3t(n,e,t);if(s>t){t=s-1;continue}if(n.exclusive)continue;if(Z3t(n)){Yj(n,t,r);continue}const i=V3t(n,e,t);if(i>t){t=i-1;continue}const a=K3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Yj(n,t,r)}return n}function q3t(e,n,t){const r=n[t];return r==="`"?U3t(e,n,t):r==="$"?G3t(e,n,t):r==="~"?W3t(e,n,t):t}function U3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&xv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&xv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function G3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function W3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(xv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!xv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function V3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` +`)return e.pendingHtml=null,s+1;return n.length}function K3t(e,n,t){const r=Q3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Y3t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Q3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Y3t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Jj(s)||!Jj(r)}function Yj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function X3t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Z3t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function J3t(e,n){n.pendingHtml!==null&&(e=e.slice(0,n5t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return xo(e5t(e,t));const r=t5t(n);if(r)return xo(ih(e,r));const s=i5t(n);return s?s.kind==="delim"?xo(z3(e,s.start,s.token.length)?s$(e,s.token):e.slice(0,s.start)):z3(e,s.start,s.token.length)?s.kind==="fence"?xo(e):s.kind==="code"?xo(ih(e,s.token)):s.token==="$$"?xo(ih(e,(e.endsWith(` `)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?yo(e):yo(sh(e,"$")):yo(s.kind==="fence"?e:e.slice(0,s.start)):yo(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function z3t(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return E3(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function j3t(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!m3t.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function T3t(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!A3t(e,s,r))break;t=s,r=s}return t}function A3t(e,n,t){if(e[t-1]!==">"||eo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!n$(r))return!1;for(let s=n+1;s"||i===` -`)return!1}return!0}function yo(e){var v;const n=e.lastIndexOf(` +`)+"$$")):/\s/.test(e[e.length-1]??"")?xo(e):xo(ih(e,"$")):xo(s.kind==="fence"?e:e.slice(0,s.start)):xo(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function e5t(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return z3(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function t5t(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!H3t.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function n5t(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!r5t(e,s,r))break;t=s,r=s}return t}function r5t(e,n,t){if(e[t-1]!==">"||eo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!a$(r))return!1;for(let s=n+1;s"||i===` +`)return!1}return!0}function xo(e){var v;const n=e.lastIndexOf(` `),t=n===-1?0:n+2,r=e.slice(0,t),s=e.slice(t),i=s.indexOf(` -`),a=i===-1?s:s.slice(0,i),o=(v=a.match(/^( *)\|/))==null?void 0:v[1];if(o===void 0)return e;if(Qj(a)<2&&!D3t(a,o))return r;const l=a.trimEnd().endsWith("|")?a:e$(a," |"),u=Qj(l),_=u<2?0:l.trimEnd().endsWith("|")?u-1:u;if(_===0)return e;const d=i===-1?"":s.slice(i+1),p=Yj(o,Array.from({length:_},()=>"-"));if(d.length===0)return r+l+` +`),a=i===-1?s:s.slice(0,i),o=(v=a.match(/^( *)\|/))==null?void 0:v[1];if(o===void 0)return e;if(Xj(a)<2&&!a5t(a,o))return r;const l=a.trimEnd().endsWith("|")?a:s$(a," |"),u=Xj(l),_=u<2?0:l.trimEnd().endsWith("|")?u-1:u;if(_===0)return e;const d=i===-1?"":s.slice(i+1),p=Zj(o,Array.from({length:_},()=>"-"));if(d.length===0)return r+l+` `+p;const m=d.indexOf(` -`),x=m===-1?d:d.slice(0,m),S=m===-1?"":d.slice(m);if(L3t(x,o,_))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const b=t$(x,o).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let E=0;E1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+l+` -`+Yj(o,b)+S}return r+l+` +`),x=m===-1?d:d.slice(0,m),S=m===-1?"":d.slice(m);if(o5t(x,o,_))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const b=i$(x,o).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let E=0;E1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+l+` +`+Zj(o,b)+S}return r+l+` `+p+` -`+d}function sh(e,n){return e+n.slice(R3t(e,n))}function e$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return sh(e,n);const r=e.slice(0,-t.length);return sh(r,n)+t}function R3t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function M3t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Qj(e){let n=0;for(let t=0;t0}function Yj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function t$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function L3t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=t$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function VS(e,n){let t=n+1;for(;tn+t}function yv(e,n){return n===0||e[n-1]===` -`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Xj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function n$(e){return!!e&&/[A-Za-z]/.test(e)}const r$=PS().use(WS);var Pp,Mh,Dh,xd,Lh,Fp,Hp,qp,wd,Up,Sd;class O3t{constructor(){rt(this,Pp,r$);rt(this,Mh,null);rt(this,Dh,{});rt(this,xd,null);rt(this,Lh,"");rt(this,Fp,[]);rt(this,Hp,[]);rt(this,qp,[]);rt(this,wd,0);rt(this,Up,[]);rt(this,Sd,[])}reconfigure(n,t,r){de(this,Mh)!==null&&de(this,Pp)===n&&s$(de(this,Dh),r)&&!!de(this,xd)===t||(Fe(this,Pp,n),n.attachers.some(s=>s[0]===bv)||(n=n(),n.use(bv),n.freeze()),Fe(this,Mh,n),Fe(this,Dh,r),Fe(this,Lh,""),Fe(this,Fp,[]),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,wd,0),Fe(this,Up,[]),Fe(this,xd,t?new p3t:null))}update(n){de(this,xd)&&(n=de(this,xd).update(n));let t=de(this,Lh);if(n===t)return de(this,Sd);const r=de(this,Fp),s=I3t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(de(this,Mh)),l=de(this,Hp),u=l.slice(i).some(N=>N.some(N3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Lh,n),qx(r.length===l.length),r.splice(i,r.length-i,...d);{const N=tw(_,d,a);qx(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||N3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=tw(_,d,a);qx(N.length===d.length),l.splice(0,l.length,...N)}const p=tw(o.runSync(_),d,a),m=de(this,qp),x=de(this,Up),S=de(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(de(this,wd)),Fe(this,wd,de(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||U3t.test(e.slice(0,n))?e:""}const rw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function Y3t(e,n){return a$(e,{})||{type:"root",children:[]}}function a$(e,n){const t=X3t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function X3t(e,n){switch(e.nodeType){case 1:return t5t(e,n);case 3:return J3t(e);case 8:return e5t(e);case 9:return tT(e,n);case 10:return Z3t();case 11:return tT(e,n);default:return}}function tT(e,n){return{type:"root",children:o$(e,n)}}function Z3t(){return{type:"doctype"}}function J3t(e){return{type:"text",value:e.nodeValue||""}}function e5t(e){return{type:"comment",value:e.nodeValue||""}}function t5t(e,n){const t=e.namespaceURI,r=t===rw.svg?ryt:oB,s=t===rw.html?e.tagName.toLowerCase():e.tagName,i=t===rw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` -`.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function c$(e,n,t){return e.type==="element"?d5t(e,n,t):e.type==="text"?t.whitespace==="normal"?u$(e,t):f5t(e):[]}function d5t(e,n,t){const r=d$(e,t),s=e.children||[];let i=-1,a=[];if(c5t(e))return a;let o,l;for(z3(e)||aT(e)&&nT(n,e,aT)?l=` -`:l5t(e)?(o=2,l=2):l$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(g5t,"-$1").toLowerCase(),b5t={"&":"&",">":">","<":"<",'"':""","'":"'"},y5t=/[&><"']/g,Ks=e=>String(e).replace(y5t,n=>b5t[n]),R1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?R1(e.body[0]):e:e.type==="font"?R1(e.body):e,x5t=new Set(["mathord","textord","atom"]),Wl=e=>x5t.has(R1(e).type),w5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},j3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function S5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function k5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return S5t(n)}function C5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:k5t(r)}class QS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(j3)){var r=j3[t];r&&C5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=w5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return zo[E5t[this.id]]}sub(){return zo[N5t[this.id]]}fracNum(){return zo[z5t[this.id]]}fracDen(){return zo[j5t[this.id]]}cramp(){return zo[T5t[this.id]]}text(){return zo[A5t[this.id]]}isTight(){return this.size>=2}}var YS=0,xv=1,fh=2,Pl=3,mp=4,ka=5,Kh=6,oi=7,zo=[new $c(YS,0,!1),new $c(xv,0,!0),new $c(fh,1,!1),new $c(Pl,1,!0),new $c(mp,2,!1),new $c(ka,2,!0),new $c(Kh,3,!1),new $c(oi,3,!0)],E5t=[mp,ka,mp,ka,Kh,oi,Kh,oi],N5t=[ka,ka,ka,ka,oi,oi,oi,oi],z5t=[fh,Pl,mp,ka,Kh,oi,Kh,oi],j5t=[Pl,Pl,ka,ka,oi,oi,oi,oi],T5t=[xv,xv,Pl,Pl,ka,ka,oi,oi],A5t=[YS,xv,fh,Pl,fh,Pl,fh,Pl],Yt={DISPLAY:zo[YS],TEXT:zo[fh],SCRIPT:zo[mp],SCRIPTSCRIPT:zo[Kh]},T3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function R5t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var M1=[];T3.forEach(e=>e.blocks.forEach(n=>M1.push(...n)));function f$(e){for(var n=0;n=M1[n]&&e<=M1[n+1])return!0;return!1}var _s=e=>e+" "+e,Gf=80,M5t=function(n,t){return"M95,"+(622+n+t)+` +`+d}function ih(e,n){return e+n.slice(s5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function s5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function i5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Xj(e){let n=0;for(let t=0;t0}function Zj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function o5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function xv(e,n){return n===0||e[n-1]===` +`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){ue(this,Dh)!==null&&ue(this,Fp)===n&&l$(ue(this,Lh),r)&&!!ue(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===yv)||(n=n(),n.use(yv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){ue(this,xd)&&(n=ue(this,xd).update(n));let t=ue(this,Oh);if(n===t)return ue(this,Sd);const r=ue(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(ue(this,Dh)),l=ue(this,qp),u=l.slice(i).some(N=>N.some(j3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),U2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=nw(_,d,a);U2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||j3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=nw(_,d,a);U2(N.length===d.length),l.splice(0,l.length,...N)}const p=nw(o.runSync(_),d,a),m=ue(this,Up),x=ue(this,Gp),S=ue(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(ue(this,wd)),Fe(this,wd,ue(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const sw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===sw.svg?jyt:dB,s=t===sw.html?e.tagName.toLowerCase():e.tagName,i=t===sw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` +`.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function h$(e,n,t){return e.type==="element"?I5t(e,n,t):e.type==="text"?t.whitespace==="normal"?_$(e,t):B5t(e):[]}function I5t(e,n,t){const r=p$(e,t),s=e.children||[];let i=-1,a=[];if(L5t(e))return a;let o,l;for(T3(e)||lT(e)&&sT(n,e,lT)?l=` +`:D5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(q5t,"-$1").toLowerCase(),G5t={"&":"&",">":">","<":"<",'"':""","'":"'"},W5t=/[&><"']/g,Ks=e=>String(e).replace(W5t,n=>G5t[n]),M1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?M1(e.body[0]):e:e.type==="font"?M1(e.body):e,V5t=new Set(["mathord","textord","atom"]),Wl=e=>V5t.has(M1(e).type),K5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},A3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Q5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Y5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Q5t(n)}function X5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Y5t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(A3)){var r=A3[t];r&&X5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=K5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[Z5t[this.id]]}sub(){return jo[J5t[this.id]]}fracNum(){return jo[e6t[this.id]]}fracDen(){return jo[t6t[this.id]]}cramp(){return jo[n6t[this.id]]}text(){return jo[r6t[this.id]]}isTight(){return this.size>=2}}var XS=0,wv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(wv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],Z5t=[gp,ka,gp,ka,Qh,oi,Qh,oi],J5t=[ka,ka,ka,ka,oi,oi,oi,oi],e6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],t6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],n6t=[wv,wv,Pl,Pl,ka,ka,oi,oi],r6t=[XS,wv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},R3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function s6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var D1=[];R3.forEach(e=>e.blocks.forEach(n=>D1.push(...n)));function m$(e){for(var n=0;n=D1[n]&&e<=D1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,i6t=function(n,t){return"M95,"+(622+n+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -716,7 +716,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+n)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},D5t=function(n,t){return"M263,"+(601+n+t)+`c0.7,0,18,39.7,52,119 +M`+(834+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},a6t=function(n,t){return"M263,"+(601+n+t)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+n/2.084+" -"+n+` @@ -726,7 +726,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},L5t=function(n,t){return"M983 "+(10+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},o6t=function(n,t){return"M983 "+(10+n+t)+` l`+n/3.13+" -"+n+` c4,-6.7,10,-10,18,-10 H400000v`+(40+n)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -735,7 +735,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},O5t=function(n,t){return"M424,"+(2398+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},l6t=function(n,t){return"M424,"+(2398+n+t)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -745,18 +745,18 @@ v`+(40+n)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+n)+" "+t+` -h400000v`+(40+n)+"h-400000z"},I5t=function(n,t){return"M473,"+(2713+n+t)+` +h400000v`+(40+n)+"h-400000z"},c6t=function(n,t){return"M473,"+(2713+n+t)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+n/5.298+" -"+n+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+n)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},B5t=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},$5t=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` +606zM`+(1001+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},u6t=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},d6t=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},P5t=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=M5t(t,Gf);break;case"sqrtSize1":s=D5t(t,Gf);break;case"sqrtSize2":s=L5t(t,Gf);break;case"sqrtSize3":s=O5t(t,Gf);break;case"sqrtSize4":s=I5t(t,Gf);break;case"sqrtTall":s=$5t(t,Gf,r)}return s},F5t=function(n,t){switch(n){case"⎜":return _s("M291 0 H417 V"+t+" H291z");case"∣":return _s("M145 0 H188 V"+t+" H145z");case"∥":return _s("M145 0 H188 V"+t+" H145z")+_s("M367 0 H410 V"+t+" H367z");case"⎟":return _s("M457 0 H583 V"+t+" H457z");case"⎢":return _s("M319 0 H403 V"+t+" H319z");case"⎥":return _s("M263 0 H347 V"+t+" H263z");case"⎪":return _s("M384 0 H504 V"+t+" H384z");case"⏐":return _s("M312 0 H355 V"+t+" H312z");case"‖":return _s("M257 0 H300 V"+t+" H257z")+_s("M478 0 H521 V"+t+" H478z");default:return""}},oT={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},f6t=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=i6t(t,Wf);break;case"sqrtSize1":s=a6t(t,Wf);break;case"sqrtSize2":s=o6t(t,Wf);break;case"sqrtSize3":s=l6t(t,Wf);break;case"sqrtSize4":s=c6t(t,Wf);break;case"sqrtTall":s=d6t(t,Wf,r)}return s},h6t=function(n,t){switch(n){case"⎜":return _s("M291 0 H417 V"+t+" H291z");case"∣":return _s("M145 0 H188 V"+t+" H145z");case"∥":return _s("M145 0 H188 V"+t+" H145z")+_s("M367 0 H410 V"+t+" H367z");case"⎟":return _s("M457 0 H583 V"+t+" H457z");case"⎢":return _s("M319 0 H403 V"+t+" H319z");case"⎥":return _s("M263 0 H347 V"+t+" H263z");case"⎪":return _s("M384 0 H504 V"+t+" H384z");case"⏐":return _s("M312 0 H355 V"+t+" H312z");case"‖":return _s("M257 0 H300 V"+t+" H257z")+_s("M478 0 H521 V"+t+" H478z");default:return""}},cT={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -927,7 +927,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},H5t=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},_6t=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -955,74 +955,74 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function q5t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(q5t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var A3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},U5t={ex:!0,em:!0,mu:!0},h$=function(n){return typeof n!="string"&&(n=n.unit),n in A3||n in U5t||n==="ex"},Ar=function(n,t){var r;if(n.unit in A3)r=A3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},XS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=v5t(r)+":"+s+";")}return t},_$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},p$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,m$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=XS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(G5t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,_$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return p$.call(this,"span")}toMarkup(){return m$.call(this,"span")}}class Bb{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,_$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return p$.call(this,"a")}toMarkup(){return m$.call(this,"a")}}class W5t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=XS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class R3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var Y5t=e=>e instanceof m_||e instanceof Bb||e instanceof p_,To={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Kg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},lT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function X5t(e,n){To[e]=n}function ZS(e,n,t){if(!To[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=To[n][r];if(!s&&e[0]in lT&&(r=lT[e[0]].charCodeAt(0),s=To[n][r]),!s&&t==="text"&&f$(r)&&(s=To[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var sw={};function Z5t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!sw[n]){var t=sw[n]={cssEmPerMu:Kg.quad[n]/18};for(var r in Kg)Kg.hasOwnProperty(r)&&(t[r]=Kg[r][n])}return sw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var W="math",He="text",J="main",fe="ams",Cr="accent-token",ut="bin",ui="close",g_="inner",Ot="mathord",is="op-token",na="open",um="punct",he="rel",Vl="spacing",ve="textord";P(W,J,he,"≡","\\equiv",!0);P(W,J,he,"≺","\\prec",!0);P(W,J,he,"≻","\\succ",!0);P(W,J,he,"∼","\\sim",!0);P(W,J,he,"⊥","\\perp");P(W,J,he,"⪯","\\preceq",!0);P(W,J,he,"⪰","\\succeq",!0);P(W,J,he,"≃","\\simeq",!0);P(W,J,he,"∣","\\mid",!0);P(W,J,he,"≪","\\ll",!0);P(W,J,he,"≫","\\gg",!0);P(W,J,he,"≍","\\asymp",!0);P(W,J,he,"∥","\\parallel");P(W,J,he,"⋈","\\bowtie",!0);P(W,J,he,"⌣","\\smile",!0);P(W,J,he,"⊑","\\sqsubseteq",!0);P(W,J,he,"⊒","\\sqsupseteq",!0);P(W,J,he,"≐","\\doteq",!0);P(W,J,he,"⌢","\\frown",!0);P(W,J,he,"∋","\\ni",!0);P(W,J,he,"∝","\\propto",!0);P(W,J,he,"⊢","\\vdash",!0);P(W,J,he,"⊣","\\dashv",!0);P(W,J,he,"∋","\\owns");P(W,J,um,".","\\ldotp");P(W,J,um,"⋅","\\cdotp");P(W,J,um,"⋅","·");P(He,J,ve,"⋅","·");P(W,J,ve,"#","\\#");P(He,J,ve,"#","\\#");P(W,J,ve,"&","\\&");P(He,J,ve,"&","\\&");P(W,J,ve,"ℵ","\\aleph",!0);P(W,J,ve,"∀","\\forall",!0);P(W,J,ve,"ℏ","\\hbar",!0);P(W,J,ve,"∃","\\exists",!0);P(W,J,ve,"∇","\\nabla",!0);P(W,J,ve,"♭","\\flat",!0);P(W,J,ve,"ℓ","\\ell",!0);P(W,J,ve,"♮","\\natural",!0);P(W,J,ve,"♣","\\clubsuit",!0);P(W,J,ve,"℘","\\wp",!0);P(W,J,ve,"♯","\\sharp",!0);P(W,J,ve,"♢","\\diamondsuit",!0);P(W,J,ve,"ℜ","\\Re",!0);P(W,J,ve,"♡","\\heartsuit",!0);P(W,J,ve,"ℑ","\\Im",!0);P(W,J,ve,"♠","\\spadesuit",!0);P(W,J,ve,"§","\\S",!0);P(He,J,ve,"§","\\S");P(W,J,ve,"¶","\\P",!0);P(He,J,ve,"¶","\\P");P(W,J,ve,"†","\\dag");P(He,J,ve,"†","\\dag");P(He,J,ve,"†","\\textdagger");P(W,J,ve,"‡","\\ddag");P(He,J,ve,"‡","\\ddag");P(He,J,ve,"‡","\\textdaggerdbl");P(W,J,ui,"⎱","\\rmoustache",!0);P(W,J,na,"⎰","\\lmoustache",!0);P(W,J,ui,"⟯","\\rgroup",!0);P(W,J,na,"⟮","\\lgroup",!0);P(W,J,ut,"∓","\\mp",!0);P(W,J,ut,"⊖","\\ominus",!0);P(W,J,ut,"⊎","\\uplus",!0);P(W,J,ut,"⊓","\\sqcap",!0);P(W,J,ut,"∗","\\ast");P(W,J,ut,"⊔","\\sqcup",!0);P(W,J,ut,"◯","\\bigcirc",!0);P(W,J,ut,"∙","\\bullet",!0);P(W,J,ut,"‡","\\ddagger");P(W,J,ut,"≀","\\wr",!0);P(W,J,ut,"⨿","\\amalg");P(W,J,ut,"&","\\And");P(W,J,he,"⟵","\\longleftarrow",!0);P(W,J,he,"⇐","\\Leftarrow",!0);P(W,J,he,"⟸","\\Longleftarrow",!0);P(W,J,he,"⟶","\\longrightarrow",!0);P(W,J,he,"⇒","\\Rightarrow",!0);P(W,J,he,"⟹","\\Longrightarrow",!0);P(W,J,he,"↔","\\leftrightarrow",!0);P(W,J,he,"⟷","\\longleftrightarrow",!0);P(W,J,he,"⇔","\\Leftrightarrow",!0);P(W,J,he,"⟺","\\Longleftrightarrow",!0);P(W,J,he,"↦","\\mapsto",!0);P(W,J,he,"⟼","\\longmapsto",!0);P(W,J,he,"↗","\\nearrow",!0);P(W,J,he,"↩","\\hookleftarrow",!0);P(W,J,he,"↪","\\hookrightarrow",!0);P(W,J,he,"↘","\\searrow",!0);P(W,J,he,"↼","\\leftharpoonup",!0);P(W,J,he,"⇀","\\rightharpoonup",!0);P(W,J,he,"↙","\\swarrow",!0);P(W,J,he,"↽","\\leftharpoondown",!0);P(W,J,he,"⇁","\\rightharpoondown",!0);P(W,J,he,"↖","\\nwarrow",!0);P(W,J,he,"⇌","\\rightleftharpoons",!0);P(W,fe,he,"≮","\\nless",!0);P(W,fe,he,"","\\@nleqslant");P(W,fe,he,"","\\@nleqq");P(W,fe,he,"⪇","\\lneq",!0);P(W,fe,he,"≨","\\lneqq",!0);P(W,fe,he,"","\\@lvertneqq");P(W,fe,he,"⋦","\\lnsim",!0);P(W,fe,he,"⪉","\\lnapprox",!0);P(W,fe,he,"⊀","\\nprec",!0);P(W,fe,he,"⋠","\\npreceq",!0);P(W,fe,he,"⋨","\\precnsim",!0);P(W,fe,he,"⪹","\\precnapprox",!0);P(W,fe,he,"≁","\\nsim",!0);P(W,fe,he,"","\\@nshortmid");P(W,fe,he,"∤","\\nmid",!0);P(W,fe,he,"⊬","\\nvdash",!0);P(W,fe,he,"⊭","\\nvDash",!0);P(W,fe,he,"⋪","\\ntriangleleft");P(W,fe,he,"⋬","\\ntrianglelefteq",!0);P(W,fe,he,"⊊","\\subsetneq",!0);P(W,fe,he,"","\\@varsubsetneq");P(W,fe,he,"⫋","\\subsetneqq",!0);P(W,fe,he,"","\\@varsubsetneqq");P(W,fe,he,"≯","\\ngtr",!0);P(W,fe,he,"","\\@ngeqslant");P(W,fe,he,"","\\@ngeqq");P(W,fe,he,"⪈","\\gneq",!0);P(W,fe,he,"≩","\\gneqq",!0);P(W,fe,he,"","\\@gvertneqq");P(W,fe,he,"⋧","\\gnsim",!0);P(W,fe,he,"⪊","\\gnapprox",!0);P(W,fe,he,"⊁","\\nsucc",!0);P(W,fe,he,"⋡","\\nsucceq",!0);P(W,fe,he,"⋩","\\succnsim",!0);P(W,fe,he,"⪺","\\succnapprox",!0);P(W,fe,he,"≆","\\ncong",!0);P(W,fe,he,"","\\@nshortparallel");P(W,fe,he,"∦","\\nparallel",!0);P(W,fe,he,"⊯","\\nVDash",!0);P(W,fe,he,"⋫","\\ntriangleright");P(W,fe,he,"⋭","\\ntrianglerighteq",!0);P(W,fe,he,"","\\@nsupseteqq");P(W,fe,he,"⊋","\\supsetneq",!0);P(W,fe,he,"","\\@varsupsetneq");P(W,fe,he,"⫌","\\supsetneqq",!0);P(W,fe,he,"","\\@varsupsetneqq");P(W,fe,he,"⊮","\\nVdash",!0);P(W,fe,he,"⪵","\\precneqq",!0);P(W,fe,he,"⪶","\\succneqq",!0);P(W,fe,he,"","\\@nsubseteqq");P(W,fe,ut,"⊴","\\unlhd");P(W,fe,ut,"⊵","\\unrhd");P(W,fe,he,"↚","\\nleftarrow",!0);P(W,fe,he,"↛","\\nrightarrow",!0);P(W,fe,he,"⇍","\\nLeftarrow",!0);P(W,fe,he,"⇏","\\nRightarrow",!0);P(W,fe,he,"↮","\\nleftrightarrow",!0);P(W,fe,he,"⇎","\\nLeftrightarrow",!0);P(W,fe,he,"△","\\vartriangle");P(W,fe,ve,"ℏ","\\hslash");P(W,fe,ve,"▽","\\triangledown");P(W,fe,ve,"◊","\\lozenge");P(W,fe,ve,"Ⓢ","\\circledS");P(W,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(W,fe,ve,"∡","\\measuredangle",!0);P(W,fe,ve,"∄","\\nexists");P(W,fe,ve,"℧","\\mho");P(W,fe,ve,"Ⅎ","\\Finv",!0);P(W,fe,ve,"⅁","\\Game",!0);P(W,fe,ve,"‵","\\backprime");P(W,fe,ve,"▲","\\blacktriangle");P(W,fe,ve,"▼","\\blacktriangledown");P(W,fe,ve,"■","\\blacksquare");P(W,fe,ve,"⧫","\\blacklozenge");P(W,fe,ve,"★","\\bigstar");P(W,fe,ve,"∢","\\sphericalangle",!0);P(W,fe,ve,"∁","\\complement",!0);P(W,fe,ve,"ð","\\eth",!0);P(He,J,ve,"ð","ð");P(W,fe,ve,"╱","\\diagup");P(W,fe,ve,"╲","\\diagdown");P(W,fe,ve,"□","\\square");P(W,fe,ve,"□","\\Box");P(W,fe,ve,"◊","\\Diamond");P(W,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(W,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(W,fe,ve,"ℶ","\\beth",!0);P(W,fe,ve,"ℸ","\\daleth",!0);P(W,fe,ve,"ℷ","\\gimel",!0);P(W,fe,ve,"ϝ","\\digamma",!0);P(W,fe,ve,"ϰ","\\varkappa");P(W,fe,na,"┌","\\@ulcorner",!0);P(W,fe,ui,"┐","\\@urcorner",!0);P(W,fe,na,"└","\\@llcorner",!0);P(W,fe,ui,"┘","\\@lrcorner",!0);P(W,fe,he,"≦","\\leqq",!0);P(W,fe,he,"⩽","\\leqslant",!0);P(W,fe,he,"⪕","\\eqslantless",!0);P(W,fe,he,"≲","\\lesssim",!0);P(W,fe,he,"⪅","\\lessapprox",!0);P(W,fe,he,"≊","\\approxeq",!0);P(W,fe,ut,"⋖","\\lessdot");P(W,fe,he,"⋘","\\lll",!0);P(W,fe,he,"≶","\\lessgtr",!0);P(W,fe,he,"⋚","\\lesseqgtr",!0);P(W,fe,he,"⪋","\\lesseqqgtr",!0);P(W,fe,he,"≑","\\doteqdot");P(W,fe,he,"≓","\\risingdotseq",!0);P(W,fe,he,"≒","\\fallingdotseq",!0);P(W,fe,he,"∽","\\backsim",!0);P(W,fe,he,"⋍","\\backsimeq",!0);P(W,fe,he,"⫅","\\subseteqq",!0);P(W,fe,he,"⋐","\\Subset",!0);P(W,fe,he,"⊏","\\sqsubset",!0);P(W,fe,he,"≼","\\preccurlyeq",!0);P(W,fe,he,"⋞","\\curlyeqprec",!0);P(W,fe,he,"≾","\\precsim",!0);P(W,fe,he,"⪷","\\precapprox",!0);P(W,fe,he,"⊲","\\vartriangleleft");P(W,fe,he,"⊴","\\trianglelefteq");P(W,fe,he,"⊨","\\vDash",!0);P(W,fe,he,"⊪","\\Vvdash",!0);P(W,fe,he,"⌣","\\smallsmile");P(W,fe,he,"⌢","\\smallfrown");P(W,fe,he,"≏","\\bumpeq",!0);P(W,fe,he,"≎","\\Bumpeq",!0);P(W,fe,he,"≧","\\geqq",!0);P(W,fe,he,"⩾","\\geqslant",!0);P(W,fe,he,"⪖","\\eqslantgtr",!0);P(W,fe,he,"≳","\\gtrsim",!0);P(W,fe,he,"⪆","\\gtrapprox",!0);P(W,fe,ut,"⋗","\\gtrdot");P(W,fe,he,"⋙","\\ggg",!0);P(W,fe,he,"≷","\\gtrless",!0);P(W,fe,he,"⋛","\\gtreqless",!0);P(W,fe,he,"⪌","\\gtreqqless",!0);P(W,fe,he,"≖","\\eqcirc",!0);P(W,fe,he,"≗","\\circeq",!0);P(W,fe,he,"≜","\\triangleq",!0);P(W,fe,he,"∼","\\thicksim");P(W,fe,he,"≈","\\thickapprox");P(W,fe,he,"⫆","\\supseteqq",!0);P(W,fe,he,"⋑","\\Supset",!0);P(W,fe,he,"⊐","\\sqsupset",!0);P(W,fe,he,"≽","\\succcurlyeq",!0);P(W,fe,he,"⋟","\\curlyeqsucc",!0);P(W,fe,he,"≿","\\succsim",!0);P(W,fe,he,"⪸","\\succapprox",!0);P(W,fe,he,"⊳","\\vartriangleright");P(W,fe,he,"⊵","\\trianglerighteq");P(W,fe,he,"⊩","\\Vdash",!0);P(W,fe,he,"∣","\\shortmid");P(W,fe,he,"∥","\\shortparallel");P(W,fe,he,"≬","\\between",!0);P(W,fe,he,"⋔","\\pitchfork",!0);P(W,fe,he,"∝","\\varpropto");P(W,fe,he,"◀","\\blacktriangleleft");P(W,fe,he,"∴","\\therefore",!0);P(W,fe,he,"∍","\\backepsilon");P(W,fe,he,"▶","\\blacktriangleright");P(W,fe,he,"∵","\\because",!0);P(W,fe,he,"⋘","\\llless");P(W,fe,he,"⋙","\\gggtr");P(W,fe,ut,"⊲","\\lhd");P(W,fe,ut,"⊳","\\rhd");P(W,fe,he,"≂","\\eqsim",!0);P(W,J,he,"⋈","\\Join");P(W,fe,he,"≑","\\Doteq",!0);P(W,fe,ut,"∔","\\dotplus",!0);P(W,fe,ut,"∖","\\smallsetminus");P(W,fe,ut,"⋒","\\Cap",!0);P(W,fe,ut,"⋓","\\Cup",!0);P(W,fe,ut,"⩞","\\doublebarwedge",!0);P(W,fe,ut,"⊟","\\boxminus",!0);P(W,fe,ut,"⊞","\\boxplus",!0);P(W,fe,ut,"⋇","\\divideontimes",!0);P(W,fe,ut,"⋉","\\ltimes",!0);P(W,fe,ut,"⋊","\\rtimes",!0);P(W,fe,ut,"⋋","\\leftthreetimes",!0);P(W,fe,ut,"⋌","\\rightthreetimes",!0);P(W,fe,ut,"⋏","\\curlywedge",!0);P(W,fe,ut,"⋎","\\curlyvee",!0);P(W,fe,ut,"⊝","\\circleddash",!0);P(W,fe,ut,"⊛","\\circledast",!0);P(W,fe,ut,"⋅","\\centerdot");P(W,fe,ut,"⊺","\\intercal",!0);P(W,fe,ut,"⋒","\\doublecap");P(W,fe,ut,"⋓","\\doublecup");P(W,fe,ut,"⊠","\\boxtimes",!0);P(W,fe,he,"⇢","\\dashrightarrow",!0);P(W,fe,he,"⇠","\\dashleftarrow",!0);P(W,fe,he,"⇇","\\leftleftarrows",!0);P(W,fe,he,"⇆","\\leftrightarrows",!0);P(W,fe,he,"⇚","\\Lleftarrow",!0);P(W,fe,he,"↞","\\twoheadleftarrow",!0);P(W,fe,he,"↢","\\leftarrowtail",!0);P(W,fe,he,"↫","\\looparrowleft",!0);P(W,fe,he,"⇋","\\leftrightharpoons",!0);P(W,fe,he,"↶","\\curvearrowleft",!0);P(W,fe,he,"↺","\\circlearrowleft",!0);P(W,fe,he,"↰","\\Lsh",!0);P(W,fe,he,"⇈","\\upuparrows",!0);P(W,fe,he,"↿","\\upharpoonleft",!0);P(W,fe,he,"⇃","\\downharpoonleft",!0);P(W,J,he,"⊶","\\origof",!0);P(W,J,he,"⊷","\\imageof",!0);P(W,fe,he,"⊸","\\multimap",!0);P(W,fe,he,"↭","\\leftrightsquigarrow",!0);P(W,fe,he,"⇉","\\rightrightarrows",!0);P(W,fe,he,"⇄","\\rightleftarrows",!0);P(W,fe,he,"↠","\\twoheadrightarrow",!0);P(W,fe,he,"↣","\\rightarrowtail",!0);P(W,fe,he,"↬","\\looparrowright",!0);P(W,fe,he,"↷","\\curvearrowright",!0);P(W,fe,he,"↻","\\circlearrowright",!0);P(W,fe,he,"↱","\\Rsh",!0);P(W,fe,he,"⇊","\\downdownarrows",!0);P(W,fe,he,"↾","\\upharpoonright",!0);P(W,fe,he,"⇂","\\downharpoonright",!0);P(W,fe,he,"⇝","\\rightsquigarrow",!0);P(W,fe,he,"⇝","\\leadsto");P(W,fe,he,"⇛","\\Rrightarrow",!0);P(W,fe,he,"↾","\\restriction");P(W,J,ve,"‘","`");P(W,J,ve,"$","\\$");P(He,J,ve,"$","\\$");P(He,J,ve,"$","\\textdollar");P(W,J,ve,"%","\\%");P(He,J,ve,"%","\\%");P(W,J,ve,"_","\\_");P(He,J,ve,"_","\\_");P(He,J,ve,"_","\\textunderscore");P(W,J,ve,"∠","\\angle",!0);P(W,J,ve,"∞","\\infty",!0);P(W,J,ve,"′","\\prime");P(W,J,ve,"△","\\triangle");P(W,J,ve,"Γ","\\Gamma",!0);P(W,J,ve,"Δ","\\Delta",!0);P(W,J,ve,"Θ","\\Theta",!0);P(W,J,ve,"Λ","\\Lambda",!0);P(W,J,ve,"Ξ","\\Xi",!0);P(W,J,ve,"Π","\\Pi",!0);P(W,J,ve,"Σ","\\Sigma",!0);P(W,J,ve,"Υ","\\Upsilon",!0);P(W,J,ve,"Φ","\\Phi",!0);P(W,J,ve,"Ψ","\\Psi",!0);P(W,J,ve,"Ω","\\Omega",!0);P(W,J,ve,"A","Α");P(W,J,ve,"B","Β");P(W,J,ve,"E","Ε");P(W,J,ve,"Z","Ζ");P(W,J,ve,"H","Η");P(W,J,ve,"I","Ι");P(W,J,ve,"K","Κ");P(W,J,ve,"M","Μ");P(W,J,ve,"N","Ν");P(W,J,ve,"O","Ο");P(W,J,ve,"P","Ρ");P(W,J,ve,"T","Τ");P(W,J,ve,"X","Χ");P(W,J,ve,"¬","\\neg",!0);P(W,J,ve,"¬","\\lnot");P(W,J,ve,"⊤","\\top");P(W,J,ve,"⊥","\\bot");P(W,J,ve,"∅","\\emptyset");P(W,fe,ve,"∅","\\varnothing");P(W,J,Ot,"α","\\alpha",!0);P(W,J,Ot,"β","\\beta",!0);P(W,J,Ot,"γ","\\gamma",!0);P(W,J,Ot,"δ","\\delta",!0);P(W,J,Ot,"ϵ","\\epsilon",!0);P(W,J,Ot,"ζ","\\zeta",!0);P(W,J,Ot,"η","\\eta",!0);P(W,J,Ot,"θ","\\theta",!0);P(W,J,Ot,"ι","\\iota",!0);P(W,J,Ot,"κ","\\kappa",!0);P(W,J,Ot,"λ","\\lambda",!0);P(W,J,Ot,"μ","\\mu",!0);P(W,J,Ot,"ν","\\nu",!0);P(W,J,Ot,"ξ","\\xi",!0);P(W,J,Ot,"ο","\\omicron",!0);P(W,J,Ot,"π","\\pi",!0);P(W,J,Ot,"ρ","\\rho",!0);P(W,J,Ot,"σ","\\sigma",!0);P(W,J,Ot,"τ","\\tau",!0);P(W,J,Ot,"υ","\\upsilon",!0);P(W,J,Ot,"ϕ","\\phi",!0);P(W,J,Ot,"χ","\\chi",!0);P(W,J,Ot,"ψ","\\psi",!0);P(W,J,Ot,"ω","\\omega",!0);P(W,J,Ot,"ε","\\varepsilon",!0);P(W,J,Ot,"ϑ","\\vartheta",!0);P(W,J,Ot,"ϖ","\\varpi",!0);P(W,J,Ot,"ϱ","\\varrho",!0);P(W,J,Ot,"ς","\\varsigma",!0);P(W,J,Ot,"φ","\\varphi",!0);P(W,J,ut,"∗","*",!0);P(W,J,ut,"+","+");P(W,J,ut,"−","-",!0);P(W,J,ut,"⋅","\\cdot",!0);P(W,J,ut,"∘","\\circ",!0);P(W,J,ut,"÷","\\div",!0);P(W,J,ut,"±","\\pm",!0);P(W,J,ut,"×","\\times",!0);P(W,J,ut,"∩","\\cap",!0);P(W,J,ut,"∪","\\cup",!0);P(W,J,ut,"∖","\\setminus",!0);P(W,J,ut,"∧","\\land");P(W,J,ut,"∨","\\lor");P(W,J,ut,"∧","\\wedge",!0);P(W,J,ut,"∨","\\vee",!0);P(W,J,ve,"√","\\surd");P(W,J,na,"⟨","\\langle",!0);P(W,J,na,"∣","\\lvert");P(W,J,na,"∥","\\lVert");P(W,J,ui,"?","?");P(W,J,ui,"!","!");P(W,J,ui,"⟩","\\rangle",!0);P(W,J,ui,"∣","\\rvert");P(W,J,ui,"∥","\\rVert");P(W,J,he,"=","=");P(W,J,he,":",":");P(W,J,he,"≈","\\approx",!0);P(W,J,he,"≅","\\cong",!0);P(W,J,he,"≥","\\ge");P(W,J,he,"≥","\\geq",!0);P(W,J,he,"←","\\gets");P(W,J,he,">","\\gt",!0);P(W,J,he,"∈","\\in",!0);P(W,J,he,"","\\@not");P(W,J,he,"⊂","\\subset",!0);P(W,J,he,"⊃","\\supset",!0);P(W,J,he,"⊆","\\subseteq",!0);P(W,J,he,"⊇","\\supseteq",!0);P(W,fe,he,"⊈","\\nsubseteq",!0);P(W,fe,he,"⊉","\\nsupseteq",!0);P(W,J,he,"⊨","\\models");P(W,J,he,"←","\\leftarrow",!0);P(W,J,he,"≤","\\le");P(W,J,he,"≤","\\leq",!0);P(W,J,he,"<","\\lt",!0);P(W,J,he,"→","\\rightarrow",!0);P(W,J,he,"→","\\to");P(W,fe,he,"≱","\\ngeq",!0);P(W,fe,he,"≰","\\nleq",!0);P(W,J,Vl," ","\\ ");P(W,J,Vl," ","\\space");P(W,J,Vl," ","\\nobreakspace");P(He,J,Vl," ","\\ ");P(He,J,Vl," "," ");P(He,J,Vl," ","\\space");P(He,J,Vl," ","\\nobreakspace");P(W,J,Vl,"","\\nobreak");P(W,J,Vl,"","\\allowbreak");P(W,J,um,",",",");P(W,J,um,";",";");P(W,fe,ut,"⊼","\\barwedge",!0);P(W,fe,ut,"⊻","\\veebar",!0);P(W,J,ut,"⊙","\\odot",!0);P(W,J,ut,"⊕","\\oplus",!0);P(W,J,ut,"⊗","\\otimes",!0);P(W,J,ve,"∂","\\partial",!0);P(W,J,ut,"⊘","\\oslash",!0);P(W,fe,ut,"⊚","\\circledcirc",!0);P(W,fe,ut,"⊡","\\boxdot",!0);P(W,J,ut,"△","\\bigtriangleup");P(W,J,ut,"▽","\\bigtriangledown");P(W,J,ut,"†","\\dagger");P(W,J,ut,"⋄","\\diamond");P(W,J,ut,"⋆","\\star");P(W,J,ut,"◃","\\triangleleft");P(W,J,ut,"▹","\\triangleright");P(W,J,na,"{","\\{");P(He,J,ve,"{","\\{");P(He,J,ve,"{","\\textbraceleft");P(W,J,ui,"}","\\}");P(He,J,ve,"}","\\}");P(He,J,ve,"}","\\textbraceright");P(W,J,na,"{","\\lbrace");P(W,J,ui,"}","\\rbrace");P(W,J,na,"[","\\lbrack",!0);P(He,J,ve,"[","\\lbrack",!0);P(W,J,ui,"]","\\rbrack",!0);P(He,J,ve,"]","\\rbrack",!0);P(W,J,na,"(","\\lparen",!0);P(W,J,ui,")","\\rparen",!0);P(He,J,ve,"<","\\textless",!0);P(He,J,ve,">","\\textgreater",!0);P(W,J,na,"⌊","\\lfloor",!0);P(W,J,ui,"⌋","\\rfloor",!0);P(W,J,na,"⌈","\\lceil",!0);P(W,J,ui,"⌉","\\rceil",!0);P(W,J,ve,"\\","\\backslash");P(W,J,ve,"∣","|");P(W,J,ve,"∣","\\vert");P(He,J,ve,"|","\\textbar",!0);P(W,J,ve,"∥","\\|");P(W,J,ve,"∥","\\Vert");P(He,J,ve,"∥","\\textbardbl");P(He,J,ve,"~","\\textasciitilde");P(He,J,ve,"\\","\\textbackslash");P(He,J,ve,"^","\\textasciicircum");P(W,J,he,"↑","\\uparrow",!0);P(W,J,he,"⇑","\\Uparrow",!0);P(W,J,he,"↓","\\downarrow",!0);P(W,J,he,"⇓","\\Downarrow",!0);P(W,J,he,"↕","\\updownarrow",!0);P(W,J,he,"⇕","\\Updownarrow",!0);P(W,J,is,"∐","\\coprod");P(W,J,is,"⋁","\\bigvee");P(W,J,is,"⋀","\\bigwedge");P(W,J,is,"⨄","\\biguplus");P(W,J,is,"⋂","\\bigcap");P(W,J,is,"⋃","\\bigcup");P(W,J,is,"∫","\\int");P(W,J,is,"∫","\\intop");P(W,J,is,"∬","\\iint");P(W,J,is,"∭","\\iiint");P(W,J,is,"∏","\\prod");P(W,J,is,"∑","\\sum");P(W,J,is,"⨂","\\bigotimes");P(W,J,is,"⨁","\\bigoplus");P(W,J,is,"⨀","\\bigodot");P(W,J,is,"∮","\\oint");P(W,J,is,"∯","\\oiint");P(W,J,is,"∰","\\oiiint");P(W,J,is,"⨆","\\bigsqcup");P(W,J,is,"∫","\\smallint");P(He,J,g_,"…","\\textellipsis");P(W,J,g_,"…","\\mathellipsis");P(He,J,g_,"…","\\ldots",!0);P(W,J,g_,"…","\\ldots",!0);P(W,J,g_,"⋯","\\@cdots",!0);P(W,J,g_,"⋱","\\ddots",!0);P(W,J,ve,"⋮","\\varvdots");P(He,J,ve,"⋮","\\varvdots");P(W,J,Cr,"ˊ","\\acute");P(W,J,Cr,"ˋ","\\grave");P(W,J,Cr,"¨","\\ddot");P(W,J,Cr,"~","\\tilde");P(W,J,Cr,"ˉ","\\bar");P(W,J,Cr,"˘","\\breve");P(W,J,Cr,"ˇ","\\check");P(W,J,Cr,"^","\\hat");P(W,J,Cr,"⃗","\\vec");P(W,J,Cr,"˙","\\dot");P(W,J,Cr,"˚","\\mathring");P(W,J,Ot,"","\\@imath");P(W,J,Ot,"","\\@jmath");P(W,J,ve,"ı","ı");P(W,J,ve,"ȷ","ȷ");P(He,J,ve,"ı","\\i",!0);P(He,J,ve,"ȷ","\\j",!0);P(He,J,ve,"ß","\\ss",!0);P(He,J,ve,"æ","\\ae",!0);P(He,J,ve,"œ","\\oe",!0);P(He,J,ve,"ø","\\o",!0);P(He,J,ve,"Æ","\\AE",!0);P(He,J,ve,"Œ","\\OE",!0);P(He,J,ve,"Ø","\\O",!0);P(He,J,Cr,"ˊ","\\'");P(He,J,Cr,"ˋ","\\`");P(He,J,Cr,"ˆ","\\^");P(He,J,Cr,"˜","\\~");P(He,J,Cr,"ˉ","\\=");P(He,J,Cr,"˘","\\u");P(He,J,Cr,"˙","\\.");P(He,J,Cr,"¸","\\c");P(He,J,Cr,"˚","\\r");P(He,J,Cr,"ˇ","\\v");P(He,J,Cr,"¨",'\\"');P(He,J,Cr,"˝","\\H");P(He,J,Cr,"◯","\\textcircled");var g$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,J,ve,"–","--",!0);P(He,J,ve,"–","\\textendash");P(He,J,ve,"—","---",!0);P(He,J,ve,"—","\\textemdash");P(He,J,ve,"‘","`",!0);P(He,J,ve,"‘","\\textquoteleft");P(He,J,ve,"’","'",!0);P(He,J,ve,"’","\\textquoteright");P(He,J,ve,"“","``",!0);P(He,J,ve,"“","\\textquotedblleft");P(He,J,ve,"”","''",!0);P(He,J,ve,"”","\\textquotedblright");P(W,J,ve,"°","\\degree",!0);P(He,J,ve,"°","\\degree");P(He,J,ve,"°","\\textdegree",!0);P(W,J,ve,"£","\\pounds");P(W,J,ve,"£","\\mathsterling",!0);P(He,J,ve,"£","\\pounds");P(He,J,ve,"£","\\textsterling",!0);P(W,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var cT='0123456789/@."';for(var iw=0;iw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return bT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return e6t[i]}else{if(r===120485||r===120486)return bT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},v$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},We=function(n,t,r,s){var i=new m_(n,t,r,s);return ek(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Qh=function(n,t,r){var s=We([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},s6t=function(n,t,r,s){var i=new Bb(n,t,r,s);return ek(i),i},Kl=function(n){var t=new p_(n);return ek(t),t},Yh=function(n,t){return n instanceof p_?We([],[n],t):n},i6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=We(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Xg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},B3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},y$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},x$=function(n,t){var[r,s,i]=y$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},xl={number:5,unit:"mu"},a6t={mord:{mop:jr,mbin:Ju,mrel:xl,minner:jr},mop:{mord:jr,mop:jr,mrel:xl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:xl,mop:xl,mopen:xl,minner:xl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:xl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:xl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:xl,mopen:jr,mpunct:jr,minner:jr}},o6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},w$={},Sv={},kv={};function lt(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&c6t.has(b)?S.classes[0]="mord":b==="mbin"&&l6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),$3(i,(x,S)=>{var v,b,w=F3(S),y=F3(x),C=w&&y?x.hasClass("mtight")?(v=o6t[w])==null?void 0:v[y]:(b=a6t[w])==null?void 0:b[y]:null;if(C)return b$(C,u)},{node:d},p,m),i},$3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},S$=function(n){return n instanceof p_||n instanceof Bb||n instanceof m_&&n.hasClass("enclosing")?n:null},P3=function(n,t){var r=S$(n);if(r){var s=r.children;if(s.length){if(t==="right")return P3(s[s.length-1],"right");if(t==="left")return P3(s[0],"left")}}return n},F3=function(n,t){if(!n)return null;t&&(n=P3(n,t));var r=n.classes[0];return d6t[r]||null},gp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return We(t.concat(r))},Un=function(n,t,r){if(!n)return We();if(Sv[n.type]){var s=Sv[n.type](n,t);if(r&&t.size!==r.size){s=We(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Zg(e,n){var t=We(["base"],e,n),r=We(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function H3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Zg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Zg(a,n));var u;t?(u=Zg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=We(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function k$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class ns{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class C${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var f6t=new Set(["\\imath","\\jmath"]),h6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(g$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new ns(n)},tk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},_6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},nk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=_6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(f6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=B3[t].fontName;return ZS(i,o,r)?B3[t].variant:null};function cw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof ns&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof ns&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=ar(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||cw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof ns&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ns&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return tk(ra(n,t,r))},ar=function(n,t){if(!n)return new Xe("mrow");if(kv[n.type])return kv[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function yT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&h6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new ns(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return We([_],[u])}var p6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],xT=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],wT=function(n,t){return t.size<2?n:p6t[n-1][t.size-1]};class El{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||El.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=xT[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new El(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:wT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:xT[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=wT(El.BASESIZE,n);return this.size===t&&this.textSize===El.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==El.BASESIZE?["sizing","reset-size"+this.size,"size"+El.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Z5t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}El.BASESIZE=6;var E$=function(n){return new El({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},N$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=We(r,[n])}return n},m6t=function(n,t,r){var s=E$(r),i;if(r.output==="mathml")return yT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=H3(n,s);i=We(["katex"],[a])}else{var o=yT(n,t,s,r.displayMode,!1),l=H3(n,s);i=We(["katex"],[o,l])}return N$(i,r)},g6t=function(n,t,r){var s=E$(r),i=H3(n,s),a=We(["katex"],[i]);return N$(a,r)},v6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Fb=function(n){var t=new Xe("mo",[new ns(v6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},b6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},y6t=new Set(["widehat","widecheck","widetilde","utilde"]),Hb=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(y6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=b6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,z;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],z=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],z=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],z=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},x6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=We(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new R3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new R3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},w6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},S6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function k6t(e){return e in w6t}function on(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function qb(e){var n=Ub(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Ub(e){return e&&(e.type==="atom"||S6t.hasOwnProperty(e.type))?e:null}var z$=e=>{if(e instanceof Zi)return e;if(Y5t(e)&&e.children.length===1)return z$(e.children[0])},rk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=on(e.base,"accent"),t=r.base,e.base=t,s=Q5t(Un(e,n)),e.base=r):(r=on(e,"accent"),t=r.base);var i=Un(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=z$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=Hb(r,n),p=Hn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=x$("vec",n),x=y$.vec[1]):(m=Pb({mode:r.mode,text:r.label},n,"textord"),m=K5t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=We(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=Hn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=We(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},j$=(e,n)=>{var t=e.isStretchy?Fb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[ar(e.base,n),t]);return r.setAttribute("accent","true"),r},C6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));lt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Cv(n[0]),r=!C6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:rk,mathmlBuilder:j$});lt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:rk,mathmlBuilder:j$});lt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Un(e.base,n),r=Hb(e,n),s=e.label==="\\utilde"?.12:0,i=Hn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return We(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=Fb(e.label),r=new Xe("munder",[ar(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var Jg=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};lt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Yh(Un(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Yh(Un(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=Hb(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=Hn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=Hn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return We(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=Fb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=Jg(ar(e.body,n));if(e.below){var i=Jg(ar(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=Jg(ar(e.below,n));r=new Xe("munder",[t,a])}else r=Jg(),r=new Xe("mover",[t,r]);return r}});function T$(e,n){var t=ps(e.body,n,!0);return We([e.mclass],t,n)}function A$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}lt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ts(s),isCharacterBox:Wl(s)}},htmlBuilder:T$,mathmlBuilder:A$});var Gb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};lt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Gb(n[0]),body:ts(n[1]),isCharacterBox:Wl(n[1])}}});lt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Gb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ts(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:T$,mathmlBuilder:A$});lt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Gb(n[0]),body:ts(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=We([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var E6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},ST=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),kT=e=>e.type==="textord"&&e.text==="@",N6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function z6t(e,n,t){var r=E6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function j6t(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=z6t(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=ST()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}lt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Yh(Un(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[ar(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});lt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Yh(Un(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[ar(e.fragment,n)])}});lt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=on(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var R$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},M$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};lt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=on(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ts(s)}},htmlBuilder:R$,mathmlBuilder:M$});lt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=on(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:R$,mathmlBuilder:M$});lt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&on(s,"size").value}},htmlBuilder(e,n){var t=We(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var q3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},D$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},T6t=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},L$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};lt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(q3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=q3[r.text]),on(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});lt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===q3[t]),{type:"internal",mode:n.mode}}});lt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=D$(n.gullet.popToken());n.gullet.consumeSpaces();var s=T6t(n);return L$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});lt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=D$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return L$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=ZS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},sk=function(n,t,r,s){var i=r.havingBaseStyle(t),a=We(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},O$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},A6t=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=sk(o,t,s,a);return O$(l,s,t),l},R6t=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},I$=function(n,t,r,s,i,a){var o=R6t(n,t,i,s),l=sk(We(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&O$(l,s,Yt.TEXT),l},uw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=We(["delimsizinginner",s],[We([],[ii(n,t,r)])]);return{type:"elem",elem:i}},dw=function(n,t,r){var s=To["Size4-Regular"][n.charCodeAt(0)]?To["Size4-Regular"][n.charCodeAt(0)][4]:To["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",F5t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},U3=.008,e1={type:"kern",size:-1*U3},M6t=new Set(["|","\\lvert","\\rvert","\\vert"]),D6t=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),B$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):M6t.has(n)?(u="∣",d="vert",p=333):D6t.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,z=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+z*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var U=M-S-y,H=Math.round(M*1e3),Y=H5t(d,Math.round(U*1e3)),V=new mu(d,Y),X=et(p/1e3),te=et(H/1e3),I=new ql([V],{width:X,height:te,viewBox:"0 0 "+p+" "+H}),L=gu([],[I],s);L.height=H/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(uw(_,m,i)),$.push(e1),l===null){var F=M-S-y+2*U3;$.push(dw(u,F,s))}else{var q=(M-S-y-C)/2+2*U3;$.push(dw(u,q,s)),$.push(e1),$.push(uw(l,m,i)),$.push(e1),$.push(dw(u,q,s))}$.push(e1),$.push(uw(o,m,i))}var G=s.havingBaseStyle(Yt.TEXT),ee=Hn({positionType:"bottom",positionData:B,children:$});return sk(We(["delimsizing","mult"],[ee],G),Yt.TEXT,s,a)},fw=80,hw=.08,_w=function(n,t,r,s,i){var a=P5t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},L6t=function(n,t){var r=t.havingBaseSizing(),s=q$("\\surd",n*r.sizeMultiplier,H$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+fw,n<1?i=1:n<1.4&&(i=.7),l=(1+a+hw)/i,u=(1+a)/i,o=_w("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+fw)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+hw)/i,o=_w("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+hw,u=n+a,_=Math.floor(1e3*n+a)+fw,o=_w("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},$$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),O6t=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),P$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],F$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),$$.has(n)||P$.has(n))return I$(n,t,!1,r,s,i);if(O6t.has(n))return B$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},I6t=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],B6t=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],H$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],$6t=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},q$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},G3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;P$.has(n)?o=I6t:$$.has(n)?o=H$:o=B6t;var l=q$(n,t,o,s);return l.type==="small"?A6t(n,l.style,r,s,i,a):l.type==="large"?I$(n,l.size,r,s,i,a):B$(n,t,r,s,i,a)},pw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return G3(n,d,!0,s,i,a)},CT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},P6t=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function ET(e){return"isMiddle"in e}function Wb(e,n){var t=Ub(e);if(t&&P6t.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}lt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Wb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:CT[e.funcName].size,mclass:CT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?We([e.mclass]):F$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function NT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}lt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Wb(n[0],e).text,color:t}}});lt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Wb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=on(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{NT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{NT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return tk(t)}});lt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Wb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=gp(n,[]):(t=F$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Vb=(e,n)=>{var t=Yh(Un(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=We(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=B5t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=x6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=Hn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=Hn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?We(["mord","cancel-lap"],[w],n):We(["mord"],[w],n)},Kb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[ar(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};lt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=on(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Vb,mathmlBuilder:Kb});lt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=on(n[0],"color-token").color,a=on(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Vb,mathmlBuilder:Kb});lt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});lt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Vb,mathmlBuilder:Kb});lt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Vb,mathmlBuilder:Kb});lt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var U$={};function Go(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},F6t=new Set(["gather","gather*"]);function ik(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Qi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(zT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[ht]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var ae,ue;le=(ae=(ue=G)==null?void 0:ue.pregap)!=null?ae:p,le!==0&&(Y=We(["arraycolsep"],[]),Y.style.width=et(le),H.push(Y))}var pe=[];for(r=0;r0){for(var Pt=Qh("hline",t,_),zt=Qh("hdashline",t,_),ot=[{type:"elem",elem:$t,shift:0}];u.length>0;){var ft=u.pop(),It=ft.pos-$;ft.isDashed?ot.push({type:"elem",elem:zt,shift:It}):ot.push({type:"elem",elem:Pt,shift:It})}$t=Hn({positionType:"individualShift",children:ot})}if(X.length===0)return We(["mord"],[$t],t);var we=Hn({positionType:"individualShift",children:X}),Re=We(["tag"],[we],t);return Kl([$t,Re])},H6t={c:"center ",l:"left ",r:"right "},Vo=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Go({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Ub(n[0]),r=t?[n[0]]:on(n[0],"ordgroup").body,s=r.map(function(a){var o=qb(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ak(e.envName))},htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ak(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Ub(n[0]),r=t?[n[0]]:on(n[0],"ordgroup").body,s=r.map(function(o){var l=qb(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ak(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:W$,htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){F6t.has(e.envName)&&Qb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ik(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:W$,htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Qb(e);var n={autoTag:ik(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Wo,mathmlBuilder:Vo});Go({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Qb(e),j6t(e.parser)},htmlBuilder:Wo,mathmlBuilder:Vo});ie("\\nonumber","\\gdef\\@eqnsw{0}");ie("\\notag","\\nonumber");lt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var jT=U$;lt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Un(e.body,r)},K$=(e,n)=>{var t=e.font,r=n.withFont(t);return ar(e.body,r)},TT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};lt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Cv(n[0]),i=r;return i in TT&&(i=TT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:V$,mathmlBuilder:K$});lt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Gb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});lt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:V$,mathmlBuilder:K$});var q6t=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Un(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[ar(e.numer,n),ar(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new ns(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new ns(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return tk(s)}return t},Q$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};lt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),Q$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:q6t,mathmlBuilder:U6t});lt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var AT=["display","text","script","scriptscript"],RT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};lt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Cv(n[0]),a=i.type==="atom"&&i.family==="open"?RT(i.text):null,o=Cv(n[1]),l=o.type==="atom"&&o.family==="close"?RT(o.text):null,u=on(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=on(m.body[0],"textord");p=AT[Number(x.text)]}}else m=on(m,"textord"),p=AT[Number(m.text)];return Q$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});lt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:on(n[0],"size").value,token:s}}});lt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=on(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var Y$=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Un(e.sup,n.havingStyle(t.sup()),n):Un(e.sub,n.havingStyle(t.sub()),n),s=on(e.base,"horizBrace")):s=on(e,"horizBrace");var i=Un(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=Hb(s,n),o;if(s.isOver?o=Hn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=Hn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=We(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=Hn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=Hn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return We(["minner",s.isOver?"mover":"munder"],[o],n)},G6t=(e,n)=>{var t=Fb(e.label);return new Xe(e.isOver?"mover":"munder",[ar(e.base,n),t])};lt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:Y$,mathmlBuilder:G6t});lt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=on(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ts(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return s6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});lt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=on(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=on(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=We(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});lt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ts(n[0]),mathml:ts(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var mw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!h$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};lt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=on(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new W5t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});lt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=on(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return b$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new C$(t)}});lt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=We([],[Un(e.body,n)]),t=We(["inner"],[t],n)):t=We(["inner"],[Un(e.body,n)]);var r=We(["fix"],[]),s=We([e.alignment],[t,r],n),i=We(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=We(["thinbox"],[s],n),We(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[ar(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});lt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});lt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var MT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};lt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ts(n[0]),text:ts(n[1]),script:ts(n[2]),scriptscript:ts(n[3])}},htmlBuilder:(e,n)=>{var t=MT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=MT(e,n);return vu(t,n)}});var X$=(e,n,t,r,s,i,a)=>{e=We([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Un(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Un(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=Hn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=Hn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=Hn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=We(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return We(["mop","op-limits"],v,r)},Z$=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=on(e.base,"op"),s=!0):i=on(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!Z$.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=x$(d+"Size"+(o?"2":"1"),n);l=Hn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Zi?(l=m[0],l.classes[0]="mop"):l=We(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),Z$.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new ns(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=k$([t,r])}return t},W6t={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};lt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=W6t[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:dm});lt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ts(r)}},htmlBuilder:v_,mathmlBuilder:dm});var V6t={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};lt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:dm});lt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:dm});lt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=V6t[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:dm});var J$=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=on(e.base,"operatorname"),s=!0):i=on(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new ns(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):k$([l,u])};lt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ts(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:J$,mathmlBuilder:K6t});ie("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");nf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):We(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});lt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Un(e.body,n.havingCrampedStyle()),r=Qh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Hn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return We(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new ns("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[ar(e.body,n),t]);return r.setAttribute("accent","true"),r}});lt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ts(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ie("\\hphantom","\\smash{\\phantom{#1}}");lt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=We(["inner"],[Un(e.body,n.withPhantom())]),r=We(["fix"],[]);return We(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ts(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});lt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=on(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Un(e.body,n),r=Ar(e.dy,n);return Hn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[ar(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});lt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});lt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=on(n[0],"size"),a=on(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&on(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=We(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function eP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return eP(e.body,t,n)};lt({type:"sizing",names:DT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:DT.indexOf(r)+1,body:i}},htmlBuilder:Q6t,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});lt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&on(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=We([],[Un(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return We(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[ar(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});lt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Un(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Yh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=Hn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Un(e.index,x,n),v=.6*(m.height-m.depth),b=Hn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=We(["root"],[b]);return We(["mord","sqrt"],[w,m],n)}else return We(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[ar(t,n),ar(r,n)]):new Xe("msqrt",[ar(t,n)])}});var W3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function Y6t(e){return e in W3}lt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!Y6t(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=W3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),eP(e.body,r,n)},mathmlBuilder(e,n){var t=W3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var X6t=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?J$:null}else{if(r.type==="accent")return Wl(r.base)?rk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?Y$:null}else return null}else return null};nf({type:"supsub",htmlBuilder(e,n){var t=X6t(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Un(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Un(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Un(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Zi||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=z,d-=z)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=Hn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=Hn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=Hn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=F3(a,"right")||"mord";return We([B],[a,We(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[ar(e.base,n)];e.sub&&i.push(ar(e.sub,n)),e.sup&&i.push(ar(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});nf({type:"atom",htmlBuilder(e,n){return JS(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=nk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var tP={mi:"italic",mn:"normal",mtext:"normal"};nf({type:"mathord",htmlBuilder(e,n){return Pb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=nk(e,n)||"italic";return r!==tP[t.type]&&t.setAttribute("mathvariant",r),t}});nf({type:"textord",htmlBuilder(e,n){return Pb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=nk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==tP[s.type]&&s.setAttribute("mathvariant",r),s}});var gw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},vw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};nf({type:"spacing",htmlBuilder(e,n){if(vw.hasOwnProperty(e.text)){var t=vw[e.text].className||"";if(e.mode==="text"){var r=Pb(e,n,"textord");return r.classes.push(t),r}else return We(["mspace",t],[JS(e.text,e.mode,n)],n)}else{if(gw.hasOwnProperty(e.text))return We(["mspace",gw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(vw.hasOwnProperty(e.text))t=new Xe("mtext",[new ns(" ")]);else{if(gw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var LT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};nf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[LT(),new Xe("mtd",[vu(e.body,n)]),LT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var OT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},IT={"\\textbf":"textbf","\\textmd":"textmd"},Z6t={"\\textit":"textit","\\textup":"textup"},BT=(e,n)=>{var t=e.font;if(t){if(OT[t])return n.withTextFontFamily(OT[t]);if(IT[t])return n.withTextFontWeight(IT[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(Z6t[t])};lt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ts(s),font:r}},htmlBuilder(e,n){var t=BT(e,n),r=ps(e.body,t,!0);return We(["mord","text"],r,t)},mathmlBuilder(e,n){var t=BT(e,n);return vu(e.body,t)}});lt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Un(e.body,n),r=Qh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Hn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return We(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new ns("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[ar(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});lt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Un(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return Hn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[ar(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});lt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=$T(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=w$,nP=`[ \r - ]`,J6t="\\\\[a-zA-Z@]+",eSt="\\\\[^\uD800-\uDFFF]",tSt="("+J6t+")"+nP+"*",nSt=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var M3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in M3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in M3)r=M3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class $b{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class D3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof $b||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var iw={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!iw[n]){var t=iw[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return iw[n]}var Sr={math:{},text:{}};function F(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",J="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";F(V,J,he,"≡","\\equiv",!0);F(V,J,he,"≺","\\prec",!0);F(V,J,he,"≻","\\succ",!0);F(V,J,he,"∼","\\sim",!0);F(V,J,he,"⊥","\\perp");F(V,J,he,"⪯","\\preceq",!0);F(V,J,he,"⪰","\\succeq",!0);F(V,J,he,"≃","\\simeq",!0);F(V,J,he,"∣","\\mid",!0);F(V,J,he,"≪","\\ll",!0);F(V,J,he,"≫","\\gg",!0);F(V,J,he,"≍","\\asymp",!0);F(V,J,he,"∥","\\parallel");F(V,J,he,"⋈","\\bowtie",!0);F(V,J,he,"⌣","\\smile",!0);F(V,J,he,"⊑","\\sqsubseteq",!0);F(V,J,he,"⊒","\\sqsupseteq",!0);F(V,J,he,"≐","\\doteq",!0);F(V,J,he,"⌢","\\frown",!0);F(V,J,he,"∋","\\ni",!0);F(V,J,he,"∝","\\propto",!0);F(V,J,he,"⊢","\\vdash",!0);F(V,J,he,"⊣","\\dashv",!0);F(V,J,he,"∋","\\owns");F(V,J,dm,".","\\ldotp");F(V,J,dm,"⋅","\\cdotp");F(V,J,dm,"⋅","·");F(He,J,ve,"⋅","·");F(V,J,ve,"#","\\#");F(He,J,ve,"#","\\#");F(V,J,ve,"&","\\&");F(He,J,ve,"&","\\&");F(V,J,ve,"ℵ","\\aleph",!0);F(V,J,ve,"∀","\\forall",!0);F(V,J,ve,"ℏ","\\hbar",!0);F(V,J,ve,"∃","\\exists",!0);F(V,J,ve,"∇","\\nabla",!0);F(V,J,ve,"♭","\\flat",!0);F(V,J,ve,"ℓ","\\ell",!0);F(V,J,ve,"♮","\\natural",!0);F(V,J,ve,"♣","\\clubsuit",!0);F(V,J,ve,"℘","\\wp",!0);F(V,J,ve,"♯","\\sharp",!0);F(V,J,ve,"♢","\\diamondsuit",!0);F(V,J,ve,"ℜ","\\Re",!0);F(V,J,ve,"♡","\\heartsuit",!0);F(V,J,ve,"ℑ","\\Im",!0);F(V,J,ve,"♠","\\spadesuit",!0);F(V,J,ve,"§","\\S",!0);F(He,J,ve,"§","\\S");F(V,J,ve,"¶","\\P",!0);F(He,J,ve,"¶","\\P");F(V,J,ve,"†","\\dag");F(He,J,ve,"†","\\dag");F(He,J,ve,"†","\\textdagger");F(V,J,ve,"‡","\\ddag");F(He,J,ve,"‡","\\ddag");F(He,J,ve,"‡","\\textdaggerdbl");F(V,J,ui,"⎱","\\rmoustache",!0);F(V,J,na,"⎰","\\lmoustache",!0);F(V,J,ui,"⟯","\\rgroup",!0);F(V,J,na,"⟮","\\lgroup",!0);F(V,J,dt,"∓","\\mp",!0);F(V,J,dt,"⊖","\\ominus",!0);F(V,J,dt,"⊎","\\uplus",!0);F(V,J,dt,"⊓","\\sqcap",!0);F(V,J,dt,"∗","\\ast");F(V,J,dt,"⊔","\\sqcup",!0);F(V,J,dt,"◯","\\bigcirc",!0);F(V,J,dt,"∙","\\bullet",!0);F(V,J,dt,"‡","\\ddagger");F(V,J,dt,"≀","\\wr",!0);F(V,J,dt,"⨿","\\amalg");F(V,J,dt,"&","\\And");F(V,J,he,"⟵","\\longleftarrow",!0);F(V,J,he,"⇐","\\Leftarrow",!0);F(V,J,he,"⟸","\\Longleftarrow",!0);F(V,J,he,"⟶","\\longrightarrow",!0);F(V,J,he,"⇒","\\Rightarrow",!0);F(V,J,he,"⟹","\\Longrightarrow",!0);F(V,J,he,"↔","\\leftrightarrow",!0);F(V,J,he,"⟷","\\longleftrightarrow",!0);F(V,J,he,"⇔","\\Leftrightarrow",!0);F(V,J,he,"⟺","\\Longleftrightarrow",!0);F(V,J,he,"↦","\\mapsto",!0);F(V,J,he,"⟼","\\longmapsto",!0);F(V,J,he,"↗","\\nearrow",!0);F(V,J,he,"↩","\\hookleftarrow",!0);F(V,J,he,"↪","\\hookrightarrow",!0);F(V,J,he,"↘","\\searrow",!0);F(V,J,he,"↼","\\leftharpoonup",!0);F(V,J,he,"⇀","\\rightharpoonup",!0);F(V,J,he,"↙","\\swarrow",!0);F(V,J,he,"↽","\\leftharpoondown",!0);F(V,J,he,"⇁","\\rightharpoondown",!0);F(V,J,he,"↖","\\nwarrow",!0);F(V,J,he,"⇌","\\rightleftharpoons",!0);F(V,fe,he,"≮","\\nless",!0);F(V,fe,he,"","\\@nleqslant");F(V,fe,he,"","\\@nleqq");F(V,fe,he,"⪇","\\lneq",!0);F(V,fe,he,"≨","\\lneqq",!0);F(V,fe,he,"","\\@lvertneqq");F(V,fe,he,"⋦","\\lnsim",!0);F(V,fe,he,"⪉","\\lnapprox",!0);F(V,fe,he,"⊀","\\nprec",!0);F(V,fe,he,"⋠","\\npreceq",!0);F(V,fe,he,"⋨","\\precnsim",!0);F(V,fe,he,"⪹","\\precnapprox",!0);F(V,fe,he,"≁","\\nsim",!0);F(V,fe,he,"","\\@nshortmid");F(V,fe,he,"∤","\\nmid",!0);F(V,fe,he,"⊬","\\nvdash",!0);F(V,fe,he,"⊭","\\nvDash",!0);F(V,fe,he,"⋪","\\ntriangleleft");F(V,fe,he,"⋬","\\ntrianglelefteq",!0);F(V,fe,he,"⊊","\\subsetneq",!0);F(V,fe,he,"","\\@varsubsetneq");F(V,fe,he,"⫋","\\subsetneqq",!0);F(V,fe,he,"","\\@varsubsetneqq");F(V,fe,he,"≯","\\ngtr",!0);F(V,fe,he,"","\\@ngeqslant");F(V,fe,he,"","\\@ngeqq");F(V,fe,he,"⪈","\\gneq",!0);F(V,fe,he,"≩","\\gneqq",!0);F(V,fe,he,"","\\@gvertneqq");F(V,fe,he,"⋧","\\gnsim",!0);F(V,fe,he,"⪊","\\gnapprox",!0);F(V,fe,he,"⊁","\\nsucc",!0);F(V,fe,he,"⋡","\\nsucceq",!0);F(V,fe,he,"⋩","\\succnsim",!0);F(V,fe,he,"⪺","\\succnapprox",!0);F(V,fe,he,"≆","\\ncong",!0);F(V,fe,he,"","\\@nshortparallel");F(V,fe,he,"∦","\\nparallel",!0);F(V,fe,he,"⊯","\\nVDash",!0);F(V,fe,he,"⋫","\\ntriangleright");F(V,fe,he,"⋭","\\ntrianglerighteq",!0);F(V,fe,he,"","\\@nsupseteqq");F(V,fe,he,"⊋","\\supsetneq",!0);F(V,fe,he,"","\\@varsupsetneq");F(V,fe,he,"⫌","\\supsetneqq",!0);F(V,fe,he,"","\\@varsupsetneqq");F(V,fe,he,"⊮","\\nVdash",!0);F(V,fe,he,"⪵","\\precneqq",!0);F(V,fe,he,"⪶","\\succneqq",!0);F(V,fe,he,"","\\@nsubseteqq");F(V,fe,dt,"⊴","\\unlhd");F(V,fe,dt,"⊵","\\unrhd");F(V,fe,he,"↚","\\nleftarrow",!0);F(V,fe,he,"↛","\\nrightarrow",!0);F(V,fe,he,"⇍","\\nLeftarrow",!0);F(V,fe,he,"⇏","\\nRightarrow",!0);F(V,fe,he,"↮","\\nleftrightarrow",!0);F(V,fe,he,"⇎","\\nLeftrightarrow",!0);F(V,fe,he,"△","\\vartriangle");F(V,fe,ve,"ℏ","\\hslash");F(V,fe,ve,"▽","\\triangledown");F(V,fe,ve,"◊","\\lozenge");F(V,fe,ve,"Ⓢ","\\circledS");F(V,fe,ve,"®","\\circledR");F(He,fe,ve,"®","\\circledR");F(V,fe,ve,"∡","\\measuredangle",!0);F(V,fe,ve,"∄","\\nexists");F(V,fe,ve,"℧","\\mho");F(V,fe,ve,"Ⅎ","\\Finv",!0);F(V,fe,ve,"⅁","\\Game",!0);F(V,fe,ve,"‵","\\backprime");F(V,fe,ve,"▲","\\blacktriangle");F(V,fe,ve,"▼","\\blacktriangledown");F(V,fe,ve,"■","\\blacksquare");F(V,fe,ve,"⧫","\\blacklozenge");F(V,fe,ve,"★","\\bigstar");F(V,fe,ve,"∢","\\sphericalangle",!0);F(V,fe,ve,"∁","\\complement",!0);F(V,fe,ve,"ð","\\eth",!0);F(He,J,ve,"ð","ð");F(V,fe,ve,"╱","\\diagup");F(V,fe,ve,"╲","\\diagdown");F(V,fe,ve,"□","\\square");F(V,fe,ve,"□","\\Box");F(V,fe,ve,"◊","\\Diamond");F(V,fe,ve,"¥","\\yen",!0);F(He,fe,ve,"¥","\\yen",!0);F(V,fe,ve,"✓","\\checkmark",!0);F(He,fe,ve,"✓","\\checkmark");F(V,fe,ve,"ℶ","\\beth",!0);F(V,fe,ve,"ℸ","\\daleth",!0);F(V,fe,ve,"ℷ","\\gimel",!0);F(V,fe,ve,"ϝ","\\digamma",!0);F(V,fe,ve,"ϰ","\\varkappa");F(V,fe,na,"┌","\\@ulcorner",!0);F(V,fe,ui,"┐","\\@urcorner",!0);F(V,fe,na,"└","\\@llcorner",!0);F(V,fe,ui,"┘","\\@lrcorner",!0);F(V,fe,he,"≦","\\leqq",!0);F(V,fe,he,"⩽","\\leqslant",!0);F(V,fe,he,"⪕","\\eqslantless",!0);F(V,fe,he,"≲","\\lesssim",!0);F(V,fe,he,"⪅","\\lessapprox",!0);F(V,fe,he,"≊","\\approxeq",!0);F(V,fe,dt,"⋖","\\lessdot");F(V,fe,he,"⋘","\\lll",!0);F(V,fe,he,"≶","\\lessgtr",!0);F(V,fe,he,"⋚","\\lesseqgtr",!0);F(V,fe,he,"⪋","\\lesseqqgtr",!0);F(V,fe,he,"≑","\\doteqdot");F(V,fe,he,"≓","\\risingdotseq",!0);F(V,fe,he,"≒","\\fallingdotseq",!0);F(V,fe,he,"∽","\\backsim",!0);F(V,fe,he,"⋍","\\backsimeq",!0);F(V,fe,he,"⫅","\\subseteqq",!0);F(V,fe,he,"⋐","\\Subset",!0);F(V,fe,he,"⊏","\\sqsubset",!0);F(V,fe,he,"≼","\\preccurlyeq",!0);F(V,fe,he,"⋞","\\curlyeqprec",!0);F(V,fe,he,"≾","\\precsim",!0);F(V,fe,he,"⪷","\\precapprox",!0);F(V,fe,he,"⊲","\\vartriangleleft");F(V,fe,he,"⊴","\\trianglelefteq");F(V,fe,he,"⊨","\\vDash",!0);F(V,fe,he,"⊪","\\Vvdash",!0);F(V,fe,he,"⌣","\\smallsmile");F(V,fe,he,"⌢","\\smallfrown");F(V,fe,he,"≏","\\bumpeq",!0);F(V,fe,he,"≎","\\Bumpeq",!0);F(V,fe,he,"≧","\\geqq",!0);F(V,fe,he,"⩾","\\geqslant",!0);F(V,fe,he,"⪖","\\eqslantgtr",!0);F(V,fe,he,"≳","\\gtrsim",!0);F(V,fe,he,"⪆","\\gtrapprox",!0);F(V,fe,dt,"⋗","\\gtrdot");F(V,fe,he,"⋙","\\ggg",!0);F(V,fe,he,"≷","\\gtrless",!0);F(V,fe,he,"⋛","\\gtreqless",!0);F(V,fe,he,"⪌","\\gtreqqless",!0);F(V,fe,he,"≖","\\eqcirc",!0);F(V,fe,he,"≗","\\circeq",!0);F(V,fe,he,"≜","\\triangleq",!0);F(V,fe,he,"∼","\\thicksim");F(V,fe,he,"≈","\\thickapprox");F(V,fe,he,"⫆","\\supseteqq",!0);F(V,fe,he,"⋑","\\Supset",!0);F(V,fe,he,"⊐","\\sqsupset",!0);F(V,fe,he,"≽","\\succcurlyeq",!0);F(V,fe,he,"⋟","\\curlyeqsucc",!0);F(V,fe,he,"≿","\\succsim",!0);F(V,fe,he,"⪸","\\succapprox",!0);F(V,fe,he,"⊳","\\vartriangleright");F(V,fe,he,"⊵","\\trianglerighteq");F(V,fe,he,"⊩","\\Vdash",!0);F(V,fe,he,"∣","\\shortmid");F(V,fe,he,"∥","\\shortparallel");F(V,fe,he,"≬","\\between",!0);F(V,fe,he,"⋔","\\pitchfork",!0);F(V,fe,he,"∝","\\varpropto");F(V,fe,he,"◀","\\blacktriangleleft");F(V,fe,he,"∴","\\therefore",!0);F(V,fe,he,"∍","\\backepsilon");F(V,fe,he,"▶","\\blacktriangleright");F(V,fe,he,"∵","\\because",!0);F(V,fe,he,"⋘","\\llless");F(V,fe,he,"⋙","\\gggtr");F(V,fe,dt,"⊲","\\lhd");F(V,fe,dt,"⊳","\\rhd");F(V,fe,he,"≂","\\eqsim",!0);F(V,J,he,"⋈","\\Join");F(V,fe,he,"≑","\\Doteq",!0);F(V,fe,dt,"∔","\\dotplus",!0);F(V,fe,dt,"∖","\\smallsetminus");F(V,fe,dt,"⋒","\\Cap",!0);F(V,fe,dt,"⋓","\\Cup",!0);F(V,fe,dt,"⩞","\\doublebarwedge",!0);F(V,fe,dt,"⊟","\\boxminus",!0);F(V,fe,dt,"⊞","\\boxplus",!0);F(V,fe,dt,"⋇","\\divideontimes",!0);F(V,fe,dt,"⋉","\\ltimes",!0);F(V,fe,dt,"⋊","\\rtimes",!0);F(V,fe,dt,"⋋","\\leftthreetimes",!0);F(V,fe,dt,"⋌","\\rightthreetimes",!0);F(V,fe,dt,"⋏","\\curlywedge",!0);F(V,fe,dt,"⋎","\\curlyvee",!0);F(V,fe,dt,"⊝","\\circleddash",!0);F(V,fe,dt,"⊛","\\circledast",!0);F(V,fe,dt,"⋅","\\centerdot");F(V,fe,dt,"⊺","\\intercal",!0);F(V,fe,dt,"⋒","\\doublecap");F(V,fe,dt,"⋓","\\doublecup");F(V,fe,dt,"⊠","\\boxtimes",!0);F(V,fe,he,"⇢","\\dashrightarrow",!0);F(V,fe,he,"⇠","\\dashleftarrow",!0);F(V,fe,he,"⇇","\\leftleftarrows",!0);F(V,fe,he,"⇆","\\leftrightarrows",!0);F(V,fe,he,"⇚","\\Lleftarrow",!0);F(V,fe,he,"↞","\\twoheadleftarrow",!0);F(V,fe,he,"↢","\\leftarrowtail",!0);F(V,fe,he,"↫","\\looparrowleft",!0);F(V,fe,he,"⇋","\\leftrightharpoons",!0);F(V,fe,he,"↶","\\curvearrowleft",!0);F(V,fe,he,"↺","\\circlearrowleft",!0);F(V,fe,he,"↰","\\Lsh",!0);F(V,fe,he,"⇈","\\upuparrows",!0);F(V,fe,he,"↿","\\upharpoonleft",!0);F(V,fe,he,"⇃","\\downharpoonleft",!0);F(V,J,he,"⊶","\\origof",!0);F(V,J,he,"⊷","\\imageof",!0);F(V,fe,he,"⊸","\\multimap",!0);F(V,fe,he,"↭","\\leftrightsquigarrow",!0);F(V,fe,he,"⇉","\\rightrightarrows",!0);F(V,fe,he,"⇄","\\rightleftarrows",!0);F(V,fe,he,"↠","\\twoheadrightarrow",!0);F(V,fe,he,"↣","\\rightarrowtail",!0);F(V,fe,he,"↬","\\looparrowright",!0);F(V,fe,he,"↷","\\curvearrowright",!0);F(V,fe,he,"↻","\\circlearrowright",!0);F(V,fe,he,"↱","\\Rsh",!0);F(V,fe,he,"⇊","\\downdownarrows",!0);F(V,fe,he,"↾","\\upharpoonright",!0);F(V,fe,he,"⇂","\\downharpoonright",!0);F(V,fe,he,"⇝","\\rightsquigarrow",!0);F(V,fe,he,"⇝","\\leadsto");F(V,fe,he,"⇛","\\Rrightarrow",!0);F(V,fe,he,"↾","\\restriction");F(V,J,ve,"‘","`");F(V,J,ve,"$","\\$");F(He,J,ve,"$","\\$");F(He,J,ve,"$","\\textdollar");F(V,J,ve,"%","\\%");F(He,J,ve,"%","\\%");F(V,J,ve,"_","\\_");F(He,J,ve,"_","\\_");F(He,J,ve,"_","\\textunderscore");F(V,J,ve,"∠","\\angle",!0);F(V,J,ve,"∞","\\infty",!0);F(V,J,ve,"′","\\prime");F(V,J,ve,"△","\\triangle");F(V,J,ve,"Γ","\\Gamma",!0);F(V,J,ve,"Δ","\\Delta",!0);F(V,J,ve,"Θ","\\Theta",!0);F(V,J,ve,"Λ","\\Lambda",!0);F(V,J,ve,"Ξ","\\Xi",!0);F(V,J,ve,"Π","\\Pi",!0);F(V,J,ve,"Σ","\\Sigma",!0);F(V,J,ve,"Υ","\\Upsilon",!0);F(V,J,ve,"Φ","\\Phi",!0);F(V,J,ve,"Ψ","\\Psi",!0);F(V,J,ve,"Ω","\\Omega",!0);F(V,J,ve,"A","Α");F(V,J,ve,"B","Β");F(V,J,ve,"E","Ε");F(V,J,ve,"Z","Ζ");F(V,J,ve,"H","Η");F(V,J,ve,"I","Ι");F(V,J,ve,"K","Κ");F(V,J,ve,"M","Μ");F(V,J,ve,"N","Ν");F(V,J,ve,"O","Ο");F(V,J,ve,"P","Ρ");F(V,J,ve,"T","Τ");F(V,J,ve,"X","Χ");F(V,J,ve,"¬","\\neg",!0);F(V,J,ve,"¬","\\lnot");F(V,J,ve,"⊤","\\top");F(V,J,ve,"⊥","\\bot");F(V,J,ve,"∅","\\emptyset");F(V,fe,ve,"∅","\\varnothing");F(V,J,Bt,"α","\\alpha",!0);F(V,J,Bt,"β","\\beta",!0);F(V,J,Bt,"γ","\\gamma",!0);F(V,J,Bt,"δ","\\delta",!0);F(V,J,Bt,"ϵ","\\epsilon",!0);F(V,J,Bt,"ζ","\\zeta",!0);F(V,J,Bt,"η","\\eta",!0);F(V,J,Bt,"θ","\\theta",!0);F(V,J,Bt,"ι","\\iota",!0);F(V,J,Bt,"κ","\\kappa",!0);F(V,J,Bt,"λ","\\lambda",!0);F(V,J,Bt,"μ","\\mu",!0);F(V,J,Bt,"ν","\\nu",!0);F(V,J,Bt,"ξ","\\xi",!0);F(V,J,Bt,"ο","\\omicron",!0);F(V,J,Bt,"π","\\pi",!0);F(V,J,Bt,"ρ","\\rho",!0);F(V,J,Bt,"σ","\\sigma",!0);F(V,J,Bt,"τ","\\tau",!0);F(V,J,Bt,"υ","\\upsilon",!0);F(V,J,Bt,"ϕ","\\phi",!0);F(V,J,Bt,"χ","\\chi",!0);F(V,J,Bt,"ψ","\\psi",!0);F(V,J,Bt,"ω","\\omega",!0);F(V,J,Bt,"ε","\\varepsilon",!0);F(V,J,Bt,"ϑ","\\vartheta",!0);F(V,J,Bt,"ϖ","\\varpi",!0);F(V,J,Bt,"ϱ","\\varrho",!0);F(V,J,Bt,"ς","\\varsigma",!0);F(V,J,Bt,"φ","\\varphi",!0);F(V,J,dt,"∗","*",!0);F(V,J,dt,"+","+");F(V,J,dt,"−","-",!0);F(V,J,dt,"⋅","\\cdot",!0);F(V,J,dt,"∘","\\circ",!0);F(V,J,dt,"÷","\\div",!0);F(V,J,dt,"±","\\pm",!0);F(V,J,dt,"×","\\times",!0);F(V,J,dt,"∩","\\cap",!0);F(V,J,dt,"∪","\\cup",!0);F(V,J,dt,"∖","\\setminus",!0);F(V,J,dt,"∧","\\land");F(V,J,dt,"∨","\\lor");F(V,J,dt,"∧","\\wedge",!0);F(V,J,dt,"∨","\\vee",!0);F(V,J,ve,"√","\\surd");F(V,J,na,"⟨","\\langle",!0);F(V,J,na,"∣","\\lvert");F(V,J,na,"∥","\\lVert");F(V,J,ui,"?","?");F(V,J,ui,"!","!");F(V,J,ui,"⟩","\\rangle",!0);F(V,J,ui,"∣","\\rvert");F(V,J,ui,"∥","\\rVert");F(V,J,he,"=","=");F(V,J,he,":",":");F(V,J,he,"≈","\\approx",!0);F(V,J,he,"≅","\\cong",!0);F(V,J,he,"≥","\\ge");F(V,J,he,"≥","\\geq",!0);F(V,J,he,"←","\\gets");F(V,J,he,">","\\gt",!0);F(V,J,he,"∈","\\in",!0);F(V,J,he,"","\\@not");F(V,J,he,"⊂","\\subset",!0);F(V,J,he,"⊃","\\supset",!0);F(V,J,he,"⊆","\\subseteq",!0);F(V,J,he,"⊇","\\supseteq",!0);F(V,fe,he,"⊈","\\nsubseteq",!0);F(V,fe,he,"⊉","\\nsupseteq",!0);F(V,J,he,"⊨","\\models");F(V,J,he,"←","\\leftarrow",!0);F(V,J,he,"≤","\\le");F(V,J,he,"≤","\\leq",!0);F(V,J,he,"<","\\lt",!0);F(V,J,he,"→","\\rightarrow",!0);F(V,J,he,"→","\\to");F(V,fe,he,"≱","\\ngeq",!0);F(V,fe,he,"≰","\\nleq",!0);F(V,J,Vl," ","\\ ");F(V,J,Vl," ","\\space");F(V,J,Vl," ","\\nobreakspace");F(He,J,Vl," ","\\ ");F(He,J,Vl," "," ");F(He,J,Vl," ","\\space");F(He,J,Vl," ","\\nobreakspace");F(V,J,Vl,"","\\nobreak");F(V,J,Vl,"","\\allowbreak");F(V,J,dm,",",",");F(V,J,dm,";",";");F(V,fe,dt,"⊼","\\barwedge",!0);F(V,fe,dt,"⊻","\\veebar",!0);F(V,J,dt,"⊙","\\odot",!0);F(V,J,dt,"⊕","\\oplus",!0);F(V,J,dt,"⊗","\\otimes",!0);F(V,J,ve,"∂","\\partial",!0);F(V,J,dt,"⊘","\\oslash",!0);F(V,fe,dt,"⊚","\\circledcirc",!0);F(V,fe,dt,"⊡","\\boxdot",!0);F(V,J,dt,"△","\\bigtriangleup");F(V,J,dt,"▽","\\bigtriangledown");F(V,J,dt,"†","\\dagger");F(V,J,dt,"⋄","\\diamond");F(V,J,dt,"⋆","\\star");F(V,J,dt,"◃","\\triangleleft");F(V,J,dt,"▹","\\triangleright");F(V,J,na,"{","\\{");F(He,J,ve,"{","\\{");F(He,J,ve,"{","\\textbraceleft");F(V,J,ui,"}","\\}");F(He,J,ve,"}","\\}");F(He,J,ve,"}","\\textbraceright");F(V,J,na,"{","\\lbrace");F(V,J,ui,"}","\\rbrace");F(V,J,na,"[","\\lbrack",!0);F(He,J,ve,"[","\\lbrack",!0);F(V,J,ui,"]","\\rbrack",!0);F(He,J,ve,"]","\\rbrack",!0);F(V,J,na,"(","\\lparen",!0);F(V,J,ui,")","\\rparen",!0);F(He,J,ve,"<","\\textless",!0);F(He,J,ve,">","\\textgreater",!0);F(V,J,na,"⌊","\\lfloor",!0);F(V,J,ui,"⌋","\\rfloor",!0);F(V,J,na,"⌈","\\lceil",!0);F(V,J,ui,"⌉","\\rceil",!0);F(V,J,ve,"\\","\\backslash");F(V,J,ve,"∣","|");F(V,J,ve,"∣","\\vert");F(He,J,ve,"|","\\textbar",!0);F(V,J,ve,"∥","\\|");F(V,J,ve,"∥","\\Vert");F(He,J,ve,"∥","\\textbardbl");F(He,J,ve,"~","\\textasciitilde");F(He,J,ve,"\\","\\textbackslash");F(He,J,ve,"^","\\textasciicircum");F(V,J,he,"↑","\\uparrow",!0);F(V,J,he,"⇑","\\Uparrow",!0);F(V,J,he,"↓","\\downarrow",!0);F(V,J,he,"⇓","\\Downarrow",!0);F(V,J,he,"↕","\\updownarrow",!0);F(V,J,he,"⇕","\\Updownarrow",!0);F(V,J,is,"∐","\\coprod");F(V,J,is,"⋁","\\bigvee");F(V,J,is,"⋀","\\bigwedge");F(V,J,is,"⨄","\\biguplus");F(V,J,is,"⋂","\\bigcap");F(V,J,is,"⋃","\\bigcup");F(V,J,is,"∫","\\int");F(V,J,is,"∫","\\intop");F(V,J,is,"∬","\\iint");F(V,J,is,"∭","\\iiint");F(V,J,is,"∏","\\prod");F(V,J,is,"∑","\\sum");F(V,J,is,"⨂","\\bigotimes");F(V,J,is,"⨁","\\bigoplus");F(V,J,is,"⨀","\\bigodot");F(V,J,is,"∮","\\oint");F(V,J,is,"∯","\\oiint");F(V,J,is,"∰","\\oiiint");F(V,J,is,"⨆","\\bigsqcup");F(V,J,is,"∫","\\smallint");F(He,J,g_,"…","\\textellipsis");F(V,J,g_,"…","\\mathellipsis");F(He,J,g_,"…","\\ldots",!0);F(V,J,g_,"…","\\ldots",!0);F(V,J,g_,"⋯","\\@cdots",!0);F(V,J,g_,"⋱","\\ddots",!0);F(V,J,ve,"⋮","\\varvdots");F(He,J,ve,"⋮","\\varvdots");F(V,J,Cr,"ˊ","\\acute");F(V,J,Cr,"ˋ","\\grave");F(V,J,Cr,"¨","\\ddot");F(V,J,Cr,"~","\\tilde");F(V,J,Cr,"ˉ","\\bar");F(V,J,Cr,"˘","\\breve");F(V,J,Cr,"ˇ","\\check");F(V,J,Cr,"^","\\hat");F(V,J,Cr,"⃗","\\vec");F(V,J,Cr,"˙","\\dot");F(V,J,Cr,"˚","\\mathring");F(V,J,Bt,"","\\@imath");F(V,J,Bt,"","\\@jmath");F(V,J,ve,"ı","ı");F(V,J,ve,"ȷ","ȷ");F(He,J,ve,"ı","\\i",!0);F(He,J,ve,"ȷ","\\j",!0);F(He,J,ve,"ß","\\ss",!0);F(He,J,ve,"æ","\\ae",!0);F(He,J,ve,"œ","\\oe",!0);F(He,J,ve,"ø","\\o",!0);F(He,J,ve,"Æ","\\AE",!0);F(He,J,ve,"Œ","\\OE",!0);F(He,J,ve,"Ø","\\O",!0);F(He,J,Cr,"ˊ","\\'");F(He,J,Cr,"ˋ","\\`");F(He,J,Cr,"ˆ","\\^");F(He,J,Cr,"˜","\\~");F(He,J,Cr,"ˉ","\\=");F(He,J,Cr,"˘","\\u");F(He,J,Cr,"˙","\\.");F(He,J,Cr,"¸","\\c");F(He,J,Cr,"˚","\\r");F(He,J,Cr,"ˇ","\\v");F(He,J,Cr,"¨",'\\"');F(He,J,Cr,"˝","\\H");F(He,J,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};F(He,J,ve,"–","--",!0);F(He,J,ve,"–","\\textendash");F(He,J,ve,"—","---",!0);F(He,J,ve,"—","\\textemdash");F(He,J,ve,"‘","`",!0);F(He,J,ve,"‘","\\textquoteleft");F(He,J,ve,"’","'",!0);F(He,J,ve,"’","\\textquoteright");F(He,J,ve,"“","``",!0);F(He,J,ve,"“","\\textquotedblleft");F(He,J,ve,"”","''",!0);F(He,J,ve,"”","\\textquotedblright");F(V,J,ve,"°","\\degree",!0);F(He,J,ve,"°","\\degree");F(He,J,ve,"°","\\textdegree",!0);F(V,J,ve,"£","\\pounds");F(V,J,ve,"£","\\mathsterling",!0);F(He,J,ve,"£","\\pounds");F(He,J,ve,"£","\\textsterling",!0);F(V,fe,ve,"✠","\\maltese");F(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var aw=0;aw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new $b(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},P3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},kv={},Cv={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),F3(i,(x,S)=>{var v,b,w=q3(S),y=q3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},F3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof $b||n instanceof m_&&n.hasClass("enclosing")?n:null},H3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return H3(s[s.length-1],"right");if(t==="left")return H3(s[0],"left")}}return n},q3=function(n,t){if(!n)return null;t&&(n=H3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(kv[n.type]){var s=kv[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function U3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=P3[t].fontName;return JS(i,o,r)?P3[t].variant:null};function uw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||uw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Cv[n.type])return Cv[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=U3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=U3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=U3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Hb=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),qb=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Ub(e){var n=Gb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Gb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=qb(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=Fb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?Hb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Ev(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=qb(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=Hb(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=qb(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=Hb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Wb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Wb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Wb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Wb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var G3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(G3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=G3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===G3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},dw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},fw=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},W3=.008,t1={type:"kern",size:-1*W3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var H=M-S-y,q=Math.round(M*1e3),Y=_6t(d,Math.round(H*1e3)),G=new mu(d,Y),X=et(p/1e3),ee=et(q/1e3),I=new ql([G],{width:X,height:ee,viewBox:"0 0 "+p+" "+q}),L=gu([],[I],s);L.height=q/1e3,L.style.width=X,L.style.height=ee,$.push({type:"elem",elem:L})}else{if($.push(dw(_,m,i)),$.push(t1),l===null){var P=M-S-y+2*W3;$.push(fw(u,P,s))}else{var W=(M-S-y-C)/2+2*W3;$.push(fw(u,W,s)),$.push(t1),$.push(dw(l,m,i)),$.push(t1),$.push(fw(u,W,s))}$.push(t1),$.push(dw(o,m,i))}var U=s.havingBaseStyle(Yt.TEXT),te=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[te],U),Yt.TEXT,s,a)},hw=80,_w=.08,pw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+hw,n<1?i=1:n<1.4&&(i=.7),l=(1+a+_w)/i,u=(1+a)/i,o=pw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+hw)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+_w)/i,o=pw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+_w,u=n+a,_=Math.floor(1e3*n+a)+hw,o=pw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},V3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},mw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return V3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Vb(e,n){var t=Gb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Vb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Vb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Kb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Qb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ce;le=(oe=(ce=U)==null?void 0:ce.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),q.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Ub(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Ub(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Yb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Yb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Yb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Ev(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Wb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Ev(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=Ev(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=qb(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=Hb(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var gw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var K3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in K3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=q3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return Fb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return Fb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var vw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},bw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(bw.hasOwnProperty(e.text)){var t=bw[e.text].className||"";if(e.mode==="text"){var r=Fb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(vw.hasOwnProperty(e.text))return Ge(["mspace",vw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(bw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(vw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r + ]`,CSt="\\\\[a-zA-Z@]+",ESt="\\\\[^\uD800-\uDFFF]",NSt="("+CSt+")"+aP+"*",zSt=`\\\\( |[ \r ]+ -?)[ \r ]*`,V3="[̀-ͯ]",rSt=new RegExp(V3+"+$"),sSt="("+nP+"+)|"+(nSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(V3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(V3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+tSt)+("|"+eSt+")");class PT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(sSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Qi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Qi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Qi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class iSt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var aSt=G$;ie("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ie("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ie("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ie("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ie("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ie("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ie("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var FT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ie("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=FT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=FT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ie("\\newcommand",e=>ok(e,!1,!0,!1));ie("\\renewcommand",e=>ok(e,!0,!1,!1));ie("\\providecommand",e=>ok(e,!0,!0,!0));ie("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ie("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ie("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ie("\\bgroup","{");ie("\\egroup","}");ie("~","\\nobreakspace");ie("\\lq","`");ie("\\rq","'");ie("\\aa","\\r a");ie("\\AA","\\r A");ie("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ie("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ie("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ie("ℬ","\\mathscr{B}");ie("ℰ","\\mathscr{E}");ie("ℱ","\\mathscr{F}");ie("ℋ","\\mathscr{H}");ie("ℐ","\\mathscr{I}");ie("ℒ","\\mathscr{L}");ie("ℳ","\\mathscr{M}");ie("ℛ","\\mathscr{R}");ie("ℭ","\\mathfrak{C}");ie("ℌ","\\mathfrak{H}");ie("ℨ","\\mathfrak{Z}");ie("\\Bbbk","\\Bbb{k}");ie("\\llap","\\mathllap{\\textrm{#1}}");ie("\\rlap","\\mathrlap{\\textrm{#1}}");ie("\\clap","\\mathclap{\\textrm{#1}}");ie("\\mathstrut","\\vphantom{(}");ie("\\underbar","\\underline{\\text{#1}}");ie("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ie("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ie("\\ne","\\neq");ie("≠","\\neq");ie("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ie("∉","\\notin");ie("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ie("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ie("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ie("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ie("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ie("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ie("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ie("⟂","\\perp");ie("‼","\\mathclose{!\\mkern-0.8mu!}");ie("∌","\\notni");ie("⌜","\\ulcorner");ie("⌝","\\urcorner");ie("⌞","\\llcorner");ie("⌟","\\lrcorner");ie("©","\\copyright");ie("®","\\textregistered");ie("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ie("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ie("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ie("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ie("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ie("⋮","\\vdots");ie("\\varGamma","\\mathit{\\Gamma}");ie("\\varDelta","\\mathit{\\Delta}");ie("\\varTheta","\\mathit{\\Theta}");ie("\\varLambda","\\mathit{\\Lambda}");ie("\\varXi","\\mathit{\\Xi}");ie("\\varPi","\\mathit{\\Pi}");ie("\\varSigma","\\mathit{\\Sigma}");ie("\\varUpsilon","\\mathit{\\Upsilon}");ie("\\varPhi","\\mathit{\\Phi}");ie("\\varPsi","\\mathit{\\Psi}");ie("\\varOmega","\\mathit{\\Omega}");ie("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ie("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ie("\\boxed","\\fbox{$\\displaystyle{#1}$}");ie("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ie("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ie("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ie("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ie("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var HT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},oSt=new Set(["bin","rel"]);ie("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in HT?n=HT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&oSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var lk={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ie("\\dotso",function(e){var n=e.future().text;return n in lk?"\\ldots\\,":"\\ldots"});ie("\\dotsc",function(e){var n=e.future().text;return n in lk&&n!==","?"\\ldots\\,":"\\ldots"});ie("\\cdots",function(e){var n=e.future().text;return n in lk?"\\@cdots\\,":"\\@cdots"});ie("\\dotsb","\\cdots");ie("\\dotsm","\\cdots");ie("\\dotsi","\\!\\cdots");ie("\\dotsx","\\ldots\\,");ie("\\DOTSI","\\relax");ie("\\DOTSB","\\relax");ie("\\DOTSX","\\relax");ie("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ie("\\,","\\tmspace+{3mu}{.1667em}");ie("\\thinspace","\\,");ie("\\>","\\mskip{4mu}");ie("\\:","\\tmspace+{4mu}{.2222em}");ie("\\medspace","\\:");ie("\\;","\\tmspace+{5mu}{.2777em}");ie("\\thickspace","\\;");ie("\\!","\\tmspace-{3mu}{.1667em}");ie("\\negthinspace","\\!");ie("\\negmedspace","\\tmspace-{4mu}{.2222em}");ie("\\negthickspace","\\tmspace-{5mu}{.277em}");ie("\\enspace","\\kern.5em ");ie("\\enskip","\\hskip.5em\\relax");ie("\\quad","\\hskip1em\\relax");ie("\\qquad","\\hskip2em\\relax");ie("\\tag","\\@ifstar\\tag@literal\\tag@paren");ie("\\tag@paren","\\tag@literal{({#1})}");ie("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ie("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ie("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ie("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ie("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ie("\\newline","\\\\\\relax");ie("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var rP=et(To["Main-Regular"][84][1]-.7*To["Main-Regular"][65][1]);ie("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+rP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ie("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+rP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ie("\\hspace","\\@ifstar\\@hspacer\\@hspace");ie("\\@hspace","\\hskip #1\\relax");ie("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ie("\\ordinarycolon",":");ie("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ie("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ie("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ie("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ie("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ie("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ie("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ie("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ie("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ie("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ie("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ie("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ie("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ie("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ie("∷","\\dblcolon");ie("∹","\\eqcolon");ie("≔","\\coloneqq");ie("≕","\\eqqcolon");ie("⩴","\\Coloneqq");ie("\\ratio","\\vcentcolon");ie("\\coloncolon","\\dblcolon");ie("\\colonequals","\\coloneqq");ie("\\coloncolonequals","\\Coloneqq");ie("\\equalscolon","\\eqqcolon");ie("\\equalscoloncolon","\\Eqqcolon");ie("\\colonminus","\\coloneq");ie("\\coloncolonminus","\\Coloneq");ie("\\minuscolon","\\eqcolon");ie("\\minuscoloncolon","\\Eqcolon");ie("\\coloncolonapprox","\\Colonapprox");ie("\\coloncolonsim","\\Colonsim");ie("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ie("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ie("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ie("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ie("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ie("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ie("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ie("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ie("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ie("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ie("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ie("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ie("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ie("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ie("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ie("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ie("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ie("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ie("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ie("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ie("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ie("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ie("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ie("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ie("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ie("\\imath","\\html@mathml{\\@imath}{ı}");ie("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ie("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ie("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ie("⟦","\\llbracket");ie("⟧","\\rrbracket");ie("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ie("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ie("⦃","\\lBrace");ie("⦄","\\rBrace");ie("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ie("⦵","\\minuso");ie("\\darr","\\downarrow");ie("\\dArr","\\Downarrow");ie("\\Darr","\\Downarrow");ie("\\lang","\\langle");ie("\\rang","\\rangle");ie("\\uarr","\\uparrow");ie("\\uArr","\\Uparrow");ie("\\Uarr","\\Uparrow");ie("\\N","\\mathbb{N}");ie("\\R","\\mathbb{R}");ie("\\Z","\\mathbb{Z}");ie("\\alef","\\aleph");ie("\\alefsym","\\aleph");ie("\\Alpha","\\mathrm{A}");ie("\\Beta","\\mathrm{B}");ie("\\bull","\\bullet");ie("\\Chi","\\mathrm{X}");ie("\\clubs","\\clubsuit");ie("\\cnums","\\mathbb{C}");ie("\\Complex","\\mathbb{C}");ie("\\Dagger","\\ddagger");ie("\\diamonds","\\diamondsuit");ie("\\empty","\\emptyset");ie("\\Epsilon","\\mathrm{E}");ie("\\Eta","\\mathrm{H}");ie("\\exist","\\exists");ie("\\harr","\\leftrightarrow");ie("\\hArr","\\Leftrightarrow");ie("\\Harr","\\Leftrightarrow");ie("\\hearts","\\heartsuit");ie("\\image","\\Im");ie("\\infin","\\infty");ie("\\Iota","\\mathrm{I}");ie("\\isin","\\in");ie("\\Kappa","\\mathrm{K}");ie("\\larr","\\leftarrow");ie("\\lArr","\\Leftarrow");ie("\\Larr","\\Leftarrow");ie("\\lrarr","\\leftrightarrow");ie("\\lrArr","\\Leftrightarrow");ie("\\Lrarr","\\Leftrightarrow");ie("\\Mu","\\mathrm{M}");ie("\\natnums","\\mathbb{N}");ie("\\Nu","\\mathrm{N}");ie("\\Omicron","\\mathrm{O}");ie("\\plusmn","\\pm");ie("\\rarr","\\rightarrow");ie("\\rArr","\\Rightarrow");ie("\\Rarr","\\Rightarrow");ie("\\real","\\Re");ie("\\reals","\\mathbb{R}");ie("\\Reals","\\mathbb{R}");ie("\\Rho","\\mathrm{P}");ie("\\sdot","\\cdot");ie("\\sect","\\S");ie("\\spades","\\spadesuit");ie("\\sub","\\subset");ie("\\sube","\\subseteq");ie("\\supe","\\supseteq");ie("\\Tau","\\mathrm{T}");ie("\\thetasym","\\vartheta");ie("\\weierp","\\wp");ie("\\Zeta","\\mathrm{Z}");ie("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ie("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ie("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ie("\\bra","\\mathinner{\\langle{#1}|}");ie("\\ket","\\mathinner{|{#1}\\rangle}");ie("\\braket","\\mathinner{\\langle{#1}\\rangle}");ie("\\Bra","\\left\\langle#1\\right|");ie("\\Ket","\\left|#1\\right\\rangle");var sP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ie("\\bra@ket",sP(!1));ie("\\bra@set",sP(!0));ie("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ie("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ie("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ie("\\angln","{\\angl n}");ie("\\blue","\\textcolor{##6495ed}{#1}");ie("\\orange","\\textcolor{##ffa500}{#1}");ie("\\pink","\\textcolor{##ff00af}{#1}");ie("\\red","\\textcolor{##df0030}{#1}");ie("\\green","\\textcolor{##28ae7b}{#1}");ie("\\gray","\\textcolor{gray}{#1}");ie("\\purple","\\textcolor{##9d38bd}{#1}");ie("\\blueA","\\textcolor{##ccfaff}{#1}");ie("\\blueB","\\textcolor{##80f6ff}{#1}");ie("\\blueC","\\textcolor{##63d9ea}{#1}");ie("\\blueD","\\textcolor{##11accd}{#1}");ie("\\blueE","\\textcolor{##0c7f99}{#1}");ie("\\tealA","\\textcolor{##94fff5}{#1}");ie("\\tealB","\\textcolor{##26edd5}{#1}");ie("\\tealC","\\textcolor{##01d1c1}{#1}");ie("\\tealD","\\textcolor{##01a995}{#1}");ie("\\tealE","\\textcolor{##208170}{#1}");ie("\\greenA","\\textcolor{##b6ffb0}{#1}");ie("\\greenB","\\textcolor{##8af281}{#1}");ie("\\greenC","\\textcolor{##74cf70}{#1}");ie("\\greenD","\\textcolor{##1fab54}{#1}");ie("\\greenE","\\textcolor{##0d923f}{#1}");ie("\\goldA","\\textcolor{##ffd0a9}{#1}");ie("\\goldB","\\textcolor{##ffbb71}{#1}");ie("\\goldC","\\textcolor{##ff9c39}{#1}");ie("\\goldD","\\textcolor{##e07d10}{#1}");ie("\\goldE","\\textcolor{##a75a05}{#1}");ie("\\redA","\\textcolor{##fca9a9}{#1}");ie("\\redB","\\textcolor{##ff8482}{#1}");ie("\\redC","\\textcolor{##f9685d}{#1}");ie("\\redD","\\textcolor{##e84d39}{#1}");ie("\\redE","\\textcolor{##bc2612}{#1}");ie("\\maroonA","\\textcolor{##ffbde0}{#1}");ie("\\maroonB","\\textcolor{##ff92c6}{#1}");ie("\\maroonC","\\textcolor{##ed5fa6}{#1}");ie("\\maroonD","\\textcolor{##ca337c}{#1}");ie("\\maroonE","\\textcolor{##9e034e}{#1}");ie("\\purpleA","\\textcolor{##ddd7ff}{#1}");ie("\\purpleB","\\textcolor{##c6b9fc}{#1}");ie("\\purpleC","\\textcolor{##aa87ff}{#1}");ie("\\purpleD","\\textcolor{##7854ab}{#1}");ie("\\purpleE","\\textcolor{##543b78}{#1}");ie("\\mintA","\\textcolor{##f5f9e8}{#1}");ie("\\mintB","\\textcolor{##edf2df}{#1}");ie("\\mintC","\\textcolor{##e0e5cc}{#1}");ie("\\grayA","\\textcolor{##f6f7f7}{#1}");ie("\\grayB","\\textcolor{##f0f1f2}{#1}");ie("\\grayC","\\textcolor{##e3e5e6}{#1}");ie("\\grayD","\\textcolor{##d6d8da}{#1}");ie("\\grayE","\\textcolor{##babec2}{#1}");ie("\\grayF","\\textcolor{##888d93}{#1}");ie("\\grayG","\\textcolor{##626569}{#1}");ie("\\grayH","\\textcolor{##3b3e40}{#1}");ie("\\grayI","\\textcolor{##21242c}{#1}");ie("\\kaBlue","\\textcolor{##314453}{#1}");ie("\\kaGreen","\\textcolor{##71B307}{#1}");var iP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class lSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new iSt(aSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new PT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Qi("EOF",r.loc)),this.pushTokens(s),new Qi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Qi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new PT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||iP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var qT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,t1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),bw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},UT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Yb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new lSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Qi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Yb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(f$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=WT(e,"(");let i=WT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function cP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Db(t))&&(!n||t!==47)}uP.peek=FSt;function MSt(){this.buffer()}function DSt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LSt(){this.buffer()}function OSt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ISt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function BSt(e){this.exit(e)}function $St(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function PSt(e){this.exit(e)}function FSt(){return"["}function uP(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function HSt(){return{enter:{gfmFootnoteCallString:MSt,gfmFootnoteCall:DSt,gfmFootnoteDefinitionLabelString:LSt,gfmFootnoteDefinition:OSt},exit:{gfmFootnoteCallString:ISt,gfmFootnoteCall:BSt,gfmFootnoteDefinitionLabelString:$St,gfmFootnoteDefinition:PSt}}}function qSt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:uP},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?dP:USt))),u(),l}}function USt(e,n,t){return n===0?e:dP(e,n,t)}function dP(e,n,t){return(t?"":" ")+e}const GSt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fP.peek=YSt;function WSt(){return{canContainEols:["delete"],enter:{strikethrough:KSt},exit:{strikethrough:QSt}}}function VSt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GSt}],handlers:{delete:fP}}}function KSt(e){this.enter({type:"delete",children:[]},e)}function QSt(e){this.exit(e)}function fP(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function YSt(){return"~"}function XSt(e){return e.length}function ZSt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||XSt,i=[],a=[],o=[],l=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++bl[b])&&(l[b]=y)}S.push(w)}a[_]=S,o[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dl[d]&&(l[d]=w),m[d]=w),p[d]=y}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),tkt);return s(),a}function tkt(e,n,t){return">"+(t?"":" ")+e}function nkt(e,n){return KT(e,n.inConstruct,!0)&&!KT(e,n.notInConstruct,!1)}function KT(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function rkt(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function skt(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function ikt(e,n,t,r){const s=skt(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(rkt(e,t)){const d=t.enter("codeIndented"),p=t.indentLines(i,akt);return d(),p}const o=t.createTracker(r),l=s.repeat(Math.max(hP(i,s)+1,3)),u=t.enter("codeFenced");let _=o.move(l);if(e.lang){const d=t.enter(`codeFencedLang${a}`);_+=o.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=t.enter(`codeFencedMeta${a}`);_+=o.move(" "),_+=o.move(t.safe(e.meta,{before:_,after:` +?)[ \r ]*`,Q3="[̀-ͯ]",jSt=new RegExp(Q3+"+$"),TSt="("+aP+"+)|"+(zSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Q3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Q3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+NSt)+("|"+ESt+")");class HT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(TSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Yi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Yi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class ASt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var RSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var qT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=qT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=qT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},MSt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in UT?n=UT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&MSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new ASt(RSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new HT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new HT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var GT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),yw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Xb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new DSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Xb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Lb(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?pP:mkt))),u(),l}}function mkt(e,n,t){return n===0?e:pP(e,n,t)}function pP(e,n,t){return(t?"":" ")+e}const gkt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mP.peek=wkt;function vkt(){return{canContainEols:["delete"],enter:{strikethrough:ykt},exit:{strikethrough:xkt}}}function bkt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gkt}],handlers:{delete:mP}}}function ykt(e){this.enter({type:"delete",children:[]},e)}function xkt(e){this.exit(e)}function mP(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function wkt(){return"~"}function Skt(e){return e.length}function kkt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||Skt,i=[],a=[],o=[],l=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++bl[b])&&(l[b]=y)}S.push(w)}a[_]=S,o[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dl[d]&&(l[d]=w),m[d]=w),p[d]=y}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),Nkt);return s(),a}function Nkt(e,n,t){return">"+(t?"":" ")+e}function zkt(e,n){return YT(e,n.inConstruct,!0)&&!YT(e,n.notInConstruct,!1)}function YT(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function jkt(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Tkt(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Akt(e,n,t,r){const s=Tkt(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(jkt(e,t)){const d=t.enter("codeIndented"),p=t.indentLines(i,Rkt);return d(),p}const o=t.createTracker(r),l=s.repeat(Math.max(gP(i,s)+1,3)),u=t.enter("codeFenced");let _=o.move(l);if(e.lang){const d=t.enter(`codeFencedLang${a}`);_+=o.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=t.enter(`codeFencedMeta${a}`);_+=o.move(" "),_+=o.move(t.safe(e.meta,{before:_,after:` `,encode:["`"],...o.current()})),d()}return _+=o.move(` `),i&&(_+=o.move(i+` -`)),_+=o.move(l),u(),_}function akt(e,n,t){return(t?"":" ")+e}function dk(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function okt(e,n,t,r){const s=dk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("definition");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("[");return u+=l.move(t.safe(t.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":` -`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function lkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function vp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ev(e,n,t){const r=Vh(e),s=Vh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_P.peek=ckt;function _P(e,n,t,r){const s=lkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=Ev(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=vp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Ev(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+vp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function ckt(e,n,t){return t.options.emphasis||"*"}function ukt(e,n){let t=!1;return BS(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,y3}),!!((!e.depth||e.depth<3)&&US(e)&&(n.options.setext||t))}function dkt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(ukt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` +`)),_+=o.move(l),u(),_}function Rkt(e,n,t){return(t?"":" ")+e}function fk(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Mkt(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("definition");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("[");return u+=l.move(t.safe(t.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":` +`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function Dkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function bp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Nv(e,n,t){const r=Kh(e),s=Kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vP.peek=Lkt;function vP(e,n,t,r){const s=Dkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=Nv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Nv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Lkt(e,n,t){return t.options.emphasis||"*"}function Okt(e,n){let t=!1;return $S(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,w3}),!!((!e.depth||e.depth<3)&&GS(e)&&(n.options.setext||t))}function Ikt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Okt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` `,after:` `});return d(),_(),p+` `+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` `))+1))}const a="#".repeat(s),o=t.enter("headingAtx"),l=t.enter("phrasing");i.move(a+" ");let u=t.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=vp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}pP.peek=fkt;function pP(e){return e.value||""}function fkt(){return"<"}mP.peek=hkt;function mP(e,n,t,r){const s=dk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function hkt(){return"!"}gP.peek=_kt;function gP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function _kt(){return"!"}vP.peek=pkt;function vP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}yP.peek=mkt;function yP(e,n,t,r){const s=dk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(bP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function mkt(e,n,t){return bP(e,t)?"<":"["}xP.peek=gkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function gkt(){return"["}function fk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function vkt(e){const n=fk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function bkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function wP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function ykt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?bkt(t):fk(t);const o=e.ordered?a==="."?")":".":vkt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),wP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Skt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const kkt=om(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ckt(e,n,t,r){return(e.children.some(function(a){return kkt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Ekt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}SP.peek=Nkt;function SP(e,n,t,r){const s=Ekt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=Ev(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=vp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Ev(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+vp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Nkt(e,n,t){return t.options.strong||"*"}function zkt(e,n,t,r){return t.safe(e.value,r)}function jkt(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function Tkt(e,n,t){const r=(wP(t)+(t.options.ruleSpaces?" ":"")).repeat(jkt(t));return t.options.ruleSpaces?r.slice(0,-1):r}const kP={blockquote:ekt,break:QT,code:ikt,definition:okt,emphasis:_P,hardBreak:QT,heading:dkt,html:pP,image:mP,imageReference:gP,inlineCode:vP,link:yP,linkReference:xP,list:ykt,listItem:wkt,paragraph:Skt,root:Ckt,strong:SP,text:zkt,thematicBreak:Tkt};function Akt(){return{enter:{table:Rkt,tableData:YT,tableHeader:YT,tableRow:Dkt},exit:{codeText:Lkt,table:Mkt,tableData:Sw,tableHeader:Sw,tableRow:Sw}}}function Rkt(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Mkt(e){this.exit(e),this.data.inTable=void 0}function Dkt(e){this.enter({type:"tableRow",children:[]},e)}function Sw(e){this.exit(e)}function YT(e){this.enter({type:"tableCell",children:[]},e)}function Lkt(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Okt));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Okt(e,n){return n==="|"?n:e}function Ikt(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=bp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}bP.peek=Bkt;function bP(e){return e.value||""}function Bkt(){return"<"}yP.peek=$kt;function yP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function $kt(){return"!"}xP.peek=Pkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pkt(){return"!"}wP.peek=Fkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Hkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Hkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=qkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function qkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ukt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Wkt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Gkt(t):hk(t);const o=e.ordered?a==="."?")":".":Ukt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Qkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Ykt=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xkt(e,n,t,r){return(e.children.some(function(a){return Ykt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zkt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=Jkt;function NP(e,n,t,r){const s=Zkt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=Nv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Nv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Jkt(e,n,t){return t.options.strong||"*"}function e7t(e,n,t,r){return t.safe(e.value,r)}function t7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(t7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Ekt,break:XT,code:Akt,definition:Mkt,emphasis:vP,hardBreak:XT,heading:Ikt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Wkt,listItem:Kkt,paragraph:Qkt,root:Xkt,strong:NP,text:e7t,thematicBreak:n7t};function r7t(){return{enter:{table:s7t,tableData:ZT,tableHeader:ZT,tableRow:a7t},exit:{codeText:o7t,table:i7t,tableData:kw,tableHeader:kw,tableRow:kw}}}function s7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function i7t(e){this.exit(e),this.data.inTable=void 0}function a7t(e){this.enter({type:"tableRow",children:[]},e)}function kw(e){this.exit(e)}function ZT(e){this.enter({type:"tableCell",children:[]},e)}function o7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function l7t(e,n){return n==="|"?n:e}function c7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:o}};function a(m,x,S,v){return u(_(m,S,v),m.align)}function o(m,x,S,v){const b=d(m,S,v),w=u([b]);return w.slice(0,w.indexOf(` -`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return ZSt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const t7t={tokenize:c7t,partial:!0};function n7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:a7t,continuation:{tokenize:o7t},exit:l7t}},text:{91:{name:"gfmFootnoteCall",tokenize:i7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:r7t,resolveTo:s7t}}}}function r7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function s7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function i7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||ir(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return ir(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function a7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||ir(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return ir(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),_n(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function o7t(e,n,t){return e.check(cm,n,e.attempt(t7t,n,t))}function l7t(e){e.exit("gfmFootnoteDefinition")}function c7t(e,n,t){const r=this;return _n(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function u7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Vh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class d7t{constructor(){this.map=[]}add(n,t,r){f7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function f7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const H=r.events[B][1].type;if(H==="lineEnding"||H==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,U=$==="tableHead"||$==="tableRow"?N:l;return U===N&&r.parser.lazy[r.now().line]?t(O):U(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):wt(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):vn(O)?_n(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||ir(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,vn(O)?_n(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return vn(O)?_n(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||wt(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return vn(O)?_n(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||wt(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||wt(O)?(e.exit("tableRow"),n(O)):vn(O)?_n(e,T,"whitespace")(O):(e.enter("data"),z(O))}function z(O){return O===null||O===124||ir(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:z)}function M(O){return O===92||O===124?(e.consume(O),z):z(O)}}function m7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new d7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},th(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function ZT(e,n,t,r,s){const i=[],a=th(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function th(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const g7t={name:"tasklistCheck",tokenize:b7t};function v7t(){return{text:{91:g7t}}}function b7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return ir(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return wt(l)?n(l):vn(l)?e.check({tokenize:y7t},n,t)(l):t(l)}}function y7t(e,n,t){return _n(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function x7t(e){return FB([Wkt(),n7t(),u7t(e),_7t(),v7t()])}const w7t={};function MP(e){const n=this,t=e||w7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(x7t(t)),i.push(Hkt()),a.push(qkt(t))}function S7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function k7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,l){const u=i.value||"",_=o.createTracker(l),d="$".repeat(Math.max(hP(u,"$")+1,2)),p=o.enter("mathFlow");let m=_.move(d);if(i.meta){const x=o.enter("mathFlowMeta");m+=_.move(o.safe(i.meta,{after:` +`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,H=$==="tableHead"||$==="tableRow"?N:l;return H===N&&r.parser.lazy[r.now().line]?t(O):H(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,l){const u=i.value||"",_=o.createTracker(l),d="$".repeat(Math.max(gP(u,"$")+1,2)),p=o.enter("mathFlow");let m=_.move(d);if(i.meta){const x=o.enter("mathFlowMeta");m+=_.move(o.safe(i.meta,{after:` `,before:m,encode:["$"],..._.current()})),x()}return m+=_.move(` `),u&&(m+=_.move(u+` -`)),m+=_.move(d),p(),m}function r(i,a,o){let l=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const _="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++dt)return null;try{return jt.highlight(e,n).children}catch{return null}}function OP(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(OP)},n)}function M7t(e,n,t=3e5){var r;return((r=LP(e,n,t))==null?void 0:r.map(OP))??e}function IP(e,n,t=3e5){const r=LP(e,n,t);if(!r)return e.split(` +`)),m+=_.move(d),p(),m}function r(i,a,o){let l=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const _="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++dt)return null;try{return Tt.highlight(e,n).children}catch{return null}}function PP(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(PP)},n)}function iCt(e,n,t=3e5){var r;return((r=$P(e,n,t))==null?void 0:r.map(PP))??e}function FP(e,n,t=3e5){const r=$P(e,n,t);if(!r)return e.split(` `);const s=[];let i=[];const a=[];let o=0;const l=_=>{let d=_;for(let p=a.length-1;p>=0;p--)d=f.jsx("span",{className:a[p],children:d},o++);i.push(d)},u=_=>{var d;if(_.type==="text"){(_.value??"").split(` -`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&l(p)});return}_.type==="element"&&(a.push((((d=_.properties)==null?void 0:d.className)??[]).join(" ")),(_.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function BP(e){return Array.isArray(e)?e.length===0:e===""}const eA=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Xh(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function bp(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function Q3(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const l=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!l)break;r+=l[0].length,t+=l[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function D7t(e,n){const t=e[n];if(t!=="`"&&t!=="~"||bp(e,n)||Xh(e,n,t)<3)return!1;const r=e.lastIndexOf(` +`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&l(p)});return}_.type==="element"&&(a.push((((d=_.properties)==null?void 0:d.className)??[]).join(" ")),(_.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function HP(e){return Array.isArray(e)?e.length===0:e===""}const nA=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Zh(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function yp(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function X3(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const l=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!l)break;r+=l[0].length,t+=l[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function aCt(e,n){const t=e[n];if(t!=="`"&&t!=="~"||yp(e,n)||Zh(e,n,t)<3)return!1;const r=e.lastIndexOf(` `,n-1)+1,s=e.indexOf(` -`,n),i=e.slice(r,s===-1?e.length:s),a=Q3(i);return a.indentation<=3&&r+a.offset===n}function L7t(e,n){const t=e[n],r=Xh(e,n,t),s=e.lastIndexOf(` +`,n),i=e.slice(r,s===-1?e.length:s),a=X3(i);return a.indentation<=3&&r+a.offset===n}function oCt(e,n){const t=e[n],r=Zh(e,n,t),s=e.lastIndexOf(` `,n-1)+1,i=e.indexOf(` -`,n),a=Q3(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` +`,n),a=X3(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` `,n+r);if(o===-1)return e.length;for(o+=1;o=a.listIndent&&d.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return l===-1?e.length:l+1;if(l===-1)return e.length;o=l+1}return e.length}function O7t(e,n,t){const r=Xh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function B7t(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function P7t(e,{predictMath:n=!1}={}){const t=B7t(e),r=new Set,s=new Set;for(let u=0;u=a.listIndent&&d.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return l===-1?e.length:l+1;if(l===-1)return e.length;o=l+1}return e.length}function lCt(e,n,t){const r=Zh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function uCt(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function fCt(e,{predictMath:n=!1}={}){const t=uCt(e),r=new Set,s=new Set;for(let u=0;u`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),P7t(t,n)}function $P(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function q7t(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Ur(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=q7t(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const U7t=1e5;function G7t({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:n6(),"aria-label":$5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(cb,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:M7t(e,n,U7t)})})]})}function W7t(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function nA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=W7t(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:kw(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:kw(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sPP(e)}function K7t(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=i$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function sA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?SQ({path:Ne(e)}):e,...Ur(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(qO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(QO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function Q7t({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?BQ({id:Ne(e)}):fY({id:Ne(e)}),...Ur(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(L6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||NL()}),f.jsx(QO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const FP={singleDollarTextMath:!0},Y7t=PS().use(WS).use(MP).use(DP,FP).use(V7t).use(bv).use(K7t).use(lP);function X7t(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const HP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const l=i?p3(i[1]):null;return f.jsx(G7t,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},$o=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Qd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(sA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(Q7t,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&X7t(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(sA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...HP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx($3t,{content:$P(n,{predictMath:a}),processor:Y7t,components:o,predict:a})})}),iA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function Z7t({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(L6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?nAe({agent:Ne(n)}):ZTe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Ur(t),children:_Ae()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:TAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:iA,children:[f.jsx(Oe,{size:"small",onClick:()=>{m(""),d(!1)},children:aAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Oe,{size:"small",variant:"primary",onClick:S,children:[wAe(),f.jsx(FO,{size:13})]})]})]}):f.jsxs("div",{className:iA,children:[f.jsx(Oe,{size:"small",onClick:i,children:vAe()}),f.jsx(Oe,{size:"small",onClick:()=>d(!0),children:EAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:PTe()}),f.jsx(Oe,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":uAe(),onClick:()=>l(v=>!v),children:f.jsx(qo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(sr,{onClick:()=>{l(!1),r("bypassPermissions")},children:UTe()})})]}):f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>r(),children:KTe()})]})]})}function aA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:o||!i.trim(),children:o?ea():Ho()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Gwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function qP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const Nv="code-source-text",UP="code-source-wrap",GP="file-view-gutter text-right text-muted select-none";function WP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function VP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>IP(e,TS(i)),[e,i]),{ruleCh:p,codeCh:m}=WP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` -`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,z=e.slice(0,N)+" "+e.slice(T);n(z),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${Nv} ${UP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Nv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${GP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),BP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function KP({onClose:e,onSaved:n}){const t=Oft(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=gn({mutationFn:({content:y,previous:C})=>bdt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(Zrt())||m.current()};ib(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Pn(t.queryKey))return;Gr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Kn(ast(),"success")}catch(y){Kn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return no.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:ust()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Krt(),onClick:b,disabled:_,children:f.jsx(qr,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(Lt,{})," ",nst()]}):f.jsx(VP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Oe,{onClick:b,disabled:_,children:Ad()}),f.jsx(Oe,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?ea():Ho()})]})]})}),document.body)}const Po=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),J7t=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Xb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),pk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ll=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Y3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Wf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Cw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?s6():ZYe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:XGe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:GD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:A4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:fZe()}:{cls:"warn",variant:"warning",label:_L()}:{cls:"warn",variant:"warning",label:CKe()}}function e8t({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:i6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?EHe():r6()}):f.jsx(f.Fragment,{children:"—"})}function t8t(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),nb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:RGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Cw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Po,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Ft,{variant:Cw(o).variant,children:Cw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Oe,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Yp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:yqe()}),f.jsx("span",{className:"v",children:o.binPath??dHe()}),f.jsx("span",{className:"k",children:yL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:nqe()}),f.jsx("span",{className:"v",children:f.jsx(e8t,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?GZe():c6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:lQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:$Qe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:QHe()}),f.jsx("span",{className:"v",children:o.models.length>0?iL({count:Wt(o.models.length),models:new Intl.ListFormat(j()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):l6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:tm(o.agentNote)}),o.id==="opencode"&&f.jsx(oI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(Lt,{})," ",JUe()]})]})}function n8t({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Ft,{variant:"success",children:uUe()}):f.jsx(Ft,{variant:"error",children:QVe()}):f.jsx(Ft,{variant:"error",children:Jqe()}):f.jsx(Ft,{variant:"error",children:yWe()})}function r8t({onEditState:e}){var T;const n=gn({mutationFn:cdt}),t=PN(),r=ct(t),s=r.data??null,i=z=>{Gr(t.queryKey,M=>(typeof z=="function"?z(M??null):z)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=z=>{i(z),l(z.context??""),_(z.namespace)},w=R.useRef(null);R.useEffect(()=>{const z=w.current;w.current=s,s&&(!z||o===(z.context??"")&&u.trim()===z.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(z){Kn(z instanceof Error?z.message:String(z),"error")}finally{x(!1)}}}async function N(z){if(z.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:o_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Ft,{children:Yi()}):C?f.jsx(Ft,{children:DD()}):f.jsx(n8t,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Xb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[_Ue(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?WPe({context:Ne(s.currentContext)}):HPe()},...o&&!s.contexts.includes(o)?[{id:o,label:pHe({context:Ne(o)})}]:[],...s.contexts.map(z=>({id:z,label:z}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[xVe(),f.jsx(rs,{type:"text",value:u,disabled:d||m,onChange:z=>_(z.target.value),placeholder:BUe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Yi():Kp()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:d||m||y,children:d?ea():Ho()})]})]})]}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",Lqe()]})})}function s8t(){var y;const e=gn({mutationFn:C=>ddt(...C)}),n=FN(),t=ct(n),r=t.data??null,s=C=>{Gr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(Lt,{})," ",$qe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:o_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Ft,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?d6():Jv()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:lFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?fFe():kFe(),f.jsx(rs,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?mFe():zFe(),f.jsx(rs,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:yFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Yp()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?ea():Ho()})]})]})]})}const QP="rounded-sm border-border-strong bg-surface text-subtext",YP="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",i8t=5e3;function XP(e){const n=za(),t=e.map(a=>HN(a)),r=LG({queries:t.map(a=>({...a,refetchInterval:i8t}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Pn(n)&&Gr(HN(a).queryKey,{running:!0})}]}function a8t({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Ft,{className:YP,children:rL()})});if(e===void 0)return f.jsx(Ft,{className:QP,children:hL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Ft,{className:"rounded-sm",variant:"warning",children:sL()}):f.jsx(Ft,{className:"rounded-sm",variant:"success",children:Qp()}):f.jsx(Ft,{className:"rounded-sm",variant:"error",children:r.length===1?LFe({tool:Ne(r[0])}):$Fe()}):f.jsx(Ft,{className:"rounded-sm",variant:"error",children:u6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:Io(e.testedAt)})]})}function o8t({remote:e=!1}){const n=WL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=XP(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(z=>({...z,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Oe,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(XO,{size:14})," ",EL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(Lt,{})," ",mL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:GVe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,z=_===N.host,M=l[N.host]??!1,O=!e&&(z||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?zK({name:Ne(N.host)}):YK({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(qo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(a8t,{test:T,connecting:z&&!p,masterRunning:b[N.host]})}),f.jsx(Oe,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),z&&!p?C():y(N.host)},disabled:!z&&_!==null&&!p,children:z?p?Ui():Ad():(T==null?void 0:T.reachable)===!1?Ui():T?xL():a6()})]})]}),O&&(M||z)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!z&&(T==null?void 0:T.error)&&f.jsx(f0t,{host:N.host,transcript:T.error}),z&&f.jsx(k6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(U=>({...U,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(U=>({...U,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(KP,{onClose:()=>i(!1)})]})}function l8t({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Ft,{className:YP,children:rL()}):e===null?f.jsx(Ft,{className:QP,children:hL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Ft,{className:"rounded-sm",variant:"warning",children:sL()}):f.jsx(Ft,{className:"rounded-sm",variant:"success",children:Qp()}):f.jsx(Ft,{className:"rounded-sm",variant:"error",children:iVe()}):f.jsx(Ft,{className:"rounded-sm",variant:"error",children:dKe()}):f.jsx(Ft,{className:"rounded-sm",variant:"error",children:u6()})}function c8t({remote:e=!1}){var I;const n=gn({mutationFn:zdt}),t=Tft(),r=ct(t),s=r.data??null,i=L=>{Gr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,z]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,U]=XP(B);function H(){z(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},V=R.useRef(null);R.useEffect(()=>{const L=V.current;V.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Xb,children:y.error}),f.jsxs("form",{className:pk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[XWe(),f.jsx(Ld,{choices:[{id:"",label:IKe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),z(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Oe,{type:"button",onClick:()=>{E&&!T?(z(!1),N(!1)):H()},disabled:!o,title:o?void 0:FZe(),children:E?T?Ui():Ad():y?xL():a6()}),f.jsx("span",{role:"status",children:f.jsx(l8t,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[AQe(),f.jsx(rs,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:EN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[c6(),f.jsx(rs,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:EN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[nZe(),f.jsx(rs,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:Qqe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Oe,{variant:"primary",type:"submit",disabled:S||X||E,children:S?ea():Ho()})})]}),!e&&E&&f.jsx(k6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),U(o),z(!1),N(!1))},onError:L=>{z(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",LWe()]})})}function u8t(){var C;const e=gn({mutationFn:Tdt}),n=Aft(),t=ct(n),r=t.data??null,s=E=>{Gr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await Adt(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Xb,children:x.error}),f.jsxs("form",{className:pk,onSubmit:w,children:[f.jsxs("label",{children:[mWe(),f.jsx(rs,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[oGe(),": ",Ne(r.resolvedAddress)," · ",gL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{variant:"primary",type:"submit",disabled:l||b,children:l?ea():Ho()}),f.jsx(Oe,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:RXe()}),f.jsx(d8t,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[VQe(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",AWe()]})})}function d8t({test:e}){return e===null?null:e==="testing"?f.jsx(Ft,{children:OXe()}):e.reachable?f.jsx(Ft,{variant:"success",children:XQe()}):f.jsx(Ft,{variant:"error",children:u6()})}function f8t(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Ml(e.memBytes),r=e.gpus.length===0?null:Z$e({count:e.gpus.length});return[n,e.cpuCount>0?u$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function h8t({remote:e}){var p;const n=ct(Mft()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:J7t,children:[f.jsx("span",{className:"k",children:o_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Ft,{className:"gap-1.5",role:"status",children:[f.jsx(Lt,{}),u?DHe():Yi()]}):r?f.jsx(Ft,{variant:"warning",children:A4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Ft,{variant:"success",children:Qp()}):t.sshKeyStatus==="unknown"?f.jsx(Ft,{variant:"warning",children:A4()}):f.jsx(Ft,{variant:"warning",children:Jv()}):f.jsx(Ft,{variant:"warning",children:_L()}):null}),f.jsx("span",{className:"k",children:fQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:iXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Ft,{variant:"success",children:UKe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Ft,{variant:"warning",children:MKe()}):t.sshKeyStatus==="none_registered"?f.jsx(Ft,{variant:"error",children:pKe()}):f.jsx(Ft,{children:vL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:eFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(d0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Kn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[FHe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[oKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),PXe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:ZZe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[rKe()," ",f.jsx("code",{children:"ssh-add"}),sQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Oe,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Yi():Kp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Oe,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(Lt,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ZJe():wL()]})]})]})}const _8t={local:Gpe,ssh:dme,tinker:pme,hf:Ipe,modal:Qpe,k8s:Fpe,slurm:ome,ray:rme,openresearch:Jpe},Zb={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},oA=["hf","modal","slurm","ray","openresearch"],Ew=["hf","modal","openresearch"],ZP={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},X3=["tinker","hf","modal","ray","k8s"],p8t={tinker:fge,hf:ege,modal:sge,openresearch:lge},lA="__custom__";function g0(e,n){return!!(n&&!(ZP[e]??[]).includes(n))}function m8t({settings:e,projectId:n,onSaved:t}){const r=gn({mutationFn:Mdt}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=oA.includes(a),y=Ew.includes(a),C=ZP[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=p8t[a],z=p?utt():y&&!l.trim()?$Be({destination:N}):a==="ssh"?VFe():qFe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,U){const H=oA.includes($);if(!(p||Ew.includes($)&&!U.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:H&&U.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const U=e.targets.find(Y=>Y.id===$);if(!U)return;o(U.id);const H=U.id===s?i:"";u(H),d(g0(U.id,H)),Ew.includes(U.id)||M(U.id,H)}function B($){if($===lA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:GUe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const U=e.targets.find(H=>H.id===$.id);return U?f.jsx(u_,{kind:Zb[U.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:EUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":CN(),title:CN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(qo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?LBe():tHe()},...l&&!C.includes(l)?[{id:l,label:w$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:lA,label:TUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:KXe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:z}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function g8t({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?NBe():e.id==="openresearch"?wL():e.id==="ray"?a6():KJe();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":X3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:Zb[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:_8t[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?BPe():Ket()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:R$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?uL():e.configured?!r||X3.includes(e.id)?d6():xtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(E1,{size:16})})]})]})}function v8t({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(ap,{size:16})," ",lL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:Zb[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Ft,{className:"flex-none border-primary bg-primary-subtle text-primary",children:uL()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(o8t,{remote:r}),e.id==="slurm"&&f.jsx(c8t,{remote:r}),e.id==="openresearch"&&f.jsx(h8t,{remote:r})]})]})}function b8t({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(DPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:Zb[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:ev(),"aria-label":ev(),onClick:i,disabled:r.saving,children:f.jsx(qr,{size:14})})]}),e.id==="tinker"&&f.jsx(x8t,{target:e}),e.id==="hf"&&f.jsx(S8t,{}),e.id==="modal"&&f.jsx(s8t,{}),e.id==="ray"&&f.jsx(u8t,{}),e.id==="k8s"&&f.jsx(r8t,{onEditState:s})]})}function y8t({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=GL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Gr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=Rft(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(g8t,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?f8t(S):v??QUe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),z=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return z&&!X3.includes(z.id)?f.jsx(v8t,{target:z,isDefault:y===z.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:cL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:aUe()}),f.jsx(P8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(m8t,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:d6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:cVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),z&&f.jsx(b8t,{target:z,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",Aqe()]})]})}function x8t({target:e}){var w;const n=gn({mutationFn:ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=$N(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Gr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...$N(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(Lt,{})," ",Yi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:o_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Ft,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Qp():_.validationStatus==="invalid"?Uet():_.validationStatus==="billingRequired"?Oet():Jv()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:Ret()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:Pet()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?CJe():r6(),f.jsx(rs,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Yi():Kp()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?kL():Ho()})]})]})]})}function w8t({settings:e}){return e.validationStatus==="missing"?f.jsx(Ft,{variant:"warning",children:Jv()}):e.validationStatus==="invalid"?f.jsx(Ft,{variant:"error",children:fWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Ft,{variant:"success",children:Qp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Ft,{variant:"warning",children:JVe()}),f.jsx(w6,{content:uPe(),className:"text-subtext",children:f.jsx(R6,{size:15})})]}):null}function S8t(){var v;const e=gn({mutationFn:edt}),n=BN(),t=ct(n),r=t.data??null,s=b=>{Gr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...BN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:c6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:o_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(w8t,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Xb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:PGe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:aPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",$We()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?jJe():XFe(),f.jsx(rs,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??OGe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Oe,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Yi():Kp()]}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?kL():Ho()})]})]})]})}const JP=/^hf_[A-Za-z0-9]{10,}$/;function eF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[ZXe()," ",f.jsx("code",{children:"HF_TOKEN"}),IYe()]})})})}const cA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function Z3(e,n){const t=n instanceof Error?n.message:String(n);Kn(t.includes(e)?t:`${e}: ${t}`,"error")}function k8t({name:e,entry:n,onVars:t}){const r=gn({mutationFn:d=>OL(...d)}),s=gn({mutationFn:hdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){Z3(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){Z3(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Ft,{children:NQe()})]}):f.jsx(rs,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:bL(),"aria-label":zY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:S4({name:Ne(e)}),"aria-label":S4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Xd,{size:13})}):i.trim()&&f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o,children:o?ea():Ho()})})]}),!n&&e!=="HF_TOKEN"&&JP.test(i.trim())&&f.jsx(eF,{})]})}function C8t({onVars:e,onDone:n}){const t=gn({mutationFn:d=>OL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){Z3(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(rs,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":MVe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(rs,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:bL(),"aria-label":IVe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Oe,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?ea():Ho()}),f.jsx(Qt,{title:Ad(),"aria-label":Nqe(),onClick:n,disabled:o,children:f.jsx(qr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&JP.test(i.trim())&&f.jsx(eF,{})]})}function E8t(){var u;const e=Dft(),n=ct(e),t=n.data??null,r=_=>{Gr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!cA.includes(_)),l=[...cA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:EZe()}),f.jsxs(Oe,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(em,{size:12})," ",GHe()]})]}),f.jsx("div",{className:Po,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(k8t,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(C8t,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:zet,icon:rmt},{value:"light",label:ket,icon:Cmt},{value:"dark",label:met,icon:imt}],N8t=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function z8t(){const e=Qd(),[n,t]=nO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:lBe()}),f.jsxs("div",{className:`${Po} mt-3`,children:[f.jsxs("div",{className:`${Ll} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:LN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":LN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ll,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:YPe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:N8t,value:e,variant:"field",dropDown:!0,onSelect:s=>{cD(s)&&JL(s)}})})]})]})]})}const j8t={installer:Plt,"app-bundle":zlt,portable:Klt,cargo:Rlt,homebrew:Olt,nix:Ult,unknown:Zlt},Nw={cargo:nct,homebrew:act,nix:uct};function T8t(){var d;const e=gn({mutationFn:p=>adt(...p)}),{status:n,error:t,apply:r}=P6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=cI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:AN()}),t?f.jsx("div",{className:Po,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:AN()}),f.jsxs("div",{className:`${Po} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:yL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:kWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:fL()}),f.jsx("div",{className:"v",children:j8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ll,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:CYe()}),f.jsx("p",{children:l.error?jL({error:l.error}):IJe({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?TL():zL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ll,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:zN()}),f.jsxs("p",{children:[jVe(),n.envDisabled&&att()]})]}),f.jsx(x6,{type:"button",checked:n.autoUpdate,"aria-label":zN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ll,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?ntt({version:Ne(n.latest??"—")}):bBe()}),f.jsx("p",{children:n.updateAvailable?TPe():ABe()})]}),f.jsx(Oe,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>sdt().then(r)),children:s==="apply"?e6():n.updateAvailable?Zet():SBe()})]})]}):f.jsx("div",{className:Ll,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:mQe()}),f.jsx("p",{children:((d=Nw[n.channel])==null?void 0:d.call(Nw))??nJe()})]})}),n.channel==="app-bundle"&&f.jsx(R8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function A8t(){var d;const e=gn({mutationFn:Zdt}),n=Hft(),t=ct(n),r=t.data??null,s=p=>{Gr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:bZe()}),r?f.jsxs("div",{className:`${Po} mt-3`,children:[f.jsxs("div",{className:Ll,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[kN(),r.locked&&r.reason&&f.jsx(w6,{content:`${wUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(R6,{size:15})})]}),f.jsx("p",{children:FVe()})]}),f.jsx(x6,{type:"button",checked:r.enabled,"aria-label":kN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]})]})}function R8t({busy:e,disabled:n,run:t}){const r=gn({mutationFn:odt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ll,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:wPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?VBe({link:Ne(s.link)}):XBe({link:Ne(s.link)}),!s.onPath&&sBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:vPe({command:Ne("orx")})})]}),f.jsx(Oe,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?e6():a?xJe():s?aJe():_Pe()})]})}function M8t(){var p;const e=gn({mutationFn:m=>FL(...m)}),n=m6(),t=ct(n),r=t.data??null,s=m=>{Gr(n.queryKey,x=>(typeof m=="function"?m(x??null):m)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((p=t.error)==null?void 0:p.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const m=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([m,!0]).then(s).catch(x=>l(x instanceof Error?x.message:String(x))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:yGe()}),r?f.jsxs("div",{className:`${Po} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:kGe()}),f.jsx(Ft,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?nL():aL()})]}),f.jsxs("div",{className:Ll,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:NN()}),f.jsx("p",{children:MZe()})]}),f.jsx(x6,{type:"button",checked:r.githubForNewProjects,"aria-label":NN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(tF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]})]})}function tF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:tm(e?FJe():EPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(Hh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[tWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Oe,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Yi():Kp()})]})]})}function D8t(){var m,x,S;const e=gn({mutationFn:Put}),n=gn({mutationFn:Fut}),t=zgt(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Gr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Y3,children:[f.jsx("h3",{children:pL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:zGe()}),f.jsx("span",{className:"v",children:f.jsx(Ft,{variant:s?"success":"default",children:s===null?p?Ya():Yi():s?MN():T4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:IZe()}),s?f.jsx("div",{className:G0,children:f.jsx(Oe,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?RN():_Je()})}):f.jsx(aA,{save:DL,onSaved:v=>o(v.hasToken),placeholder:SQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:FYe()}),f.jsx("span",{className:"v",children:f.jsx(Ft,{variant:i?"success":"default",children:i===null?p?Ya():Yi():i?MN():T4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:GYe()}),i?f.jsx("div",{className:G0,children:f.jsx(Oe,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?RN():uJe()})}):f.jsx(aA,{save:v=>LL(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:N4(),createHref:"https://www.overleaf.com/project",createLabel:qze()}),p&&f.jsx("div",{className:"error",children:p})]})}function L8t({project:e,onProjectUpdate:n}){var T;const t=gn({mutationFn:z=>FL(...z)}),r={...Fft((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=z=>{Gr(r.queryKey,M=>(typeof z=="function"?z(M??null):z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((T=s.error)==null?void 0:T.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),w=!!(i!=null&&i.github.owner&&i.github.repo),y=async()=>{await s.refetch({cancelRefetch:!1})},C=z=>{const M=z instanceof Error?z.message:String(z);return M.toLowerCase().includes("archived")?P$e():M.includes("(fetch first)")||M.includes("non-fast-forward")?U$e():M.includes("403")||M.toLowerCase().includes("permission denied")?K$e():M},E=()=>{e&&(l(!0),_(null),Qdt(e.id).then(z=>{a(z.git),n(z.project),nt.fetchQuery(m6()).then(M=>{!M.githubForNewProjects&&!M.githubDefaultPromptSeen&&m(!0)}).catch(()=>{})}).catch(z=>_(C(z))).finally(()=>l(!1)))},N=z=>{S(!0),b(null),t.mutateAsync([z,!0]).then(()=>m(!1)).catch(M=>b(M instanceof Error?M.message:String(M))).finally(()=>S(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:xYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:MJe({project:(e==null?void 0:e.name)??v$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Y3,children:[f.jsx("h3",{children:VWe()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:LQe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??qD()}),f.jsx("span",{className:"k",children:hXe()}),f.jsx("span",{className:"v",children:i.initialized?O$e({branch:Ne(i.currentBranch??o6()),state:i.clean?qBe():nPe()}):bHe()}),f.jsx("span",{className:"k",children:mqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:gYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(z=>`${z.name}: ${z.url}`).join(" · "):l6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Oe,{variant:"primary",onClick:()=>void Kdt(e.id).then(a).catch(z=>_(String(z))),children:UGe()})})]}),f.jsxs("div",{className:Y3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:oL()}),f.jsx("span",{className:"v",children:f.jsx(Ft,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?nL():aL()})}),f.jsx("span",{className:"k",children:qQe()}),f.jsx("span",{className:"v",children:w?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Ft,{children:zXe()})]}):f.jsx(Ft,{children:qWe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:kXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(tF,{ghInstalled:i.github.ghInstalled,onCheck:()=>y()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:w?_tt():_$e()}),f.jsxs("div",{className:G0,children:[w&&i.github.url&&f.jsxs(Hh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[TN()," ",f.jsx(Md,{size:12})]}),f.jsx(Oe,{variant:"primary",disabled:o,onClick:E,children:o?oIe():rIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:rGe()}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(Hh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[TN()," ",f.jsx(Md,{size:12})]}),f.jsx(Oe,{disabled:o,onClick:()=>{l(!0),Ydt(e.id).then(z=>{a(z.git),n(z.project)}).catch(z=>_(z instanceof Error?z.message:String(z))).finally(()=>l(!1))},children:o?dIe():JOe()})]})]})]}),f.jsx(D8t,{}),d&&f.jsx("div",{className:"error",children:C(d)})]}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]}):f.jsx("div",{className:Po,children:f.jsx("p",{className:Ca,children:KKe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>N(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:z=>z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:tVe()}),f.jsx("p",{children:UXe()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Oe,{disabled:x,onClick:()=>N(!1),children:jKe()}),f.jsx(Oe,{variant:"primary",disabled:x,onClick:()=>N(!0),children:x?ea():sFe()})]})]})})]})}const O8t={env:Ait,config:Lit,xdg:$it,default:Nit},zw={preparing:bit,copying:Qst,verifying:qit,finalizing:Jst},I8t=e=>{var n;return((n=zw[e])==null?void 0:n.call(zw))??e};function B8t(){var y;const e=Lft(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>XL(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(oit({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await mdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:yXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:cet()}),r?f.jsx("div",{className:Po,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Po,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:DUe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:vUe()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:gL()}),f.jsx("span",{className:"v",children:O8t[t.source]()})]}),!x&&f.jsxs("form",{className:pk,onSubmit:w,children:[f.jsxs("label",{children:[CVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[oYe()," ",Ml(l.treeBytes??0),l.freeBytes!=null&&` — ${rit({size:Ne(Ml(l.freeBytes))})}`,l.sameFilesystem?Sit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(qP,{value:_.copied,max:_.total,label:I8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Ml(_.copied)," / ",Ml(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[gVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",THe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[hVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Oe,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Yi():fBe()}),f.jsx(Oe,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?pit():dit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]})]})}const J3=e=>e==="running"||e==="starting";function $8t(e){return J3(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function nF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:fqe()}),f.jsx("th",{children:o_()}),f.jsx("th",{children:cXe()}),f.jsx("th",{children:MYe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx($6,{backend:t.backend}),r&&f.jsx(rb,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:jN(),"aria-label":jN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Gi(t)})}),f.jsx("td",{children:Io(t.createdAt)}),f.jsx("td",{children:$8t(t)})]},t.id)})})]})})}function P8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>J3(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!J3(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[jYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Yp()]}),f.jsx(Oe,{size:"small",onClick:n,children:_!=null&&_.length?p3e({count:Wt(_.length)}):d3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]}):f.jsx(nF,{instances:u,emptyLabel:e?J4e():o3e()})]})}function F8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(ap,{size:14})," ",lL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:lWe()}),f.jsxs(Oe,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Yp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(nF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?Q4e():r3e()}):f.jsxs(ss,{children:[f.jsx(Lt,{})," ",xu()]})]})}const rF=["projects","harnesses","storage"],H8t=[{id:"compute",label:cL,icon:f.jsx(HO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:dL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:f6,icon:f.jsx(XO,{size:15}),activeTabs:["settings",...rF]}];function q8t(e){return rF.includes(e)}function U8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||q8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:f6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Wf,children:f.jsx(z8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Wf,children:f.jsx(M8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Wf,children:f.jsx(t8t,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Wf,children:f.jsx(B8t,{})}),f.jsx("section",{className:Wf,children:f.jsx(A8t,{})}),!s&&f.jsx("section",{className:Wf,children:f.jsx(T8t,{})})]})]}),e==="compute"&&f.jsx(y8t,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(F8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:dL()}),f.jsx(E8t,{})]}),e==="git"&&f.jsx(L8t,{project:n,onProjectUpdate:t})]})}function zv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function e5(e){return`${e.plugin?`${zv(e.plugin)}: `:""}${zv(e.name)}`}const uA={name:"plan",get description(){return OTe()},source:"command"};function jw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function dA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function V8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==uA.name);return n&&t.push(uA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||e5(r).localeCompare(e5(s),void 0,{sensitivity:"base"}))}function K8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function fA(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function Q8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(WO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(JO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:e5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:Mtt()})]},i.name))})}const Y8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let X8t=null;function t5(e,n){const t=X8t??(X8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(zv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function sF({name:e}){const n=e==="plan"?WO:JO;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),zv(e)]})}function iF(e,n,t,r,s,i=!1){let a=0;return G8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(sF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function Z8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...Uft(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),z=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:z,width:T}:{left:z,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":WQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(sF,{name:n})})})]}),_&&no.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":kY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Ft,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Ctt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:jtt()}):f.jsx($o,{text:m??r.description})})]}),document.body)]})}function J8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:iF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function eCt({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of Y8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[iF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` -`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(Z8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function tCt(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const n5=6.5,hA=2*Math.PI*n5;function nCt({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(rCt,{usage:e})}function rCt({usage:e}){const{open:n,setOpen:t,ref:r}=ro(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":tCt(a),l=a===null?"":new Intl.NumberFormat(j(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:yge(),onClick:()=>t(u=>!u),children:a===null?jg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:n5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:n5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${hA*Math.max(a,2)/100} ${hA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:mge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?kge({value:Ne(jg(s))}):zge({used:Ne(jg(s)),total:Ne(jg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(qP,{value:s,max:i,fillColor:o})]})]})}const jv="!";function _A(e){return e.startsWith(jv)?e.slice(jv.length).trim():null}function sCt(e){return e.startsWith(jv)?e.slice(jv.length):e}function iCt(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function aCt(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function oCt(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` +`,u+3),p=d===-1?e.length:d;/^[ \t]*$/.test(e.slice(_,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Wr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:s6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(ub,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Cw(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Cw(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Wr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Wr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(yv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` +`)))return f.jsx("code",{className:s,...r,children:t});const l=i?g3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Wr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const zv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` +`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${zv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${zv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ab(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Zb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Ew(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),rb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Ew(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Ew(o).variant,children:Ew(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Zb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():eb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,P=>(typeof L=="function"?L(P??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function ee(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(P){w(P instanceof Error?P.message:String(P))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Zb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:ee,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Zb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:eb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},Jb={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],Nw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=Nw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||Nw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),Nw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:Jb[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":EN(),title:EN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:Jb[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(N1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:Jb[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:Jb[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():eb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:eb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Zb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:k4({name:Ne(e)}),"aria-label":k4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},zw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":jN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=zw[n.channel])==null?void 0:d.call(zw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x,r.githubDefaultPromptSeen]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:zN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":zN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:R4()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":R4(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:z4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var I;const t=mn({mutationFn:L=>GL(...L)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=L=>{Vr(r.queryKey,P=>(typeof L=="function"?L(P??null):L)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((I=s.error)==null?void 0:I.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(!1),[j,M]=R.useState(null),O=!!(i!=null&&i.github.owner&&i.github.repo);R.useEffect(()=>{!e||w!==null||(y(e.githubAutoTopicsEnabled),E(e.githubTopics.join(", ")))},[e,w]);const B=async()=>{await s.refetch({cancelRefetch:!1})},$=L=>{const P=L instanceof Error?L.message:String(L);return P.toLowerCase().includes("archived")?tPe():P.includes("(fetch first)")||P.includes("non-fast-forward")?iPe():P.includes("403")||P.toLowerCase().includes("permission denied")?cPe():P},H=()=>{e&&(l(!0),_(null),yft(e.id).then(L=>{a(L.git),n(L.project),nt.fetchQuery(v6()).then(P=>{!P.githubForNewProjects&&!P.githubDefaultPromptSeen&&m(!0)}).catch(()=>{})}).catch(L=>_($(L))).finally(()=>l(!1)))},q=L=>{S(!0),b(null),t.mutateAsync([L,L,!0]).then(()=>m(!1)).catch(P=>b(P instanceof Error?P.message:String(P))).finally(()=>S(!1))},Y=L=>L.split(",").map(P=>P.trim()).filter(P=>P.length>0),G=e?e.githubTopics.join(", "):"",X=!!(e&&w!==null&&C!==null&&(w!==e.githubAutoTopicsEnabled||C!==G)),ee=()=>{!e||w===null||C===null||(T(!0),M(null),Wut(e.id,{githubAutoTopicsEnabled:w,githubTopics:Y(C)}).then(L=>{y(L.githubAutoTopicsEnabled),E(L.githubTopics.join(", ")),n(L)}).catch(L=>M(L instanceof Error?L.message:String(L))).finally(()=>T(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(L=>`${L.name}: ${L.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(L=>_(String(L))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:O?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>B()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:O?Btt():j$e()}),f.jsxs("div",{className:G0,children:[O&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:H,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:RN()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:w??!1,"aria-label":R4(),disabled:w===null||N,onClick:()=>y(L=>!(L??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:C??"",onChange:L=>E(L.target.value),placeholder:GD(),disabled:C===null||N,"aria-label":RN()}),f.jsx(Le,{variant:"primary",disabled:!X||N,onClick:ee,children:N?Ei():no()})]}),j&&f.jsx("div",{className:"error mt-2",children:j})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(L=>{a(L.git),n(L.project)}).catch(L=>_(L instanceof Error?L.message:String(L))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:$(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>q(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:L=>L.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>q(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>q(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},jw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=jw[e])==null?void 0:n.call(jw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(sb,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:TN(),"aria-label":TN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function jv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${jv(e.plugin)}: `:""}${jv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Tw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||n5(r).localeCompare(n5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:n5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function r5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(jv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),jv(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` +`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const s5=6.5,pA=2*Math.PI*s5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Tv="!";function mA(e){return e.startsWith(Tv)?e.slice(Tv.length).trim():null}function T8t(e){return e.startsWith(Tv)?e.slice(Tv.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` ${t} ${e.replace(/^\n|\n$/g,"")} ${t} -`}function r5(e,n){return n?` +`}function i5(e,n){return n?` \\[ ${e} \\] -`:`\\(${e}\\)`}function lCt(e,n){const t=n.trim().split(` +`:`\\(${e}\\)`}function D8t(e,n){const t=n.trim().split(` `),r=" ".repeat(e.length+1);return[`${e} ${t[0]??""}`,...t.slice(1).map(s=>s?`${r}${s}`:"")].join(` -`)}function cCt(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,l)=>a[l]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` -`)}function uCt(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function dCt(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function fCt(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const aF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",mk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,oF=1024,lF=2e4,Tw=8,r1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function pA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Aw(e,n){return pA(e).compareBoundaryPoints(Range.START_TO_START,pA(n))<0}function mA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const hCt=new Set(["A","B","CODE","EM","I","STRONG"]);function _Ct(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if(hCt.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function pCt(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function mCt(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Aw(s,u)&&t.append(mA(s,u)),t.append(o.cloneNode(!0)),s=_,!Aw(s,r))break}return i.length===0?t.append(e.cloneContents()):Aw(s,r)&&t.append(mA(s,r)),_Ct(e,t),pCt(t),t}function gCt(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>yp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` +`)}function L8t(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,l)=>a[l]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` +`)}function O8t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function I8t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function B8t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const uF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",gk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,dF=1024,fF=2e4,Aw=8,s1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function gA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Rw(e,n){return gA(e).compareBoundaryPoints(Range.START_TO_START,gA(n))<0}function vA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const $8t=new Set(["A","B","CODE","EM","I","STRONG"]);function P8t(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if($8t.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function F8t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function H8t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Rw(s,u)&&t.append(vA(s,u)),t.append(o.cloneNode(!0)),s=_,!Rw(s,r))break}return i.length===0?t.append(e.cloneContents()):Rw(s,r)&&t.append(vA(s,r)),P8t(e,t),F8t(t),t}function q8t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>xp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` -${cCt(n,!!e.querySelector("tr:first-child th"))} +${L8t(n,!!e.querySelector("tr:first-child th"))} -`:""}function cF(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const i=[];for(const a of Array.from(e.children).filter(o=>o instanceof HTMLElement&&o.tagName==="LI")){const o=a.getAttribute("value"),l=o===null?s:Number(o),u=Number.isFinite(l)?l:s;s=u+1;const _=Array.from(a.childNodes).map(d=>d instanceof HTMLElement&&d.matches("UL, OL")?` -${cF(d).trim()} -`:yp(d)).join("").trim();i.push(lCt(n?`${u}.`:"-",_))}return` +`:""}function hF(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const i=[];for(const a of Array.from(e.children).filter(o=>o instanceof HTMLElement&&o.tagName==="LI")){const o=a.getAttribute("value"),l=o===null?s:Number(o),u=Number.isFinite(l)?l:s;s=u+1;const _=Array.from(a.childNodes).map(d=>d instanceof HTMLElement&&d.matches("UL, OL")?` +${hF(d).trim()} +`:xp(d)).join("").trim();i.push(D8t(n?`${u}.`:"-",_))}return` ${i.join(` `)} -`}function yp(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return iCt(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(yp).join("");if(e.matches(".katex-display")){const l=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return l?r5(l,!0):""}if(e.matches(".katex")){const l=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return l?r5(l,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return gCt(e);if(e.matches("UL, OL"))return cF(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return aCt(e.textContent??"");if(e.tagName==="PRE")return oCt(e.textContent??"");const n=Array.from(e.childNodes).map(yp).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const l=e.getAttribute("href");return l?`[${n}](${l})`:n}if(e.tagName==="LI")return`${n.trim()} +`}function xp(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return A8t(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(xp).join("");if(e.matches(".katex-display")){const l=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return l?i5(l,!0):""}if(e.matches(".katex")){const l=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return l?i5(l,!1):""}if(e.tagName==="BR")return` +`;if(e.tagName==="TABLE")return q8t(e);if(e.matches("UL, OL"))return hF(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return R8t(e.textContent??"");if(e.tagName==="PRE")return M8t(e.textContent??"");const n=Array.from(e.childNodes).map(xp).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const l=e.getAttribute("href");return l?`[${n}](${l})`:n}if(e.tagName==="LI")return`${n.trim()} `;if(e.matches("TH, TD"))return`${n.trim()} | `;if(e.tagName==="TR")return`${n.replace(/ \| $/,"")} `;if(e.tagName==="BLOCKQUOTE")return` @@ -1030,7 +1030,7 @@ ${n.trim().split(` `).map(l=>`> ${l}`).join(` `)} -`;const t=uCt(e.tagName,n);return t?` +`;const t=O8t(e.tagName,n);return t?` ${t} @@ -1038,35 +1038,35 @@ ${t} ${n.trim()} -`:n}function vCt(e,n){return yp(e).replace(/\r\n?/g,` +`:n}function U8t(e,n){return xp(e).replace(/\r\n?/g,` `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim()||n}function gA(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function bCt(e,n){var s,i,a,o;if(!dCt(e))return;const t=gA(e);if(t.length<8)return;let r;for(const l of n.querySelectorAll(".msg-assistant > .md .katex")){const _=[(s=l.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=l.querySelector(".katex-html"))==null?void 0:i.textContent,l.textContent].filter(x=>!!x).map(gA).find(x=>fCt(x,t));if(!_)continue;const d=(o=(a=l.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!d)continue;const p=!!l.closest(".katex-display"),m={markdown:r5(d,p).trim(),delta:Math.abs(_.length-t.length)};(!r||m.delta .md .katex")){const _=[(s=l.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=l.querySelector(".katex-html"))==null?void 0:i.textContent,l.textContent].filter(x=>!!x).map(bA).find(x=>B8t(x,t));if(!_)continue;const d=(o=(a=l.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!d)continue;const p=!!l.closest(".katex-display"),m={markdown:i5(d,p).trim(),delta:Math.abs(_.length-t.length)};(!r||m.deltaz.width>0&&z.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(z=>z.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(z=>z.left)),w=Math.max(...v.map(z=>z.right)),y=Math.min(...v.map(z=>z.top)),C=Math.max(...v.map(z=>z.bottom)),E=34,N=74,T=y>=E+Tw?y-E-Tw:C+Tw;return{text:vCt(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function xCt(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?yCt(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function wCt(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(r1);return}const t=new Highlight(...n);return CSS.highlights.set(r1,t),()=>{CSS.highlights.get(r1)===t&&CSS.highlights.delete(r1)}},[e])}function SCt({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?bCt(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx($o,{text:t??e.text})})}function kCt({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Mde()}),f.jsx(SCt,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ade(),"aria-label":YQ({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(qr,{size:13})})]},t.id))}function gk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=ro(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(VO,{size:l?13:14,className:"text-muted"}),e.length===1?Wae():Zse({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:vE(),"aria-label":vE(),onClick:t,children:f.jsx(qr,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":jde(),children:f.jsx(kCt,{annotations:e,onRemove:r?m:void 0})})]})}function CCt(e){return f.jsx(gk,{...e,variant:"composer"})}const ECt=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),vA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),NCt=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),zCt=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),s5="prompt-actions flex flex-wrap gap-2",bA=[],jCt=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Rw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function TCt(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Mw(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Dw(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function ACt(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function hh(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=oF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function Jb(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!d)return null;const p=H8t(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(j=>j.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),E=34,N=74,T=y>=E+Aw?y-E-Aw:C+Aw;return{text:U8t(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function V8t(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?W8t(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function K8t(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(s1);return}const t=new Highlight(...n);return CSS.highlights.set(s1,t),()=>{CSS.highlights.get(s1)===t&&CSS.highlights.delete(s1)}},[e])}function Q8t({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?G8t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Fo,{text:t??e.text})})}function Y8t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Ide()}),f.jsx(Q8t,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ude(),"aria-label":eY({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Ur,{size:13})})]},t.id))}function vk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=so(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(XO,{size:l?13:14,className:"text-muted"}),e.length===1?Yae():nie({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:bE(),"aria-label":bE(),onClick:t,children:f.jsx(Ur,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Mde(),children:f.jsx(Y8t,{annotations:e,onRemove:r?m:void 0})})]})}function X8t(e){return f.jsx(vk,{...e,variant:"composer"})}const Z8t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),yA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),J8t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),e9t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),a5="prompt-actions flex flex-wrap gap-2",xA=[],t9t=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Mw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function n9t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Dw(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Lw(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function r9t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function _h(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=dF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function ey(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` -`).trim()}function RCt(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function MCt(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=o2t(r),uF(r)}function uF(e){return LCt(e).replace(/[\t\r ]+/g," ").trim()}function DCt(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&fF(s)?{ref:r,path:s}:null}function BCt(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function yA(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function $Ct(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const l=yA(s,o);if(!l)return null;s=l}return s?yA(s,e):e}const So="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",PCt=new RegExp(`\\bchat_(${So})\\b`,"gi"),Nd=`(?:${So}|[0-9a-f]{8})`;function _h(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,d=null,p=!1;for(let m=u;m{let _=!1;for(let d=u;du2t(t.raw,n))}function ya(e,n){return ey(e,n).length>0}function FCt(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,lF).matchAll(PCt))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function i5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,lF),s=n==="runs"?[new RegExp(`/runs/(${So})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${So})`,"gi"),new RegExp(`^\\s*RUN\\s+(${So})\\b`,"gim"),new RegExp(`={3,}\\s*(${So})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${So})`,"gi"),new RegExp(`^\\s*id:\\s*(${So})`,"gim"),new RegExp(`={3,}\\s*(${So})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${So})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function _F(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function pF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function mF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function HCt(e,n,t=[],r=[]){const s=ey(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:i5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return hh([...i])}let a=!1;for(const{invocation:o,offset:l}of _F(e,s)){const u=Wh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=pF(e,m,l,Nd);for(const v of x)i.add(v);const S=mF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:i5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return hh([...i])}function Vf(e,n,t=[],r=[]){const s=ey(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of _F(e,s)){const u=Wh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=pF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=mF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:i5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return hh([...i])}const xA=new WeakMap;function $d(e){const n=j(),t=xA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=qCt(e);return xA.set(e,{locale:n,activity:r}),r}function qCt(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=ACt(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=hh(Dw(i,"targetIds")),_=hh(Dw(i,"runTargetIds")),d=hh(Dw(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Mw(i,"search_query","q"),N=Mw(i,"image_query","q"),T=Mw(i,"find","pattern");return E?{kind:"web",label:nE({query:E})}:N?{kind:"web",label:FJ({query:N})}:T?{kind:"web",label:iee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:iue()}:Array.isArray(i.weather)?{kind:"web",label:zle()}:Array.isArray(i.finance)?{kind:"web",label:yle()}:Array.isArray(i.sports)?{kind:"web",label:kle()}:Array.isArray(i.time)?{kind:"web",label:mle()}:{kind:"web",label:mE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Rue()};const E=MCt(a??(o==null?void 0:o.join(" "))??""),N=_h(E);let T=N.map(oe=>oe.raw);if(o!=null&&o.length){const oe=c2t(o);T=oe===null?[o]:_h(uF(oe)).map(ne=>ne.raw)}let z=null;for(const oe of T)if(z=d2t(oe),z)break;const M=T.some(oe=>{const ne=Wh(oe);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(z&&!M){const oe=z.kind==="discover"?{keyword:SJ(),embedding:NJ(),openalex:ZJ(),biorxiv:AJ()}[z.strategy]:null,ne=z.kind==="discover"?z.query?DX({activity:oe??tE(),query:z.query}):oe??tE():z.id?l0({target:Ne(z.id)}):kZ();return{kind:z.kind==="paper"?"read":"search",label:ne,litCall:z}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Wle(),spawnedSessionIds:FCt(l),litCall:z??void 0};const O=N.map(oe=>hF(oe.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),U=ey(E,"exp\\s+desc").some(oe=>(Wh(oe.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),H=U?Mee():yZ(),Y=U?UY():sJ();if(ya(E,"logs")){const oe=HCt(E,l,_,u);return{kind:"project",label:oe.length===1?YZ():eJ(),runIds:oe,litCall:z??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:Yde(),litCall:z??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Efe(),litCall:z??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:Xoe(),litCall:z??void 0};const V=ya(E,"project\\s+view");if(V&&B&&$)return{kind:"project",label:Y,experimentIds:Vf(E,l,d,u),litCall:z??void 0};if(V&&$)return{kind:"project",label:H,experimentIds:Vf(E,l,d,u),litCall:z??void 0};if(V&&B)return{kind:"project",label:gE(),experimentIds:Vf(E,l,d,u),litCall:z??void 0};if(V)return{kind:"project",label:Kue(),litCall:z??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Vf(E,l,d,u),litCall:z??void 0};if(B)return{kind:"project",label:gE(),experimentIds:Vf(E,l,d,u),litCall:z??void 0};if($)return{kind:"project",label:H,experimentIds:Vf(E,l,d,u),litCall:z??void 0};if(ya(E,"runs?"))return{kind:"project",label:Oce(),litCall:z??void 0};if(ya(E,"projects"))return{kind:"project",label:Pce(),litCall:z??void 0};if(ya(E,"compute"))return{kind:"project",label:ile(),litCall:z??void 0};const X=O.map(ICt).find(oe=>oe!=null);if(X){const oe=Rw(X.path);return{kind:oe?"skill":"read",label:oe?gx({name:Ne(oe)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:oe?`${oe} skill`:rd(X.path)}}const te=O.findIndex(oe=>oe!=null&&["sed","cat","head","tail"].includes(oe.name)),I=te>=0?O[te]:null,L=I?OCt(I):null,F=L?$Ct(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const oe=Rw(F);return{kind:oe?"skill":"read",label:oe?gx({name:Ne(oe)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:oe?`${oe} skill`:rd(L)}}if(O.some(oe=>(oe==null?void 0:oe.name)==="find"||(oe==null?void 0:oe.name)==="ls"||(oe==null?void 0:oe.name)==="rg"&&oe.args.includes("--files")))return{kind:"search",label:kE()};const q=O.findIndex(oe=>(oe==null?void 0:oe.name)==="rg"||(oe==null?void 0:oe.name)==="grep");if(q>=0){const oe=BCt(N[q].raw);return{kind:"search",label:oe?bx({pattern:Ne(oe)}):vx(),searchPattern:oe??void 0}}const G=O.find(oe=>(oe==null?void 0:oe.name)==="git"),ee=G==null?void 0:G.args[0];if(ee==="grep"){const oe=G==null?void 0:G.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:oe?bx({pattern:Ne(oe)}):vx(),searchPattern:oe}}if(ee==="status")return{kind:"command",label:fle()};if(ee==="diff")return{kind:"command",label:wde()};if(ee==="log")return{kind:"command",label:Uue()};const ce=oe=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===oe||ne.args[0]==="run"&&ne.args[1]===oe);return ce("test")?{kind:"command",label:Oue()}:O.some(oe=>(oe==null?void 0:oe.name)==="tsc")||ce("typecheck")?{kind:"command",label:Rle()}:ce("lint")?{kind:"command",label:tle()}:ce("build")?{kind:"command",label:qoe()}:{kind:"command",label:lZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?TCt(n,E):null;return{kind:"skill",label:E?YX({name:Ne(E)}):WX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Rw(p):null;return N?{kind:"skill",label:gx({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Pue()}}case"edit":case"write":case"notebookedit":{const E=RCt(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,z=T?(E==null?void 0:E.type)==="add"?aX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?vX({target:Ne(T)}):EX({target:Ne(T)}):null;return T?{kind:"edit",label:z??yE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:yE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?bx({pattern:Ne(E)}):vx(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?BX({pattern:Ne(E)}):kE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:nE({query:E})}:T&&N?{kind:"web",label:KJ({pattern:T})}:N?{kind:"web",label:sZ({target:Ne(N)})}:{kind:"web",label:m??mE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??DZ()}}case"task":return{kind:"agent",label:m??fZ()};case"subagent":return{kind:"agent",label:UCt(i)};case"error":return{kind:"command",label:pfe()};case"contextcompaction":return{kind:"command",label:ZY(),progressLabel:nX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function UCt(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return gee();case"sendInput":return hee();case"resumeAgent":return HZ();case"wait":return Iee();case"closeAgent":return KY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return jee();case"interacted":return RY();case"interrupted":return Cee()}return xee()}function Tv({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(SB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx(LO,{...t});break;case"read":case"project":r=f.jsx(OO,{...t});break;case"search":r=f.jsx(YO,{...t});break;case"edit":r=f.jsx(D6,{...t});break;case"web":r=f.jsx(Ppt,{...t});break;case"agent":r=f.jsx(I6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Lw({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Ur(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?eQ({target:r}):yY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?zD():ope({count:Wt(e.length)})})]})}function a5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:g2t(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(W0t,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Ur(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:uE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:tue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:uE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Lw,{items:m,onSelect:r,targetType:Gse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||Cl()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:AQ({run:Ne(x)}),...Ur(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||Cl()}):f.jsx("span",{children:(s==null?void 0:s(x))||Cl()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Lw,{items:m,onOpen:t,targetType:Ihe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||Cl()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:bQ({name:(a==null?void 0:a(x))||Ne(x)}),...Ur(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||Cl()}):f.jsx("span",{children:(a==null?void 0:a(x))||Cl()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Lw,{items:m,onOpen:i,targetType:oae()})]})]})}return e.label}function vk(e){const n=e.progressLabel??{skill:eZ(),read:BZ(),search:cee(),edit:TX(),project:lJ(),web:PY(),agent:_X(),command:_D()}[e.kind];return{...e,label:n}}function gF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:HX(),read:mZ(),search:bJ(),edit:wX(),project:WZ(),web:OY(),agent:uX(),command:fJ()}[t.kind]}function GCt(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const WCt=250;function VCt(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=WCt-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const KCt=160;function vF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),KCt);return()=>window.clearTimeout(r)},[e]),e&&n}function QCt(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:wD()}}function YCt(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function XCt(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=YCt(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function bF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=n2t(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(Lt,{}),f.jsx("span",{children:v})]})}const u=xB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=yB(e)?Sae():s?Vhe():IE(),p=s?Lpt:O6,m=Jb(((S=e.state)==null?void 0:S.error)||IE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Oe,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?c_e():u==="retry"?Ui():Fie()})]})}function wA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=Jb((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(bF,{part:e,busy:!1,recovering:!1,usageLimited:v3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[J5()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(PO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Tv,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${aF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(a5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:lQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?sQ({activity:n.label}):mY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:mk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function ZCt({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var z,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=XCt(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((z=v==null?void 0:v.state)==null?void 0:z.status)!=="error"?(b&&vk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(GCt((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=VCt(w,y),E=vF(C!=null),N=C??QCt(x),T=C?C.label:wD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Tv,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(a5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(wA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Tv,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(a5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Iie():rae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:U,activity:H})=>f.jsx(wA,{part:$,repeatCount:U,activity:H,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function JCt({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:hue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:Cue(),icon:D6,iconClass:"text-accent-amber"}:s.approved===!1?{label:gue(),icon:qr,iconClass:"text-accent-red"}:{label:xue(),icon:ub,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:NCt,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?SD():DE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${vA} ms-6`,children:[f.jsx($o,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(gk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:ECt,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||nhe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||jhe()})]}),f.jsxs("div",{className:vA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Qfe():DE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx($o,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Ur(p=>r(s.plan??"",e.id,p)),children:wfe()}),!o&&!d&&f.jsxs("div",{className:s5,children:[f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:roe()}),f.jsx(Oe,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:ooe()}),f.jsx(Oe,{size:"small",onClick:()=>l({approve:!1}),children:Zue()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||gF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(O6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Soe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Oe,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:Jle()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:boe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:zCt,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:s5,children:f.jsx(Oe,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:dfe()})})]})}function e9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Gh(t,n))}function t9t(e){const n=e.text??"",t=n.startsWith("data:")?n:gft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function n9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(AD());await navigator.clipboard.writeText(e),Kn(tp(),"success")}catch(m){Kn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(IO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:CE(),"aria-label":CE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(j(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":n6(),disabled:!e,onClick:p,children:f.jsx(cb,{size:13})})]}),f.jsx(Qt,{size:"small",title:bE(),"aria-label":bE(),disabled:u,onClick:l,children:f.jsx(D6,{size:13})})]})}const r9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:z,onSelectFork:M}){var V,X;Qd();const[O,B]=R.useState(null),$=i9t(n);if($)return f.jsx(a9t,{part:$});if(n.role==="user"){const te=n.parts.filter(ee=>ee.type==="text").map(ee=>ee.text??"").join(` -`),I=ee=>!!(v!=null&&v.some(ce=>ce.name===ee)),L=n.parts.filter(ee=>ee.type==="image"&&ee.text).map(t9t),F=L.filter(ee=>!ee.isPdf),q=L.filter(ee=>ee.isPdf),G=n.parts.filter(ee=>ee.type==="annotation"&&ee.text).map(ee=>({id:ee.id,text:ee.text??""}));if(O!==null){const ee=()=>{const ce=O.trim();!ce||N||(B(null),z(n.id,ce))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":ace(),value:O,autoFocus:!0,onChange:ce=>B(ce.target.value),onKeyDown:ce=>{ce.key==="Escape"?(ce.preventDefault(),B(null)):ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),ee())}}),f.jsxs("div",{className:`${s5} justify-end`,children:[f.jsx(Oe,{size:"small",onClick:()=>B(null),children:Voe()}),f.jsx(Oe,{size:"small",variant:"primary",onClick:ee,disabled:N||!O.trim(),children:C4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[G.length>0&&f.jsx(gk,{annotations:G,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(J8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((ee,ce)=>f.jsx("a",{href:ee.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:ee.src,alt:_ie()})},ce))}),q.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:q.map((ee,ce)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:ee.src,target:"_blank",rel:"noreferrer",children:[f.jsx(ub,{size:15}),f.jsx("span",{children:ee.name})]},ce))})]}),w!==void 0&&f.jsx(n9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const U=n.parts.find(te=>te.type==="tool"&&v3(te)),H=n.parts.find(am)??U,Y=n.parts.filter(te=>te!==H&&!(U&&v3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(s9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),H&&f.jsx(bF,{part:H,usageLimited:!!U,busy:m,recovering:x===((X=(V=H.state)==null?void 0:V.input)==null?void 0:X.turnId),onRecover:S})]})});function s9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=t2t(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:D1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):s0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?e0e():l0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:D1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:D1(i,t)})]})}function i9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===VL?n:null}function a9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?_D():s&&i!==null?Tie({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[bD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${mk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function D1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Gh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(ZCt,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Gh(C,t)){if(C.type==="tool"&&(l9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(u9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx($o,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Bfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(JCt,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function o9t(e){return $d(e).label}function l9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function yF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Av(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Av(t.children,n);if(r)return r}return null}function c9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?Jb(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=D1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?vB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":yF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[J5()," "]}),_&&f.jsx("div",{className:mk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?e6():Dae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx($o,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function u9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=Jb(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?vk($d(e)):$d(e),a=vF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!yF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[J5()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(PO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Tv,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${aF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:Yae(),...Ur(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function d9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function bk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||gF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function f9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=d9t(e),o=bk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?rE({label:Do(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:rE({label:Do(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>am(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=xB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${vte()}${y?` ${y==="retry"?Zee():Kee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Uee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?ute({labels:y}):_te({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?vk($d(y)).label:nte(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ate(),sequence:y.sequence+1}))},[e]),n}const h9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Qd();const T=((I=bk(n))==null?void 0:I.id)??null,z=R.useMemo(()=>n.filter(q=>e9t(q,T)),[n,T]),M=R.useMemo(()=>{const q=z.filter(G=>G.role==="user"&&!G.id.startsWith(Cd));return Zyt(a,n,q,G=>G.startsWith(Cd))},[n,z,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),U=R.useCallback(q=>z[q].id,[z]),H=R.useCallback(q=>{if(B)return z.map((ee,ce)=>ce);const G=new Set(mB(q));return z.forEach((ee,ce)=>{O.current.has(ee.id)&&G.add(ce)}),[...G].sort((ee,ce)=>ee-ce)},[z,B]),Y=Qyt({count:z.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:U,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var q;return Math.max(0,z.length*400-(((q=t.current)==null?void 0:q.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:H});R.useLayoutEffect(()=>{const q=()=>Y.scrollToEnd();return r.current=q,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const q=()=>{var ce;const G=window.getSelection();if(!G||G.isCollapsed||!G.rangeCount)return;const ee=G.getRangeAt(0);for(const oe of((ce=t.current)==null?void 0:ce.querySelectorAll("[data-message-id]"))??[])ee.intersectsNode(oe)&&oe.dataset.messageId&&O.current.add(oe.dataset.messageId)};return document.addEventListener("selectionchange",q),()=>document.removeEventListener("selectionchange",q)},[t]);const V=z.at(-1),X=f9t(n),te=_?bB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(q=>!q),children:t_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(q=>{var ne,Q,le,ae,ue,pe;const G=z[q.index],ee=G.parts.find(am),ce=(Q=(ne=ee==null?void 0:ee.state)==null?void 0:ne.input)==null?void 0:Q.turnId,oe=ee?_||C!==null:!1;return f.jsx("div",{"data-index":q.index,"data-message-id":G.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:q.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(G.id),onFocusCapture:()=>O.current.add(G.id),children:f.jsx(r9t,{message:G,forkCount:(le=M.get(G.id))==null?void 0:le.count,forkIndex:(ae=M.get(G.id))==null?void 0:ae.index,forkPrevId:(ue=M.get(G.id))==null?void 0:ue.prevId,forkNextId:(pe=M.get(G.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===G.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:oe,recoveringTurnId:ce===C?C:null,onRecover:E,skills:N,predictTextTail:_&&G===V&&G.role==="assistant"})},G.id)})})]})}),_9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,xF=[{id:"active",label:doe,railLabel:kD},{id:"archived",label:_E,railLabel:_E},{id:"all",label:poe,railLabel:vD}];function p9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=ro();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:SE(),"aria-label":SE(),onClick:()=>r(i=>!i),children:f.jsx(ZO,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:xF.map(i=>f.jsxs(sr,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const m9t=14,g9t=500,v9t=1200;function wF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*m9t,g9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function b9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=ro(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?i_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(I6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":qde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(wF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:AE(),"aria-label":AE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(A6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(sr,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:xD()})}),f.jsx(sr,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?q_e():nie()})}),f.jsx(sr,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:yD()})})]})]})}const SA=[OO,YO,c_,db],Ow=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],kA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function y9t({onClose:e,onConfigureSsh:n}){var v,b;const t=gn({mutationFn:w=>Sdt(...w)}),r=ct(WL()),s=ct(Bft()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ib(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Kn(sLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:vht(),locale:j()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Kn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return no.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":$Me(),onClick:e,children:f.jsx(qr,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:ZD()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:qMe()}),f.jsx(rs,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:wN(),"aria-label":wN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(Lt,{})," ",mL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:HDe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Oe,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(Lt,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:YDe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Oe,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(ZO,{size:15}),EL()]})})]})}),document.body)}function x9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Kr,ua,Ia,hc,tl;const N=gn({mutationFn:se=>hft(...se)}),T=gn({mutationFn:se=>fft(...se)}),z=gn({mutationFn:se=>lft(...se)}),M=gn({mutationFn:se=>uft(...se)}),O=gn({mutationFn:se=>dft(...se)}),B=gn({mutationFn:cft}),$=R.useMemo(()=>Ea(e),[e]),{data:U=jCt}=ct($),H=R.useCallback(se=>{Gr($.queryKey,be=>{if(!be)return;const Ae=typeof se=="function"?se(be):se,Le=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Le.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Le.delete(Ue.id);for(const Ue of Le.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,V]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[q,G]=R.useState(new Set),[ee,ce]=R.useState("active"),[oe,ne]=R.useState(""),[Q,le]=R.useState([]),ae=R.useRef(0),ue=R.useRef({projectId:e,activeId:I,mainView:i});(ue.current.projectId!==e||ue.current.activeId!==I||ue.current.mainView!==i)&&(ue.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,ze]=R.useState(null),at=R.useRef(Promise.resolve()),bt=R.useRef(0),$t=R.useRef(0),[Pt,zt]=R.useState(null),ot=R.useRef(null),ft=R.useRef(!1),It=R.useRef(null),[we,Re,Ze]=Zft(e,i==="chat"?I:null),{data:ht=S9t}=ct(hu()),[xt,Vt]=R.useState(y);R.useEffect(()=>Vt(y),[y]);const[Ve,Ht]=R.useState({}),[sn,fn]=R.useState(b0),[Zt,Qn]=R.useState(null),Jt=R.useRef(!1),bn=R.useRef(null),[or,lr]=R.useState(null),br=R.useRef(!1),Dn=R.useRef(null),[Wr,Nr]=R.useState(new Map),vt=R.useRef(new Map),un=R.useRef(null),Cn=R.useRef(null),en=R.useRef(null),Jn=R.useRef(!0),[hn,En]=R.useState(!0),ln=R.useRef(null),pt=ro(),kt=R.useCallback(se=>{var be;ae.current+=1,le(Ae=>[...Ae,{id:`annotation-${ae.current}`,...se}]),(be=ln.current)==null||be.focus()},[]),Ge=xCt(Cn,kt);wCt(Q),R.useEffect(()=>{le([]),Ge.dismiss()},[I,e,Ge.dismiss]);const[mt,fr]=R.useState(0),[cn,qt]=R.useState(!1),[er,Ln]=R.useState(0),di=R.useRef(!1);function Xl(se){if(!gs)return;if(se.source==="command"&&se.name==="plan"){yr(oe,gs);return}const be=t5(se.name,ln.current),Ae=W8t(oe,gs,se.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Le,Ue;(Le=ln.current)==null||Le.focus(),(Ue=ln.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),Ln(Ae.cursor)})}function io(se){if(ao)return!1;const be=se.selectionStart;if(di.current||be!==se.selectionEnd)return!1;const Ae=oe.slice(0,be).replace(/[ \t]+$/,"").length,Le=jw(oe,Ae);if(!Le||Le.end!==Ae||!la(Le.query)||be>Ae&&be-Ae!==t5(Le.query,se))return!1;const Ue=dA(oe,{...Le,end:be});return ne(Ue.text),Ln(Ue.cursor),window.requestAnimationFrame(()=>se.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function Ni(se){qe(null);let Le=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of se){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(vie({name:Ne(Ue.name)}));continue}if(Le+Ue.size>41943040){qe(wie());continue}Le+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(dr=>[...dr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(se){const be=Array.from(se.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(se.preventDefault(),Ni(be))}const tn=U.find(se=>se.id===I),Ys=xt??fgt(ht),cr=tn?{harness:tn.harness,model:Ve.model??tn.model,serviceTier:Ve.serviceTier!==void 0?Ve.serviceTier:tn.serviceTier,permissionMode:Ve.permissionMode??tn.permissionMode,reasoningLevel:Ve.reasoningLevel??tn.reasoningLevel}:Ys?{...Ys,...Ve}:null,{data:Rr=w9t}=ct(qft(cr==null?void 0:cr.harness)),Ke=cr?ht.find(se=>se.id===cr.harness):void 0,Ut=Ke==null?void 0:Ke.options,zi=R.useMemo(()=>V8t(Rr,Ut==null?void 0:Ut.planActivation),[Rr,Ut==null?void 0:Ut.planActivation]),os=_A(oe),ks=os!==null,gs=jw(oe,er),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:zi.filter(se=>se.name.startsWith(sa)||se.plugin&&`${se.plugin}:${se.name}`.toLowerCase().startsWith(sa)),ao=!ks&&sa!==null&&(gs==null?void 0:gs.end)===er&&Ma.length>0,Cs=ao&&!cn?Ma:[],Da=Cs.length>0,Vr=Math.min(mt,Math.max(0,Cs.length-1));R.useEffect(()=>fr(0),[sa]);const Mr=cr&&Ke&&Ke.models.length>0&&!Ke.models.some(se=>se.id===cr.model)?Ke.models[0].id:(cr==null?void 0:cr.model)??null,nn=cr&&{...cr,model:Mr,serviceTier:rv(Ke,Mr,cr.serviceTier),reasoningLevel:qL(Ke,Mr,cr.reasoningLevel)},vs=tb(Ke,nn==null?void 0:nn.model),Xs=se=>{if(!nn)return;const be={...nn,...se},Ae={};se.model!==void 0&&se.model!==nn.model&&(Ae.model=se.model),se.serviceTier!==void 0&&se.serviceTier!==nn.serviceTier&&(Ae.serviceTier=se.serviceTier),se.permissionMode!==void 0&&se.permissionMode!==nn.permissionMode&&(Ae.permissionMode=se.permissionMode),se.reasoningLevel!==void 0&&se.reasoningLevel!==nn.reasoningLevel&&(Ae.reasoningLevel=se.reasoningLevel),fn(Le=>({...Le,...Ae})),Vt(be),C(be).catch(()=>{}),tn?Ht(Le=>({...Le,...se})):se.harness&&se.harness!==nn.harness&&Ht({})},ur=R.useCallback(se=>{const be=at.current.catch(()=>{}).then(()=>{if(!Pn($.queryKey))throw new DOMException("Workspace changed","AbortError");return se()});return at.current=be.then(()=>{},()=>{}),be},[$]),ls=se=>{if(se==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(fn(Le=>({...Le,permissionMode:se})),Ht(Le=>({...Le,permissionMode:se}))):(Ht(Le=>{const Ue={...Le};return delete Ue.permissionMode,Ue}),Xs({permissionMode:se})),!tn)return;const be=tn.id,Ae=++bt.current;ze(null),ur(()=>N.mutateAsync([be,se])).then(Le=>{H(Ue=>Ue.map(zn=>zn.id===Le.id?Le:zn)),bt.current===Ae&&Ht(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{bt.current===Ae&&(Ht(Le=>{const Ue={...Le};return delete Ue.permissionMode,Ue}),ze(Y_e()))})},Ls=se=>Xs({reasoningLevel:se}),$r=(nn==null?void 0:nn.harness)==="claude-code"?nn.permissionMode==="plan":(Ut==null?void 0:Ut.planActivation)==="command"?Pt??(tn==null?void 0:tn.planMode)??!1:!1;R.useEffect(()=>{Pt===null||(tn==null?void 0:tn.planMode)!==Pt||(ot.current=null,zt(null))},[tn==null?void 0:tn.planMode,Pt]);async function Dr(se){if(fn(Le=>({...Le,planMode:se})),ot.current=se,zt(se),!tn)return;const be=tn.id,Ae=++$t.current;ze(null);try{const Le=await ur(()=>T.mutateAsync([be,se]));H(Ue=>Ue.map(zn=>zn.id===Le.id?Le:zn)),$t.current===Ae&&(ot.current=null,zt(null),ze(null))}catch(Le){throw $t.current===Ae&&(ot.current=null,zt(null)),Le}}async function cs(){if((nn==null?void 0:nn.harness)==="claude-code"){ls("auto");return}if(tn)try{await Dr(!1)}catch{ze(Jie())}}async function bs(){const se=!$r;try{if((nn==null?void 0:nn.harness)==="claude-code")ls(se?"plan":"auto");else if((Ut==null?void 0:Ut.planActivation)==="command")await Dr(se);else throw new Error(xx())}catch{ze(OE())}}function yr(se,be){const Ae=dA(se,be);ne(Ae.text),qt(!0),bs(),window.requestAnimationFrame(()=>{var Le,Ue;(Le=ln.current)==null||Le.focus(),(Ue=ln.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),Ln(Ae.cursor)})}const ys=R.useCallback(async(se=!1)=>{const be=F.current;if(be.projectId!==e||!Pn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Le=>Le.id);try{const Le=await nt.fetchQuery({...$,...se?{staleTime:0}:{}});if(F.current!==be||!Pn($.queryKey))return null;const Ue=Le.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return vt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async se=>{F.current.projectId!==e||!Pn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(se),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const se=RO();G(e===Ex?new Set([h6,_6].filter(Ae=>!se.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),vt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{fn(b0),Dn.current=null},[I]),R.useEffect(()=>iv(se=>{switch(se.type){case"session":{if(se.session.projectId!==e||du.has(se.session.id))return;const be=vt.current.has(se.session.id),Ae=vt.current.get(se.session.id)!==se.session.title;vt.current.set(se.session.id,se.session.title),be&&Ae&&se.session.titleSource==="generated"&&(Nr(Le=>{const Ue=new Map(Le);return Ue.set(se.session.id,(Le.get(se.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Le=>{if(!Le.has(se.session.id))return Le;const Ue=new Map(Le);return Ue.delete(se.session.id),Ue})},v9t));break}case"sessionDeleted":cc(se.sessionId);break}}),[e]),R.useEffect(()=>iv(se=>{se.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??bA:bA,Yo=I?we.activeLeafBySession[I]??null:null;bn.current=Yo;const Es=R.useMemo(()=>Yyt(aa,Yo),[aa,Yo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const se=Nu.current;Nu.current={projectId:e,ids:we.busySessions},se.projectId===e&&G(be=>e2t(be,se.ids,we.busySessions,U,i==="chat"?I:null))},[e,we.busySessions,U,I,i]);const Bn=I?we.busySessions.has(I):!1,y_=!Bn&&!!(Ke!=null&&Ke.agentReady),Zl=Bn&&bB(Es)!=null,Xo=Bn&&Jyt(Es),Pr=I?we.queuedBySession[I]??[]:[],oa=Pr.some(se=>se.dispatchState==="retrying"),Jl=Pr.findIndex(se=>se.dispatchState==="blocked"),ji=Pr.reduce((se,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?se:se===null?be.nextRetryAt:Math.min(se,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||ji===null||(ec(Date.now()),ji<=Date.now()))return;const se=window.setInterval(()=>{const be=Date.now();ec(be),be>=ji&&window.clearInterval(se)},1e3);return()=>window.clearInterval(se)},[oa,ji]),R.useEffect(()=>{const se=Pr.reduce((be,Ae)=>Ae.planMode??be,void 0);se!==void 0?(ft.current=!0,ot.current=se,zt(se)):ft.current&&(ft.current=!1,ot.current=null,zt(null))},[Pr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const se=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Le=>Le.type==="prompt"&&Le.prompt&&!Le.prompt.resolved&&Le.prompt.nativeId))&&se.add(be);return se},[we.busySessions,we.messagesBySession]),Ti=I?nc.has(I):!1,Nn=tn,rc=Nn?Wr.get(Nn.id):void 0,Rt=R.useMemo(()=>{var se;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((se=Ae.prompt)==null?void 0:se.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const se=Nn==null?void 0:Nn.harness;if(!I||se!=="claude-code"&&se!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=se=>!hr&&!ks&&zi.some(be=>be.name===se),[Ai,oo]=R.useState(null),lo=Ai&&Ai.sessionId===I?Ai:null;R.useEffect(()=>{if(!Ai)return;const se=we.busySessions.has(Ai.sessionId),be=Ai.sessionId===I&&Rt&&Rt.promptId!==Ai.promptId;(!se||be)&&oo(null)},[Ai,Rt,we.busySessions,I]);const sc=R.useMemo(()=>bk(Es),[Es]),us=Bn&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Rt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(se,be,Ae)=>p(se,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(se,be,Ae)=>m(I,se,be,Ae):void 0,[m,I]),Zo=R.useMemo(()=>o&&((se,be,Ae,Le,Ue)=>o(se,I??void 0,be,Ae,Le,Ue)),[o,I]);R.useEffect(()=>{bt.current+=1,$t.current+=1;const se=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ft.current=se!==void 0,ot.current=se??null,zt(se??null),Ht({}),ze(null)},[I]);const Is=i==="chat"&&(Es.length>0||Bn),Oa=(nn==null?void 0:nn.harness)??null,zu=(nn==null?void 0:nn.model)??null,Zs=Ze.data?null:Ze.error,Jo=i==="chat"&&!Is&&!tc&&!Zs,el=ct({..._ht(e,Oa??"claude-code",zu,j()),enabled:Jo&&Oa!==null,subscribed:Jo&&Oa!==null}),ac=((Kr=el.data)==null?void 0:Kr.prompts)??null,rf=Oa!==null&&el.isPending,ju=e===Ex?"demo":"project",Tu=se=>{ne(se),qt(!1),window.requestAnimationFrame(()=>{const be=ln.current;be&&(be.focus(),be.setSelectionRange(se.length,se.length),Ln(se.length))})};R.useEffect(()=>{v&&(ne(v),qt(!1),Ln(v.length))},[v]);const co=R.useCallback(se=>{const be=se.scrollHeight-se.scrollTop-se.clientHeight<60;Jn.current=be,En(be)},[]),fi=R.useCallback(()=>{var se;Jn.current=!0,En(!0),(se=en.current)==null||se.call(en)},[]);R.useEffect(()=>{const se=un.current,be=Cn.current;if(!se||!be)return;const Ae=new ResizeObserver(()=>{var Le;Jn.current?(Le=en.current)==null||Le.call(en):En(se.scrollHeight-se.scrollTop-se.clientHeight<60)});return Ae.observe(se),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(se=>{se.currentTarget.blur(),fi()},[fi]);async function sf({queue:se=!1}={}){var Mt,Gn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),br.current)return;const be=oe.trim(),Ae=hr?null:K8t(be,Ut==null?void 0:Ut.planActivation),Le=!!Ae,Ue=!$r,zn=fA(Ut==null?void 0:Ut.planActivation,Le?Ue:void 0,ot.current),jn=Le&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,dr=Ae?Ae.prompt:be,Mn=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),hf=e,Mu=i;let nl=I;const $s=()=>{const Tn=ue.current;return Pn($.queryKey)&&Tn.projectId===hf&&Tn.activeId===nl&&Tn.mainView===Mu},fo=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Mn),le(Tn=>Tn.length?Tn:_r))};if(Le&&!dr&&Mn.length===0&&_r.length===0){ne(""),qt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ut==null?void 0:Ut.planActivation)==="command")await Dr(Ue);else throw new Error(xx())}catch{ze(OE()),fo()}return}const Z=nn?{...nn,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const Te=ot.current;Le&&(Ut==null?void 0:Ut.planActivation)==="command"&&(ge=++$t.current,ot.current=Ue,zt(Ue));const $e=()=>{!$s()||ge===null||$t.current!==ge||(ot.current=Te,zt(Te))};if(!dr&&Mn.length===0&&_r.length===0)return;if((dr||_r.length>0)&&hr&&Mn.length===0){ne(""),le([]),uo({promptId:hr,answers:[],note:dr||void 0,annotations:da}).then(Tn=>{Tn||fo()});return}const Me=JSON.stringify({text:dr,images:Mn.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:null}),it=((Mt=Dn.current)==null?void 0:Mt.signature)===Me?Dn.current.id:`ct_${crypto.randomUUID()}`;if(Dn.current={signature:Me,id:it},Bn){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Qr=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:(Ut==null?void 0:Ut.planActivation)==="command"?zn??(tn==null?void 0:tn.planMode):zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Ht({});const Js=Mn.map(tr=>({mediaType:tr.mediaType,dataBase64:tr.dataUrl.slice(tr.dataUrl.indexOf(",")+1),name:tr.name}));try{(Gn=(await ur(()=>IN(Tn,dr,Qr,Js.length?Js:void 0,da,it,us&&!se&&!Le?"steer":void 0))).turn)!=null&&Gn.existing&&await ia(Tn),$s()&&fn(b0),((Ns=Dn.current)==null?void 0:Ns.id)===it&&(Dn.current=null)}catch{$e(),fo()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!Z){$e();return}let tt=I;try{br.current=!0;try{if(!tt){const ho=await Au(Z,zn);tt=ho.id,nl=ho.id}if(!Pn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{br.current=!1}if(!Pn($.queryKey))return;$s()&&(ne(pr=>pr===oe?"":pr),Se(pr=>pr===Mn?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:dr||uie(),attachments:Mn.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&ee==="archived"&&ce("active");const Tn=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Ht({});const Qr=Mn.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(Xhe());(Ps=(await ur(()=>IN(Js,dr,Tn,Qr.length?Qr:void 0,da,it))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&fn(b0),((_i=Dn.current)==null?void 0:_i.id)===it&&(Dn.current=null)}catch(Tn){if(!Pn($.queryKey)||(fo(),$e(),!tt))return;const Qr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Qr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(tr=>{var _c;return!!((_c=tr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(tr=>tr===dr?"":tr),Se(tr=>tr===Mn?[]:tr),le(tr=>tr===_r?[]:tr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:bae({error:Ne(Qr)})})}}async function Au(se,be){const Ae=ue.current,Le=F.current,Ue=await z.mutateAsync([e,se.harness,{model:se.model,serviceTier:se.serviceTier,permissionMode:se.permissionMode,planMode:be,reasoningLevel:se.reasoningLevel}]);return F.current===Le&&(H(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Le&&ue.current===Ae&&(L.current(Ue.id,{replace:!0}),ue.current={...Ae,activeId:Ue.id}),Ue}function hi(){const se=sCt(oe);ne(se),window.requestAnimationFrame(()=>{var be,Ae;(be=ln.current)==null||be.focus(),(Ae=ln.current)==null||Ae.setSelectionRange(se.length,se.length),Ln(se.length)})}async function af(){const se=os;if(!se)return;if(ze(null),Bn){ze(Eie());return}const be=oe,Ae=ue.current;let Le=I;const Ue=()=>{const Mn=ue.current;return Mn.projectId===Ae.projectId&&Mn.activeId===Le&&Mn.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Mn=>Mn||be)};ne(""),qt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!nn){zn(),ze(xx());return}try{const Mn=fA(Ut==null?void 0:Ut.planActivation,void 0,ot.current);jn=(await Au(nn,Mn)).id,Le=jn,Ue()&&Ht({})}catch(Mn){zn();const _r=Mn instanceof Error?Mn.message:String(Mn);Ue()&&ze(dE({error:Ne(_r)}));return}}Ue()&&ee==="archived"&&ce("active");const dr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:dr,command:se}),Ue()&&fi();try{const{message:Mn}=await vft(jn,se);Re({type:"upsertMessage",sessionId:jn,message:Mn})}catch(Mn){const _r=Mn instanceof Error?Mn.message:String(Mn);Re({type:"localShell",sessionId:jn,id:dr,command:se,error:dE({error:Ne(_r)})})}}function of(){I&&wft(I).catch(()=>{ze(g_e())})}const x_=R.useCallback(async(se,be)=>{if(!(!I||Jt.current)){Jt.current=!0,ze(null),Qn(se);try{const Ae=s2t({model:sn.model,serviceTier:sn.serviceTier,permissionMode:sn.permissionMode,planMode:sn.planMode,reasoningLevel:sn.reasoningLevel}),Le=I;(await bft(Le,se,be,Ae)).turn.existing&&await ia(Le),fn(b0)}catch{ze(ghe())}finally{Jt.current=!1,Qn(null)}}},[I,sn,ia]),w_=R.useCallback((se,be)=>{if(!I||Bn||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),ur(()=>yft(Ae,se,be)).catch(Le=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Le instanceof Error?Le.message:String(Le);Re({type:"localError",sessionId:Ae,text:Che({error:Ne(Ue)})})})},[I,Bn,Ke==null?void 0:Ke.agentReady,fi,ur]),lc=R.useCallback(se=>{if(!I||Bn)return;const be=I,Ae=bn.current;Re({type:"activeLeaf",sessionId:be,leafId:se}),ur(()=>xft(be,se)).catch(Le=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Le instanceof Error?Le.message:String(Le);Re({type:"localError",sessionId:be,text:x_e({error:Ne(Ue)})})})},[I,Bn,ur]);function lf(se){if(!I)return;const be=I;pft(be,se).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>ze(xhe()))}async function cf(se){if(!I||or)return;const be=I;ze(null),lr(se);try{await mft(be,se),await ia(be)}catch{ze(Mhe())}finally{lr(null)}}R.useEffect(()=>{if(!Bn||i!=="chat")return;function se(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),of(),(Ae=ln.current)==null||Ae.focus())}return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[Bn,I,i]);function cc(se){Zv(se),ue.current.projectId===e&&ue.current.activeId===se&&ue.current.mainView==="chat"&&L.current(null,{replace:!0}),G(be=>{if(!be.has(se))return be;const Ae=new Set(be);return Ae.delete(se),Ae}),vt.current.delete(se)}function uc(se,be){const Ae=se.archived;H(Le=>Le.map(Ue=>Ue.id===se.id?{...Ue,archived:be}:Ue)),M.mutateAsync([se.id,be]).catch(()=>{H(Le=>Le.map(Ue=>Ue.id===se.id?{...Ue,archived:Ae}:Ue))})}function uf(se,be){const Ae=se.title;H(Le=>Le.map(Ue=>Ue.id===se.id?{...Ue,title:be}:Ue)),O.mutateAsync([se.id,be]).catch(()=>{H(Le=>Le.map(Ue=>Ue.id===se.id?{...Ue,title:Ae}:Ue))})}async function S_(se){var Ae;const be=((Ae=se.title)==null?void 0:Ae.trim())||Eg();if(window.confirm(Gie({title:Do(be)}))){try{await B.mutateAsync(se.id)}catch(Le){Kn(Qie({title:Do(be),error:Ne(Le instanceof Error?Le.message:String(Le))}),"error");return}cc(se.id)}}const uo=R.useCallback(se=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),ur(()=>Sft(be,se)).then(()=>!0).catch(()=>!1).finally(()=>{Pn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,ur,$]),dc=U.filter(se=>_9t(ee,se.archived)),df=/Mac|iPhone|iPad/.test(navigator.platform),k_=df?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=df?"⌘ Enter":"Ctrl + Enter",Rn=R.useCallback(()=>{ce("active"),w(null)},[w]),Ru=R.useCallback(se=>{ce("all"),w(se)},[w]);R.useEffect(()=>{const se=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Rn())};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[Rn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Rn,children:[f.jsx(em,{size:15}),Kce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx(LO,{size:15}),$le()]}),H8t.map(se=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&se.activeTabs.includes(i)?"active":""}`,"data-onboarding":se.id==="compute"?"nav-compute":void 0,onClick:()=>a(se.id),children:[se.icon,se.label()]},se.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=xF.find(se=>se.id===ee))==null?void 0:ua.railLabel())??kD()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(p9t,{value:ee,onChange:ce})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(se=>f.jsx(b9t,{session:se,active:se.id===I&&i==="chat",unread:q.has(se.id),busy:we.busySessions.has(se.id),waiting:nc.has(se.id),revealTitle:Wr.get(se.id),onOpen:()=>{if(w(se.id),e===Ex){A0t(se.id);const be=sut[se.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>uf(se,be),onSetArchived:be=>uc(se,be),onDelete:()=>void S_(se)},se.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:ee==="archived"?Bae():U.length>0?Tae():Hae()})]}),x.kind==="ssh"?f.jsx(uv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":ZD(),"aria-haspopup":"dialog",onClick:()=>V(!0),children:f.jsx(e3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:i6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(y9t,{onClose:()=>V(!1),onConfigureSsh:()=>{V(!1),te(!0)}}),X&&f.jsx(KP,{onClose:()=>{te(!1),V(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",ff=!r&&f.jsx(Qt,{title:RE(),"aria-label":RE(),onClick:s,children:f.jsx(KO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:ff}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[ff,f.jsxs("div",{className:ca,children:[f.jsx(op,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Eg():fE(),children:Nn?f.jsx(wF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Eg(),animate:rc!==void 0},rc??"static"):fE()}),S&&f.jsx(Qt,{"data-tip":hE(),"aria-label":hE(),onClick:S,children:f.jsx(ipt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Oe,{onClick:()=>void Ze.refetch(),children:Ui()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(Lt,{}),f.jsx("span",{children:Uce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:un,tabIndex:0,role:"region","aria-label":((tl=Nn==null?void 0:Nn.title)==null?void 0:tl.trim())||Eg(),onScroll:se=>{co(se.currentTarget),Ge.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx(h9t,{scrollRef:un,scrollToEndRef:en,stickToBottom:Jn,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:Bn,onOpenFile:Zo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:uo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Zt,onRecover:x_,skills:zi},I),Bn&&Ti&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Tfe()}),Bn&&!Ti&&!Zl&&!Xo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:j_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(B6,{})}),f.jsx("h2",{children:Dfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),rf&&f.jsx("div",{className:kA,role:"status","aria-live":"polite","aria-label":efe(),"aria-busy":"true",children:SA.map((se,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Ow[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Ow[be].icon}`,children:[f.jsx(se,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:kA,role:"group","aria-label":sfe(),children:ac.map((se,be)=>{const Ae=SA[be],Le=Ow[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Le.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(se.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Le.icon}),se.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:se.prompt})]},be)})})]}),Ge.action&&f.jsxs(Oe,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ge.action.x,top:Ge.action.top,transform:"translateX(-50%)"},onMouseDown:se=>se.preventDefault(),onClick:Ge.add,children:[f.jsx(VO,{size:14}),Toe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${hn?"opacity-0":"opacity-100"}`,title:LE(),"aria-label":LE(),inert:hn,onClick:oc,children:Bn&&!Ti?f.jsx(A6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(H0t,{size:16})}),Rt&&!(lo&&Rt.promptId===lo.promptId)&&f.jsx(Z7t,{synthesized:Rt.synthesized,agentLabel:Nn?E0[Nn.harness]:C_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:se=>Os==null?void 0:Os(Rt.plan,Rt.promptId,se),onApprove:se=>uo({promptId:Rt.promptId,approve:!0,...se?{resumeMode:se}:{}}),onReject:()=>uo({promptId:Rt.promptId,approve:!1}),onRevise:se=>{I&&oo({sessionId:I,promptId:Rt.promptId}),uo({promptId:Rt.promptId,approve:!1,note:se})}}),Pr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Pr.map((se,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:se.error?`${se.text} +`).trim()}function s9t(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function i9t(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Mxt(r),_F(r)}function _F(e){return o9t(e).replace(/[\t\r ]+/g," ").trim()}function a9t(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&mF(s)?{ref:r,path:s}:null}function u9t(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function wA(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function d9t(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const l=wA(s,o);if(!l)return null;s=l}return s?wA(s,e):e}const ko="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",f9t=new RegExp(`\\bchat_(${ko})\\b`,"gi"),Nd=`(?:${ko}|[0-9a-f]{8})`;function ph(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,d=null,p=!1;for(let m=u;m{let _=!1;for(let d=u;dOxt(t.raw,n))}function ya(e,n){return ty(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function o5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ty(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:o5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ty(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Lw(i,"targetIds")),_=_h(Lw(i,"runTargetIds")),d=_h(Lw(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Dw(i,"search_query","q"),N=Dw(i,"image_query","q"),T=Dw(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),H=ty(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),q=H?Iee():kZ(),Y=H?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Mw(X.path);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const ee=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=ee>=0?O[ee]:null,L=I?l9t(I):null,P=L?d9t(L,N,ee,Gs(i,"cwd","workdir")):null;if(L&&P){const re=Mw(P);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:P,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re??void 0}}const U=O.find(re=>(re==null?void 0:re.name)==="git"),te=U==null?void 0:U.args[0];if(te==="grep"){const re=U==null?void 0:U.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re}}if(te==="status")return{kind:"command",label:mle()};if(te==="diff")return{kind:"command",label:Ede()};if(te==="log")return{kind:"command",label:Kue()};const de=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return de("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||de("typecheck")?{kind:"command",label:Ole()}:de("lint")?{kind:"command",label:ile()}:de("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Mw(p):null;return N?{kind:"skill",label:v2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?y2({pattern:Ne(E)}):b2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Av({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Ow({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Wr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function l5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Wr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Wr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Wr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ey(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ey((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:y3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(l5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Av,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Av,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:H,activity:q})=>f.jsx(kA,{part:$,repeatCount:H,activity:q,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Ur,iconClass:"text-accent-red"}:{label:Cue(),icon:db,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Wr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:a5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:a5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":s6(),disabled:!e,onClick:p,children:f.jsx(ub,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const ee=n.parts.filter(te=>te.type==="text").map(te=>te.text??"").join(` +`),I=te=>!!(v!=null&&v.some(de=>de.name===te)),L=n.parts.filter(te=>te.type==="image"&&te.text).map(N9t),P=L.filter(te=>!te.isPdf),W=L.filter(te=>te.isPdf),U=n.parts.filter(te=>te.type==="annotation"&&te.text).map(te=>({id:te.id,text:te.text??""}));if(O!==null){const te=()=>{const de=O.trim();!de||N||(B(null),j(n.id,de))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:de=>B(de.target.value),onKeyDown:de=>{de.key==="Escape"?(de.preventDefault(),B(null)):de.key==="Enter"&&!de.shiftKey&&!de.nativeEvent.isComposing&&(de.preventDefault(),te())}}),f.jsxs("div",{className:`${a5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:te,disabled:N||!O.trim(),children:E4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[U.length>0&&f.jsx(vk,{annotations:U,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:ee,isCommand:I}),P.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:P.map((te,de)=>f.jsx("a",{href:te.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:te.src,alt:vie()})},de))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((te,de)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:te.src,target:"_blank",rel:"noreferrer",children:[f.jsx(db,{size:15}),f.jsx("span",{children:te.name})]},de))})]}),w!==void 0&&f.jsx(z9t,{text:ee,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(ee),editDisabled:N})]})}const H=n.parts.find(ee=>ee.type==="tool"&&y3(ee)),q=n.parts.find(om)??H,Y=n.parts.filter(ee=>ee!==q&&!(H&&y3(ee)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),q&&f.jsx(SF,{part:q,usageLimited:!!H,busy:m,recovering:x===((X=(G=q.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:L1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:L1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:L1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function L1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Rv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Rv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ey(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=L1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?n6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ey(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Wr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,P;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(U=>U.role==="user"&&!U.id.startsWith(Cd));return kxt(a,n,W,U=>U.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),H=R.useCallback(W=>j[W].id,[j]),q=R.useCallback(W=>{if(B)return j.map((te,de)=>de);const U=new Set(yB(W));return j.forEach((te,de)=>{O.current.has(te.id)&&U.add(de)}),[...U].sort((te,de)=>te-de)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:H,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((P=t.current)==null?void 0:P.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:q});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var de;const U=window.getSelection();if(!U||U.isCollapsed||!U.rangeCount)return;const te=U.getRangeAt(0);for(const re of((de=t.current)==null?void 0:de.querySelectorAll("[data-message-id]"))??[])te.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),ee=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ce,pe;const U=j[W.index],te=U.parts.find(om),de=(Q=(ne=te==null?void 0:te.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=te?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":U.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(U.id),onFocusCapture:()=>O.current.add(U.id),children:f.jsx(j9t,{message:U,forkCount:(le=M.get(U.id))==null?void 0:le.count,forkIndex:(oe=M.get(U.id))==null?void 0:oe.index,forkPrevId:(ce=M.get(U.id))==null?void 0:ce.prevId,forkNextId:(pe=M.get(U.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(ee==null?void 0:ee.messageId)===U.id?ee.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:de===C?C:null,onRecover:E,skills:N,predictTextTail:_&&U===G&&U.role==="assistant"})},U.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,fb],Iw=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ab(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:H=t9t}=ct($),q=R.useCallback(ie=>{Vr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,ee]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const P=R.useRef({projectId:e});P.current.projectId!==e&&(P.current={projectId:e});const[W,U]=R.useState(new Set),[te,de]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ce=R.useRef({projectId:e,activeId:I,mainView:i});(ce.current.projectId!==e||ce.current.activeId!==I||ce.current.mainView!==i)&&(ce.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=r5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Tw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==r5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=H.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Tw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:sv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=nb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Pr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Pr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(w2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=P.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(P.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{P.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();U(e===N2?new Set([p6,m6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=P.current;return()=>{P.current===be&&(P.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>av(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>av(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&U(be=>Ext(be,ie.ids,we.busySessions,H,i==="chat"?I:null))},[e,we.busySessions,H,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Fr=I?we.queuedBySession[I]??[]:[],oa=Fr.some(ie=>ie.dispatchState==="retrying"),Jl=Fr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Fr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Fr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Fr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===N2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Pr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ce.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(w2())}catch{Te(IE()),ho()}return}const Z=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!Z){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(Z,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&te==="archived"&&de("active");const Tn=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ce.current,Oe=P.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return P.current===Oe&&(q(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),P.current===Oe&&ce.current===Ae&&(L.current(Ue.id,{replace:!0}),ce.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ce.current;let Oe=I;const Ue=()=>{const Ln=ce.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(w2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&te==="archived"&&de("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){Jv(ie),ce.current.projectId===e&&ce.current.activeId===ie&&ce.current.mainView==="chat"&&L.current(null,{replace:!0}),U(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=H.filter(ie=>P9t(te,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{de("active"),w(null)},[w]),Ru=R.useCallback(ie=>{de("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===te))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:te,onChange:de})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===N2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:te==="archived"?Hae():H.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(dv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:o6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),ee(!0)}}),X&&f.jsx(ZP,{onClose:()=>{ee(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Iw[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Iw[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=Iw[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Fr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Fr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} -${se.error}`:se.text,children:[se.dispatchState==="blocked"?f.jsx(O6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(dpt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:se.text}),se.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:se.dispatchState==="retrying"?r2t(se.nextRetryAt,La):ahe()}),se.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void cf(se.id),"aria-label":lY({text:se.text}),disabled:or!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:or===se.id?tL():Ui()}),f.jsx("button",{onClick:()=>lf(se.id),"aria-label":sY({text:se.text}),disabled:or!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:nde()}),be===Jl&&belf(se.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(qr,{size:11})})]},se.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",Cce()]})," ",Ke.agentNote?tm(Ke.agentNote):hhe()]}),Da&&f.jsx(Q8t,{skills:Cs,activeIndex:Vr,onPick:Xl,onHover:fr}),Q.length>0&&f.jsx(CCt,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var se;return(se=ln.current)==null?void 0:se.focus()})},onRemove:se=>{const be=Q.filter(Ae=>Ae.id!==se);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=ln.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((se,be)=>{const Ae=()=>Se(Le=>Le.filter((Ue,zn)=>zn!==be));return se.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:se.name,children:[f.jsx(ub,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:se.name??"document.pdf"}),f.jsx("button",{title:NE(),"aria-label":NE(),onClick:Ae,children:f.jsx(qr,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:se.dataUrl,alt:Hfe()}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(qr,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:ln,className:"relative z-1 bg-transparent",value:oe,placeholder:hr?$_e():us&&Ke?h_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):nn?Ke!=null&&Ke.agentReady?pae({harness:Ne(E0[nn.harness])}):dae({harness:Ne(E0[nn.harness])}):aie(),rows:2,onPaste:Ra,onDragOver:se=>{se.dataTransfer.types.includes("Files")&&se.preventDefault()},onDrop:se=>{se.dataTransfer.files.length!==0&&(se.preventDefault(),Ni(Array.from(se.dataTransfer.files)))},onChange:se=>{const be=se.target.value,Ae=se.target.selectionStart;Ln(Ae);const Le=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&_A(be)===null?jw(be,Ae-1):null;if((Le==null?void 0:Le.query)==="plan"&&(Ut!=null&&Ut.planActivation)){yr(be,Le);return}ne(be),qt(!1)},onSelect:se=>Ln(se.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:se=>{if(Da){if(se.key==="ArrowDown"||se.key==="ArrowUp"){se.preventDefault();const be=se.key==="ArrowDown"?1:-1;fr((Vr+be+Cs.length)%Cs.length);return}if(se.key==="Tab"||se.key==="Enter"){se.preventDefault(),Xl(Cs[Vr]);return}if(se.key==="Escape"){se.preventDefault(),qt(!0);return}}if(se.key==="Backspace"&&io(se.currentTarget)){se.preventDefault();return}if(se.key==="Enter"&&!se.shiftKey&&!se.nativeEvent.isComposing){if(se.preventDefault(),xs){af();return}sf({queue:se.metaKey||se.ctrlKey})}}}),f.jsx(eCt,{text:oe,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:zi,projectId:e,textareaRef:ln})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:pt.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:yx(),"aria-label":yx(),"aria-haspopup":"dialog","aria-expanded":pt.open,onClick:()=>pt.setOpen(se=>!se),children:f.jsx(zmt,{size:16})}),pt.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:yx()}),f.jsx(b2t,{})]})]}),f.jsx("input",{ref:It,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:se=>{Ni(Array.from(se.target.files??[])),se.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:pE(),"aria-label":pE(),onClick:()=>{var se;return(se=It.current)==null?void 0:se.click()},children:f.jsx(fmt,{size:16})}),$r&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(Vpt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(qr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:cue()})]}),xs&&f.jsxs(Oe,{type:"button",variant:"ghost",active:!0,className:"group",title:xE(),"aria-label":xE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(qr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:bD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(hgt,{value:nn,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ut==null?void 0:Ut.permissionModes)??[]:[],defaultPermissionId:(Ut==null?void 0:Ut.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!tn}),f.jsx(nCt,{usage:tn==null?void 0:tn.contextUsage})]}),Bn&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:ME(),"aria-label":ME(),onClick:of,children:f.jsx(qr,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?TE():C4(),"aria-label":xs?TE():C4(),onClick:()=>void(xs?af():sf()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!oe.trim()&&pe.length===0&&Q.length===0,children:f.jsx(FO,{size:16})})]})]})]})]})]})}const w9t=[],S9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function ph({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Ao({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const CA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function k9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:CA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Vit()})})});let m=null;for(const S of u)if(m=Av(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:CA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(c9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Xit()})})})})}function C9t({experiment:e}){var s;const n=ct(fI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(ph,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Ao,{children:[Tse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(hB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(pB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Bse():Ese()}):f.jsx(Ao,{children:Dse()})})}function SF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":w0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:E0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:CD()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(Jp,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(rb,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(hb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:BE(),"aria-label":BE(),onClick:l,children:o?f.jsx(Lt,{}):f.jsx(gmt,{size:13})})]})}const E9t=/\.(md|mdx|markdown)$/i,N9t=/\.tex$/i,z9t=/\.html?$/i,j9t=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,T9t=/\.(csv|tsv|xlsx?|ods)$/i,A9t=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,R9t=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,M9t=/\.pdf$/i,D9t=/\.(docx?|log|rtf|txt)$/i;function L9t(e){return j9t.test(e)}function yk(e){return E9t.test(e)}function kF(e){return N9t.test(e)}function O9t(e){return z9t.test(e)}function Zh({name:e}){const n=yk(e)?"markdown":L9t(e)?"image":T9t.test(e)?"spreadsheet":A9t.test(e)?"code":R9t.test(e)?"archive":M9t.test(e)?"pdf":D9t.test(e)||kF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function CF(e,n){const t=navigator.clipboard;if(!t){Kn(AD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Kn(tp(),"success")).catch(r=>Kn(r instanceof Error?r.message:String(r),"error"))}function EF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(rs,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Obe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function NF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function zF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(sr,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return no.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":zbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Rbe(),n),t&&p(xD(),t),r&&p(kbe(),r),p(bre(),s),i&&p(yD(),i,!0)]}),document.body)}const o5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),EA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function NA(){return{dirs:new Map,files:[]}}function jF(e){const n=NA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(qo,{size:13,className:EA}):f.jsx(Ta,{size:13,className:EA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(xk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function xk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(I9t,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:o5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Zh,{name:p}),f.jsx(EF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Ur(S=>i(m,S));return f.jsxs("button",{type:"button",className:o5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:fQ({name:Ne(m)}),children:[f.jsx(Zh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function B9t({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({..._I(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({...fv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=fI(t.id),S=IG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?jF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const z=new Set(s);z.has(T)?z.delete(T):z.add(T),a(z)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(SF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?eb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:hD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(C9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Ao,{children:M0e()}),p&&w&&f.jsxs(Ao,{children:[F0e()," ",Ne(p)]}),f.jsx(ph,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Ao,{children:I0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(xk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,z)=>v?o(T,v,void 0,z):o(T,void 0,l,z)})}):f.jsx(Ao,{children:p?ED({error:Ne(p)}):ND()})})]})]})}function wk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function $9t({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(q=>q.id===e&&q.busy))??!1,d=ct({...fv(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({..._I(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(fv(e)),nt.invalidateQueries({queryKey:Nt("getCodeTree",l),predicate:q=>!iD(q)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const z=R.useMemo(()=>S?jF(S.entries):null,[S]),M=R.useCallback(q=>{const G=new Set(r);G.has(q)?G.delete(q):G.add(q),i(G)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?Ict({branch:Ne(O.baselineBranch)}):o6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,U=O?jct({branch:Ne(`${B}${$>0?"*":""}`)}):Mct({branch:Ne(n.baselineBranch)}),H=O?O.branch:n.baselineBranch,Y=(q,G)=>O?a(q,e,void 0,G):a(q,void 0,n.baselineBranch,G),V=(S==null?void 0:S.root)==="worktree",X=async(q,G)=>{try{await Lut(l,q,G,{sessionId:e}),N()}catch(ee){Kn(ee instanceof Error?ee.message:String(ee),"error")}},te=q=>{const G=(S==null?void 0:S.path)??n.repoPath;CF(G,q)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(SF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:U,branchTitle:U,githubHref:n.githubEnabled&&H?eb(n.githubOwner,n.githubRepo,H):void 0,githubTitle:H?hD({branch:Ne(H)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Ao,{children:[rut()," ",Ne(v)]}),!S||e&&!p?f.jsx(ph,{children:f.jsx(Ao,{children:v?ED({error:Ne(v)}):ND()})}):O&&t==="changes"?f.jsx(ph,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:Qct()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(hB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(pB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(ph,{children:[S.truncated&&f.jsx(Ao,{children:Fct()}),z?z.dirs.size===0&&z.files.length===0?f.jsx(wk,{icon:Dd,title:Jct(),description:Gxe()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(xk,{node:z,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(q,G)=>{y(NF(q,G))},onRename:(q,G)=>{E(null),X(q,{action:"rename",newName:G})},onCancelRename:()=>E(null)})}):f.jsx(Ao,{children:Gct()})]}),w&&f.jsx(zF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:V&&o(w.path)?()=>E(w.path):void 0,onDuplicate:V?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:V?()=>{window.confirm(ybe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function TF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` -`),d=IP(_,TS(n));return _.endsWith(` -`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=WP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${GP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Nv} ${UP}`,children:BP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Nv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function AF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function zA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[W5e()," ",f.jsxs("a",{href:e,download:n,children:[$D()," ",Ne(n)]})]})}function l5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(zA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(zA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[$D()," ",t]})})]})}const P9t=e=>({queryKey:Nt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function RF(e,n=!0){return ct({...P9t(e),enabled:n,subscribed:n}).data??null}function F9t(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function H9t(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Ph(e,_)}${p?`&${p}`:""}${i}`}}function q9t(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const MF="orx:files-tree-width",DF="orx:artifacts-collapsed:",LF=180,OF=320,U9t=8,G9t=280;function W9t(){try{const e=Number(localStorage.getItem(MF));if(Number.isFinite(e)&&e>=LF&&e<=OF)return e}catch{}return G9t}function V9t(e){try{const n=localStorage.getItem(`${DF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function xp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=xp(t.children??[],n);if(r)return r}}return null}function IF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(F9t(i))return i;const a=H9t(e,n,i);if(!a)return null;const o=xp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(W3t,{remarkPlugins:[MP,[DP,FP]],rehypePlugins:[lP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...HP},children:$P(q9t(t))})})}function K9t(e){return e.presentation==="text"&&yk(e.name)?"markdown":AF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function Q9t(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=PL,i=q6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Sre():null),wantsText:s}}function Y9t({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=K9t(n),i=RF(Ph(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=Q9t(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Ph(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(l5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?pre():wse()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?RD():Nre()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Hre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(Lt,{})," ",gD()]}):m&&!d?v=f.jsx(IF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(TF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Zh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[ose()," ",new Date(n.modifiedAt).toLocaleString(j(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Ml(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?tv():nh(),"data-tip-align":"end","aria-label":d?tv():nh(),onClick:()=>p(b=>!b),children:f.jsx(Z4,{size:13})}),f.jsx(rb,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":lE(),"data-tip-align":"end","aria-label":lE(),onClick:()=>{window.confirm(Z5({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Xd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Wre()})]})]})}function BF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,U9t)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?ere({name:Ne(p.name)}):dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Bre(),"data-tip-align":"end","aria-label":ore({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(Z5({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Xd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(BF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Zh,{name:p.name}),f.jsx(EF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:hK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Zh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function X9t({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>V9t(e.id)),[l,u]=R.useState(W9t),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${DF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),z=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const U=Math.round($.clientX-((T==null?void 0:T.left)??0)),H=Math.min(Math.max(U,LF),OF);u(H);try{localStorage.setItem(MF,String(H))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=z};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=xp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const z=new Set(T);return z.has(N)?z.delete(N):z.add(N),z}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),Idt(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await Bdt(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(z){Kn(z instanceof Error?z.message:String(z),"error")}},y=N=>{n&&CF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(Lt,{})," ",rse()]})});const C=N=>f.jsx(BF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,z)=>{d(NF(T,z))},onRename:(T,z)=>{m(null),w(T,{action:"rename",newName:z})},onCancelRename:()=>m(null)}),E=s?xp(n.entries,s):null;return n.entries.length===0?f.jsx(wk,{icon:M6,title:dse(),description:vse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:Yre()})]})]}),E?f.jsx(Y9t,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(omt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Are()})]}),_&&f.jsx(zF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(Z5({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const $F=20*1024*1024,PF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",FF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",Z9t="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",J9t="text-sm font-normal text-text",eEt="mt-1 mb-0 text-sm leading-relaxed text-text";function HF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function tEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function qF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(Lt,{}),f.jsx("span",{children:Rrt()})]}):f.jsxs(f.Fragment,{children:[f.jsx(Rmt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function UF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Ml(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",Io(n)]})]})}function nEt({skill:e,onError:n}){const t=gn({mutationFn:aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:J9t,children:e.name}),e.origin&&f.jsx(Ft,{size:"small",children:e.origin})]}),f.jsx(UF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ent():ert(),"data-tip-align":"end","aria-label":e.origin?Dnt({name:Ne(e.name)}):Gtt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?Tnt({name:Ne(e.name)}):Ftt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Xd,{size:13})})]})}function rEt({template:e,onError:n}){const t=gn({mutationFn:rft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:Z9t,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:eEt,children:[e.entry,s>0&&(s===1?vnt():Bnt({count:Wt(s)}))]})]}),f.jsx(UF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":srt(),"data-tip-align":"end","aria-label":Jtt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(Qtt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Xd,{size:13})})]})}function sEt(){var w;const e=gn({mutationFn:ift}),n=ct(Wft()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!tEt(y.name)){x(Prt());return}if(y.size>$F){x(CL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await HF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:PF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:zrt()}),f.jsxs(Oe,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Yp()]})]}),f.jsx("p",{className:FF,children:rnt()}),f.jsx(qF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:ont()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Itt()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Hnt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(Lt,{})," ",frt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:yrt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(nEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function iEt(){var _;const e=gn({mutationFn:nft}),n=ct(Gft()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(Urt());return}if(d.size>$F){o(CL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await HF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:PF,children:[f.jsx("h3",{children:lrt()}),f.jsx("p",{className:FF,children:Ort()}),f.jsx(qF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:dnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:cat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[Wnt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(Lt,{})," ",mrt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(rEt,{template:d,onError:o},d.name))})]})}function aEt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:Ynt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:wnt()}),f.jsx(sEt,{}),f.jsx(iEt,{})]})}const oEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?oEt:""}`,onClick:i,onDoubleClick:a,title:s?iat({label:n}):n,"aria-label":s?tat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:p0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(qr,{size:12})})]})}const jA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function lEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:jA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:jA,href:eb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:J1({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(hb,{size:12})]})}const Iw=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),TA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function AA(e){return new Date(e).toLocaleString(j(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function RA(e,n){return np((e.endedAt??n)-e.createdAt)}function cEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Gi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Oe,{...Ur(_=>s(a.id,_)),children:[f.jsx(qh,{size:15}),J1e()]}),f.jsxs(Oe,{...Ur(i),children:[f.jsx(fb,{size:15}),C1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:I1e()}),f.jsx($o,{text:e.description})]}),f.jsxs("section",{className:Iw,children:[f.jsx("h2",{children:a?x1e():pve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Gi(a)}),f.jsx($6,{backend:a.backend}),f.jsxs("span",{title:dve(),children:[f.jsx(Y0t,{size:13}),AA(a.createdAt)]}),f.jsxs("span",{title:F1e(),children:[f.jsx(cpt,{size:13}),RA(a,l)]}),a.commitSha&&f.jsxs("span",{title:j1e(),children:[f.jsx(Bpt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[G1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:TA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx($o,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:Iw,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(lEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[Q1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:AA(e.createdAt),children:[M1e()," ",Io(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:TA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Iw,children:[f.jsx("h2",{children:ove()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Ur(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[rve()," ",r.length-d]}),f.jsx($l,{status:Gi(_)}),f.jsx("span",{children:Io(_.createdAt)}),f.jsx("span",{children:RA(_,l)}),f.jsx(qh,{size:13})]},_.id))})]})]})})}function MA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=S6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await zut(e,a);if(i)return;if(d.dataBase64&&r.write(MA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=Jft(e,d=>{if(i)return;const p=MA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function dEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(cEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(fEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function fEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await ML(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Oe,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx($O,{size:13}),m?G0e():jD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Oe,{title:$ge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[$E()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Gi(d)}),f.jsx(qo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(sr,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[$E()," ",x(v.id)]}),f.jsx($l,{status:Gi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:Io(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(uEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Rge()})})]})}let c5=!1;function DA(e){c5=!0;try{return window.confirm(e)}finally{c5=!1}}const u5=e=>e.replace(/\r\n/g,` -`),LA=(e,n,t)=>{const r=u5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r -`),conflict:null}},kl=e=>e.draft!==e.baseline,hEt=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),_Et=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function pEt(e,n,t){return!kl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class mEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(kl(this.buffer)||this.buffer.conflict!==null)}}function gEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...Ngt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[z,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),U=R.useRef(o);U.current=o;const H=R.useRef(!1),Y=R.useRef(null),V=R.useCallback(()=>{if(H.current)return;Y.current=n,H.current=!0,m(!0);const L=U.current;T(null),b(null),E(null),But(e,n,{sessionId:t}).then(F=>{var G,ee;const q=F.pdfPath;if(F.ok&&q){S(ce=>({path:q,version:((ce==null?void 0:ce.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((G=F.log)==null?void 0:G.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((ee=F.log)==null?void 0:ee.trim())||b3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{H.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&V()},[r,s,a,u,n,V]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:z,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),V()},dismiss:()=>{T(null),b(null)}}}const vEt=3e4,bEt=3e4,yEt=5*6e4;function xEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var oe,ne,Q,le;const u=R.useMemo(()=>jgt(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((oe=_.data)==null?void 0:oe.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,z]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(ae=>{Pn(u.queryKey)&&nt.setQueryData(u.queryKey,ue=>ue&&{...ue,hasSession:ae})},[u]),$=R.useCallback(ae=>{Pn(u.queryKey)&&nt.setQueryData(u.queryKey,ae)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,z(null),O(!1),V.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const U=R.useRef(!1),H=R.useRef(l);H.current=l;const Y=R.useRef(o);Y.current=o;const V=R.useRef(!1),X=R.useCallback(ae=>!d||!m||U.current||Y.current?!1:(U.current=!0,C(!0),z(null),Kut(e,n,{sessionId:t,resolve:ae}).then(ue=>{V.current=!1,N(ue),ue.pulled.includes(n)&&(Y.current?O(!0):H.current(ue.pulled))}).catch(ue=>{V.current=!0,N(null),z(ue instanceof Error?ue.message:String(ue))}).finally(()=>{U.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const ae=`${n}:${m.projectId}:${a}`;te.current!==ae&&X()&&(te.current=ae)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,q=R.useRef(null),G=R.useRef(Promise.resolve()),ee=R.useRef(!1);ee.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const ce=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let ae=!1;const ue=()=>{const Se=ce.current;ce.current=!1,!(!Se&&ee.current)&&(G.current=G.current.then(()=>{if(!ae)return qut(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;ae||((q.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),q.current=ye.key)}).catch(ye=>{ae||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ue();const pe=setInterval(ue,bEt);return()=>{ae=!0,clearInterval(pe),q.current=null,v(null),G.current=G.current.then(()=>Uut(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>rht(ae=>{if(ae.key===q.current){if(ae.type==="live"){v(ae.status);return}ae.paths.includes(n)&&(Y.current?O(!0):H.current(ae.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const ae=setInterval(()=>{U.current||V.current||nt.fetchQuery({...Tgt(e,n,{sessionId:t}),staleTime:0}).then(ue=>{ue.remoteChanged&&X()}).catch(ue=>{V.current=!0,z(ue instanceof Error?ue.message:String(ue))})},vEt);return()=>clearInterval(ae)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const ae=setInterval(X,yEt);return()=>clearInterval(ae)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{ce.current=!0,w(ae=>ae+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:Yut(e,n,{sessionId:t}),saveToken:async ae=>{const ue=await DL(ae);te.current=null,V.current=!1,z(null),Pn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ue.hasToken})},saveSession:async ae=>{const ue=await LL(ae,{host:m==null?void 0:m.host});B(ue.hasSession),ce.current=!0,w(pe=>pe+1)},importSession:async()=>{const ae=await Hut({host:m==null?void 0:m.host});return B(ae.hasSession),ce.current=!0,w(ue=>ue+1),ae.source},linkProject:async ae=>{N(null),v(null),L.current=!1,te.current=null,$(await Wut(e,n,{project:ae,sessionId:t})),i==null||i()},unlink:async()=>{$(await Vut(e,n,{sessionId:t})),te.current=null,V.current=!1,N(null),z(null)},sync:ae=>{V.current=!1,X(ae)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function GF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function OA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function wEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const IA=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],SEt=4e6,kEt=200,BA=16e6,CEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),$A=e=>e.startsWith("//")?`https:${e}`:e;async function EEt(e,n){var s;let t=SEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=kEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await CEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function NEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(IA.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of IA){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,$A(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await EEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!GF(l)||(o.setAttribute("href",$A(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function zEt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${BA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>BA}}function jEt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),zEt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await NEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(Lt,{})," ",MD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:Zye()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:n2e({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function TEt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=ro(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?z4():l?PNe():!e.hasToken||!e.link?oTe():e.syncing?YD():e.blocked?QD():WD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Kn(z4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":HQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(Lt,{}):f.jsx(hpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&no.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":pL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Dye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(qr,{size:13})})}),f.jsx(LEt,{overleaf:e})]}),document.body)]})}const s1=e=>Do(new Intl.ListFormat(j()).format(e.map(Ne)));function AEt(e){if(e.error)return lze();if(e.syncing)return YD();if(e.blocked)return QD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Bje({pulled:s1(n.pulled),pushed:s1(n.pushed)}):n.pulled.length?Dje({paths:s1(n.pulled)}):n.pushed.length?Hje({paths:s1(n.pushed)}):n.conflicts.length?$ze():WD():Eje()}function REt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:KD()})}function MEt(e){return e.state==="live"?yze():e.state==="connecting"?mze():e.error??zze()}function PA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?_Te():n?Wje():XNe();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(rs,{className:"basis-full min-w-0","aria-label":N4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:N4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(Lt,{}),a?f.jsx(Oe,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?ea():ONe()}):f.jsx(Oe,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:tze()}),f.jsx(Oe,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?VD():Tje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function DEt({overleaf:e}){if(!e.hasSession)return f.jsx(PA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Rze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:MEt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Oe,{onClick:e.retryLive,children:kze()})}),t&&f.jsx(PA,{overleaf:e,replacing:!0})]})}function LEt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(Lt,{}),e.error?z4():AEt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(DEt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Oe,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?Yje():((m=e.live)==null?void 0:m.state)==="live"?xTe():void 0,onClick:()=>e.sync(),children:e.error?Ui():dje()}),f.jsxs(Hh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[sje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",Yze()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:eje()}),f.jsx(Oe,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:wje()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:f6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Oe,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:pN()}),f.jsx(Hh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:KD()}),f.jsx(Oe,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:pje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?zTe():RTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(rs,{className:"basis-full min-w-0","aria-label":_?hN():_N(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?hN():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Oe,{type:"submit",disabled:r||!n.trim(),children:r?_?ea():Yi():_?rTe():fze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?UNe():_N()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(REt,{href:e.uploadUrl}),o?f.jsx(Oe,{variant:"ghost",type:"button",onClick:()=>l(!1),children:VD()}):e.hasToken&&f.jsx(Oe,{variant:"ghost",type:"button",onClick:u,children:pN()})]})]})}function OEt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?fxe():lye(),"aria-label":fye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(cb,{size:13})})]})}function IEt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var pt,kt;const E=mI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,z=((pt=N.error)==null?void 0:pt.message)??null,M=Ge=>{Gr(E.queryKey,mt=>(typeof Ge=="function"?Ge(mt??null):Ge)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",U=t==="abs",H=yk(n),Y=kF(n),V=O9t(n),X=H||V,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const q=S.getSnapshot(),G=S.set,ee=S.saving,ce=S.setSaving,oe=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),ae=R.useRef(l),ue=(T==null?void 0:T.file)??null,pe=q&&kl(q)?q.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ge=>{var mt;return((mt=OA(Se,Ge,U))==null?void 0:mt.path)??null},[U,Se]),Ie=R.useCallback(Ge=>U?Mut(Ge):ye?Ph(e,Ge):ON(e,Ge,{sessionId:r,ref:s}),[ye,s,U,e,r]),ze=R.useCallback(Ge=>{if(GF(Ge))return Ge;const mt=OA(Se,Ge,U);return mt?wEt(Ie(mt.path),mt):null},[U,Se,Ie]),at=AF(ue==null?void 0:ue.presentation),bt=(T==null?void 0:T.source)==="artifact"&&!$,$t=$&&(T==null?void 0:T.source)==="checkout",Pt=!s&&(T==null?void 0:T.source)==="checkout"&&ue!=null&&!ue.notFound,zt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",ot=Pt&&ue!=null&&!ue.binary&&!ue.truncated&&!at&&!zt,ft=ot&&ue.version===void 0,It=q!==null&&kl(q),we=!ft&&(ot&&typeof ue.version=="string"||It),Re=(q==null?void 0:q.draft)??u5((ue==null?void 0:ue.content)??""),Ze=(q==null?void 0:q.baseline)??u5((ue==null?void 0:ue.content)??""),ht=we&&q!==null&&kl(q),xt=async Ge=>{const mt=S.getSnapshot();if(!we||!mt||!kl(mt))return!0;if(S.saving)return!1;if(mt.conflict&&Ge===void 0)return Q(mt.conflict.exists?PE():HE()),!1;const fr=mt.draft,cn=_Et(mt);ce(!0),Q(null);try{await nt.cancelQueries(E);const qt=await Dut(e,pe,cn,{sessionId:r,expectedVersion:Ge??mt.version});return S.getSnapshot()?(S.saved(fr,qt.version),M(Ln=>Ln&&Ln.source==="checkout"?{source:"checkout",file:{...Ln.file,content:cn,version:qt.version}}:Ln),!0):!1}catch(qt){if(qt instanceof R4){const er=S.getSnapshot();return!er||!kl(er)||G({...er,conflict:{currentVersion:qt.currentVersion,exists:qt.exists}}),!1}return Q(qt instanceof Error?qt.message:String(qt)),!1}finally{ce(!1)}},Vt=Y&&Pt&&!zt,Ve=gEt({projectId:e,filePath:pe,sessionId:r,enabled:Vt,autoRun:L,onManualAction:F,ready:ue!=null&&!ue.notFound,source:we?Re:(ue==null?void 0:ue.content)??""}),Ht=xEt({projectId:e,filePath:pe,sessionId:r,enabled:Vt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:ht,onPulled:R.useCallback(Ge=>{Ge.includes(pe)&&B(mt=>mt+1)},[pe])}),sn=Y&&Ve.showPdf&&Ve.compiled!=null,fn=ft&&It,Zt=(we||fn)&&!(X&&!y)&&!sn,Qn=Ve.compiled?`${ON(e,Ve.compiled.path,{sessionId:r})}&v=${Ve.compiled.version}`:null,Jt=Qn?`${Qn}&view=${Ve.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,bn=Ve.compiled?Ve.compiled.path.split("/").pop()??Ve.compiled.path:null,or=async()=>{ht&&!await xt()||Y&&Ve.engine&&Ve.compile()},lr=async()=>{ht&&(L?await or():await xt())},[br,Dn]=R.useState(!1),[Wr,Nr]=R.useState(null),vt=async()=>{Dn(!0),Nr(null);try{await Out(e,pe,{sessionId:r})}catch(Ge){Nr(Ge instanceof Error?Ge.message:String(Ge))}finally{Dn(!1)}},un=R.useCallback(()=>{S.saving||B(Ge=>Ge+1)},[S]),Cn=()=>{G(null),Q(null),un()},en=RF(Ie(pe),!s&&!ee);R.useEffect(()=>{if(!z||s)return;const Ge=window.setInterval(()=>{document.visibilityState!=="hidden"&&un()},2e3);return()=>window.clearInterval(Ge)},[z,s,un]);const Jn=`${Ie(pe)}&v=${encodeURIComponent(en??m??"")}&reload=${O}`;R.useEffect(()=>{var fr,cn;if(!T||S.saving)return;const Ge=T,mt=S.getSnapshot();if(mt&&kl(mt)){const qt=Ge.source==="checkout"?Ge.file:null,er=qt!==null&&qt.path===mt.path&&(!r||qt.root==="worktree"),Ln=pEt(mt,er&&typeof qt.version=="string"?qt.version:null,er&&!qt.notFound);Ln&&(Ln.currentVersion!==((fr=mt.conflict)==null?void 0:fr.currentVersion)||Ln.exists!==((cn=mt.conflict)==null?void 0:cn.exists))?G({...mt,conflict:Ln}):!Ln&&mt.conflict&&G({...mt,conflict:null})}(!mt||!kl(mt))&&Ge.source==="checkout"&&!Ge.file.notFound&&!Ge.file.binary&&!Ge.file.truncated&&typeof Ge.file.version=="string"&&(G(LA(Ge.file.path,Ge.file.content,Ge.file.version)),Q(null))},[T,S,r,ee,oe]);const hn=JSON.stringify(E.queryKey),En=R.useRef({sourceKey:hn,nonce:O,artifactVersion:m,diskVersion:en});R.useEffect(()=>{const Ge=En.current;En.current={sourceKey:hn,nonce:O,artifactVersion:m,diskVersion:en},Ge.sourceKey===hn&&(Ge.nonce!==O||Ge.diskVersion!==null&&Ge.diskVersion!==en||Ge.artifactVersion!=null&&Ge.artifactVersion!==m)&&Agt(e,n,t??"repo",r,s)},[hn,O,m,en,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ge=le.current,mt=ae.current;!Ge||!ue||!mt||(Ge.scrollTop=mt.top,Ge.scrollLeft=mt.left)},[ue]);const ln=Ge=>{if(Ge.source==="absolute")return x2e();if($)return h2e({root:r?zg():Ng()});if(s)return g2e({branch:Ne(s)});if(r&&Ge.source==="checkout"&&Ge.file.root==="clone")return Fxe();const mt=Ge.source==="checkout"?Ge.file.root:Ge.checkoutRoot;return C2e({root:mt==="worktree"?zg():Ng()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Zh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:gK({branch:Ne(a)}),children:[f.jsx(Jp,{size:11}),a]}),Zt&&(ee||ht||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(ee?ea():Mxe()),children:ee?f.jsxs(f.Fragment,{children:[f.jsx(Lt,{})," ",lxe()]}):ne?sxe():DD()}),Y&&Ve.compiled&&f.jsx(Qt,{size:"small",active:!Ve.showPdf,"data-tip":Ve.stale&&Ve.showPdf?U2e():Ve.showPdf?nh():VE(),"data-tip-align":"end","aria-label":Ve.showPdf?nh():VE(),onClick:()=>Ve.setShowPdf(!Ve.showPdf),children:Ve.showPdf?f.jsx(Z4,{size:13}):f.jsx(ub,{size:13,className:Ve.stale?"text-accent-amber":void 0})}),Y&&Qn&&bn&&f.jsx(rb,{size:"small","data-tip":Ve.stale?Fye({name:Ne(bn)}):eE({name:Ne(bn)}),"data-tip-align":"end","aria-label":eE({name:Ne(bn)}),href:Qn,download:bn,children:f.jsx(bpt,{size:13,className:Ve.stale?"text-accent-amber":void 0})}),Vt&&f.jsx(TEt,{overleaf:Ht}),Y&&Pt&&f.jsx(Qt,{size:"small","data-tip":Ve.compiled?WE():FE(),"data-tip-align":"end","aria-label":Ve.compiled?WE():FE(),disabled:Ve.compiling||!Ve.engine,onClick:()=>void or(),children:Ve.compiling?f.jsx(Lt,{}):f.jsx(kpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?tv():nh(),"data-tip-align":"end","aria-label":y?tv():nh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(Z4,{size:13})}),Pt&&!v&&f.jsx(Qt,{size:"small","data-tip":Wr??GE(),"data-tip-align":"end","aria-label":GE(),disabled:br,onClick:()=>void vt(),children:br?f.jsx(Lt,{}):f.jsx(Md,{size:13})})]}),!z&&$t&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:j2e({root:T.file.root==="worktree"?zg():Ng()})}),ft&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:Ixe()}),z&&ue!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[UE()," ",Ne(z)]}),(q==null?void 0:q.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:q.conflict.exists?PE():HE()}),((kt=q==null?void 0:q.conflict)==null?void 0:kt.exists)&&q.conflict.currentVersion&&f.jsx(Oe,{disabled:ee,onPointerDown:Ge=>Ge.preventDefault(),onClick:()=>{var Ge;return void xt(((Ge=q.conflict)==null?void 0:Ge.currentVersion)??void 0)},children:P2e()}),f.jsx(Oe,{disabled:ee,onPointerDown:Ge=>Ge.preventDefault(),onClick:Cn,children:exe()})]}),(Ve.error||Ve.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${Ve.builtWithErrors?"text-subtext":"text-accent-red"}`,children:Ve.error??(Ve.builtWithErrors?sye():Xbe())}),f.jsx(Qt,{"data-tip":Eye(),"data-tip-align":"end","aria-label":Tye(),onClick:Ve.dismiss,children:f.jsx(qr,{size:13})})]}),Ve.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:Ve.log})]}),Vt&&Ht.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:O2e()}),f.jsx(Oe,{onClick:()=>{Ht.reloaded(),B(Ge=>Ge+1)},children:bye()})]}),Y&&Pt&&Ve.engine===null&&Ve.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[Ve.installHint,Ve.installCommand&&f.jsx(OEt,{command:Ve.installCommand})]}),Ve.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:Ve.note}),sn&&Ve.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:wxe()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ge=>{const mt={top:Math.max(0,Ge.currentTarget.scrollTop),left:Math.max(0,Ge.currentTarget.scrollLeft)};ae.current=mt,u==null||u(mt)},children:[!Zt&&!z&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Exe()}),!Zt&&!z&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&bt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Pbe({root:T.checkoutRoot==="worktree"?zg():Ng()})}),z&&ue===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[UE()," ",Ne(z)]}):ue===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:MD()}):Zt?f.jsx(VP,{value:Re,onChange:Ge=>{const mt=S.getSnapshot()??(ue&&typeof ue.version=="string"?LA(ue.path,ue.content,ue.version):null);mt&&G(hEt(mt,Ge)),p==null||p(),ne&&Q(null)},onSave:()=>void lr(),onBlur:()=>{c5||lr()},readOnly:fn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:ae.current,onScrollPositionChange:Ge=>{ae.current=Ge,u==null||u(Ge)}}):ue.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?ln(T):c2e()}):at?f.jsx(l5,{kind:at,url:Jn,name:n.split("/").pop()??n}):ue.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Ube()," ",f.jsx("a",{href:Jn,download:n.split("/").pop()??n,children:RD()})]}):sn&&Jt&&bn?f.jsx(l5,{kind:"pdf",url:Jt,name:bn,downloadBar:!1},Jt):H&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(IF,{projectId:e,folder:Se,markdown:ue.content,entries:x}):f.jsx($o,{text:ue.content,resolveFilePath:qe,resolveImageSrc:ze,onOpenFile:o&&((Ge,mt,fr,cn,qt)=>o(Ge,r,s,qt))})}):V&&!y?f.jsx(jEt,{html:ue.content,truncated:ue.truncated,url:Jn,name:pe,resolveSrc:ze}):f.jsxs(f.Fragment,{children:[f.jsx(TF,{text:ue.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ue.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Kye()})]})]})]})}const Bw=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function BEt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=ro(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":KE(),onClick:n,children:f.jsx(ap,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:c4e()}),s&&f.jsx(Qt,{size:"small","data-tip":QE(),"data-tip-align":"end","aria-label":QE(),onClick:s,children:f.jsx(KO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(qo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(sr,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:Bw,children:[f.jsx(UO,{size:14}),Zwe()]})}),f.jsx(sr,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:Bw,children:[f.jsx(Hpt,{size:14}),KE()]})}),f.jsx(sr,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:Bw,children:[f.jsx(Tpt,{size:14}),n4e()]})})]})]})})}function $Et({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(wk,{icon:db,title:t??Nve(),description:t?void 0:bve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[hbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":ibe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Gi(b):v?Gi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Ur(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(Jp,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?Lve():qve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?Io(v.createdAt):Ave()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":cK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Oe,{size:"small",disabled:!w,title:w?$ve():Sve(),...Ur(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(qh,{size:15}),cbe()]}),f.jsxs(Oe,{size:"small",title:fD({branch:Ne(x.branchName)}),...Ur(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(fb,{size:15}),tbe()]}),b&&f.jsxs(Oe,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Vve():Xve(),onClick:()=>void m(b.id),children:[f.jsx($O,{size:15}),y?Tpe():jD()]})]})]},x.id)})})]})}function PEt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(Fat())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),no.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":gat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(qr,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(B6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Cat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Qat()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[Gat()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:Iat()}),hat()]}),f.jsx("p",{dir:"auto",children:Mat()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Oe,{onClick:()=>o(n),disabled:t,children:xat()}),f.jsx(Oe,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?ea():jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ty(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}L1.prototype=ty.prototype={constructor:L1,on:function(e,n){var t=this._,r=HEt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),HA.hasOwnProperty(n)?{space:HA[n],local:e}:e}function UEt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===d5&&n.documentElement.namespaceURI===d5?n.createElement(e):n.createElementNS(t,e)}}function GEt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function WF(e){var n=ny(e);return(n.local?GEt:UEt)(n)}function WEt(){}function Sk(e){return e==null?WEt:function(){return this.querySelector(e)}}function VEt(e){typeof e!="function"&&(e=Sk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function vNt(e){e||(e=bNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function yNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function xNt(){return Array.from(this)}function wNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?MNt:typeof n=="function"?LNt:DNt)(e,n,t??"")):Jh(this.node(),e)}function Jh(e,n){return e.style.getPropertyValue(n)||XF(e).getComputedStyle(e,null).getPropertyValue(n)}function INt(e){return function(){delete this[e]}}function BNt(e,n){return function(){this[e]=n}}function $Nt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function PNt(e,n){return arguments.length>1?this.each((n==null?INt:typeof n=="function"?$Nt:BNt)(e,n)):this.node()[e]}function ZF(e){return e.trim().split(/^|\s+/)}function kk(e){return e.classList||new JF(e)}function JF(e){this._node=e,this._names=ZF(e.getAttribute("class")||"")}JF.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function eH(e,n){for(var t=kk(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function _zt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function f5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}f5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function kzt(e){return!e.ctrlKey&&!e.button}function Czt(){return this.parentNode}function Ezt(e,n){return n??{x:e.x,y:e.y}}function Nzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function aH(){var e=kzt,n=Czt,t=Ezt,r=Nzt,s={},i=ty("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Szt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Fi(C.view).on("mousemove.drag",x,wp).on("mouseup.drag",S,wp),sH(C.view),$w(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(mh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Fi(C.view).on("mousemove.drag mouseup.drag",null),iH(C.view,u),mh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),z=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?a1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?a1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=jzt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=Tzt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Azt.exec(e))?a1(n[1],n[2],n[3],n[4]):(n=Rzt.exec(e))?a1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Mzt.exec(e))?QA(n[1],n[2]/100,n[3]/100,1):(n=Dzt.exec(e))?QA(n[1],n[2]/100,n[3]/100,n[4]):qA.hasOwnProperty(e)?WA(qA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function WA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function a1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function Izt(e){return e instanceof hm||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function h5(e,n,t,r){return arguments.length===1?Izt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ck(Ci,h5,oH(hm,{brighter(e){return e=e==null?Mv:Math.pow(Mv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sp:Math.pow(Sp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Dv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:VA,formatHex:VA,formatHex8:Bzt,formatRgb:KA,toString:KA}));function VA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function Bzt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function KA(){const e=Dv(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Dv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function QA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function lH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof hm||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function $zt(e,n,t,r){return arguments.length===1?lH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ck(Qa,$zt,oH(hm,{brighter(e){return e=e==null?Mv:Math.pow(Mv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sp:Math.pow(Sp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Pw(e>=240?e-240:e+120,s,r),Pw(e,s,r),Pw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(YA(this.h),o1(this.s),o1(this.l),Dv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Dv(this.opacity);return`${e===1?"hsl(":"hsla("}${YA(this.h)}, ${o1(this.s)*100}%, ${o1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function YA(e){return e=(e||0)%360,e<0?e+360:e}function o1(e){return Math.max(0,Math.min(1,e||0))}function Pw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Ek=e=>()=>e;function Pzt(e,n){return function(t){return e+t*n}}function Fzt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function Hzt(e){return(e=+e)==1?cH:function(n,t){return t-n?Fzt(n,t,e):Ek(isNaN(n)?t:n)}}function cH(e,n){var t=n-e;return t?Pzt(e,t):Ek(isNaN(e)?n:e)}const Lv=(function e(n){var t=Hzt(n);function r(s,i){var a=t((s=h5(s)).r,(i=h5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=cH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function qzt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:jo(r,s)})),t=Fw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:jo(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:jo(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:jo(u,d)},{i:S-2,x:jo(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--e_}function JA(){Fd=(Iv=Cp.now())+ry,e_=z0=0;try{sjt()}finally{e_=0,ajt(),Fd=0}}function ijt(){var e=Cp.now(),n=e-Iv;n>hH&&(ry-=n,Iv=e)}function ajt(){for(var e,n=Ov,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Ov=t);j0=e,m5(r)}function m5(e){if(!e_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(JA,e-Cp.now()-ry)),y0&&(y0=clearInterval(y0))):(y0||(Iv=Cp.now(),y0=setInterval(ijt,hH)),e_=1,_H(JA))}}function eR(e,n,t){var r=new Bv;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var ojt=ty("start","end","cancel","interrupt"),ljt=[],mH=0,tR=1,g5=2,I1=3,nR=4,v5=5,B1=6;function sy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;cjt(e,t,{name:n,index:r,group:s,on:ojt,tween:ljt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:mH})}function zk(e,n){var t=so(e,n);if(t.state>mH)throw new Error("too late; already scheduled");return t}function Qo(e,n){var t=so(e,n);if(t.state>I1)throw new Error("too late; already running");return t}function so(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function cjt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=pH(i,0,t.time);function i(u){t.state=tR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==tR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===I1)return eR(a);m.state===nR?(m.state=B1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_g5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function $jt(e,n,t){var r,s,i=Bjt(n)?zk:Qo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function Pjt(e,n){var t=this._id;return arguments.length<2?so(this.node(),t).on.on(e):this.each($jt(t,e,n))}function Fjt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function Hjt(){return this.on("end.remove",Fjt(this._id))}function qjt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=Sk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function _Tt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var iy=new Ol(1,0,0);yH.prototype=Ol.prototype;function yH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return iy;return e.__zoom}function Hw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function pTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function mTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function rR(){return this.__zoom||iy}function gTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function vTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function bTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function xH(){var e=pTt,n=mTt,t=bTt,r=gTt,s=vTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=O1,u=ty("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(H){H.property("__zoom",rR).on("wheel.zoom",z,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(H,Y,V,X){var te=H.selection?H.selection():H;te.property("__zoom",rR),H!==te?E(H,Y,V,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(H,Y,V,X){b.scaleTo(H,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},V,X)},b.scaleTo=function(H,Y,V,X){b.transform(H,function(){var te=n.apply(this,arguments),I=this.__zoom,L=V==null?C(te):typeof V=="function"?V.apply(this,arguments):V,F=I.invert(L),q=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,q),L,F),te,a)},V,X)},b.translateBy=function(H,Y,V,X){b.transform(H,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof V=="function"?V.apply(this,arguments):V),n.apply(this,arguments),a)},null,X)},b.translateTo=function(H,Y,V,X,te){b.transform(H,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(iy.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof V=="function"?-V.apply(this,arguments):-V),I,a)},X,te)};function w(H,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===H.k?H:new Ol(Y,H.x,H.y)}function y(H,Y,V){var X=Y[0]-V[0]*H.k,te=Y[1]-V[1]*H.k;return X===H.x&&te===H.y?H:new Ol(H.k,X,te)}function C(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function E(H,Y,V,X){H.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),q=V==null?C(F):typeof V=="function"?V.apply(te,I):V,G=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ee=te.__zoom,ce=typeof Y=="function"?Y.apply(te,I):Y,oe=l(ee.invert(q).concat(G/ee.k),ce.invert(q).concat(G/ce.k));return function(ne){if(ne===1)ne=ce;else{var Q=oe(ne),le=G/Q[2];ne=new Ol(le,q[0]-Q[0]*le,q[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(H,Y,V){return!V&&H.__zooming||new T(H,Y)}function T(H,Y){this.that=H,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(H,Y),this.taps=0}T.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Y){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Y=Fi(this.that).datum();u.call(H,this.that,new _Tt(H,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function z(H,...Y){if(!e.apply(this,arguments))return;var V=N(this,Y).event(H),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(H);if(V.wheel)(V.mouse[0][0]!==I[0]||V.mouse[0][1]!==I[1])&&(V.mouse[1]=X.invert(V.mouse[0]=I)),clearTimeout(V.wheel);else{if(X.k===te)return;V.mouse=[I,X.invert(I)],$1(this),V.start()}x0(H),V.wheel=setTimeout(L,x),V.zoom("mouse",t(y(w(X,te),V.mouse[0],V.mouse[1]),V.extent,a));function L(){V.wheel=null,V.end()}}function M(H,...Y){if(p||!e.apply(this,arguments))return;var V=H.currentTarget,X=N(this,Y,!0).event(H),te=Fi(H.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",G,!0),I=Ua(H,V),L=H.clientX,F=H.clientY;sH(H.view),Hw(H),X.mouse=[I,this.__zoom.invert(I)],$1(this),X.start();function q(ee){if(x0(ee),!X.moved){var ce=ee.clientX-L,oe=ee.clientY-F;X.moved=ce*ce+oe*oe>S}X.event(ee).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(ee,V),X.mouse[1]),X.extent,a))}function G(ee){te.on("mousemove.zoom mouseup.zoom",null),iH(ee.view,X.moved),x0(ee),X.event(ee).end()}}function O(H,...Y){if(e.apply(this,arguments)){var V=this.__zoom,X=Ua(H.changedTouches?H.changedTouches[0]:H,this),te=V.invert(X),I=V.k*(H.shiftKey?.5:2),L=t(y(w(V,I),X,te),n.apply(this,Y),a);x0(H),o>0?Fi(this).transition().duration(o).call(E,L,X,H):Fi(this).call(b.transform,L,X,H)}}function B(H,...Y){if(e.apply(this,arguments)){var V=H.touches,X=V.length,te=N(this,Y,H.changedTouches.length===X).event(H),I,L,F,q;for(Hw(H),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Ep=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],wH=["Enter"," ","Escape"],SH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var t_;(function(e){e.Strict="strict",e.Loose="loose"})(t_||(t_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var Np;(function(e){e.Partial="partial",e.Full="full"})(Np||(Np={}));const kH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var $v;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})($v||($v={}));var Et;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Et||(Et={}));const sR={[Et.Left]:Et.Right,[Et.Right]:Et.Left,[Et.Top]:Et.Bottom,[Et.Bottom]:Et.Top};function CH(e){return e===null?null:e?"valid":"invalid"}const EH=e=>"id"in e&&"source"in e&&"target"in e,yTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Tk=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_m=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},xTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Tk(s)?s:n.nodeLookup.get(s.id));const o=a?Pv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ay(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return oy(t)},pm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=ay(t,Pv(s)),r=!0)}),r?oy(t):{x:0,y:0,width:0,height:0}},Ak=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=TH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},wTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function STt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function kTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=STt(e,a),l=pm(o),u=Mk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function NH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function CTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=wTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const n_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:n_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:n_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function zH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const iR=(e,n,t)=>et?-n_(Math.abs(e-t),1,n)/n:0,Rk=(e,n,t=15,r=40)=>{const s=iR(e.x,r,n.width-r)*t,i=iR(e.y,r,n.height-r)*t;return[s,i]},ay=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),b5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),oy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),zp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Tk(e)?e.internals.positionAbsolute:_m(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Pv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Tk(e)?e.internals.positionAbsolute:_m(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},jH=(e,n)=>oy(ay(b5(e),b5(n))),TH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},Fv=(e,n)=>TH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),aR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),AH=(e,n)=>(t,r)=>{},mm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),gm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?mm(o,a):o},r_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Kf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ETt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Kf(e,t),s=Kf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Kf(e.top??e.y??0,t),s=Kf(e.bottom??e.y??0,t),i=Kf(e.left??e.x??0,n),a=Kf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function NTt(e,n,t,r,s,i){const{x:a,y:o}=r_(e,[n,t,r]),{x:l,y:u}=r_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Mk=(e,n,t,r,s,i)=>{const a=ETt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=n_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=NTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},jp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function RH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function MH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function oR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function zTt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function jTt(e){return{...SH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=gm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?mm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Dk=e=>({width:e.offsetWidth,height:e.offsetHeight}),DH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},TTt=["INPUT","SELECT","TEXTAREA"];function LH(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:TTt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const OH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=OH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},lR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Dk(a)}})};function IH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function u1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function cR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Et.Left:return[n-u1(n-r,i),t];case Et.Right:return[n+u1(r-n,i),t];case Et.Top:return[n,t-u1(t-s,i)];case Et.Bottom:return[n,t+u1(s-t,i)]}}function BH({sourceX:e,sourceY:n,sourcePosition:t=Et.Bottom,targetX:r,targetY:s,targetPosition:i=Et.Top,curvature:a=.25}){const[o,l]=cR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=cR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=IH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function $H({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const MTt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,DTt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),LTt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||MTt;let s;return EH(e)?s={...e}:s={...e,id:r(e)},DTt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function PH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=$H({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const uR={[Et.Left]:{x:-1,y:0},[Et.Right]:{x:1,y:0},[Et.Top]:{x:0,y:-1},[Et.Bottom]:{x:0,y:1}},OTt=({source:e,sourcePosition:n=Et.Bottom,target:t})=>n===Et.Left||n===Et.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function ITt({source:e,sourcePosition:n=Et.Bottom,target:t,targetPosition:r=Et.Top,center:s,offset:i,stepPosition:a}){const o=uR[n],l=uR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=OTt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=$H({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const z=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?z:M:x=p==="x"?M:z}else{const z=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:z:x=o.y===m?z:M,n===r){const H=Math.abs(e[p]-t[p]);if(H<=i){const Y=Math.min(i-1,i-H);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const H=p==="x"?"y":"x",Y=o[p]===l[H],V=u[H]>_[H],X=u[H]<_[H];(o[p]===1&&(!Y&&V||Y&&X)||o[p]!==1&&(!Y&&X||Y&&V))&&(x=p==="x"?z:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),U=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=U?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function BTt(e,n,t,r){const s=Math.min(dR(e,n)/2,dR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function x5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function PTt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=x5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const FH=1e3,FTt=10,Lk={nodeOrigin:[0,0],nodeExtent:Ep,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},HTt={...Lk,checkEquality:!0};function Ok(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function qTt(e,n,t){const r=Ok(Lk,t);for(const s of e.values())if(s.parentId)Bk(s,e,n,r);else{const i=_m(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function UTt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Ik(e){return e==="manual"}function w5(e,n,t,r={}){var _,d;const s=Ok(HTt,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Ik(s.zIndexMode)?FH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=_m(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:UTt(p,m),z:HH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&Bk(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function GTt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function Bk(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ok(Lk,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}GTt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*FTt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Ik(l)?FH:0,{x:p,y:m,z:x}=WTt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function HH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Ik(t)?r:r+(e.selected?n:0)}function WTt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=_m(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=zH(d,l,n));const p=HH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function $k(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??zp(l),_=jH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=$k(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function KTt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function pR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function qH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;pR("source",l,_,e,s,a),pR("target",l,u,e,i,o),n.set(r.id,r)}}function UH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:UH(t,n):!1}function mR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function QTt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!UH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function qw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function YTt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=mm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function XTt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Fi(C);function z({x:$,y:U}){const{nodeLookup:H,nodeExtent:Y,snapGrid:V,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:q}=n();i={x:$,y:U};let G=!1;const ee=o.size>1,ce=ee&&Y?b5(pm(o)):null,oe=ee&&X?YTt({dragItems:o,snapGrid:V,x:$,y:U}):null;for(const[ne,Q]of o){if(!H.has(ne))continue;let le={x:$-Q.distance.x,y:U-Q.distance.y};X&&(le=oe?{x:Math.round(le.x+oe.x),y:Math.round(le.y+oe.y)}:mm(le,V));let ae=null;if(ee&&Y&&!Q.extent&&ce){const{positionAbsolute:Se}=Q.internals,ye=Se.x-ce.x+Y[0][0],qe=Se.x+Q.measured.width-ce.x2+Y[1][0],Ie=Se.y-ce.y+Y[0][1],ze=Se.y+Q.measured.height-ce.y2+Y[1][1];ae=[[ye,Ie],[qe,ze]]}const{position:ue,positionAbsolute:pe}=NH({nodeId:ne,nextPosition:le,nodeLookup:H,nodeExtent:ae||Y,nodeOrigin:te,onError:F});G=G||Q.position.x!==ue.x||Q.position.y!==ue.y,Q.position=ue,Q.internals.positionAbsolute=pe}if(x=x||G,!!G&&(q(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=qw({nodeId:N,dragItems:o,nodeLookup:H});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:U,autoPanSpeed:H,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[V,X]=Rk(u,_,H);(V!==0||X!==0)&&(i.x=(i.x??0)-V/$[2],i.y=(i.y??0)-X/$[2],await U({x:V,y:X})&&z(i)),a=requestAnimationFrame(M)}function O($){var ee;const{nodeLookup:U,multiSelectionActive:H,nodesDraggable:Y,transform:V,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:q}=n();d=!0,(!I||!E)&&!H&&N&&((ee=U.get(N))!=null&&ee.selected||q()),E&&I&&N&&(e==null||e(N));const G=V0($.sourceEvent,{transform:V,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=G,o=QTt(U,Y,G,N),o.size>0&&(t||L||!N&&F)){const[ce,oe]=qw({nodeId:N,dragItems:o,nodeLookup:U});t==null||t($.sourceEvent,o,ce,oe),L==null||L($.sourceEvent,ce,oe),N||F==null||F($.sourceEvent,oe)}}const B=aH().clickDistance(T).on("start",$=>{const{domNode:U,nodeDragThreshold:H,transform:Y,snapGrid:V,snapToGrid:X}=n();_=(U==null?void 0:U.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,H===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:V,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:U,transform:H,snapGrid:Y,snapToGrid:V,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:H,snapGrid:Y,snapToGrid:V,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&U&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,q=L.y-u.y;Math.sqrt(F*F+q*q)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),z(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:U,updateNodePositions:H,onNodeDragStop:Y,onSelectionDragStop:V}=n();if(x&&(H(o,!1),x=!1),s||Y||!N&&V){const[X,te]=qw({nodeId:N,dragItems:o,nodeLookup:U,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||V==null||V($.sourceEvent,te)}}}).filter($=>{const U=$.target;return!$.button&&(!w||!mR(U,`.${w}`,C))&&(!y||mR(U,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function ZTt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Fv(s,zp(i))>0&&r.push(i);return r}const JTt=250;function eAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=ZTt(e,t,n+JTt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function GH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function WH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function tAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const VH=()=>!0;function nAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=VH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:z}){const M=DH(e.target);let O=0,B;const{x:$,y:U}=Za(e),H=WH(i,z),Y=o==null?void 0:o.getBoundingClientRect();let V=!1;if(!Y||!H)return;const X=GH(s,H,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,q=null;function G(){if(!_||!Y)return;const[ue,pe]=Rk(te,Y,N);p({x:ue,y:pe}),O=requestAnimationFrame(G)}const ee={...X,nodeId:s,type:H,position:X.position},ce=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(ce,ee,Et.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:ce,to:te,toHandle:null,toPosition:sR[ee.position],toNode:null,pointer:te};function Q(){V=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:H})}T===0&&Q();function le(ue){if(!V){const{x:ze,y:at}=Za(ue),bt=ze-$,$t=at-U;if(!(bt*bt+$t*$t>T*T))return;Q()}if(!E()||!ee){ae(ue);return}const pe=C();te=Za(ue,Y),B=eAt(gm(te,pe,!1,[1,1]),t,l,ee),I||(G(),I=!0);const Se=KH(ue,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});q=Se.handleDomNode,L=Se.connection,F=tAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,ee,Et.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?r_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:sR[ee.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function ae(ue){if(!("touches"in ue&&ue.touches.length>0)){if(V){(B||q)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ue,ye),i&&(w==null||w(ue,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,q=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",ae),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",ae)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",ae),M.addEventListener("touchmove",le),M.addEventListener("touchend",ae)}function KH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=VH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=WH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===t_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=GH(y,w,C,_,t,!0)}return b}const S5={onPointerDown:nAt,isValid:KH};function rAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Fi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&jp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),z={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:z.x,y:z.y,zoom:C[2]},M,o)},w=xH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const ly=e=>({x:e.x,y:e.y,zoom:e.k}),Uw=({x:e,y:n,zoom:t})=>iy.translate(e,n).scale(t),ih=(e,n)=>e.target.closest(`.${n}`),QH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),sAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Gw=(e,n=0,t=sAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},YH=e=>{const n=e.ctrlKey&&jp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function iAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ih(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=YH(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!jp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=ly(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function aAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ih(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function oAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=ly(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function lAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&QH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,ly(i.transform)))}}function cAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&QH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=ly(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function uAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ih(d,`${u}-flow__node`)||ih(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ih(d,o)&&x||ih(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function dAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=xH().scaleExtent([n,t]).translateExtent(r),p=Fi(e).call(d);w({x:s.x,y:s.y,zoom:n_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(YH);async function S(B,$){return p?new Promise(U=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:O1).transform(Gw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:U,userSelectionActive:H,panOnScroll:Y,panOnDrag:V,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:q,zoomActivationKeyPressed:G,lib:ee,onTransformChange:ce,connectionInProgress:oe,paneClickDistance:ne,selectionOnDrag:Q}){H&&!u.isZoomingOrPanning&&b();const le=Y&&!G&&!H;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const ae=le?iAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):aAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",ae,{passive:!1});const ue=oAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ue);const pe=lAt({zoomPanValues:u,panOnDrag:V,onPaneContextMenu:!!U,onPanZoom:i,onTransformChange:ce});d.on("zoom",pe);const Se=cAt({zoomPanValues:u,panOnDrag:V,panOnScroll:Y,onPaneContextMenu:U,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=uAt({zoomActivationKeyPressed:G,panOnDrag:V,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:q,zoomOnPinch:L,userSelectionActive:H,noPanClassName:$,noWheelClassName:B,lib:ee,connectionInProgress:oe});d.filter(ye),q?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,U){const H=Uw(B),Y=d==null?void 0:d.constrain()(H,$,U);return Y&&await S(Y),Y}async function y(B,$){const U=Uw(B);return await S(U,$),U}function C(B){if(p){const $=Uw(B),U=p.property("__zoom");(U.k!==B.zoom||U.x!==B.x||U.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?yH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(U=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:O1).scaleTo(Gw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),B)}):!1}async function T(B,$){return p?new Promise(U=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:O1).scaleBy(Gw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>U(!0)),B)}):!1}function z(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:z,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var s_;(function(e){e.Line="line",e.Handle="handle"})(s_||(s_={}));function fAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function gR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function d1(e,n,t){return Math.max(0,n-e,e-t)}function vR(e,n){return e?!n:n}function hAt(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let z=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-z:z),B=N+(u?-M:M),$=-i[0]*E,U=-i[1]*N;let H=d1(O,S,v),Y=d1(B,b,w);if(a){let te=0,I=0;l&&z<0?te=Hc(y+z+$,a[0][0]):!l&&z>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+U,a[0][1]):!u&&M>0&&(I=qc(C+B+U,a[1][1])),H=Math.max(H,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&z>0?te=qc(y+z,o[0][0]):!l&&z<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),H=Math.max(H,te),Y=Math.max(Y,I)}if(s){if(_){const te=d1(O/T,b,w)*T;if(H=Math.max(H,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+U+O/T,a[1][1])*T:I=Hc(C+U+(l?z:-z)/T,a[0][1])*T,H=Math.max(H,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?z:-z)/T,o[0][1])*T,H=Math.max(H,I)}}if(d){const te=d1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),z=z+(z<0?H:-H),s&&(p?O>B*T?M=(vR(l,u)?-z:z)/T:z=(vR(l,u)?-M:M)*T:_?(M=z/T,u=l):(z=M*T,l=u));const V=l?y+z:y,X=u?C+M:C;return{width:E+(l?-z:z),height:N+(u?-M:M),x:i[0]*z*(l?-1:1)+V,y:i[1]*M*(u?-1:1)+X}}const XH={width:0,height:0,x:0,y:0},_At={...XH,pointerX:0,pointerY:0,aspectRatio:1};function pAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function mAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Fi(e);let a={controlDirection:gR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...XH},w={..._At};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:gR(u)};let y,C=null,E=[],N,T,z,M=!1;const O=aH().on("start",B=>{const{nodeLookup:$,transform:U,snapGrid:H,snapToGrid:Y,nodeOrigin:V,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:U,snapGrid:H,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],z=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const q=pAt(F,y,F.origin??V);z?z=[[Math.min(q[0][0],z[0][0]),Math.min(q[0][1],z[0][1])],[Math.max(q[1][0],z[1][0]),Math.max(q[1][1],z[1][1])]]:z=q}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:U,snapToGrid:H,nodeOrigin:Y}=t(),V=V0(B.sourceEvent,{transform:$,snapGrid:U,snapToGrid:H,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,q={},G=y.origin??Y,{width:ee,height:ce,x:oe,y:ne}=hAt(w,a.controlDirection,V,a.boundaries,a.keepAspectRatio,G,T,z),Q=ee!==L,le=ce!==F,ae=oe!==te&&Q,ue=ne!==I&≤if(!ae&&!ue&&!Q&&!le)return;if((ae||ue||G[0]===1||G[1]===1)&&(q.x=ae?oe:b.x,q.y=ue?ne:b.y,b.x=q.x,b.y=q.y,E.length>0)){const qe=oe-te,Ie=ne-I;for(const ze of E)ze.position={x:ze.position.x-qe+G[0]*(ee-L),y:ze.position.y-Ie+G[1]*(ce-F)},X.push(ze)}if((Q||le)&&(q.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ee:b.width,q.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:b.height,b.width=q.width,b.height=q.height),N&&y.expandParent){const qe=G[0]*(q.width??0);q.x&&q.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const gAt={},bR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(gAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},vAt=e=>e?bR(e):bR,{useDebugValue:bAt}=Je,{useSyncExternalStoreWithSelector:yAt}=hV,xAt=e=>e;function ZH(e,n=xAt,t){const r=yAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return bAt(r),r}const yR=(e,n)=>{const t=vAt(e),r=(s,i=n)=>ZH(t,s,i);return Object.assign(r,t),r},wAt=(e,n)=>e?yR(e,n):yR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const cy=R.createContext(null),SAt=cy.Provider,JH=to.error001("react");function An(e,n){const t=R.useContext(cy);if(t===null)throw new Error(JH);return ZH(t,e,n)}function Er(){const e=R.useContext(cy);if(e===null)throw new Error(JH);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const xR={display:"none"},kAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},eq="react-flow__node-desc",tq="react-flow__edge-desc",CAt="react-flow__aria-live",EAt=e=>e.ariaLiveMessage,NAt=e=>e.ariaLabelConfig;function zAt({rfId:e}){const n=An(EAt);return f.jsx("div",{id:`${CAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:kAt,children:n})}function jAt({rfId:e,disableKeyboardA11y:n}){const t=An(NAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${eq}-${e}`,style:xR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${tq}-${e}`,style:xR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(zAt,{rfId:e})]})}const uy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});uy.displayName="Panel";const wR="https://reactflow.dev?utm_source=attribution";function TAt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(uy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${wR}`,children:f.jsx("a",{href:wR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const AAt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},f1=e=>e.id;function RAt(e,n){return kr(e.selectedNodes.map(f1),n.selectedNodes.map(f1))&&kr(e.selectedEdges.map(f1),n.selectedEdges.map(f1))}function MAt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(AAt,RAt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const DAt=e=>!!e.onSelectionChangeHandlers;function LAt({onSelectionChange:e}){const n=An(DAt);return e||n?f.jsx(MAt,{onSelectionChange:e}):null}const nq=[0,0],OAt={x:0,y:0,zoom:1},IAt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],SR=[...IAt,"rfId"],BAt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),kR={translateExtent:Ep,nodeOrigin:nq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function $At(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(BAt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=kR,o()}),[]);const _=R.useRef(kR);return R.useEffect(()=>{for(const d of SR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:jTt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},SR.map(d=>e[d])),null}function CR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function PAt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=CR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=CR())!=null&&r.matches?"dark":"light"}const ER=typeof document<"u"?document:null;function Tp(e=null,n={target:ER,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` +${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Ur,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(db,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Tw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:x2(),"aria-label":x2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:x2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Pr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Ur,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():E4(),"aria-label":xs?AE():E4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Rv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(sb,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(_b,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const c5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:c5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Wr(S=>i(m,S));return f.jsxs("button",{type:"button",className:c5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({...hv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?tb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,P;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({...hv(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(hv(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const U=new Set(r);U.has(W)?U.delete(W):U.add(W),i(U)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):c6()),$=((P=O==null?void 0:O.files)==null?void 0:P.length)??0,H=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),q=O?O.branch:n.baselineBranch,Y=(W,U)=>O?a(W,e,void 0,U):a(W,void 0,n.baselineBranch,U),G=(S==null?void 0:S.root)==="worktree",X=async(W,U)=>{try{await adt(l,W,U,{sessionId:e}),N()}catch(te){Qn(te instanceof Error?te.message:String(te),"error")}},ee=W=>{const U=(S==null?void 0:S.path)??n.repoPath;jF(U,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&q?tb(n.githubOwner,n.githubRepo,q):void 0,githubTitle:q?pD({branch:Ne(q)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,U)=>{y(AF(W,U))},onRename:(W,U)=>{E(null),X(W,{action:"rename",newName:U})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>ee(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` +`),d=FP(_,AS(n));return _.endsWith(` +`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${zv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${zv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function TA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[FD()," ",Ne(n)]})]})}function u5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(TA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(TA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[FD()," ",t]})})]})}const fEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...fEt(e),enabled:n,subscribed:n}).data??null}function hEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function _Et(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function pEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(u5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?nv():rh(),"data-tip-align":"end","aria-label":d?nv():rh(),onClick:()=>p(b=>!b),children:f.jsx(e3,{size:13})}),f.jsx(sb,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(e6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(e6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const H=Math.round($.clientX-((T==null?void 0:T.left)??0)),q=Math.min(Math.max(H,$F),PF);u(q);try{localStorage.setItem(IF,String(q))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(e6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Ur,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:tb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:ev({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(_b,{size:12})]})}const Bw=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Wr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Wr(i),children:[f.jsx(hb,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Wr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let d5=!1;function OA(e){d5=!0;try{return window.confirm(e)}finally{d5=!1}}const f5=e=>e.replace(/\r\n/g,` +`),IA=(e,n,t)=>{const r=f5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r +`),conflict:null}},Cl=e=>e.draft!==e.baseline,$Et=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),PEt=e=>e.crlf?e.draft.replace(/\n/g,`\r +`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,ee,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((ee=l.data)==null?void 0:ee.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(P=>P+1)},[]),H=R.useRef(o);H.current=o;const q=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(q.current)return;Y.current=n,q.current=!0,m(!0);const L=H.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(P=>{var U,te;const W=P.pdfPath;if(P.ok&&W){S(de=>({path:W,version:((de==null?void 0:de.version)??0)+1,source:L})),y(P.hadErrors),E(P.note),P.hadErrors&&b(((U=P.log)==null?void 0:U.trim())||null),$(!0);return}S(null),y(!1),E(P.note),M(!1),b(((te=P.log)==null?void 0:te.trim())||S3e())}).catch(P=>{S(null),y(!1),E(null),M(!1),T(P instanceof Error?P.message:String(P))}).finally(()=>{q.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ce=>ce&&{...ce,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const H=R.useRef(!1),q=R.useRef(l);q.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||H.current||Y.current?!1:(H.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ce=>{G.current=!1,N(ce),ce.pulled.includes(n)&&(Y.current?O(!0):q.current(ce.pulled))}).catch(ce=>{G.current=!0,N(null),j(ce instanceof Error?ce.message:String(ce))}).finally(()=>{H.current=!1,C(!1)}),!0),[e,n,t,d,m]),ee=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;ee.current!==oe&&X()&&(ee.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const P=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),U=R.useRef(Promise.resolve()),te=R.useRef(!1);te.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const de=R.useRef(!1);return R.useEffect(()=>{if(!P)return;let oe=!1;const ce=()=>{const Se=de.current;de.current=!1,!(!Se&&te.current)&&(U.current=U.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ce();const pe=setInterval(ce,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),U.current=U.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[P,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):q.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{H.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ce=>{ce.remoteChanged&&X()}).catch(ce=>{G.current=!0,j(ce instanceof Error?ce.message:String(ce))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{de.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ce=await BL(oe);ee.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ce.hasToken})},saveSession:async oe=>{const ce=await $L(oe,{host:m==null?void 0:m.host});B(ce.hasSession),de.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),de.current=!0,w(ce=>ce+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,ee.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),ee.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(ee.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?j4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(j4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Ur,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":z4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:z4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?j4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:_6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(ub,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Vr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",H=t==="abs",q=xk(n),Y=zF(n),G=lEt(n),X=q||G,[ee,I]=R.useState(!1),L=!b||ee,P=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),U=S.set,te=S.saving,de=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ce=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,H))==null?void 0:xt.path)??null},[H,Se]),Ie=R.useCallback(Ve=>H?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,H,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,H);return xt?KEt(Ie(xt.path),xt):null},[H,Se,Ie]),vt=LF(ce==null?void 0:ce.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ce!=null&&!ce.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ce!=null&&!ce.binary&&!ce.truncated&&!vt&&!mt,ut=rt&&ce.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ce.version=="string"||Ct),Re=(W==null?void 0:W.draft)??f5((ce==null?void 0:ce.content)??""),Ze=(W==null?void 0:W.baseline)??f5((ce==null?void 0:ce.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);de(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof D4){const xn=S.getSnapshot();return!xn||!Cl(xn)||U({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{de(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:P,ready:ce!=null&&!ce.notFound,source:we?Re:(ce==null?void 0:ce.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:P,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{U(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!te);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?U({...xt,conflict:On}):!On&&xt.conflict&&U({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(U(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,te,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ce||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ce]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(te||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(te?Ei():I2e()),children:te?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(e3,{size:13}):f.jsx(db,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(sb,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?nv():rh(),"data-tip-align":"end","aria-label":y?nv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(e3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ce!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:te,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:te,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Ur,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ce===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ce===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ce&&typeof ce.version=="string"?IA(ce.path,ce.content,ce.version):null);xt&&U($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{d5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ce.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(u5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ce.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(u5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):q&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ce.content,entries:x}):f.jsx(Fo,{text:ce.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ce.content,truncated:ce.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ce.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ce.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const $w=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:$w,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:$w,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:$w,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:fb,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Wr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Wr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Wr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(hb,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ny(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}O1.prototype=ny.prototype={constructor:O1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===h5&&n.documentElement.namespaceURI===h5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=ry(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function _5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}_5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=ny("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Pw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function p5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,p5,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Lv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Lv(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Lv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Fw(e>=240?e-240:e+120,s,r),Fw(e,s,r),Fw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Lv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lv(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function Fw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Ov=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=p5(s)).r,(i=p5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=Hw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=(Bv=Ep.now())+sy,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-Bv;n>gH&&(sy-=n,Bv=e)}function Rjt(){for(var e,n=Iv,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Iv=t);j0=e,v5(r)}function v5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-sy)),y0&&(y0=clearInterval(y0))):(y0||(Bv=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new $v;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=ny("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,b5=2,B1=3,sR=4,y5=5,$1=6;function iy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>B1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===B1)return nR(a);m.state===sR?(m.state=$1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_b5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ay=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ay;return e.__zoom}function qw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||ay}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=I1,u=ny("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(q){q.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,Y,G,X){var ee=q.selection?q.selection():q;ee.property("__zoom",iR),q!==ee?E(q,Y,G,X):ee.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(q,Y,G,X){b.scaleTo(q,function(){var ee=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return ee*I},G,X)},b.scaleTo=function(q,Y,G,X){b.transform(q,function(){var ee=n.apply(this,arguments),I=this.__zoom,L=G==null?C(ee):typeof G=="function"?G.apply(this,arguments):G,P=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,P),ee,a)},G,X)},b.translateBy=function(q,Y,G,X){b.transform(q,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(q,Y,G,X,ee){b.transform(q,function(){var I=n.apply(this,arguments),L=this.__zoom,P=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(ay.translate(P[0],P[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,ee)};function w(q,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===q.k?q:new Ol(Y,q.x,q.y)}function y(q,Y,G){var X=Y[0]-G[0]*q.k,ee=Y[1]-G[1]*q.k;return X===q.x&&ee===q.y?q:new Ol(q.k,X,ee)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function E(q,Y,G,X){q.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var ee=this,I=arguments,L=N(ee,I).event(X),P=n.apply(ee,I),W=G==null?C(P):typeof G=="function"?G.apply(ee,I):G,U=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),te=ee.__zoom,de=typeof Y=="function"?Y.apply(ee,I):Y,re=l(te.invert(W).concat(U/te.k),de.invert(W).concat(U/de.k));return function(ne){if(ne===1)ne=de;else{var Q=re(ne),le=U/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(q,Y,G){return!G&&q.__zooming||new T(q,Y)}function T(q,Y){this.that=q,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,Y),this.taps=0}T.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Y){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Y=Hi(this.that).datum();u.call(q,this.that,new PTt(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(q,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(q),X=this.__zoom,ee=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(q);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===ee)return;G.mouse=[I,X.invert(I)],P1(this),G.start()}x0(q),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,ee),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(q,...Y){if(p||!e.apply(this,arguments))return;var G=q.currentTarget,X=N(this,Y,!0).event(q),ee=Hi(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",U,!0),I=Ua(q,G),L=q.clientX,P=q.clientY;lH(q.view),qw(q),X.mouse=[I,this.__zoom.invert(I)],P1(this),X.start();function W(te){if(x0(te),!X.moved){var de=te.clientX-L,re=te.clientY-P;X.moved=de*de+re*re>S}X.event(te).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(te,G),X.mouse[1]),X.extent,a))}function U(te){ee.on("mousemove.zoom mouseup.zoom",null),cH(te.view,X.moved),x0(te),X.event(te).end()}}function O(q,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(q.changedTouches?q.changedTouches[0]:q,this),ee=G.invert(X),I=G.k*(q.shiftKey?.5:2),L=t(y(w(G,I),X,ee),n.apply(this,Y),a);x0(q),o>0?Hi(this).transition().duration(o).call(E,L,X,q):Hi(this).call(b.transform,L,X,q)}}function B(q,...Y){if(e.apply(this,arguments)){var G=q.touches,X=G.length,ee=N(this,Y,q.changedTouches.length===X).event(q),I,L,P,W;for(qw(q),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Pv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pv||(Pv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?Fv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ly(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=oy(t,Fv(s)),r=!0)}),r?ly(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},oy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),x5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),ly=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Fv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>ly(oy(x5(e),x5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},Hv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const q=Math.abs(e[p]-t[p]);if(q<=i){const Y=Math.min(i-1,i-q);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const q=p==="x"?"y":"x",Y=o[p]===l[q],G=u[q]>_[q],X=u[q]<_[q];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),H=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=H?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function S5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=S5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function k5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Uw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:H}){const{nodeLookup:q,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:ee,onNodeDrag:I,onSelectionDrag:L,onError:P,updateNodePositions:W}=n();i={x:$,y:H};let U=!1;const te=o.size>1,de=te&&Y?x5(mm(o)):null,re=te&&X?wAt({dragItems:o,snapGrid:G,x:$,y:H}):null;for(const[ne,Q]of o){if(!q.has(ne))continue;let le={x:$-Q.distance.x,y:H-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(te&&Y&&!Q.extent&&de){const{positionAbsolute:Se}=Q.internals,ye=Se.x-de.x+Y[0][0],qe=Se.x+Q.measured.width-de.x2+Y[1][0],Ie=Se.y-de.y+Y[0][1],Te=Se.y+Q.measured.height-de.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ce,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:q,nodeExtent:oe||Y,nodeOrigin:ee,onError:P});U=U||Q.position.x!==ce.x||Q.position.y!==ce.y,Q.position=ce,Q.internals.positionAbsolute=pe}if(x=x||U,!!U&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Uw({nodeId:N,dragItems:o,nodeLookup:q});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:H,autoPanSpeed:q,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,q);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await H({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var te;const{nodeLookup:H,multiSelectionActive:q,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:ee,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:P,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!q&&N&&((te=H.get(N))!=null&&te.selected||W()),E&&I&&N&&(e==null||e(N));const U=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:ee,containerBounds:_});if(i=U,o=xAt(H,Y,U,N),o.size>0&&(t||L||!N&&P)){const[de,re]=Uw({nodeId:N,dragItems:o,nodeLookup:H});t==null||t($.sourceEvent,o,de,re),L==null||L($.sourceEvent,de,re),N||P==null||P($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:H,nodeDragThreshold:q,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,q===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:q,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:ee}=n(),I=V0($.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!ee.has(N))&&(m=!0),!m){if(!l&&H&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),P=L.x-u.x,W=L.y-u.y;Math.sqrt(P*P+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:H,updateNodePositions:q,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(q(o,!1),x=!1),s||Y||!N&&G){const[X,ee]=Uw({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,o,X,ee),Y==null||Y($.sourceEvent,X,ee),N||G==null||G($.sourceEvent,ee)}}}).filter($=>{const H=$.target;return!$.button&&(!w||!vR(H,`.${w}`,C))&&(!y||vR(H,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Hv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:H}=Za(e),q=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!q)return;const X=QH(s,q,r,l,n);if(!X)return;let ee=Za(e,Y),I=!1,L=null,P=!1,W=null;function U(){if(!_||!Y)return;const[ce,pe]=Mk(ee,Y,N);p({x:ce,y:pe}),O=requestAnimationFrame(U)}const te={...X,nodeId:s,type:q,position:X.position},de=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(de,te,Nt.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:de,to:ee,toHandle:null,toPosition:aR[te.position],toNode:null,pointer:ee};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:q})}T===0&&Q();function le(ce){if(!G){const{x:Te,y:vt}=Za(ce),Dt=Te-$,Ut=vt-H;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!te){oe(ce);return}const pe=C();ee=Za(ce,Y),B=EAt(vm(ee,pe,!1,[1,1]),t,l,te),I||(U(),I=!0);const Se=ZH(ce,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,P=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,te,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:P,to:Se.toHandle&&P?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):ee,toHandle:Se.toHandle,toPosition:P&&Se.toHandle?Se.toHandle.position:aR[te.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:ee};y(Ie),ne=Ie}function oe(ce){if(!("touches"in ce&&ce.touches.length>0)){if(G){(B||W)&&L&&P&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ce,ye),i&&(w==null||w(ce,ye))}m(),cancelAnimationFrame(O),I=!1,P=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const C5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const cy=e=>({x:e.x,y:e.y,zoom:e.k}),Gw=({x:e,y:n,zoom:t})=>ay.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ww=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=cy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=cy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,cy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=cy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).transform(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:q,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:ee,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:P,zoomOnDoubleClick:W,zoomActivationKeyPressed:U,lib:te,onTransformChange:de,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){q&&!u.isZoomingOrPanning&&b();const le=Y&&!U&&!q;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:ee,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ce=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ce);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:de});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:U,panOnDrag:G,zoomOnScroll:P,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:q,noPanClassName:$,noWheelClassName:B,lib:te,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,H){const q=Gw(B),Y=d==null?void 0:d.constrain()(q,$,H);return Y&&await S(Y),Y}async function y(B,$){const H=Gw(B);return await S(H,$),H}function C(B){if(p){const $=Gw(B),H=p.property("__zoom");(H.k!==B.zoom||H.x!==B.x||H.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleTo(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}async function T(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleBy(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,H=-i[1]*N;let q=f1(O,S,v),Y=f1(B,b,w);if(a){let ee=0,I=0;l&&j<0?ee=Hc(y+j+$,a[0][0]):!l&&j>0&&(ee=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+H,a[0][1]):!u&&M>0&&(I=qc(C+B+H,a[1][1])),q=Math.max(q,ee),Y=Math.max(Y,I)}if(o){let ee=0,I=0;l&&j>0?ee=qc(y+j,o[0][0]):!l&&j<0&&(ee=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),q=Math.max(q,ee),Y=Math.max(Y,I)}if(s){if(_){const ee=f1(O/T,b,w)*T;if(q=Math.max(q,ee),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+H+O/T,a[1][1])*T:I=Hc(C+H+(l?j:-j)/T,a[0][1])*T,q=Math.max(q,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,q=Math.max(q,I)}}if(d){const ee=f1(B*T,S,v)/T;if(Y=Math.max(Y,ee),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?q:-q),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:H,snapGrid:q,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:ee,ySnapped:I}=V0(B.sourceEvent,{transform:H,snapGrid:q,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:ee,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,P]of $)if(P.parentId===n&&(E.push({id:L,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const W=FAt(P,y,P.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:H,snapToGrid:q,containerBounds:C}),X=[];if(!y)return;const{x:ee,y:I,width:L,height:P}=b,W={},U=y.origin??Y,{width:te,height:de,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,U,T,j),Q=te!==L,le=de!==P,oe=re!==ee&&Q,ce=ne!==I&≤if(!oe&&!ce&&!Q&&!le)return;if((oe||ce||U[0]===1||U[1]===1)&&(W.x=oe?re:b.x,W.y=ce?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-ee,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+U[0]*(te-L),y:Te.position.y-Ie+U[1]*(de-P)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?te:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?de:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=U[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const uy=R.createContext(null),QAt=uy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(uy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(uy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const dy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});dy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(dy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??ER,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&LH(m))return!1;const S=zR(m.code,o);if(i.current.add(m[S]),NR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=zR(m.code,o);NR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function NR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function zR(e,n){return n.includes(e)?"code":"key"}const FAt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Mk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return gm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=r_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function rq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)HAt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function HAt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function qAt(e,n){return rq(e,n)}function UAt(e,n){return rq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function ah(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function jR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function TR(e){return{id:e.id,type:"remove"}}const GAt=AH();function WAt(e,n,t={}){return LTt(e,n,{...t,onError:t.onError??GAt})}const AR=e=>yTt(e),VAt=e=>EH(e);function sq(e){return R.forwardRef(e)}const KAt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function RR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>QAt(()=>t(s=>s+BigInt(1))));return KAt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function QAt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const iq=R.createContext(null);function YAt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=jR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=RR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(jR({items:m,lookup:p}))},[]),i=RR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(iq.Provider,{value:a,children:e})}function XAt(){const e=R.useContext(iq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ZAt=e=>!!e.panZoom;function Pk(){const e=FAt(),n=Er(),t=XAt(),r=An(ZAt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=AR(d)?d:p.get(d.id),S=x.parentId?MH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return zp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&AR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&VAt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await CTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,z=E.length>0;if(T){const M=N.map(TR);v==null||v(N),w(M)}if(z){const M=E.map(TR);S==null||S(E),b(M)}return(z||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=aR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=zp(v?b:w),C=Fv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=aR(d)?d:l(d);if(!S)return!1;const v=Fv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return xTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??zTt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const MR=e=>e.selected,JAt=typeof window<"u"?window:void 0;function eRt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Pk(),s=Tp(e,{actInsideInputWithModifier:!1}),i=Tp(n,{target:JAt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(MR),edges:a.filter(MR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function tRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Dk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const dy={position:"absolute",width:"100%",height:"100%",top:0,left:0},nRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function rRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:z,connectionInProgress:M}=An(nRt,kr),O=Tp(p),B=R.useRef();tRt(N);const $=R.useCallback(U=>{b==null||b({x:U[0],y:U[1],zoom:U[2]}),w||E.setState({transform:U})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=dAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:V=>E.setState(X=>X.paneDragging===V?X:{paneDragging:V}),onPanZoomStart:(V,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(V,X),te==null||te(X)},onPanZoom:(V,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(V,X),te==null||te(X)},onPanZoomEnd:(V,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(V,X),te==null||te(X)}});const{x:U,y:H,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[U,H,Y],domNode:N.current.closest(".react-flow")}),()=>{var V;(V=B.current)==null||V.destroy()}}},[]),R.useEffect(()=>{var U;(U=B.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:z,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,z,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:dy,children:x})}const sRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function iRt(){const{userSelectionActive:e,userSelectionRect:n}=An(sRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Ww=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},aRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function oRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=Np.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(aRt,kr),T=y&&(e||w),z=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),U=R.useRef(!1),H=R.useRef({x:0,y:0}),Y=R.useRef(!1),V=Q=>{if(U.current||$.current||b.getState().connection.inProgress){U.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{U.current&&(Q.stopPropagation(),U.current=!1)},L=Q=>{var ze,at;const{domNode:le,transform:ae}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ue=Q.target===z.current;if(!ue&&!!Q.target.closest(".nokey")||!e||!(a&&ue||n)||Q.button!==0||!Q.isPrimary)return;(at=(ze=Q.target)==null?void 0:ze.setPointerCapture)==null||at.call(ze,Q.pointerId),U.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=gm({x:ye,y:qe},ae);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ue||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:ae}=b.getState();if(!ae)return;const{transform:ue,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:ze}=b.getState(),at={x:ae.startX,y:ae.startY},{x:bt,y:$t}=r_(at,ue),Pt={startX:at.x,startY:at.y,x:QIt.id)),B.current=new Set;const ft=(ze==null?void 0:ze.selectable)??!0;for(const It of O.current){const we=ye.get(It);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ft)&&B.current.add(Re)}}if(!oR(zt,O.current)){const It=ah(pe,O.current,!0);qe(It)}if(!oR(ot,B.current)){const It=ah(Se,B.current);Ie(It)}b.setState({userSelectionRect:Pt,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!s||!M.current)return;const[Q,le]=Rk(H.current,M.current,N);E({x:Q,y:le}).then(ae=>{if(!U.current||!ae){v.current=requestAnimationFrame(q);return}const{x:ue,y:pe}=H.current;F(ue,pe),v.current=requestAnimationFrame(q)})}const G=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>G(),[]);const ee=Q=>{const{userSelectionRect:le,transform:ae,resetSelectedElements:ue}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);H.current={x:pe,y:Se};const ye=r_({x:le.startX,y:le.startY},ae);if(!U.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ue(),o==null||o(Q)}U.current=!0,Y.current||(q(),Y.current=!0),F(pe,Se)},ce=Q=>{var le,ae;if(!T){Q.target===z.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((ae=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||ae.call(le,Q.pointerId),!w&&Q.target===z.current&&b.getState().userSelectionRect&&(V==null||V(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),G())},oe=Q=>{var le,ae;(ae=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||ae.call(le,Q.pointerId),G()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Ww(V,z),onContextMenu:Ww(X,z),onWheel:Ww(te,z),onPointerEnter:T?void 0:p,onPointerMove:T?ee:m,onPointerUp:ce,onPointerCancel:T?oe:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:z,style:dy,children:[S,f.jsx(iRt,{})]})}function k5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function aq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=XTt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{k5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const lRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function oq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=lRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=mm(w,i));const{position:y,positionAbsolute:C}=NH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Fk=R.createContext(null),cRt=Fk.Provider;Fk.Consumer;const lq=()=>R.useContext(Fk),uRt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cq=R.createContext(null);function dRt({children:e}){const n=An(uRt,kr);return f.jsx(cq.Provider,{value:n,children:e})}function fRt(){const e=R.useContext(cq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const hRt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},_Rt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return hRt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===t_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function pRt({type:e="source",position:n=Et.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,V;const x=a||null,S=e==="target",v=Er(),b=lq(),{connectOnClick:w,noPanClassName:y,rfId:C}=fRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:z,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(_Rt(b,x,e),kr);b||(V=(Y=v.getState()).onError)==null||V.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:q,setEdges:G,onError:ee}=v.getState();G(WAt(F,q,{onError:ee}))}I==null||I(F),o==null||o(F)},U=X=>{if(!b)return;const te=OH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();S5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,q;return(q=(F=v.getState()).onConnectEnd)==null?void 0:q.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,q;return((q=(F=v.getState()).isValidConnection)==null?void 0:q.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},H=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:q,lib:G,rfId:ee,nodeLookup:ce,connection:oe}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=DH(X.target),Q=t||q,{connection:le,isValid:ae}=S5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:ee,doc:ne,lib:G,nodeLookup:ce});ae&&le&&$(le);const ue=structuredClone(oe);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,I==null||I(X,ue),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||z)&&(M||O?i:s)}]),onMouseDown:U,onTouchStart:U,onClick:w?H:void 0,ref:m,...p,children:l})}const yu=R.memo(sq(pRt));function mRt({data:e,isConnectable:n,sourcePosition:t=Et.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function gRt({data:e,isConnectable:n,targetPosition:t=Et.Top,sourcePosition:r=Et.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function vRt(){return null}function bRt({data:e,isConnectable:n,targetPosition:t=Et.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const Hv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},DR={input:mRt,default:gRt,output:bRt,group:vRt};function yRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const xRt=e=>{const{width:n,height:t,x:r,y:s}=pm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function wRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(xRt,kr),l=oq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(aq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Hv,m.key)&&(m.preventDefault(),l({direction:Hv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const LR=typeof window<"u"?window:void 0,SRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function uq({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:z,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:U,preventScrolling:H,onSelectionContextMenu:Y,noWheelClassName:V,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:q}=An(SRt,kr),G=Tp(u,{target:LR}),ee=Tp(S,{target:LR}),ce=ee||z,oe=ee||C,ne=_&&ce!==!0,Q=G||q||ne;return eRt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(rRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:oe,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!G&&ce,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:U,zoomActivationKeyCode:v,preventScrolling:H,noWheelClassName:V,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(oRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ce,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:G,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(wRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}uq.displayName="FlowRenderer";const kRt=R.memo(uq),CRt=e=>n=>e?Ak(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ERt(e){return An(R.useCallback(CRt(e),[e]),kr)}const NRt=e=>e.updateNodeInternals;function zRt(){const e=An(NRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function jRt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function TRt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),ae=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:ae}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||DR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||DR.default);const z=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),U=RH(y),H=jRt({node:y,nodeType:N,hasDimensions:U,resizeObserver:d}),Y=aq({nodeRef:H,disabled:y.hidden||!z,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),V=oq();if(y.hidden)return null;const X=Yl(y),te=yRt(y),I=M||z||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,q=s?Q=>s(Q,{...C.userNode}):void 0,G=i?Q=>i(Q,{...C.userNode}):void 0,ee=a?Q=>a(Q,{...C.userNode}):void 0,ce=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:ae}=$.getState();M&&(!le||!z||ae>0)&&k5({id:e,store:$,nodeRef:H}),n&&n(Q,{...C.userNode})},oe=Q=>{if(!(LH(Q.nativeEvent)||x)){if(wH.includes(Q.key)&&M){const le=Q.key==="Escape";k5({id:e,store:$,unselect:le,nodeRef:H})}else if(z&&y.selected&&Object.prototype.hasOwnProperty.call(Hv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:Hv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=H.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:ae,autoPanOnNodeFocus:ue,setCenter:pe}=$.getState();if(!ue)return;Ak(new Map([[e,y]]),{x:0,y:0,width:le,height:ae},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:z},y.className,{selected:y.selected,selectable:M,parent:E,draggable:z,dragging:Y}]),ref:H,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:U?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:q,onContextMenu:G,onClick:ce,onDoubleClick:ee,onKeyDown:B?oe:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${eq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(cRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:z,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var ARt=R.memo(TRt);const RRt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function dq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(RRt,kr),a=ERt(e.onlyRenderVisibleElements),o=zRt();return f.jsx("div",{className:"react-flow__nodes",style:dy,children:a.map(l=>f.jsx(ARt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}dq.displayName="NodeRenderer";const MRt=R.memo(dq);function DRt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&RTt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const LRt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ORt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},OR={[$v.Arrow]:LRt,[$v.ArrowClosed]:ORt};function IRt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(OR,e)?OR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const BRt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=IRt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},fq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>PTt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(BRt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};fq.displayName="MarkerDefinitions";var $Rt=R.memo(fq);function hq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}hq.displayName="EdgeText";const PRt=R.memo(hq);function fy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(PRt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function IR({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Et.Left||e===Et.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function _q({sourceX:e,sourceY:n,sourcePosition:t=Et.Bottom,targetX:r,targetY:s,targetPosition:i=Et.Top}){const[a,o]=IR({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=IR({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=IH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function pq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=_q({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(fy,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const FRt=pq({isInternal:!1}),mq=pq({isInternal:!0});FRt.displayName="SimpleBezierEdge";mq.displayName="SimpleBezierEdgeInternal";function gq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Et.Bottom,targetPosition:x=Et.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=y5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(fy,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const vq=gq({isInternal:!1}),bq=gq({isInternal:!0});vq.displayName="SmoothStepEdge";bq.displayName="SmoothStepEdgeInternal";function yq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(vq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const HRt=yq({isInternal:!1}),xq=yq({isInternal:!0});HRt.displayName="StepEdge";xq.displayName="StepEdgeInternal";function wq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=PH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(fy,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const qRt=wq({isInternal:!1}),Sq=wq({isInternal:!0});qRt.displayName="StraightEdge";Sq.displayName="StraightEdgeInternal";function kq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Et.Bottom,targetPosition:o=Et.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=BH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(fy,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const URt=kq({isInternal:!1}),Cq=kq({isInternal:!0});URt.displayName="BezierEdge";Cq.displayName="BezierEdgeInternal";const BR={default:Cq,straight:Sq,step:xq,smoothstep:bq,simplebezier:mq},$R={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},GRt=(e,n,t)=>t===Et.Left?e-n:t===Et.Right?e+n:e,WRt=(e,n,t)=>t===Et.Top?e-n:t===Et.Bottom?e+n:e,PR="react-flow__edgeupdater";function FR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([PR,`${PR}-${o}`]),cx:GRt(n,r,e),cy:WRt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function VRt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:z,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:U,rfId:H,panBy:Y,updateConnection:V}=x.getState(),X=E.type==="target",te=(F,q)=>{p(!1),d==null||d(F,t,E.type,q)},I=F=>u==null?void 0:u(t,F),L=(F,q)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,q)};S5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:z,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:U,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:H,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var q,G;return((G=(q=x.getState()).isValidConnection)==null?void 0:G.call(q,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var q,G;return(G=(q=x.getState()).onConnectEnd)==null?void 0:G.call(q,...F)},onReconnectEnd:te,updateConnection:V,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(FR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(FR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function KRt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||BR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||BR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),z=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[U,H]=R.useState(!1),Y=Er(),{zIndex:V=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:q}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return $R;const qe=$Tt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=ATt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||$R,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),G=R.useMemo(()=>y.markerStart?`url('#${x5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),ee=R.useMemo(()=>y.markerEnd?`url('#${x5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const ce=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},oe=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,ae=u?pe=>{u(pe,{...y})}:void 0,ue=pe=>{var Se;if(!w&&wH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:ce,onDoubleClick:oe,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:ae,onKeyDown:T?ue:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${tq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!U&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:q,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:G,markerEnd:ee,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),z&&f.jsx(VRt,{edge:y,isReconnectable:z,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:q,setUpdateHover:$,setReconnecting:H})]})})}var QRt=R.memo(KRt);const YRt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Eq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(YRt,kr),C=DRt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx($Rt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(QRt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Eq.displayName="EdgeRenderer";const XRt=R.memo(Eq),ZRt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function JRt({children:e}){const n=An(ZRt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function eMt(e){const n=Pk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const tMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function nMt(e){const n=An(tMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function rMt(e){return e.connection.inProgress?{...e.connection,to:gm(e.connection.to,e.transform)}:{...e.connection}}function sMt(e){return rMt}function iMt(e){const n=sMt();return An(n,kr)}const aMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function oMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(aMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",CH(o)]),children:f.jsx(Nq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Nq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=iMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:CH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=BH(S);break;case Kc.SimpleBezier:[x]=_q(S);break;case Kc.Step:[x]=y5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=y5(S);break;default:[x]=PH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Nq.displayName="ConnectionLine";const lMt={};function HR(e=lMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function cMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function zq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:z,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:U,maxZoom:H,preventScrolling:Y,defaultMarkerColor:V,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:q,panOnDrag:G,autoPanOnSelection:ee,onPaneClick:ce,onPaneMouseEnter:oe,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:ae,paneClickDistance:ue,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:ze,onReconnect:at,onReconnectStart:bt,onReconnectEnd:$t,noDragClassName:Pt,noWheelClassName:zt,noPanClassName:ot,disableKeyboardA11y:ft,nodeExtent:It,rfId:we,viewport:Re,onViewportChange:Ze}){return HR(e),HR(n),cMt(),eMt(t),nMt(Re),f.jsx(kRt,{onPaneClick:ce,onPaneMouseEnter:oe,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:ae,onPaneScroll:le,paneClickDistance:ue,deleteKeyCode:z,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:q,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:G,autoPanOnSelection:ee,defaultViewport:B,translateExtent:$,minZoom:U,maxZoom:H,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Pt,noWheelClassName:zt,noPanClassName:ot,disableKeyboardA11y:ft,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(JRt,{children:[f.jsx(XRt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:at,onReconnectStart:bt,onReconnectEnd:$t,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:ze,defaultMarkerColor:V,noPanClassName:ot,disableKeyboardA11y:ft,rfId:we}),f.jsx(oMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(MRt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:ot,noDragClassName:Pt,disableKeyboardA11y:ft,nodeExtent:It,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}zq.displayName="GraphView";const uMt=R.memo(zq),dMt=AH(),qR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Ep;qH(S,v,b);const{nodesInitialized:E}=w5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=pm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:z,y:M,zoom:O}=Mk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[z,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Ep,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:t_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...kH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:dMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:SH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},fMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>wAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await kTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...qR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:z,hasSelectedNodes:M}=w5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&z?(S(),m({nodes:v,nodesInitialized:z,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:z,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();qH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:z,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=VTt(v,w,y,C,E,N,M);B&&(qTt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),z?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:z}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),U={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const H=Ud(B,N.fromHandle,Et.Left,!0);T({...N,from:H})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(U)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=$k(w,C,M,O);y.push(...B)}for(const M of z.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=qAt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=UAt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(ah(y,new Set([...v]),!0)),E(ah(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(ah(w,new Set([...v]))),C(ah(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,z=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of z)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,z)=>z.selected?[...T,sd(z.id,!1)]:T,[]),N=v.reduce((T,z)=>z.selected?[...T,sd(z.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(w5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return KTt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...kH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...qR()})}},Object.is);function hMt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>fMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(SAt,{value:x,children:f.jsx(YAt,{children:f.jsx(dRt,{children:m})})})}function _Mt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(cy)?f.jsx(f.Fragment,{children:e}):f.jsx(hMt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const pMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function mMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:z,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:U,onSelectionDragStart:H,onSelectionDrag:Y,onSelectionDragStop:V,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:q=Kc.Bezier,connectionLineStyle:G,connectionLineComponent:ee,connectionLineContainerStyle:ce,deleteKeyCode:oe="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=Np.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:ue=jp()?"Meta":"Control",zoomActivationKeyCode:pe=jp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:ze,autoPanOnNodeFocus:at,nodesConnectable:bt,nodesFocusable:$t,nodeOrigin:Pt=nq,edgesFocusable:zt,edgesReconnectable:ot,elementsSelectable:ft=!0,defaultViewport:It=OAt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Ep,preventScrolling:ht=!0,nodeExtent:xt,defaultMarkerColor:Vt="#b1b1b7",zoomOnScroll:Ve=!0,zoomOnPinch:Ht=!0,panOnScroll:sn=!1,panOnScrollSpeed:fn=.5,panOnScrollMode:Zt=jd.Free,zoomOnDoubleClick:Qn=!0,panOnDrag:Jt=!0,onPaneClick:bn,onPaneMouseEnter:or,onPaneMouseMove:lr,onPaneMouseLeave:br,onPaneScroll:Dn,onPaneContextMenu:Wr,paneClickDistance:Nr=1,nodeClickDistance:vt=0,children:un,onReconnect:Cn,onReconnectStart:en,onReconnectEnd:Jn,onEdgeContextMenu:hn,onEdgeDoubleClick:En,onEdgeMouseEnter:ln,onEdgeMouseMove:pt,onEdgeMouseLeave:kt,reconnectRadius:Ge=10,onNodesChange:mt,onEdgesChange:fr,noDragClassName:cn="nodrag",noWheelClassName:qt="nowheel",noPanClassName:er="nopan",fitView:Ln,fitViewOptions:di,connectOnClick:Xl,attributionPosition:io,proOptions:Ni,defaultEdgeOptions:Ra,elevateNodesOnSelect:tn=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:cr=!1,autoPanOnConnect:Rr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ut=!0,autoPanSpeed:zi,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:ao,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Vr,width:Mr,height:nn,colorMode:vs="light",debug:Xs,onScroll:ur,ariaLabelConfig:ls,zIndexMode:Ls="basic",...$r},Dr){const cs=Ma||"1",bs=PAt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ur==null||ur(ys)},[ur]);return f.jsx("div",{"data-testid":"rf__wrapper",...$r,onScroll:yr,style:{...sa,...pMt},ref:Dr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(_Mt,{nodes:e,edges:n,width:Mr,height:nn,fitView:Ln,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Pt,nodeExtent:xt,zIndexMode:Ls,children:[f.jsx($At,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:ze,autoPanOnNodeFocus:at,nodesConnectable:bt,nodesFocusable:$t,edgesFocusable:zt,edgesReconnectable:ot,elementsSelectable:ft,elevateNodesOnSelect:tn,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:xt,onNodesChange:mt,onEdgesChange:fr,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:Ln,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:z,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:H,onSelectionDragStop:V,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:er,nodeOrigin:Pt,rfId:cs,autoPanOnConnect:Rr,autoPanOnNodeDrag:Ke,autoPanSpeed:zi,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:ao,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(uMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:q,connectionLineStyle:G,connectionLineComponent:ee,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:oe,multiSelectionKeyCode:ue,panActivationKeyCode:ae,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:It,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:ht,zoomOnScroll:Ve,zoomOnPinch:Ht,zoomOnDoubleClick:Qn,panOnScroll:sn,panOnScrollSpeed:fn,panOnScrollMode:Zt,panOnDrag:Jt,autoPanOnSelection:Ut,onPaneClick:bn,onPaneMouseEnter:or,onPaneMouseMove:lr,onPaneMouseLeave:br,onPaneScroll:Dn,onPaneContextMenu:Wr,paneClickDistance:Nr,nodeClickDistance:vt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:en,onReconnectEnd:Jn,onEdgeContextMenu:hn,onEdgeDoubleClick:En,onEdgeMouseEnter:ln,onEdgeMouseMove:pt,onEdgeMouseLeave:kt,reconnectRadius:Ge,defaultMarkerColor:Vt,noDragClassName:cn,noWheelClassName:qt,noPanClassName:er,rfId:cs,disableKeyboardA11y:cr,nodeExtent:xt,viewport:Da,onViewportChange:Vr}),f.jsx(LAt,{onSelectionChange:U}),un,f.jsx(TAt,{proOptions:Ni,position:io}),f.jsx(jAt,{rfId:cs,disableKeyboardA11y:cr})]})})}var gMt=sq(mMt);function vMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function bMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const yMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},xMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function jq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(xMt,kr),x=r||yMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...dy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(bMt,{radius:y/2,className:_}):f.jsx(vMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}jq.displayName="Background";const wMt=R.memo(jq);function SMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function CMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function EMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function NMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function h1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const zMt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Tq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(zMt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Pk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},z=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(uy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(h1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(SMt,{})}),f.jsx(h1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(kMt,{})})]}),t&&f.jsx(h1,{className:"react-flow__controls-fitview",onClick:z,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(CMt,{})}),r&&f.jsx(h1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(NMt,{}):f.jsx(EMt,{})}),_]})}Tq.displayName="Controls";R.memo(Tq);function jMt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const TMt=R.memo(jMt),AMt=e=>e.nodes.map(n=>n.id),Vw=e=>e instanceof Function?e:()=>e;function RMt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=TMt,onClick:a}){const o=An(AMt,kr),l=Vw(n),u=Vw(e),_=Vw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(DMt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function MMt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!RH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const DMt=R.memo(MMt);var LMt=R.memo(RMt);const OMt=200,IMt=150,BMt=e=>!e.hidden,$Mt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?jH(pm(e.nodeLookup,{filter:BMt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},PMt="react-flow__minimap-desc";function Aq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:z,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:U,ariaLabelConfig:H}=An($Mt,kr),Y=(e==null?void 0:e.width)??OMt,V=(e==null?void 0:e.height)??IMt,X=T.width/Y,te=T.height/V,I=Math.max(X,te),L=I*Y,F=I*V,q=C*I,G=T.x-(L-T.width)/2-q,ee=T.y-(F-T.height)/2-q,ce=L+q*2,oe=F+q*2,ne=`${PMt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=rAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:U,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,U]);const ae=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ue=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??H["minimap.ariaLabel"];return f.jsx(uy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:V,viewBox:`${G} ${ee} ${ce} ${oe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:ae,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(LMt,{onClick:ue,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-q},${ee-q}h${ce+q*2}v${oe+q*2}h${-ce-q*2}z - M${z.x},${z.y}h${z.width}v${z.height}h${-z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Aq.displayName="MiniMap";R.memo(Aq);const FMt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,HMt={[s_.Line]:"right",[s_.Handle]:"bottom-right"};function qMt({nodeId:e,position:n,variant:t=s_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=lq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===s_.Handle,T=An(R.useCallback(FMt(N&&m),[N,m]),kr),z=R.useRef(null),M=n??HMt[t];R.useEffect(()=>{if(!(!E.current||!y))return z.current||(z.current=mAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:U,snapToGrid:H,nodeOrigin:Y,domNode:V}=C.getState();return{nodeLookup:B,transform:$,snapGrid:U,snapToGrid:H,nodeOrigin:Y,paneDomNode:V}},onChange:(B,$)=>{const{triggerNodeChanges:U,nodeLookup:H,parentLookup:Y,nodeOrigin:V}=C.getState(),X=[],te={x:B.x,y:B.y},I=H.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??V,F=B.width??I.measured.width??0,q=B.height??I.measured.height??0,G={id:I.id,parentId:I.parentId,rect:{width:F,height:q,...MH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:q},I.parentId,H,L)}},ee=$k([G],H,Y,V);X.push(...ee),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*q,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}U(X)},onEnd:({width:B,height:$})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([U])}})),z.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=z.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(qMt);function UMt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const _1=8;function GMt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,_1),i-t-_1),l=Math.min(Math.max(l,_1),s-r-_1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Kw=380,Qw=12,WMt=350,VMt=150,C5=new EventTarget;function KMt(){C5.dispatchEvent(new Event("move"))}function QMt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return C5.addEventListener("move",u),()=>{C5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},WMt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),VMt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function YMt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(j(),t)}function XMt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=UMt(),_=s.right+Qw+Kw<=window.innerWidth,d=s.x-Qw-Kw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=GMt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Qw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Cgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const V=$.lastIndexOf(` -diff --git `);$=V!==-1?$.slice(0,V+1):$.slice(0,$.lastIndexOf(` -`)+1)}let U=[];try{U=$.trim()?r3($):[]}catch{return null}if(B.truncated&&U.every(V=>V.hunks.length===0))return null;let H=0,Y=0;for(const V of U){const X=Mb(V);H+=X.additions,Y+=X.deletions}return{fileCount:U.length,additions:H,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,z]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{z(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),no.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Kw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Gi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Ur(i),children:[f.jsx(qh,{size:13}),g1e()]}),f.jsxs("button",{type:"button",...Ur(a),children:[f.jsx(fb,{size:13}),i1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>z(B=>!B),children:T?zD():Spe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(j(),{style:"short"}).format([n.length===1?F4e():G4e({count:Wt(n.length)}),...w.done>0?[g4e({count:Wt(w.done)})]:[],...w.failed>0?[x4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[h4e({count:Wt(w.cancelled)})]:[],...w.live>0?[M4e({count:Wt(w.live)})]:[]])}),t&&p6(t.backend)&&f.jsx($6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:Io(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(Jp,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[h1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?OK({parent:Ne(r??"parent")}):RK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?I4e():b.truncated?j4e({count:Wt(b.fileCount)}):C4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[c1e()," ",YMt(e.createdAt)]})]})]}),document.body)}const UR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),ZMt=264,GR=132,P1=44,JMt=72,eDt=148,tDt=44;function nDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function rDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function E5(e){return e.kind==="exp"?ZMt:eDt}function p1(e){return e.kind==="exp"?e.exp.id:e.id}function F1(e){if(e.children.length===0)return E5(e);const n=e.children.reduce((t,r)=>t+F1(r),0)+P1*(e.children.length-1);return Math.max(E5(e),n)}function sDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const iDt=R.memo(function({data:n}){Qd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Gi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Jat():p?_ot():Cl(),x=s.slice(-8),S=R.useRef(null),v=QMt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Et.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Ur(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Jot()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${sDt(Gi(b))}`,title:U6(Gi(b))},b.id))}):f.jsx("span",{children:Fot()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:Io(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:Got(),...Ur(b=>u(t.id,"terminal",b)),children:[f.jsx(qh,{size:13}),NL()]}),f.jsxs("button",{className:"node-action",title:fD({branch:Ne(t.branchName)}),...Ur(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(fb,{size:13}),Eot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:J1({name:Ne(t.branchName)}),"aria-label":J1({name:Ne(t.branchName)}),href:eb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(hb,{size:13})})]}),f.jsx(yu,{type:"source",position:Et.Bottom}),v.rect&&f.jsx(XMt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),aDt=R.memo(function({data:n}){Qd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:rlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Et.Top}),f.jsx(A6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?uot():aot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:Qot()})]}),f.jsx(yu,{type:"source",position:Et.Bottom})]})}),oDt={exp:iDt,elided:aDt},Rq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},lDt={...Rq.style,strokeDasharray:"4 4"};function cDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=rDt(nDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-E5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(GR-tDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+F1(O),0)+P1*(y.children.length-1);let z=C-T/2;for(const M of y.children){const O=F1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${p1(y)}-${p1(M)}`,source:p1(y),target:p1(M),...B?{style:lDt}:{}}),b(M,z+O/2,E+GR+JMt),z+=O+P1}}let w=0;for(const y of S){const C=F1(y);b(y,w+C/2,0),w+=C+P1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:UR,children:[f.jsx("p",{className:"empty-state-title",children:Iot()}),f.jsx("p",{className:"empty-state-hint",children:wot()})]}):u.length===0&&i?f.jsxs("div",{className:UR,children:[f.jsx("p",{className:"empty-state-title",children:Mot()}),f.jsx("p",{className:"empty-state-hint",children:vot()})]}):f.jsx(gMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:oDt,defaultEdgeOptions:Rq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:KMt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(wMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function uDt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?uDt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function fDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const qv=360,hDt=10,WR=1448,_Dt=272,pDt=380,mDt=_Dt+56,gDt=80,vDt=48;function T0(){return Math.max(qv,window.innerWidth-mDt-pDt)}function bDt(){const e=T0();return Math.max(qv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function VR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function KR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function yDt({runtime:e,projectId:n,pane:t}){var nl,$s,fo;const r=gn({mutationFn:fut}),s=li(),i=sD({select:Z=>Z.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const Z=t?Wa(t):"experiments";return typeof Z=="object"&&"path"in Z&&Z.line&&p!==v.current.value?{...Z,lineScrollRequest:v.current.value}:Z},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var Z;return((Z=w.data)==null?void 0:Z.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,z]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((Z,ge=!1)=>{const Te=M.current;Te.projectId&&s.navigate({href:k1(Te.projectId,Te.activeSessionId,Z),replace:ge})},[s]),B=R.useCallback(Z=>{const ge=Dl(Z);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),U=R.useCallback(Z=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:Z??void 0})},[t,O]),H=R.useCallback(Z=>{s.navigate({href:Z?`/projects/${encodeURIComponent(Z)}`:"/projects"})},[s]),Y=R.useCallback(Z=>{var ge;if(n)if(Z==="chat"){const Te=l.current;s.navigate({href:k1(n,Te,(ge=cu(oa.current,Te??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${Z==="skills"?"skills":`settings/${Z}`}`})},[s,n]),V=Qd(),{status:X}=P6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(Z=>{Gr(te.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[te]),q=R.useMemo(()=>Xp(),[n]),G=ct(q),ee=G.data??null,ce=R.useCallback(Z=>{Gr(q.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[q]),oe=R.useRef(void 0);oe.current=ee==null?void 0:ee.tourCompleted;const ne=[!w.data&&w.error?vD():null,!I.data&&I.error?D0():null,!G.data&&G.error?Dne():null].filter(Z=>Z!==null),Q=ne.length?Bne({items:new Intl.ListFormat(V).format(ne)}):null,le=R.useRef(null),ae=ct(U4(n)),ue=ae.data??[],pe=!ae.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],ze=R.useRef(Ie);ze.current=Ie;const at=R.useRef(new Map),bt=R.useRef(new Set),$t=R.useRef(null),Pt=R.useRef(!1),zt=R.useRef(new Map),ot=R.useRef(new Map),ft=R.useRef(0),It=R.useRef(ue);It.current=ue;const Re=ct(Egt(n)).data??null,[Ze,ht]=R.useState("table"),[xt,Vt]=R.useState("project"),Ve=R.useRef(null),{open:Ht,setOpen:sn,ref:fn}=ro(Ve),[Zt,Qn]=R.useState(!1),Jt=ue.every(Z=>Z.chatSessionId),bn=u&&Jt?xt:"project",or=R.useMemo(()=>bn!=="agent"?ue:ue.filter(Z=>Z.chatSessionId===u),[ue,bn,u]),lr=R.useMemo(()=>{if(bn!=="agent")return Ie;const Z=new Set(or.map(ge=>ge.id));return Ie.filter(ge=>Z.has(ge.experimentId))},[Ie,or,bn]),[br,Dn]=R.useState([]),[Wr,Nr]=R.useState(!1),[vt,un]=R.useState(!1),[Cn,en]=R.useState(!1),[Jn,hn]=R.useState([]),[En,ln]=R.useState([]),pt=R.useRef(new Map),kt=R.useRef(new Map),Ge=Z=>{let ge=kt.current.get(Z);return ge||(ge=new mEt,kt.current.set(Z,ge)),ge},[mt,fr]=R.useState([]),[cn,qt]=R.useState([]),[er,Ln]=R.useState([]),[di,Xl]=R.useState([]),[io,Ni]=R.useState(null),[Ra,tn]=R.useState("files"),[Ys,cr]=R.useState(new Set),[Rr,Ke]=R.useState(!1),[Ut,zi]=R.useState(null),[os,ks]=R.useState(bDt),[gs,sa]=R.useState(()=>window.innerWidth>=WR),Ma=o==="chat"&&!_&&gs,[ao,Cs]=R.useState(!0),[Da,Vr]=R.useState(!1),Mr=R.useRef(z6()),nn=R.useRef(u);nn.current=u;const vs=R.useRef(br);vs.current=br;const Xs=R.useRef(di);Xs.current=di;const ur=R.useRef(null),ls=R.useCallback(Z=>{const ge=[...Z];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(Z=>{ur.current=Z,Ni(Z)},[]),$r=R.useCallback(Z=>{const ge=Ct(Z);hn(Me=>u0(Me,ge)),ln(Me=>u0(Me,ge)),fr(Me=>u0(Me,ge)),qt(Me=>u0(Me,ge)),Ln(Me=>u0(Me,ge));const Te=hr.current;if(Te&&"path"in Z){const Me=Ms(Te,nn.current,Z);pt.current.delete(Me),kt.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Ct(Me)!==ge);vs.current=$e,Dn($e)},[]),Dr=R.useCallback(Z=>{const ge=Ct(Z),Te=[...vs.current.filter($e=>Ct($e)!==ge),Ig(Z)];vs.current=Te,Dn(Te),B(Z)},[B]),cs=R.useCallback((Z,ge,Te)=>{const $e=Ct(Z),Me=ur.current,it=F7t({order:Xs.current,previewKey:Me?Ct(Me):null},$e,ge);it.replacedKey&&Me&&typeof Me!="string"&&Ct(Me)===it.replacedKey&&$r(Me),ls(it.order),it.previewKey===null?Ls(null):it.previewKey===$e&&Ls(Ig(Z));const tt=[...vs.current.filter(Mt=>Ct(Mt)!==$e),Ig(Z)];vs.current=tt,Dn(tt),O(Dl(Z,Te))},[$r,ls,Ls,O]),bs=R.useCallback(Z=>{const ge=ur.current;ge&&Ct(ge)===Ct(Z)&&Ls(null)},[Ls]);R.useEffect(()=>{let Z=!1;const ge=$e=>{const Me=ur.current,it=$e.target;if(it instanceof Element&&it.closest("input, textarea, [contenteditable='true']")!==null){Z=!1;return}if(Me&&Ct(Me)===Ct(Mr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),Z=!0;return}if(Z&&$e.key==="Enter"){$e.preventDefault(),Z=!1;const Mt=ur.current;Mt&&bs(Mt);return}Z=!1},Te=()=>{Z=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",Te),window.addEventListener("pointerdown",Te),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",Te),window.removeEventListener("pointerdown",Te)}},[bs]);const yr=R.useCallback((Z,ge)=>{const Te=Ct(Z),$e=ur.current;$e&&Ct($e)===Te&&Ls(null);const Me=H7t({order:Xs.current,previewKey:$e?Ct($e):null},Te,vs.current.map(Ct));ls(Me.order);const it=vs.current.filter(Mt=>Ct(Mt)!==Te);if(vs.current=it,Dn(it),!ge)return;const tt=Me.fallbackKey?it.find(Mt=>Ct(Mt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Ig(b),tabHistory:br,experimentsTabOpen:Wr,filesTabOpen:vt,artifactsTabOpen:Cn,expTabs:Jn,fileTabs:En,planTabs:mt,subagentTabs:cn,codeTabs:er,contentTabOrder:Xs.current,previewTab:ur.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:xt,panelOpen:_,panelMax:Rr,treeViewport:Ut}),[b,br,Wr,vt,Cn,Jn,En,mt,cn,er,di,io,Ra,Ys,d,xt,_,Rr,Ut]);Mr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(pt.current),[]),Yo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Yo.current),Yo.current=setTimeout(()=>z(Z=>Z+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Yo.current),[]);const Nu=R.useCallback((Z,ge,Te)=>{if(Dn(Z.tabHistory),vs.current=Z.tabHistory,Nr(Z.experimentsTabOpen),un(Z.filesTabOpen),en(Z.artifactsTabOpen),hn(Z.expTabs),ln(Z.fileTabs),fr(Me=>Me===Z.planTabs?Me:Z.planTabs.map(it=>{var tt;return{...it,plan:((tt=Me.find(Mt=>Mt.sessionId===it.sessionId&&Mt.promptId===it.promptId))==null?void 0:tt.plan)??""}})),qt(Z.subagentTabs),Ln(Z.codeTabs),ls(Z.contentTabOrder),Ls(Z.previewTab),tn(Z.filesView),cr(Z.filesToggled),Vt(Z.scope),Ke(Z.panelMax),zi(Z.treeViewport),Qn(M.current.activeSessionId===O0&&Z.fileTabs.some(Me=>Yu(Me,{path:w1,source:"artifacts"}))),Te){for(const[Me,it]of Object.entries((ge==null?void 0:ge.scroll)??{}))pt.current.set(Me,it);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of Z.fileTabs){const it=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(it)||C.current.add(it)}},[ls,Ls]),{ready:Bn,loaded:y_,error:Zl,retry:Xo,capture:Pr,workspace:oa}=S0t({projectId:ee&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(ee==null?void 0:ee.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!Bn||!pe||(a==null?void 0:a.kind)!=="task")return;const Z=Jl.current;(Z==null?void 0:Z.projectId)===n&&Z.taskId===u&&Z.scope!==bn&&zi(null),Jl.current={projectId:n,taskId:u,scope:bn}},[Bn,pe,a==null?void 0:a.kind,n,u,bn]);const ji=R.useCallback((Z,ge)=>{var it;if(!n)return;Z&&ge!=null&&ge.replace&&u===null&&(Pr(),x0t(n,Z));const Te=cu(TO(n),Z??"new"),$e=Te?Te.active:Wc(n)?(it=j6(Z??void 0,oe.current===!1))==null?void 0:it.active:void 0,Me=ge!=null&&ge.replace&&Z&&u===null?M.current.pane:$e;s.navigate({href:k1(n,Z,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Pr]);R.useEffect(()=>{Bn&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,z(Z=>Z+1))},[Bn,a==null?void 0:a.kind,oa,y]),HV({shouldBlockFn:({next:Z})=>{var ge;return((ge=Rd(Z.pathname))==null?void 0:ge.projectId)!==n&&[...kt.current.values()].some(Te=>Te.needsProtection)&&!DA(qE())},enableBeforeUnload:()=>[...kt.current.values()].some(Z=>Z.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const Z=ab(i.href);!ee||!Bn||!Z||(ob.queue({lastLocation:Z,railOpen:ao,panelWidth:os,experimentsView:Ze},La.current===Z?250:0),La.current=Z)},[i.href,ee,Bn,ao,os,Ze]);const ec=(ee==null?void 0:ee.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ti=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async Z=>{const ge=oe.current===!1,Te=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:Z}),ce($e=>$e&&{...$e,tourCompleted:Te.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Vr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||ee!=null&&ee.tourCompleted||Ti()},[n,ec,Ti,ee==null?void 0:ee.tourCompleted]);const Rt=(L==null?void 0:L.find(Z=>Z.id===n))??null;R.useEffect(()=>{const Z=Q||ee===null?null:Rt==null?void 0:Rt.name;document.title=Z?`${Do(Z)} — OpenResearch`:"OpenResearch"},[Q,ee,Rt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(Z=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:Z})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((Z=!1)=>{Z&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},Z))},[O,xs]),Ai=()=>{I.refetch(),G.refetch(),w.refetch()},oo=R.useRef(!1);R.useEffect(()=>{if(!ee||oo.current)return;oo.current=!0,le.current=ee.preferredAgent;const Z=E6()??ee.workspace;Z&&(Cs(Z.railOpen),ks(Math.min(Z.panelWidth,T0())),ht(Z.experimentsView))},[ee]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const lo=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(Z=>{const ge=++sc.current;ce($e=>$e&&{...$e,preferredAgent:Z});const Te=lo.current.then(()=>r.mutateAsync({preferredAgent:Z})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return lo.current=Te.catch(()=>{}),Te},[]);R.useEffect(()=>{const Z=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=WR)};return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const Os=R.useCallback(Z=>{Pt.current=!1,zt.current.clear(),ot.current.clear();const ge=++ft.current;nt.fetchQuery(iu(Z)).then(Te=>{if(hr.current!==Z||$t.current!==Z||ft.current!==ge)return;zt.current=new Map(Te.map(Me=>[Me.id,Me]));const $e=[...ot.current.values()].some(Me=>{const it=zt.current.get(Me.id);return!it||it.status!=="running"&&it.updatedAt<=Me.updatedAt});ot.current.clear();for(const Me of Te){const it=at.current.get(Me.id);(!it||it.updatedAt{ft.current===ge&&(ot.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return $t.current=n,at.current.clear(),bt.current.clear(),kut(n).catch(()=>{}),Os(n),()=>{ft.current++}},[Os,n]);const ic=R.useCallback(()=>{en(!0),Dr("artifacts")},[Dr]);uht({onReconnect:()=>{const Z=hr.current;Z&&($t.current=Z,at.current.clear(),bt.current.clear(),Os(Z))},onRun:Z=>{if(Z.projectId!==hr.current||Z.projectId!==$t.current)return;const ge=at.current.get(Z.id),Te=bt.current.has(Z.id);if(ge&&ge.updatedAt>Z.updatedAt||(at.current.set(Z.id,Z),bt.current.add(Z.id),Z.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=zt.current.get(Z.id),Me=Pt.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=Z.updatedAt);Te&&ge||Me?la(!0):Pt.current||ot.current.set(Z.id,Z)}});const Zo=R.useCallback(()=>Vt("project"),[]),Is=R.useCallback((Z,ge="overview",Te="preview",$e)=>{xs("open_experiment");const Me={id:Z,view:ge};hn(it=>it.some(tt=>Rx(tt,Me))?it:[...it,Me]),cs(Me,Te,$e)},[cs]),Oa=R.useCallback((Z,ge="preview")=>{const Te=ze.current.filter(Me=>Me.id===Z||Me.id.startsWith(Z)),$e=Te.length===1?Te[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ue.map(Z=>{var ge;return[Z.id,((ge=Z.title)==null?void 0:ge.trim())||Z.slug||Cl()]})),[ue,V]),Zs=KR(zu),Jo=R.useMemo(()=>{const Z=new Map;for(const ge of Ie)Z.set(ge.id,Zs.get(ge.experimentId)??Cl());return Z},[Zs,Ie,V]),el=KR(Jo),ac=R.useCallback(Z=>{const ge=el.get(Z);if(ge)return ge;const Te=[...el].filter(([$e])=>$e.startsWith(Z));return Te.length===1?Te[0][1]:""},[el]),rf=R.useCallback(Z=>{const ge=Zs.get(Z);if(ge)return ge;const Te=[...Zs].filter(([$e])=>$e.startsWith(Z));return Te.length===1?Te[0][1]:""},[Zs]),ju=R.useCallback((Z,ge="preview")=>{const Te=It.current.filter($e=>$e.id===Z||$e.id.startsWith(Z));Te.length===1&&Is(Te[0].id,"overview",ge)},[Is]),Tu=R.useCallback(Z=>{const ge=Jn.findIndex(Te=>Rx(Te,Z));ge!==-1&&(hn(Te=>Te.filter(($e,Me)=>Me!==ge)),yr(Z,Ct(b)===Ct(Z)))},[Jn,yr,b]),co=R.useCallback((Z,ge="preview")=>{Z.line!=null&&S(Me=>Me+1);const Te=hr.current;if(Te){const Me=Ms(Te,nn.current,Z);Mr.current.fileTabs.some(it=>Yu(it,Z))||C.current.delete(Me),E.current.add(Me)}const $e=zO(Z);ln(Me=>{const it=Me.findIndex(Mt=>Yu(Mt,Z));if(it===-1)return[...Me,$e];const tt=Me.slice();return tt[it]=$e,tt}),cs(Z,ge)},[cs]),fi=R.useCallback((Z,ge,Te,$e,Me,it)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Mt=dDt(Z,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Mt)return null;const Gn=Me?It.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=Te??(Gn==null?void 0:Gn.branchName),zs=Mt.source==null||Mt.source==="repo";return Ns&&zs&&(Mt.ref=Ns),it&&!Mt.ref&&zs&&(Mt.branchLabel=it),$e!=null&&(Mt.line=$e),Mt},[L,n]),oc=R.useCallback((Z,ge,Te,$e,Me,it,tt="preview")=>{const Mt=fi(Z,ge,Te,$e,Me,it);Mt&&co(Mt,tt)},[co,fi]),sf=R.useCallback(Z=>co({path:Z,source:"artifacts"},"keepOpen"),[co]),Au=R.useCallback((Z,ge,Te,$e,Me,it="preview")=>{const tt=fi(Z,ge,Me,Te,$e);tt&&co(tt,it)},[co,fi]),hi=R.useCallback((Z,ge)=>{bs(Z),ge()},[bs]),af=R.useCallback(Z=>{var $e;const ge=En.findIndex(Me=>Yu(Me,Z));if(ge===-1)return;const Te=n?Ms(n,u,Z):null;Te&&(($e=kt.current.get(Te))!=null&&$e.needsProtection)&&!DA(qE())||(ln(Me=>Me.filter((it,tt)=>tt!==ge)),Te&&(pt.current.delete(Te),kt.current.delete(Te),E.current.delete(Te),C.current.delete(Te),delete N.current[Te]),u===O0&&Yu(Z,{path:w1,source:"artifacts"})&&Qn(!1),yr(Z,Ct(b)===Ct(Z)))},[u,En,yr,n,b]),of=R.useCallback(Z=>{Z.lineScrollRequest!==void 0&&m(Z.lineScrollRequest)},[]),x_=R.useCallback((Z,ge,Te,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:Te,plan:Z};fr(it=>{const tt=it.findIndex(Gn=>Gn.promptId===Te);if(tt===-1)return[...it,Me];const Mt=it.slice();return Mt[tt]=Me,Mt}),cs(Me,$e)},[cs]),w_=R.useCallback(Z=>{const ge=mt.findIndex(Te=>Te.promptId===Z.promptId);ge!==-1&&(fr(Te=>Te.filter(($e,Me)=>Me!==ge)),yr(Z,Ct(b)===Ct(Z)))},[yr,mt,b]),lc=R.useCallback((Z,ge,Te,$e="preview")=>{const Me={kind:"subagent",sessionId:Z,spawnPartId:ge,label:Te};qt(it=>it.some(tt=>tt.spawnPartId===ge)?it:[...it,Me]),cs(Me,$e)},[cs]),lf=R.useCallback(Z=>{const ge=cn.findIndex(Te=>Te.spawnPartId===Z.spawnPartId);ge!==-1&&(qt(Te=>Te.filter(($e,Me)=>Me!==ge)),yr(Z,Ct(b)===Ct(Z)))},[yr,b,cn]),[cf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Mt=new Set(cn.map(Gn=>Gn.spawnPartId));return Object.keys(tt).every(Gn=>Mt.has(Gn))?tt:Object.fromEntries(Object.entries(tt).filter(([Gn])=>Mt.has(Gn)))}),cn.length===0)return;let Z=!0;const ge=new Set,Te=(tt,Mt,Gn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Mt)if(!(Gn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Qr=Av(Tn.parts,_i.spawnPartId);if(!Qr)continue;Gn||ge.add(_i.spawnPartId);const Js={label:o9t(Qr),running:((Ps=Qr.state)==null?void 0:Ps.status)==="running"},tr=zs[_i.spawnPartId];(!tr||tr.label!==Js.label||tr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Mt of new Set(cn.map(Gn=>Gn.sessionId)))nt.fetchQuery({...Bl(Mt),staleTime:0}).then(({messages:Gn})=>{Z&&tt===$e&&Te(Gn,cn.filter(Ns=>Ns.sessionId===Mt),!0)}).catch(()=>{})};Me();const it=iv(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Mt=cn.filter(Gn=>Gn.sessionId===tt.sessionId);Mt.length&&Te([tt.message],Mt,!1)});return()=>{Z=!1,it()}},[cn]);const uc=R.useCallback((Z,ge,Te="files",$e="preview")=>{const Me={code:!0,experimentId:Z,branch:ge,view:Te,toggled:new Set};Ln(it=>it.some(tt=>Hf(tt,Me))?it.map(tt=>Hf(tt,Me)?{...tt,experimentId:Z,view:Te}:tt):[...it,Me]),cs(Me,$e)},[cs]),uf=R.useCallback((Z,ge)=>{Ln(Te=>Te.map($e=>Hf($e,Z)?{...$e,...ge}:$e)),ge.view&&O(Dl({...Z,...ge}))},[]),S_=R.useCallback(Z=>{const ge=er.findIndex(Te=>Hf(Te,Z));ge!==-1&&(Ln(Te=>Te.filter(($e,Me)=>Me!==ge)),yr(Z,Ct(b)===Ct(Z)))},[er,yr,b]),uo=R.useCallback(()=>{un(!0),Dr("files")},[Dr]),dc=R.useCallback(Z=>{Z==="experiments"?Nr(!1):Z==="files"?un(!1):en(!1),yr(Z,b===Z)},[yr,b]),df=Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId);const Te=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Rr,Me=Z.clientX,it=os;let tt=!1;function Mt(){window.removeEventListener("pointermove",Gn),window.removeEventListener("pointerup",Mt),window.removeEventListener("pointercancel",Mt),document.body.style.userSelect=Te}function Gn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+gDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,qv),Ps);ks(_i)}window.addEventListener("pointermove",Gn),window.addEventListener("pointerup",Mt),window.addEventListener("pointercancel",Mt)},k_=(Z,ge)=>{F(Te=>Te?VR(Te,Z):[Z]),s.navigate({href:`/projects/${encodeURIComponent(Z.id)}${ge?"/settings/git":""}`}),ge&&Kn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Rn=typeof b=="object"&&"path"in b?b:null,Ru=(Rn==null?void 0:Rn.source)==="artifacts"&&Re?xp(Re.entries,Rn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Zt?En.find(Z=>Yu(Z,{path:w1,source:"artifacts"})):void 0,ff=ca?[ca]:[],Kr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Kr==null?void 0:Kr.sessionId,Ia=Kr==null?void 0:Kr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),tl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),se=R.useMemo(()=>{var ge;if(!ua||!Ia||!tl.data)return null;const Z=tl.data.messages.flatMap(Te=>{const $e=Av(Te.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=Z==null?void 0:Z.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,tl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Le=Ae?er.find(Z=>Hf(Z,Ae))??null:null,Ue=new Map;for(const Z of[...Jn,...En,...mt,...cn,...er])Ue.set(Ct(Z),Z);const zn=ca?Ct(ca):null,jn=di.filter(Z=>Z!==zn).map(Z=>Ue.get(Z)).filter(v0t),dr=Z=>io!==null&&Ct(io)===Ct(Z),Mn=Z=>f.jsx(Fc,{active:Rn!==null&&Yu(Rn,Z),label:Z.path.split("/").pop()||Z.path,icon:f.jsx(qO,{size:12,className:"shrink-0"}),preview:dr(Z),onSelect:()=>Dr(Z),onPromote:()=>bs(Z),onClose:()=>af(Z)},`file:${N6(Z)}`),_r=Bs?ue.find(Z=>Z.id===Bs.id)??null:null,da=Le?ue.find(Z=>Z.id===Le.experimentId&&Z.branchName===Le.branch)??null:null,hf=Z=>{var Te,$e;if("path"in Z)return Mn(Z);if("id"in Z){const Me=ue.find(it=>it.id===Z.id);return f.jsx(Fc,{active:Bs!==null&&Rx(Bs,Z),label:Me?Me.title||Me.slug:"…",icon:Z.view==="overview"?f.jsx(Z0t,{size:12,className:"shrink-0"}):f.jsx(qh,{size:12,className:"shrink-0"}),preview:dr(Z),onSelect:()=>Dr(Z),onPromote:()=>bs(Z),onClose:()=>Tu(Z)},Ct(Z))}if("kind"in Z&&Z.kind==="plan")return f.jsx(Fc,{active:Kr!==null&&Kr.promptId===Z.promptId,label:SD(),icon:f.jsx(L6,{size:12,className:"shrink-0"}),preview:dr(Z),onSelect:()=>Dr(Z),onPromote:()=>bs(Z),onClose:()=>w_(Z)},Ct(Z));if("kind"in Z)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===Z.spawnPartId,label:((Te=cf[Z.spawnPartId])==null?void 0:Te.label)??Z.label??Hne(),shimmer:(($e=cf[Z.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(I6,{size:12,className:"shrink-0"}),preview:dr(Z),onSelect:()=>Dr(Z),onPromote:()=>bs(Z),onClose:()=>lf(Z)},Ct(Z));const ge=ue.find(Me=>Me.id===Z.experimentId);return f.jsx(Fc,{active:Le!==null&&Hf(Le,Z),label:(ge==null?void 0:ge.slug)??Z.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:dr(Z),onSelect:()=>Dr(Z),onPromote:()=>bs(Z),onClose:()=>S_(Z)},Ct(Z))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Oe,{variant:"primary",onClick:Ai,children:Ui()})]}),e.kind==="ssh"&&f.jsx(uv,{runtime:e,corner:!0})]});if(L&&!Rt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Oe,{onClick:()=>H(null),children:D0()})]});if(Zl&&!Bn)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Oe,{onClick:Xo,children:Ui()})]});if(L===null||ee===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(Lt,{})}),e.kind==="ssh"&&f.jsx(uv,{runtime:e,corner:!0})]});if(!Rt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Oe,{onClick:()=>H(null),children:D0()})]});const Mu=f.jsx(BEt,{projectName:((nl=L.find(Z=>Z.id===n))==null?void 0:nl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Vr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(iI,{}),e.kind==="local"&&f.jsx(uI,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Oe,{onClick:Xo,children:Ui()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(x9t,{projectId:n,projectName:(Rt==null?void 0:Rt.name)??"",railHeader:Mu,railOpen:ao,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:rf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Rt&&Wc(Rt.id)&&(ee==null?void 0:ee.tourCompleted)===!1?iut:null,runtime:e,onOpenDemoWelcome:Rt&&Wc(Rt.id)?Ti:void 0,activeSessionId:u,onActiveSessionChange:ji,preferredAgent:ee.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(aEt,{}):o!=="chat"?f.jsx(U8t,{remote:e.kind==="ssh",tab:o,project:Rt,onProjectUpdate:Z=>{F(ge=>ge?VR(ge,Z):[Z])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(Ryt,{expanded:Ma,experiments:ue,runs:Ie,onOpenExperiment:(Z,ge)=>Is(Z,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Rt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(Z=>Z.id===u&&Z.busy))??!1,onChanges:()=>{tn("changes"),uo()},onFiles:()=>{tn("files"),uo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Rr?"max":""}`,style:Rr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Rr?"cursor-e-resize":"cursor-col-resize"}`,title:Rr?Lte():Ate(),onPointerDown:df}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[ff.map(Mn),vt&&f.jsx(Fc,{active:b==="files",label:k4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Dr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:pD(),icon:f.jsx(M6,{size:12,className:"shrink-0"}),onSelect:()=>Dr("artifacts"),onClose:()=>dc("artifacts")}),Wr&&f.jsx(Fc,{active:b==="experiments",label:mD(),icon:f.jsx(db,{size:12,className:"shrink-0"}),onSelect:()=>Dr("experiments"),onClose:()=>dc("experiments")}),jn.map(hf)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Rr?oE():aE(),"aria-label":Rr?oE():aE(),onClick:()=>Ke(Z=>!Z),children:Rr?f.jsx(tmt,{size:14}):f.jsx(Zpt,{size:14})}),f.jsx(Qt,{title:ev(),"aria-label":ev(),onClick:()=>{$(),Ke(!1)},children:f.jsx(qr,{size:14})})]})]}),!Bn||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(Lt,{})}):Bs&&(!_r||d&&!Ie.some(Z=>Z.id===d&&Z.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Rt&&f.jsx(X9t,{project:Rt,artifacts:Re,onOpenFile:sf,canRenameFile:Z=>{var ge;return!((ge=kt.current.get(Ms(Rt.id,u,{path:Z,source:"artifacts"})))!=null&&ge.needsProtection)}},Rt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:fn,children:[f.jsx(Qt,{size:"small",ref:Ve,className:"experiment-scope-trigger",active:bn==="agent",title:Gte({scope:bn==="agent"?sE():iE()}),"aria-label":ine(),"aria-expanded":Ht,onClick:()=>sn(Z=>!Z),children:f.jsx(Mpt,{size:16,strokeWidth:2.5})}),Ht&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(sr,{"aria-pressed":bn==="agent",disabled:!u||!Jt,title:u?Jt?void 0:cne():gne(),onClick:()=>{Vt("agent"),sn(!1)},children:[f.jsx("span",{children:sE()}),bn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(sr,{"aria-pressed":bn==="project",onClick:()=>{Vt("project"),sn(!1)},children:[f.jsx("span",{children:iE()}),bn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Qte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>ht("table"),children:Wne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>ht("tree"),children:Yne()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Rt&&f.jsx(cDt,{experiments:ue,runs:lr,project:Rt,onOpenView:Is,onOpenCode:uc,agentSessionId:bn==="agent"?u:null,onShowProjectScope:Zo,viewport:Ut,onViewportChange:zi}):f.jsx($Et,{runs:lr,emptyHint:bn==="agent"&&ue.length>0?hne():void 0,experiments:or,onOpen:(Z,ge)=>{Is(Z.id,"overview",ge)},onOpenLogs:(Z,ge,Te)=>{Is(Z,"terminal",Te,ge)},onOpenCode:(Z,ge)=>{const Te=ue.find($e=>$e.id===Z);Te&&uc(Te.id,Te.branchName,"files",ge)},onCancel:ML})})]}):b==="files"?f.jsx(Fa,{children:Rt?f.jsx($9t,{sessionId:u??void 0,project:Rt,view:Ra,toggled:Ys,onViewChange:tn,onToggledChange:cr,canRenameFile:Z=>{var ge;return!((ge=kt.current.get(Ms(Rt.id,u,{path:Z,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(Z,ge,Te,$e)=>oc(Z,ge,Te,void 0,void 0,void 0,$e)},`files:${u??`project:${Rt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(ph,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(UO,{size:22}),f.jsx("p",{children:Tne()})]})})})}):Rn?f.jsx(Fa,{children:n&&f.jsx(IEt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Rn)),onRestoreActivated:()=>{const Z=Ms(n,u,Rn);C.current.delete(Z),E.current.add(Z)},showSource:N.current[Ms(n,u,Rn)]??!1,onShowSourceChange:Z=>{N.current[Ms(n,u,Rn)]=Z,z(ge=>ge+1)},projectId:n,path:Rn.path,source:Rn.source,sessionId:Rn.source==="artifacts"?u??void 0:Rn.sessionId,gitRef:Rn.ref,line:Rn.line,branchLabel:fDt(Rn,Rt==null?void 0:Rt.baselineBranch),artifactVersion:fc,artifactEntries:Rn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ge(Ms(n,u,Rn)),onOpenFile:(Z,ge,Te,$e)=>hi(Rn,()=>oc(Z,ge,Te,void 0,void 0,void 0,$e)),scrollPosition:pt.current.get(Ms(n,u,Rn)),onScrollPositionChange:Z=>{pt.current.set(Ms(n,u,Rn),Z),Es()},lineScrollRequest:Rn.lineScrollRequest,onLineScrollRequestHandled:()=>of(Rn),onEdit:()=>bs(Rn)},Ms(n,u,Rn))}):Kr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx($o,{text:(se==null?void 0:se.key)===`${Kr.sessionId}:${Kr.promptId}`?se.text??Ya():((fo=mt.find(Z=>Z.promptId===Kr.promptId))==null?void 0:fo.plan)||gD(),onOpenFile:(Z,ge,Te,$e,Me)=>hi(Kr,()=>oc(Z,Kr.sessionId,$e,ge,Te,void 0,Me))})})}):be?f.jsx(k9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(Z,ge,Te,$e,Me)=>hi(be,()=>Au(Z,be.sessionId,ge,Te,$e,Me)),onOpenRun:(Z,ge)=>hi(be,()=>Oa(Z,ge)),runExperimentName:ac,onOpenExperiment:(Z,ge)=>hi(be,()=>ju(Z,ge)),experimentName:rf,onOpenSubagent:(Z,ge,Te)=>hi(be,()=>lc(be.sessionId,Z,ge,Te))},be.spawnPartId):Le?f.jsx(Fa,{children:n&&Rt&&Le&&da&&f.jsx(B9t,{projectId:n,project:Rt,experiment:da,view:Le.view,toggled:Le.toggled,onViewChange:Z=>uf(Le,{view:Z}),onToggledChange:Z=>uf(Le,{toggled:Z}),onOpenFile:(Z,ge,Te,$e)=>hi(Le,()=>oc(Z,ge,Te,void 0,void 0,da.branchName,$e))},`code:${Le.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Rt&&f.jsx(dEt,{experiment:_r,project:Rt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:U,parentExperiment:ue.find(Z=>Z.id===_r.parentExperimentId)??null,onOpenView:(Z,ge,Te)=>{hi(Bs,()=>Is(_r.id,Z,Te,ge))},onOpenCode:(Z,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,Z,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(sI,{remote:e.kind==="ssh",onClose:()=>Vr(!1),onCreated:(Z,ge)=>{Vr(!1),k_(Z,ge)}}),tc&&Rt&&Wc(Rt.id)&&f.jsx(PEt,{onClose:Nn,onCreateProject:rc})]})}const N5=Fo()({validateSearch:e=>({pane:C6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw pW()},component:xDt});function xDt(){const{projectId:e}=N5.useParams(),{pane:n}=N5.useSearch(),t=li(),r=sD({select:s=>s.location});return R.useEffect(()=>{const s=wDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(yDt,{projectId:e,pane:n,runtime:AO()},e)]})}function wDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&C6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Mq=Fo()({component:SDt});function SDt(){const{projectId:e}=Mq.useParams();return f.jsx(bgt,{projectId:e})}const kDt=Fo()({}),CDt=Fo()({}),EDt=Fo()({}),NDt=Fo()({}),zDt=xgt.update({id:"/",path:"/",getParentRoute:()=>lb}),Hk=wgt.update({id:"/projects",path:"/projects",getParentRoute:()=>lb}),jDt=Sgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>lb}),TDt=kgt.update({id:"/",path:"/",getParentRoute:()=>Hk}),b_=N5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>Hk}),ADt=Mq.update({id:"/",path:"/",getParentRoute:()=>b_}),RDt=kDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),MDt=CDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),DDt=EDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),LDt=NDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),ODt={ProjectsProjectIdSkillsRoute:RDt,ProjectsProjectIdIndexRoute:ADt,ProjectsProjectIdSettingsTabRoute:MDt,ProjectsProjectIdTasksSessionIdRoute:DDt,ProjectsProjectIdTasksNewRoute:LDt},IDt=b_._addFileChildren(ODt),BDt={ProjectsProjectIdRoute:IDt,ProjectsIndexRoute:TDt},$Dt=Hk._addFileChildren(BDt),PDt={IndexRoute:zDt,ProjectsRoute:$Dt,RemoteLaunchRoute:jDt},FDt=lb._addFileChildren(PDt)._addFileTypes(),HDt=IV({routeTree:FDt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:F6,defaultErrorComponent:H6,defaultNotFoundComponent:ggt}),qDt=j();document.documentElement.lang=qDt;document.documentElement.dir="ltr";GG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(iG,{client:nt,children:f.jsx(PV,{router:HDt})}),f.jsx(J_t,{})]})); +`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=Hv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=Hv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const fy={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(H=>{b==null||b({x:H[0],y:H[1],zoom:H[2]}),w||E.setState({transform:H})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:ee,onMoveStart:I}=E.getState();I==null||I(G,X),ee==null||ee(X)},onPanZoom:(G,X)=>{const{onViewportChange:ee,onMove:I}=E.getState();I==null||I(G,X),ee==null||ee(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:ee,onMoveEnd:I}=E.getState();I==null||I(G,X),ee==null||ee(X)}});const{x:H,y:q,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[H,q,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:fy,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Vw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),H=R.useRef(!1),q=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(H.current||$.current||b.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},ee=d?Q=>d(Q):void 0,I=Q=>{H.current&&(Q.stopPropagation(),H.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ce=Q.target===j.current;if(!ce&&!!Q.target.closest(".nokey")||!e||!(a&&ce||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),H.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ce||(Q.stopPropagation(),Q.preventDefault())};function P(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ce,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ce),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(q.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!H.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ce,y:pe}=q.current;P(ce,pe),v.current=requestAnimationFrame(W)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>U(),[]);const te=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ce}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);q.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!H.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ce(),o==null||o(Q)}H.current=!0,Y.current||(W(),Y.current=!0),P(pe,Se)},de=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),U())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),U()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Vw(G,j),onContextMenu:Vw(X,j),onWheel:Vw(ee,j),onPointerEnter:T?void 0:p,onPointerMove:T?te:m,onPointerUp:de,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:fy,children:[S,f.jsx(ARt,{})]})}function E5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{E5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:ee,onConnect:I,hasDefaultEdges:L}=v.getState(),P={...ee,...X};if(L){const{edges:W,setEdges:U,onError:te}=v.getState();U(vRt(P,W,{onError:te}))}I==null||I(P),o==null||o(P)},H=X=>{if(!b)return;const ee=PH(X.nativeEvent);if(s&&(ee&&X.button===0||!ee)){const I=v.getState();C5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var P,W;return(W=(P=v.getState()).onConnectEnd)==null?void 0:W.call(P,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var P,W;return((W=(P=v.getState()).isValidConnection)==null?void 0:W.call(P,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}ee?_==null||_(X):d==null||d(X)},q=X=>{const{onClickConnectStart:ee,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:P,isValidConnection:W,lib:U,rfId:te,nodeLookup:de,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){ee==null||ee(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=C5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:P,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:te,doc:ne,lib:U,nodeLookup:de});oe&&le&&$(le);const ce=structuredClone(re);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,I==null||I(X,ce),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:w?q:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const qv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(qv,m.key)&&(m.preventDefault(),l({direction:qv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,preventScrolling:q,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:ee,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:P,userSelectionActive:W}=An(QRt,kr),U=Ap(u,{target:IR}),te=Ap(S,{target:IR}),de=te||j,re=te||C,ne=_&&de!==!0,Q=U||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!U&&de,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,zoomActivationKeyCode:v,preventScrolling:q,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:de,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:ne,children:[e,P&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:ee})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),H=OH(y),q=tMt({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),Y=uq({nodeRef:q,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),ee=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,P=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,U=i?Q=>i(Q,{...C.userNode}):void 0,te=a?Q=>a(Q,{...C.userNode}):void 0,de=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&E5({id:e,store:$,nodeRef:q}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";E5({id:e,store:$,unselect:le,nodeRef:q})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(qv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:qv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=q.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ce,setCenter:pe}=$.getState();if(!ce)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:H?"visible":"hidden",...y.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:P,onMouseLeave:W,onContextMenu:U,onClick:de,onDoubleClick:te,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:fy,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Pv.Arrow]:oMt,[Pv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function hy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(hy,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=w5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(hy,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:H,rfId:q,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",ee=(P,W)=>{p(!1),d==null||d(P,t,E.type,W)},I=P=>u==null?void 0:u(t,P),L=(P,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(P,W)};C5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:q,cancelConnection:$,panBy:Y,isValidConnection:(...P)=>{var W,U;return((U=(W=x.getState()).isValidConnection)==null?void 0:U.call(W,...P))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...P)=>{var W,U;return(U=(W=x.getState()).onConnectEnd)==null?void 0:U.call(W,...P)},onReconnectEnd:ee,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[H,q]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:ee,targetX:I,targetY:L,sourcePosition:P,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),U=R.useMemo(()=>y.markerStart?`url('#${S5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),te=R.useMemo(()=>y.markerEnd?`url('#${S5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||ee===null||I===null||L===null)return null;const de=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ce=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:de,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ce:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!H&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:ee,targetX:I,targetY:L,sourcePosition:P,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:te,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:ee,targetX:I,targetY:L,sourcePosition:P,targetPosition:W,setUpdateHover:$,setReconnecting:q})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=w5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=w5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:ee,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:P,zoomOnDoubleClick:W,panOnDrag:U,autoPanOnSelection:te,onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ce,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ce,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:ee,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:P,panOnDrag:U,autoPanOnSelection:te,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=k5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=k5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),H={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const q=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:q})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(H)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(k5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(uy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:H,onSelectionDragStart:q,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:ee,onSelectionEnd:I,onBeforeDelete:L,connectionMode:P,connectionLineType:W=Kc.Bezier,connectionLineStyle:U,connectionLineComponent:te,connectionLineContainerStyle:de,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ce=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Pr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Pr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:P,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:q,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:U,connectionLineComponent:te,connectionLineContainerStyle:de,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ce,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:ee,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:H}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...fy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(dy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Kw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Kw(n),u=Kw(e),_=Kw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:H,ariaLabelConfig:q}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,ee=T.height/G,I=Math.max(X,ee),L=I*Y,P=I*G,W=C*I,U=T.x-(L-T.width)/2-W,te=T.y-(P-T.height)/2-W,de=L+W*2,re=P+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:H,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,H]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ce=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??q["minimap.ariaLabel"];return f.jsx(dy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${U} ${te} ${de} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ce,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-W},${te-W}h${de+W*2}v${re+W*2}h${-de-W*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:H,nodeLookup:q,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],ee={x:B.x,y:B.y},I=q.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,P=B.width??I.measured.width??0,W=B.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:P,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:P,height:W},I.parentId,q,L)}},te=Pk([U],q,Y,G);X.push(...te),ee.x=B.x?Math.max(L[0]*P,B.x):void 0,ee.y=B.y?Math.max(L[1]*W,B.y):void 0}if(ee.x!==void 0&&ee.y!==void 0){const L={id:y,type:"position",position:{...ee}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const P={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(P)}for(const L of $){const P={...L,type:"position"};X.push(P)}H(X)},onEnd:({width:B,height:$})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Qw=380,Yw=12,vDt=350,bDt=150,N5=new EventTarget;function yDt(){N5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return N5.addEventListener("move",u),()=>{N5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Yw+Qw<=window.innerWidth,d=s.x-Yw-Qw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Yw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` +diff --git `);$=G!==-1?$.slice(0,G+1):$.slice(0,$.lastIndexOf(` +`)+1)}let H=[];try{H=$.trim()?i3($):[]}catch{return null}if(B.truncated&&H.every(G=>G.hunks.length===0))return null;let q=0,Y=0;for(const G of H){const X=Db(G);q+=X.additions,Y+=X.deletions}return{fileCount:H.length,additions:q,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Qw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Wr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Wr(a),children:[f.jsx(hb,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&g6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,F1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function z5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function H1(e){if(e.children.length===0)return z5(e);const n=e.children.reduce((t,r)=>t+H1(r),0)+F1*(e.children.length-1);return Math.max(z5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Wr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Wr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Wr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(hb,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:ev({name:Ne(t.branchName)}),"aria-label":ev({name:Ne(t.branchName)}),href:tb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(_b,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-z5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+H1(O),0)+F1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=H1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+F1}}let w=0;for(const y of S){const C=H1(y);b(y,w+C/2,0),w+=C+F1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Uv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Uv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Uv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:Z=>Z.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const Z=t?Wa(t):"experiments";return typeof Z=="object"&&"path"in Z&&Z.line&&p!==v.current.value?{...Z,lineScrollRequest:v.current.value}:Z},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var Z;return((Z=w.data)==null?void 0:Z.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((Z,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:C1(je.projectId,je.activeSessionId,Z),replace:ge})},[s]),B=R.useCallback(Z=>{const ge=Ll(Z);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),H=R.useCallback(Z=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:Z??void 0})},[t,O]),q=R.useCallback(Z=>{s.navigate({href:Z?`/projects/${encodeURIComponent(Z)}`:"/projects"})},[s]),Y=R.useCallback(Z=>{var ge;if(n)if(Z==="chat"){const je=l.current;s.navigate({href:C1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${Z==="skills"?"skills":`settings/${Z}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),ee=R.useMemo(()=>rp(),[n]),I=ct(ee),L=I.data??null,P=R.useCallback(Z=>{Vr(ee.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[ee]),W=R.useMemo(()=>Zp(),[n]),U=ct(W),te=U.data??null,de=R.useCallback(Z=>{Vr(W.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[W]),re=R.useRef(void 0);re.current=te==null?void 0:te.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!U.data&&U.error?Bne():null].filter(Z=>Z!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(W4(n)),ce=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ce);Ct.current=ce;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ce.every(Z=>Z.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ce:ce.filter(Z=>Z.chatSessionId===u),[ce,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const Z=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>Z.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=Z=>{let ge=En.current.get(Z);return ge||(ge=new HEt,En.current.set(Z,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(Z=>{const ge=[...Z];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(Z=>{dr.current=Z,zi(Z)},[]),Pr=R.useCallback(Z=>{const ge=Et(Z);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in Z){const Me=Ms(je,en.current,Z);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(Z=>{const ge=Et(Z),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(Z)];vs.current=je,Rn(je),B(Z)},[B]),cs=R.useCallback((Z,ge,je)=>{const $e=Et(Z),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Pr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(Z));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(Z)];vs.current=tt,Rn(tt),O(Ll(Z,je))},[Pr,ls,Ls,O]),bs=R.useCallback(Z=>{const ge=dr.current;ge&&Et(ge)===Et(Z)&&Ls(null)},[Ls]);R.useEffect(()=>{let Z=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){Z=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),Z=!0;return}if(Z&&$e.key==="Enter"){$e.preventDefault(),Z=!1;const Lt=dr.current;Lt&&bs(Lt);return}Z=!1},je=()=>{Z=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((Z,ge)=>{const je=Et(Z),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(Z=>Z+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((Z,ge,je)=>{if(Rn(Z.tabHistory),vs.current=Z.tabHistory,Nr(Z.experimentsTabOpen),fn(Z.filesTabOpen),tn(Z.artifactsTabOpen),un(Z.expTabs),on(Z.fileTabs),lt(Me=>Me===Z.planTabs?Me:Z.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(Z.subagentTabs),On(Z.codeTabs),ls(Z.contentTabOrder),Ls(Z.previewTab),Jt(Z.filesView),ur(Z.filesToggled),Zt(Z.scope),Ke(Z.panelMax),ji(Z.treeViewport),Yn(M.current.activeSessionId===O0&&Z.fileTabs.some(Me=>Yu(Me,{path:S1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of Z.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Fr,workspace:oa}=K0t({projectId:te&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(te==null?void 0:te.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const Z=Jl.current;(Z==null?void 0:Z.projectId)===n&&Z.taskId===u&&Z.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((Z,ge)=>{var at;if(!n)return;Z&&ge!=null&&ge.replace&&u===null&&(Fr(),W0t(n,Z));const je=cu(DO(n),Z??"new"),$e=je?je.active:Wc(n)?(at=T6(Z??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&Z&&u===null?M.current.pane:$e;s.navigate({href:C1(n,Z,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Fr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(Z=>Z+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:Z})=>{var ge;return((ge=Rd(Z.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(Z=>Z.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const Z=ob(i.href);!te||!$n||!Z||(lb.queue({lastLocation:Z,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===Z?250:0),La.current=Z)},[i.href,te,$n,oo,os,Ze]);const ec=(te==null?void 0:te.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async Z=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:Z}),de($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||te!=null&&te.tourCompleted||Ai()},[n,ec,Ai,te==null?void 0:te.tourCompleted]);const Mt=(L==null?void 0:L.find(Z=>Z.id===n))??null;R.useEffect(()=>{const Z=Q||te===null?null:Mt==null?void 0:Mt.name;document.title=Z?`${Oo(Z)} — OpenResearch`:"OpenResearch"},[Q,te,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(Z=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:Z})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((Z=!1)=>{Z&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},Z))},[O,xs]),Ri=()=>{I.refetch(),U.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!te||lo.current)return;lo.current=!0,le.current=te.preferredAgent;const Z=N6()??te.workspace;Z&&(Cs(Z.railOpen),ks(Math.min(Z.panelWidth,T0())),_t(Z.experimentsView))},[te]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(Z=>{const ge=++sc.current;de($e=>$e&&{...$e,preferredAgent:Z});const je=co.current.then(()=>r.mutateAsync({preferredAgent:Z})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const Z=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const Os=R.useCallback(Z=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(Z)).then(je=>{if(hr.current!==Z||Ut.current!==Z||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const Z=hr.current;Z&&(Ut.current=Z,vt.current.clear(),Dt.current.clear(),Os(Z))},onRun:Z=>{if(Z.projectId!==hr.current||Z.projectId!==Ut.current)return;const ge=vt.current.get(Z.id),je=Dt.current.has(Z.id);if(ge&&ge.updatedAt>Z.updatedAt||(vt.current.set(Z.id,Z),Dt.current.add(Z.id),Z.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(Z.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=Z.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(Z.id,Z)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((Z,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:Z,view:ge};un(at=>at.some(tt=>M2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((Z,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===Z||Me.id.startsWith(Z)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ce.map(Z=>{var ge;return[Z.id,((ge=Z.title)==null?void 0:ge.trim())||Z.slug||El()]})),[ce,G]),Zs=YR(zu),el=R.useMemo(()=>{const Z=new Map;for(const ge of Ie)Z.set(ge.id,Zs.get(ge.experimentId)??El());return Z},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(Z=>{const ge=tl.get(Z);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(Z=>{const ge=Zs.get(Z);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((Z,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===Z||$e.id.startsWith(Z));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(Z=>{const ge=nr.findIndex(je=>M2(je,Z));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[nr,yr,b]),uo=R.useCallback((Z,ge="preview")=>{Z.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,Z);Dr.current.fileTabs.some(at=>Yu(at,Z))||C.current.delete(Me),E.current.add(Me)}const $e=RO(Z);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,Z));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(Z,ge)},[cs]),fi=R.useCallback((Z,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(Z,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((Z,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(Z,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(Z=>uo({path:Z,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((Z,ge,je,$e,Me,at="preview")=>{const tt=fi(Z,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((Z,ge)=>{bs(Z),ge()},[bs]),of=R.useCallback(Z=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,Z));if(ge===-1)return;const je=n?Ms(n,u,Z):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(Z,{path:S1,source:"artifacts"})&&Yn(!1),yr(Z,Et(b)===Et(Z)))},[u,Mn,yr,n,b]),lf=R.useCallback(Z=>{Z.lineScrollRequest!==void 0&&m(Z.lineScrollRequest)},[]),x_=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:Z};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(Z=>{const ge=xt.findIndex(je=>je.promptId===Z.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,xt,b]),lc=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:Z,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(Z=>{const ge=ft.findIndex(je=>je.spawnPartId===Z.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let Z=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Rv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{Z&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=av(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{Z=!1,at()}},[ft]);const uc=R.useCallback((Z,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:Z,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:Z,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((Z,ge)=>{On(je=>je.map($e=>qf($e,Z)?{...$e,...ge}:$e)),ge.view&&O(Ll({...Z,...ge}))},[]),S_=R.useCallback(Z=>{const ge=xn.findIndex(je=>qf(je,Z));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(Z=>{Z==="experiments"?Nr(!1):Z==="files"?fn(!1):tn(!1),yr(Z,b===Z)},[yr,b]),ff=Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=Z.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Uv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(Z,ge)=>{P(je=>je?QR(je,Z):[Z]),s.navigate({href:`/projects/${encodeURIComponent(Z.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(Z=>Yu(Z,{path:S1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const Z=nl.data.messages.flatMap(je=>{const $e=Rv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=Z==null?void 0:Z.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(Z=>qf(Z,Ae))??null:null,Ue=new Map;for(const Z of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(Z),Z);const zn=ca?Et(ca):null,jn=di.filter(Z=>Z!==zn).map(Z=>Ue.get(Z)).filter(q0t),fr=Z=>ao!==null&&Et(ao)===Et(Z),Ln=Z=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,Z),label:Z.path.split("/").pop()||Z.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>of(Z)},`file:${z6(Z)}`),_r=Bs?ce.find(Z=>Z.id===Bs.id)??null:null,da=Oe?ce.find(Z=>Z.id===Oe.experimentId&&Z.branchName===Oe.branch)??null:null,_f=Z=>{var je,$e;if("path"in Z)return Ln(Z);if("id"in Z){const Me=ce.find(at=>at.id===Z.id);return f.jsx(Fc,{active:Bs!==null&&M2(Bs,Z),label:Me?Me.title||Me.slug:"…",icon:Z.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>Tu(Z)},Et(Z))}if("kind"in Z&&Z.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===Z.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>w_(Z)},Et(Z));if("kind"in Z)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===Z.spawnPartId,label:((je=uf[Z.spawnPartId])==null?void 0:je.label)??Z.label??Wne(),shimmer:(($e=uf[Z.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>cf(Z)},Et(Z));const ge=ce.find(Me=>Me.id===Z.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,Z),label:(ge==null?void 0:ge.slug)??Z.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>S_(Z)},Et(Z))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||te===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(Z=>Z.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(te==null?void 0:te.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:te.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:Z=>{P(ge=>ge?QR(ge,Z):[Z])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ce,runs:Ie,onOpenExperiment:(Z,ge)=>Is(Z,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(Z=>Z.id===u&&Z.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:C4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(fb,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(Z=>!Z),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Ur,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(Z=>Z.id===d&&Z.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(Z=>!Z),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ce,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ce.length>0?gne():void 0,experiments:br,onOpen:(Z,ge)=>{Is(Z.id,"overview",ge)},onOpenLogs:(Z,ge,je)=>{Is(Z,"terminal",je,ge)},onOpenCode:(Z,ge)=>{const je=ce.find($e=>$e.id===Z);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(Z,ge,je,$e)=>oc(Z,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const Z=Ms(n,u,Dn);C.current.delete(Z),E.current.add(Z)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:Z=>{N.current[Ms(n,u,Dn)]=Z,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(Z,ge,je,$e)=>hi(Dn,()=>oc(Z,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:Z=>{rr.current.set(Ms(n,u,Dn),Z),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(Z=>Z.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(Z,ge,je,$e,Me)=>hi(Qr,()=>oc(Z,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(Z,ge,je,$e,Me)=>hi(be,()=>Au(Z,be.sessionId,ge,je,$e,Me)),onOpenRun:(Z,ge)=>hi(be,()=>Oa(Z,ge)),runExperimentName:ac,onOpenExperiment:(Z,ge)=>hi(be,()=>ju(Z,ge)),experimentName:sf,onOpenSubagent:(Z,ge,je)=>hi(be,()=>lc(be.sessionId,Z,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:Z=>df(Oe,{view:Z}),onToggledChange:Z=>df(Oe,{toggled:Z}),onOpenFile:(Z,ge,je,$e)=>hi(Oe,()=>oc(Z,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:H,parentExperiment:ce.find(Z=>Z.id===_r.parentExperimentId)??null,onOpenView:(Z,ge,je)=>{hi(Bs,()=>Is(_r.id,Z,je,ge))},onOpenCode:(Z,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,Z,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(Z,ge)=>{Kr(!1),k_(Z,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const j5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=j5.useParams(),{pane:n}=j5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>cb}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>cb}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>cb}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=j5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=cb._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); diff --git a/ui/dist/index.html b/ui/dist/index.html index 1f83c0e11..2091d97c0 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/messages/en.json b/ui/messages/en.json index 28530458f..9ea6bc949 100644 --- a/ui/messages/en.json +++ b/ui/messages/en.json @@ -1144,5 +1144,11 @@ "local_models_custom_endpoint": "Custom Endpoint", "local_models_compatible_api": "(OpenAI compatible)", "chat_session_limit_reached": "Session limit reached", - "chat_model_unavailable": "Model unavailable" + "chat_model_unavailable": "Model unavailable", + "new_project_form_auto_apply_repository_topics": "Auto-apply repository topics", + "new_project_form_automatic_topics_include_openresearch_and": "Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.", + "new_project_form_extra_topics_comma_separated_e_g_llm": "Extra topics (comma-separated), e.g. llm, benchmark", + "settings_page_auto_apply_git_hub_topics_for_new_projects": "Auto-apply GitHub topics for new projects", + "settings_page_auto_apply_git_hub_topics_help": "Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.", + "settings_page_repository_topics": "Repository topics" } diff --git a/ui/messages/fa.json b/ui/messages/fa.json index 619787d79..7afbb6f07 100644 --- a/ui/messages/fa.json +++ b/ui/messages/fa.json @@ -1144,5 +1144,11 @@ "skills_remove_imported_label": "حذف {name} از OpenResearch", "skills_remove_imported_confirm": "«{name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.", "chat_session_limit_reached": "به سقف مصرف نشست رسیده‌اید", - "chat_model_unavailable": "مدل در دسترس نیست" + "chat_model_unavailable": "مدل در دسترس نیست", + "new_project_form_auto_apply_repository_topics": "اعمال خودکار موضوع‌های مخزن", + "new_project_form_automatic_topics_include_openresearch_and": "موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.", + "new_project_form_extra_topics_comma_separated_e_g_llm": "موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark", + "settings_page_auto_apply_git_hub_topics_for_new_projects": "اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید", + "settings_page_auto_apply_git_hub_topics_help": "مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.", + "settings_page_repository_topics": "موضوع‌های مخزن" } diff --git a/ui/messages/zh-CN.json b/ui/messages/zh-CN.json index 460212689..03740ba90 100644 --- a/ui/messages/zh-CN.json +++ b/ui/messages/zh-CN.json @@ -1144,5 +1144,11 @@ "skills_remove_imported_label": "从 OpenResearch 移除 {name}", "skills_remove_imported_confirm": "从 OpenResearch 移除“{name}”?源文件将保留在你的编程智能体中。", "chat_session_limit_reached": "已达到会话使用限额", - "chat_model_unavailable": "模型不可用" + "chat_model_unavailable": "模型不可用", + "new_project_form_auto_apply_repository_topics": "自动添加仓库 topic", + "new_project_form_automatic_topics_include_openresearch_and": "自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。", + "new_project_form_extra_topics_comma_separated_e_g_llm": "附加 topic(逗号分隔),例如 llm, benchmark", + "settings_page_auto_apply_git_hub_topics_for_new_projects": "为新项目自动添加 GitHub topic", + "settings_page_auto_apply_git_hub_topics_help": "为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。", + "settings_page_repository_topics": "仓库 topic" } diff --git a/ui/src/api.ts b/ui/src/api.ts index 4730f5eae..02429bd09 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -49,6 +49,8 @@ export interface Project { slug: string; githubOwner: string; githubRepo: string; + githubAutoTopicsEnabled: boolean; + githubTopics: string[]; baselineBranch: string; repoPath: string; path: string; @@ -257,6 +259,8 @@ export interface NewProject { requireNewFolder?: boolean; initializeGit?: boolean; githubSyncEnabled?: boolean; + githubAutoTopicsEnabled?: boolean; + githubTopics?: string[]; /** UI locale for the starter prompts the server warms up on creation. */ locale?: string; } @@ -308,7 +312,15 @@ export const resolvePaper = (id: string, signal?: AbortSignal) => (r) => r.paper, ); -export const updateProject = (projectId: string, body: { runCommand?: string; name?: string }) => +export const updateProject = ( + projectId: string, + body: { + runCommand?: string; + name?: string; + githubAutoTopicsEnabled?: boolean; + githubTopics?: string[]; + }, +) => patch<{ project: Project }>(`/api/projects/${projectId}`, body).then((r) => r.project); /** One suggested opening message for the empty chat, written by a model that @@ -1357,6 +1369,7 @@ export const setLitSources = (body: LitSourcesSettings) => export interface ProjectDefaultsSettings { githubForNewProjects: boolean; + githubAutoTopicsForNewProjects: boolean; githubDefaultPromptSeen: boolean; ghInstalled: boolean; githubAuthenticated: boolean; @@ -1367,10 +1380,14 @@ export const getProjectDefaults = (signal?: AbortSignal) => export const setProjectDefaults = ( githubForNewProjects: boolean, + githubAutoTopicsForNewProjects?: boolean, githubDefaultPromptSeen?: boolean, ) => post("/api/settings/projects", { githubForNewProjects, + ...(githubAutoTopicsForNewProjects === undefined + ? {} + : { githubAutoTopicsForNewProjects }), ...(githubDefaultPromptSeen === undefined ? {} : { githubDefaultPromptSeen }), }); diff --git a/ui/src/components/NewProjectForm.tsx b/ui/src/components/NewProjectForm.tsx index 40df369ab..017087c88 100644 --- a/ui/src/components/NewProjectForm.tsx +++ b/ui/src/components/NewProjectForm.tsx @@ -48,6 +48,14 @@ function parsePaperId(input: string): string | null { return /^\d{4}\.\d{4,5}(v\d+)?$/.test(id) ? id : null; } +/** Splits the comma-separated topics field; the server normalizes and caps them. */ +function parseTopics(raw: string): string[] { + return raw + .split(",") + .map((topic) => topic.trim()) + .filter((topic) => topic.length > 0); +} + function parseGithubRepository(url?: string | null): { owner: string; repo: string } | null { const match = url?.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i); if (!match) return null; @@ -90,6 +98,8 @@ export function NewProjectForm({ const [error, setError] = useState(null); const [advancedOpen, setAdvancedOpen] = useState(false); const [githubSyncEnabled, setGithubSyncEnabled] = useState(false); + const [githubAutoTopicsEnabled, setGithubAutoTopicsEnabled] = useState(false); + const [githubTopics, setGithubTopics] = useState(""); const [paperQuery, setPaperQuery] = useState(""); const [paper, setPaper] = useState(null); const [choosingPaper, setChoosingPaper] = useState(false); @@ -127,7 +137,9 @@ export function NewProjectForm({ if (appliedDefaults.current || !defaultsQuery.data) return; appliedDefaults.current = true; setGithubSyncEnabled(defaultsQuery.data.githubForNewProjects); + setGithubAutoTopicsEnabled(defaultsQuery.data.githubAutoTopicsForNewProjects); }, [defaultsQuery.data]); + const previewName = useDebouncedValue(name.trim(), 150); const previewQuery = useQuery({ ...githubProjectRepoPreviewQuery(previewName), enabled: previewName === name.trim() }); const githubRepoName = previewName === name.trim() ? previewQuery.data?.repo ?? slugify(name, 48) : slugify(name, 48); @@ -249,6 +261,8 @@ export function NewProjectForm({ requireNewFolder: mode === "blank", initializeGit: true, githubSyncEnabled, + githubAutoTopicsEnabled, + githubTopics: parseTopics(githubTopics), locale: getLocale(), ...(mode === "paper" && paper ? { paperId: paper.paperId, cloneUrl: paper.repoUrl ?? undefined } @@ -606,6 +620,32 @@ export function NewProjectForm({ {m.new_project_form_sync_experiments_to_git_hub()} + {githubSyncEnabled && ( + <> + + setGithubAutoTopicsEnabled(event.target.checked)} + disabled={pending} + /> + + {m.new_project_form_auto_apply_repository_topics()} + + + + {m.new_project_form_automatic_topics_include_openresearch_and()} + + setGithubTopics(event.target.value)} + placeholder={m.new_project_form_extra_topics_comma_separated_e_g_llm()} + disabled={pending} + /> + + )} {githubDecisionPending diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index 66c27f8d3..33a52b578 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -63,6 +63,7 @@ import { disableProjectGithub, enableProjectGithub, initializeProjectGit, + updateProject, saveHfToken, saveTinkerKey, saveModalToken, @@ -2759,7 +2760,26 @@ function ProjectDefaultsTab() { const enabled = !settings.githubForNewProjects; setSaving(true); setError(null); - void setProjectDefaultsMutation.mutateAsync([enabled, true]) + void setProjectDefaultsMutation.mutateAsync([ + enabled, + settings.githubAutoTopicsForNewProjects, + true, + ]) + .then(setSettings) + .catch((err) => setError(err instanceof Error ? err.message : String(err))) + .finally(() => setSaving(false)); + }; + + const toggleAutoTopics = () => { + if (!settings || saving) return; + const enabled = !settings.githubAutoTopicsForNewProjects; + setSaving(true); + setError(null); + void setProjectDefaultsMutation.mutateAsync([ + settings.githubForNewProjects, + enabled, + settings.githubDefaultPromptSeen, + ]) .then(setSettings) .catch((err) => setError(err instanceof Error ? err.message : String(err))) .finally(() => setSaving(false)); @@ -2793,6 +2813,21 @@ function ProjectDefaultsTab() { onClick={toggle} /> +
+
+
+ {m.settings_page_auto_apply_git_hub_topics_for_new_projects()} +
+

{m.settings_page_auto_apply_git_hub_topics_help()}

+
+ +
{!settings.githubAuthenticated && (
@@ -2966,8 +3001,20 @@ function GitTab({ const [defaultPromptOpen, setDefaultPromptOpen] = useState(false); const [defaultPromptSaving, setDefaultPromptSaving] = useState(false); const [defaultPromptError, setDefaultPromptError] = useState(null); + // Topic editor state. `null` means "not seeded yet"; once the project arrives it + // holds the user's edits, so a background refetch cannot clobber typing. + const [topicsAuto, setTopicsAuto] = useState(null); + const [topicsCustom, setTopicsCustom] = useState(null); + const [topicsSaving, setTopicsSaving] = useState(false); + const [topicsError, setTopicsError] = useState(null); const hasGithubRepository = Boolean(status?.github.owner && status.github.repo); + useEffect(() => { + if (!project || topicsAuto !== null) return; + setTopicsAuto(project.githubAutoTopicsEnabled); + setTopicsCustom(project.githubTopics.join(", ")); + }, [project, topicsAuto]); + const load = async () => { await statusQuery.refetch({ cancelRefetch: false }); }; const syncErrorMessage = (err: unknown) => { @@ -3007,12 +3054,40 @@ function GitTab({ const finishDefaultPrompt = (enabled: boolean) => { setDefaultPromptSaving(true); setDefaultPromptError(null); - void setProjectDefaultsMutation.mutateAsync([enabled, true]) + void setProjectDefaultsMutation.mutateAsync([enabled, enabled, true]) .then(() => setDefaultPromptOpen(false)) .catch((err) => setDefaultPromptError(err instanceof Error ? err.message : String(err))) .finally(() => setDefaultPromptSaving(false)); }; + /** Splits the comma-separated field; the server normalizes and caps the topics. */ + const parseTopicDraft = (raw: string) => + raw.split(",").map((topic) => topic.trim()).filter((topic) => topic.length > 0); + + const savedTopics = project ? project.githubTopics.join(", ") : ""; + const topicsDirty = Boolean( + project && topicsAuto !== null && topicsCustom !== null + && (topicsAuto !== project.githubAutoTopicsEnabled || topicsCustom !== savedTopics), + ); + + const saveTopics = () => { + if (!project || topicsAuto === null || topicsCustom === null) return; + setTopicsSaving(true); + setTopicsError(null); + void updateProject(project.id, { + githubAutoTopicsEnabled: topicsAuto, + githubTopics: parseTopicDraft(topicsCustom), + }) + .then((updated) => { + // Re-seed from the server's sanitized values so the field shows what was kept. + setTopicsAuto(updated.githubAutoTopicsEnabled); + setTopicsCustom(updated.githubTopics.join(", ")); + onProjectUpdate(updated); + }) + .catch((err) => setTopicsError(err instanceof Error ? err.message : String(err))) + .finally(() => setTopicsSaving(false)); + }; + return ( <>

{m.settings_page_repository()}

@@ -3070,6 +3145,34 @@ function GitTab({

{m.settings_page_disabling_syncing_stops_automatic_pushes_compute_continues_to()}

+
+
+
+
{m.settings_page_repository_topics()}
+

{m.settings_page_auto_apply_git_hub_topics_help()}

+
+ setTopicsAuto((current) => !(current ?? false))} + /> +
+
+ setTopicsCustom(event.target.value)} + placeholder={m.new_project_form_extra_topics_comma_separated_e_g_llm()} + disabled={topicsCustom === null || topicsSaving} + aria-label={m.settings_page_repository_topics()} + /> + +
+ {topicsError &&
{topicsError}
} +
{status.github.url && {m.settings_page_open_on_git_hub()} } From a728cbaa2897669a91142a4924a74689253abfd6 Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 12:59:11 +0800 Subject: [PATCH 2/9] Address review: fail safe on topic reads and sync edits immediately - Abort topic publication when the repository's current topics cannot be read. Treating an unreadable list as empty let a transient GET failure turn the merge into a replace, deleting the topics it exists to keep. - Publish topics right after a settings edit instead of waiting for the next push, so the editor has a visible effect. - Drop the auto-topics flag from the publish guard. It decided whether anything was worth publishing, which meant custom topics never reached the repository while automatic tagging was off. - Re-seed the topics editor when the project changes; it was seeded once, so switching projects could show and then save the previous project's topics onto the new one. - Keep the auto-topics default when answering the one-time sync prompt, which only asks about syncing. --- src/commands/up.rs | 14 ++-- src/local/github.rs | 9 ++- .../{index-zOVqYBAH.js => index-D9ReCQbY.js} | 68 +++++++++---------- ui/dist/index.html | 2 +- ui/src/components/SettingsPage.tsx | 22 +++++- 5 files changed, 69 insertions(+), 46 deletions(-) rename ui/dist/assets/{index-zOVqYBAH.js => index-D9ReCQbY.js} (94%) diff --git a/src/commands/up.rs b/src/commands/up.rs index 0bac351db..51d062e54 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -1565,16 +1565,16 @@ fn push_project(project: &local::model::LocalProject) -> Result<()> { /// or a folder project riding an existing remote — never has another project's /// topics (or hand-added ones) wiped out. async fn sync_project_topics(project: &local::model::LocalProject) -> Result<()> { - if !project.github_topics_enabled() && project.github_topics.is_empty() { - // Nothing to derive and no extras configured: publishing an empty set - // would only risk clearing whatever the repository already carries. - return Ok(()); - } let topics = local::github::effective_project_topics( project.paper_id.as_deref(), &project.github_topics, project.github_auto_topics_enabled, ); + if topics.is_empty() { + // Nothing to derive and no extras configured: publishing an empty set + // would only risk clearing whatever the repository already carries. + return Ok(()); + } local::github::set_repo_topics(&project.github_owner, &project.github_repo, &topics).await } @@ -1861,6 +1861,10 @@ async fn update_project( project.github_topics = local::github::sanitize_topics(&topics); } store.update_local_project(&project)?; + // A manual edit should reach the repository now rather than waiting for the + // next push. The SQLite row above is the source of truth, so a failure here + // only warns and leaves the next push to apply it. + sync_project_topics_best_effort(&project).await; // Re-read: update bumps updated_at, which is also what fires the SSE // project.updated diff. let project = store diff --git a/src/local/github.rs b/src/local/github.rs index 90aef6cad..6612af67a 100644 --- a/src/local/github.rs +++ b/src/local/github.rs @@ -202,7 +202,10 @@ pub fn effective_project_topics( /// carries. Never clears the repository's topics, and skips the write when the /// union changes nothing. pub async fn set_repo_topics(owner: &str, repo: &str, topics: &[String]) -> Result<()> { - let existing = repo_topics(owner, repo).await.unwrap_or_default(); + // Read failures must abort rather than degrade to an empty set: PUT replaces + // the whole list, so treating "could not read" as "has none" would delete the + // topics this merge exists to protect. + let existing = repo_topics(owner, repo).await?; let merged = merge_topics(&sanitize_topics(topics), &existing); if merged.is_empty() || merged == existing { // Never PUT an empty set (it clears the repo) and skip a no-op write. @@ -224,8 +227,8 @@ pub async fn set_repo_topics(owner: &str, repo: &str, topics: &[String]) -> Resu Ok(()) } -/// Topics the repository currently carries. An unreadable list is treated as -/// empty: the caller then diffs against `[]` and still publishes its own set. +/// Topics the repository currently carries. Errors propagate to the caller: a +/// merge computed against a silently-empty read would delete the real topics. async fn repo_topics(owner: &str, repo: &str) -> Result> { let endpoint = format!("{}/topics", repository_endpoint(owner, repo)); let body = gh( diff --git a/ui/dist/assets/index-zOVqYBAH.js b/ui/dist/assets/index-D9ReCQbY.js similarity index 94% rename from ui/dist/assets/index-zOVqYBAH.js rename to ui/dist/assets/index-D9ReCQbY.js index 56417bc04..43d9ee92f 100644 --- a/ui/dist/assets/index-zOVqYBAH.js +++ b/ui/dist/assets/index-D9ReCQbY.js @@ -14,7 +14,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(P){return P===null||typeof P!="object"?null:(P=p&&P[p]||P["@@iterator"],typeof P=="function"?P:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(P,W,U){this.props=P,this.context=W,this.refs=v,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(P,W){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,W,"setState")},b.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(P,W,U){this.props=P,this.context=W,this.refs=v,this.updater=U||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(P,W,U){var te=U.ref;return{$$typeof:e,type:P,key:W,ref:te!==void 0?te:null,props:U}}function O(P,W){return M(P.type,W,P.props)}function B(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function $(P){var W={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(U){return W[U]})}var H=/\/+/g;function q(P,W){return typeof P=="object"&&P!==null&&P.key!=null?$(""+P.key):W.toString(36)}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(N,N):(P.status="pending",P.then(function(W){P.status==="pending"&&(P.status="fulfilled",P.value=W)},function(W){P.status==="pending"&&(P.status="rejected",P.reason=W)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function G(P,W,U,te,de){var re=typeof P;(re==="undefined"||re==="boolean")&&(P=null);var ne=!1;if(P===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(P.$$typeof){case e:case n:ne=!0;break;case _:return ne=P._init,G(ne(P._payload),W,U,te,de)}}if(ne)return de=de(P),ne=te===""?"."+q(P,0):te,E(de)?(U="",ne!=null&&(U=ne.replace(H,"$&/")+"/"),G(de,W,U,"",function(oe){return oe})):de!=null&&(B(de)&&(de=O(de,U+(de.key==null||P&&P.key===de.key?"":(""+de.key).replace(H,"$&/")+"/")+ne)),W.push(de)),1;ne=0;var Q=te===""?".":te+":";if(E(P))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,T5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,T5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return ue(this,Qc).setTimeout(e,n)}clearTimeout(e){ue(this,Qc).clearTimeout(e)}setInterval(e,n){return ue(this,Qc).setInterval(e,n)}clearInterval(e){ue(this,Qc).clearInterval(e)}},Qc=new WeakMap,T5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==A5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function A5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Xw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Xw(e)&&Xw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Zw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?R5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const M5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===M5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const L5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ue(this,Yc)||this.setEventListener(ue(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=ue(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){ue(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof ue(this,ud)=="boolean"?ue(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const O5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,Xc)||this.setEventListener(ue(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=ue(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){ue(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return ue(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const q1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?q1.isOnline():!0}var U1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof U1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new U1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>O5.isFocused()&&(e.networkMode==="always"||q1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(L5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L5()?1/0:3e5))}clearGcTimeout(){ue(this,dd)!==void 0&&(ad.clearTimeout(ue(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,ue(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??ue(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ue(this,wh)}get promise(){var n;return(n=ue(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...ue(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,wa).remove(this)}setData(n,t){const r=Zw(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=ue(this,hs))==null?void 0:r.promise;return(s=ue(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ue(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===M5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),ue(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(ue(this,hs)&&(ue(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ue(this,hs).cancel({revert:!0}):ue(this,hs).cancelRetry()),this.scheduleGc()),ue(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=ue(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(ue(this,hs))return ue(this,hs).continueRetry(),ue(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:ue(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ue(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=ue(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof U1&&E.revert&&this.setState({...ue(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=ue(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=ue(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof U1){if(E.silent)return ue(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=ue(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=ue(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{ue(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),ue(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,Jw,e4,t4,n4,r4,s4,i4,a4,nM,I5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,Sn).addObserver(this),u9(ue(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,r4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return o4(ue(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return o4(ue(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,s4).call(this),Ot(this,Un,i4).call(this),ue(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=ue(this,Sn);if(this.options=ue(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,ue(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,a4).call(this),ue(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&ue(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,Sn),observer:this});const s=this.hasListeners();s&&d9(ue(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||$r(this.options.staleTime,ue(this,Sn))!==$r(t.staleTime,ue(this,Sn)))&&Ot(this,Un,e4).call(this);const i=Ot(this,Un,t4).call(this);s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||i!==ue(this,Zc))&&Ot(this,Un,n4).call(this,i)}getOptimisticResult(n){const t=ue(this,ni).getQueryCache().build(ue(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,ue(this,Sn).state)),r}getCurrentResult(){return ue(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){ue(this,Nh).add(n)}getCurrentQuery(){return ue(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=ue(this,ni).defaultQueryOptions(n),r=ue(this,ni).getQueryCache().build(ue(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=ue(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,ri)))}createResult(n,t){var N;const r=ue(this,Sn),s=this.options,i=ue(this,ri),a=ue(this,pd),o=ue(this,kh),l=n!==r?n.state:ue(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=ue(this,Eh))==null?void 0:N.state.data,ue(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=Zw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===ue(this,Dp))p=ue(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=Zw(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);ue(this,zl)&&(m=ue(this,zl),p=ue(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:B5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=ue(this,ri),t=this.createResult(ue(this,Sn),this.options);if(Fe(this,pd,ue(this,Sn).state),Fe(this,kh,this.options),ue(this,pd).data!==void 0&&Fe(this,Eh,ue(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,Nh).size)return!0;const o=new Set(a??ue(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(ue(this,ri)).some(l=>{const u=l;return ue(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(ue(this,ri))}),ue(this,ni).getQueryCache().notify({query:ue(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,r4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,a4).call(this);let t=ue(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},Jw=function(n){return!L5()&&$r(this.options.enabled,ue(this,Sn))!==!1&&uM(n)},e4=function(){Ot(this,Un,s4).call(this);const n=$r(this.options.staleTime,ue(this,Sn));if(ue(this,ri).isStale||!Ot(this,Un,Jw).call(this,n))return;const t=dM(ue(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{ue(this,ri).isStale||this.updateResult()},t))},t4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,Sn)):this.options.refetchInterval)??!1},n4=function(n){Ot(this,Un,i4).call(this),Fe(this,Zc,n),!(ue(this,Zc)===0||!Ot(this,Un,Jw).call(this,ue(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||O5.isFocused())&&Ot(this,Un,S0).call(this)},ue(this,Zc)))},r4=function(){Ot(this,Un,e4).call(this),Ot(this,Un,n4).call(this,Ot(this,Un,t4).call(this))},s4=function(){ue(this,md)!==void 0&&(ad.clearTimeout(ue(this,md)),Fe(this,md,void 0))},i4=function(){ue(this,gd)!==void 0&&(ad.clearInterval(ue(this,gd)),Fe(this,gd,void 0))},a4=function(){const n=ue(this,ni).getQueryCache().build(ue(this,ni),this.options);if(n===ue(this,Sn))return;const t=ue(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&o4(e,n,n.refetchOnMount)}function o4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&B5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&B5(e,t)}function B5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){ue(this,Eo).includes(n)||(ue(this,Eo).push(n),this.clearGcTimeout(),ue(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,ue(this,Eo).filter(t=>t!==n)),this.scheduleGc(),ue(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){ue(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():ue(this,qs).remove(this))}continue(){var n;return((n=ue(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:ue(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),ue(this,qs).config.onMutate&&await ue(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=ue(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=ue(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=ue(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=ue(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{ue(this,vd)===s&&Fe(this,vd,void 0),ue(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{ue(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),ue(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){ue(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);r?r.push(n):ue(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(ue(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&ue(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{ue(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),ue(this,jl).clear(),ue(this,qa).clear()})}getAll(){return Array.from(ue(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,l4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=ue(this,Tl).defaultMutationOptions(t),A0(this.options,r)||ue(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ue(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=ue(this,Us))==null?void 0:s.state.status)==="pending"&&ue(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&ue(this,Us)&&(ue(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=ue(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this,t)}getCurrentResult(){return ue(this,Jc)}reset(){var t;(t=ue(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=ue(this,Us))==null||s.removeObserver(this),Fe(this,Us,ue(this,Tl).getMutationCache().build(ue(this,Tl),this.options)),ue(this,Us).addObserver(this),ue(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=ue(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},l4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(ue(this,Al)&&this.hasListeners()){const d=ue(this,Jc).variables,p=ue(this,Jc).context,m={client:ue(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=ue(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=ue(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=ue(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=ue(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(ue(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,c4,u4,vM,d4,f4,h4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&ue(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,f4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,ue(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=ue(this,Fi),s=Ot(this,ms,d4).call(this,ue(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=ue(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,f4).call(this,d,p)})})),Ot(this,ms,h4).call(this)))})}getCurrentResult(){return ue(this,si)}getQueries(){return ue(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return ue(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,d4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,u4).call(this,a??s,t,i),()=>Ot(this,ms,c4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,c4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},u4=function(n,t,r){if(t){const s=ue(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(ue(this,si)!==ue(this,Bp)||i||t!==ue(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,ue(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,R5(ue(this,yd),t(n)))),ue(this,yd)}return n},vM=function(){var n;return!((n=ue(this,bd))!=null&&n.combine)||ue(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=ue(this,si)[r])==null?void 0:s.data)===void 0})},d4=function(n){const t=new Map;ue(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=ue(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new I5(ue(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},f4=function(n,t){const r=ue(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,ue(this,si).slice()),ue(this,si)[r]=t,Ot(this,ms,h4).call(this))},h4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=ue(this,yd),s=t?r:Ot(this,ms,u4).call(this,Ot(this,ms,c4).call(this,ue(this,si),ue(this,Pp)),(n=ue(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(ue(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??A5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){ue(this,zo).has(n.queryHash)||(ue(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=ue(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&ue(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return ue(this,zo).get(n)}getAll(){return[...ue(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,ue(this,nu)===1&&(Fe(this,Rh,O5.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onFocus())})),Fe(this,Mh,q1.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,ue(this,nu)===0&&((e=ue(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=ue(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return ue(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=ue(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return ue(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=ue(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return ue(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>ue(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=ue(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=ue(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>ue(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(ue(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>ue(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return q1.isOnline()?ue(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,zr)}getMutationCache(){return ue(this,eu)}getDefaultOptions(){return ue(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){ue(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...ue(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){ue(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...ue(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...ue(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=A5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===M5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,zr).clear(),ue(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?D5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||D5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>_4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&_4(b,S)){const w=new I5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),_4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,I5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&D5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Gv=0;const p4=new Set,HG=()=>Gv,_9=e=>(p4.add(e),()=>{p4.delete(e)}),za=()=>["workspace",Gv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Gv++,du.clear(),$5({queryKey:t}),p4.forEach(r=>r()),!0}const Fn=e=>e[1]===Gv;async function $5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Vr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var i2={exports:{}},i0={},a2={exports:{}},o2={};/** + */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,W,H){this.props=F,this.context=W,this.refs=v,this.updater=H||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,W){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,W,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,W,H){this.props=F,this.context=W,this.refs=v,this.updater=H||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,W,H){var ee=H.ref;return{$$typeof:e,type:F,key:W,ref:ee!==void 0?ee:null,props:H}}function O(F,W){return M(F.type,W,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var W={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(H){return W[H]})}var q=/\/+/g;function U(F,W){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):W.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(W){F.status==="pending"&&(F.status="fulfilled",F.value=W)},function(W){F.status==="pending"&&(F.status="rejected",F.reason=W)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function G(F,W,H,ee,de){var re=typeof F;(re==="undefined"||re==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,G(ne(F._payload),W,H,ee,de)}}if(ne)return de=de(F),ne=ee===""?"."+U(F,0):ee,E(de)?(H="",ne!=null&&(H=ne.replace(q,"$&/")+"/"),G(de,W,H,"",function(oe){return oe})):de!=null&&(B(de)&&(de=O(de,H+(de.key==null||F&&F.key===de.key?"":(""+de.key).replace(q,"$&/")+"/")+ne)),W.push(de)),1;ne=0;var Q=ee===""?".":ee+":";if(E(F))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,T5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,T5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return ue(this,Qc).setTimeout(e,n)}clearTimeout(e){ue(this,Qc).clearTimeout(e)}setInterval(e,n){return ue(this,Qc).setInterval(e,n)}clearInterval(e){ue(this,Qc).clearInterval(e)}},Qc=new WeakMap,T5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==A5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function A5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Xw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Xw(e)&&Xw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Zw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?R5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const M5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===M5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const L5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ue(this,Yc)||this.setEventListener(ue(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=ue(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){ue(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof ue(this,ud)=="boolean"?ue(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const O5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,Xc)||this.setEventListener(ue(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=ue(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){ue(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return ue(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const q1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?q1.isOnline():!0}var U1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof U1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new U1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>O5.isFocused()&&(e.networkMode==="always"||q1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(L5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L5()?1/0:3e5))}clearGcTimeout(){ue(this,dd)!==void 0&&(ad.clearTimeout(ue(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,ue(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??ue(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ue(this,wh)}get promise(){var n;return(n=ue(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...ue(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,wa).remove(this)}setData(n,t){const r=Zw(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=ue(this,hs))==null?void 0:r.promise;return(s=ue(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ue(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===M5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),ue(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(ue(this,hs)&&(ue(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ue(this,hs).cancel({revert:!0}):ue(this,hs).cancelRetry()),this.scheduleGc()),ue(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=ue(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(ue(this,hs))return ue(this,hs).continueRetry(),ue(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:ue(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ue(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=ue(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof U1&&E.revert&&this.setState({...ue(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=ue(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=ue(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof U1){if(E.silent)return ue(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=ue(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=ue(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{ue(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),ue(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,Jw,e4,t4,n4,r4,s4,i4,a4,nM,I5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,Sn).addObserver(this),u9(ue(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,r4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return o4(ue(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return o4(ue(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,s4).call(this),Ot(this,Un,i4).call(this),ue(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=ue(this,Sn);if(this.options=ue(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,ue(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,a4).call(this),ue(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&ue(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,Sn),observer:this});const s=this.hasListeners();s&&d9(ue(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||$r(this.options.staleTime,ue(this,Sn))!==$r(t.staleTime,ue(this,Sn)))&&Ot(this,Un,e4).call(this);const i=Ot(this,Un,t4).call(this);s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||i!==ue(this,Zc))&&Ot(this,Un,n4).call(this,i)}getOptimisticResult(n){const t=ue(this,ni).getQueryCache().build(ue(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,ue(this,Sn).state)),r}getCurrentResult(){return ue(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){ue(this,Nh).add(n)}getCurrentQuery(){return ue(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=ue(this,ni).defaultQueryOptions(n),r=ue(this,ni).getQueryCache().build(ue(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=ue(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,ri)))}createResult(n,t){var N;const r=ue(this,Sn),s=this.options,i=ue(this,ri),a=ue(this,pd),o=ue(this,kh),l=n!==r?n.state:ue(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=ue(this,Eh))==null?void 0:N.state.data,ue(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=Zw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===ue(this,Dp))p=ue(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=Zw(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);ue(this,zl)&&(m=ue(this,zl),p=ue(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:B5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=ue(this,ri),t=this.createResult(ue(this,Sn),this.options);if(Fe(this,pd,ue(this,Sn).state),Fe(this,kh,this.options),ue(this,pd).data!==void 0&&Fe(this,Eh,ue(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,Nh).size)return!0;const o=new Set(a??ue(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(ue(this,ri)).some(l=>{const u=l;return ue(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(ue(this,ri))}),ue(this,ni).getQueryCache().notify({query:ue(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,r4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,a4).call(this);let t=ue(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},Jw=function(n){return!L5()&&$r(this.options.enabled,ue(this,Sn))!==!1&&uM(n)},e4=function(){Ot(this,Un,s4).call(this);const n=$r(this.options.staleTime,ue(this,Sn));if(ue(this,ri).isStale||!Ot(this,Un,Jw).call(this,n))return;const t=dM(ue(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{ue(this,ri).isStale||this.updateResult()},t))},t4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,Sn)):this.options.refetchInterval)??!1},n4=function(n){Ot(this,Un,i4).call(this),Fe(this,Zc,n),!(ue(this,Zc)===0||!Ot(this,Un,Jw).call(this,ue(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||O5.isFocused())&&Ot(this,Un,S0).call(this)},ue(this,Zc)))},r4=function(){Ot(this,Un,e4).call(this),Ot(this,Un,n4).call(this,Ot(this,Un,t4).call(this))},s4=function(){ue(this,md)!==void 0&&(ad.clearTimeout(ue(this,md)),Fe(this,md,void 0))},i4=function(){ue(this,gd)!==void 0&&(ad.clearInterval(ue(this,gd)),Fe(this,gd,void 0))},a4=function(){const n=ue(this,ni).getQueryCache().build(ue(this,ni),this.options);if(n===ue(this,Sn))return;const t=ue(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&o4(e,n,n.refetchOnMount)}function o4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&B5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&B5(e,t)}function B5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){ue(this,Eo).includes(n)||(ue(this,Eo).push(n),this.clearGcTimeout(),ue(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,ue(this,Eo).filter(t=>t!==n)),this.scheduleGc(),ue(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){ue(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():ue(this,qs).remove(this))}continue(){var n;return((n=ue(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:ue(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),ue(this,qs).config.onMutate&&await ue(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=ue(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=ue(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=ue(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=ue(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{ue(this,vd)===s&&Fe(this,vd,void 0),ue(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{ue(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),ue(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){ue(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);r?r.push(n):ue(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(ue(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&ue(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{ue(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),ue(this,jl).clear(),ue(this,qa).clear()})}getAll(){return Array.from(ue(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,l4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=ue(this,Tl).defaultMutationOptions(t),A0(this.options,r)||ue(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ue(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=ue(this,Us))==null?void 0:s.state.status)==="pending"&&ue(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&ue(this,Us)&&(ue(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=ue(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this,t)}getCurrentResult(){return ue(this,Jc)}reset(){var t;(t=ue(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=ue(this,Us))==null||s.removeObserver(this),Fe(this,Us,ue(this,Tl).getMutationCache().build(ue(this,Tl),this.options)),ue(this,Us).addObserver(this),ue(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=ue(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},l4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(ue(this,Al)&&this.hasListeners()){const d=ue(this,Jc).variables,p=ue(this,Jc).context,m={client:ue(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=ue(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=ue(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=ue(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=ue(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(ue(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,c4,u4,vM,d4,f4,h4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&ue(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,f4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,ue(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=ue(this,Fi),s=Ot(this,ms,d4).call(this,ue(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=ue(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,f4).call(this,d,p)})})),Ot(this,ms,h4).call(this)))})}getCurrentResult(){return ue(this,si)}getQueries(){return ue(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return ue(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,d4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,u4).call(this,a??s,t,i),()=>Ot(this,ms,c4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,c4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},u4=function(n,t,r){if(t){const s=ue(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(ue(this,si)!==ue(this,Bp)||i||t!==ue(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,ue(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,R5(ue(this,yd),t(n)))),ue(this,yd)}return n},vM=function(){var n;return!((n=ue(this,bd))!=null&&n.combine)||ue(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=ue(this,si)[r])==null?void 0:s.data)===void 0})},d4=function(n){const t=new Map;ue(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=ue(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new I5(ue(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},f4=function(n,t){const r=ue(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,ue(this,si).slice()),ue(this,si)[r]=t,Ot(this,ms,h4).call(this))},h4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=ue(this,yd),s=t?r:Ot(this,ms,u4).call(this,Ot(this,ms,c4).call(this,ue(this,si),ue(this,Pp)),(n=ue(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(ue(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??A5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){ue(this,zo).has(n.queryHash)||(ue(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=ue(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&ue(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return ue(this,zo).get(n)}getAll(){return[...ue(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,ue(this,nu)===1&&(Fe(this,Rh,O5.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onFocus())})),Fe(this,Mh,q1.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,ue(this,nu)===0&&((e=ue(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=ue(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return ue(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=ue(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return ue(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=ue(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return ue(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>ue(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=ue(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=ue(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>ue(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(ue(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>ue(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return q1.isOnline()?ue(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,zr)}getMutationCache(){return ue(this,eu)}getDefaultOptions(){return ue(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){ue(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...ue(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){ue(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...ue(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...ue(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=A5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===M5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,zr).clear(),ue(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?D5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||D5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>_4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&_4(b,S)){const w=new I5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),_4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,I5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&D5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Gv=0;const p4=new Set,HG=()=>Gv,_9=e=>(p4.add(e),()=>{p4.delete(e)}),za=()=>["workspace",Gv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Gv++,du.clear(),$5({queryKey:t}),p4.forEach(r=>r()),!0}const Fn=e=>e[1]===Gv;async function $5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Vr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var i2={exports:{}},i0={},a2={exports:{}},o2={};/** * @license React * scheduler.production.js * @@ -22,7 +22,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var ee=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(U,ee))tes(de,U)?(G[I]=de,G[te]=ee,I=te):(G[I]=U,G[W]=ee,I=W);else if(tes(de,ee))G[I]=de,G[te]=ee,I=te;else break e}}return X}function s(G,X){var ee=G.sortIndex-X.sortIndex;return ee!==0?ee:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var P=t(u);P!==null&&Y(E,P.startTime-G),X=!1}}break e}finally{d=null,p=ee,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=B,$=function(){q.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=ee,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,ee-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var ee=p;p=X;try{return G.apply(this,arguments)}finally{p=ee}}}})(o2)),o2}var m9;function GG(){return m9||(m9=1,a2.exports=UG()),a2.exports}var l2={exports:{}},Hs={};/** + */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var te=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(H,te))ees(de,H)?(G[I]=de,G[ee]=te,I=ee):(G[I]=H,G[W]=te,I=W);else if(ees(de,te))G[I]=de,G[ee]=te,I=ee;else break e}}return X}function s(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-G),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,U=q.port2;q.port1.onmessage=B,$=function(){U.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=te,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var te=p;p=X;try{return G.apply(this,arguments)}finally{p=te}}}})(o2)),o2}var m9;function GG(){return m9||(m9=1,a2.exports=UG()),a2.exports}var l2={exports:{}},Hs={};/** * @license React * react-dom.production.js * @@ -38,15 +38,15 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var b9;function VG(){if(b9)return i0;b9=1;var e=GG(),n=Vp(),t=NM();function r(c){var h="https://react.dev/errors/"+c;if(1L||(c.current=I[L],I[L]=null,L--)}function U(c,h){L++,I[L]=c.current,c.current=h}var te=P(null),de=P(null),re=P(null),ne=P(null);function Q(c,h){switch(U(re,h),U(de,c),U(te,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?x8(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=x8(h),c=w8(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}W(te),U(te,c)}function le(){W(te),W(de),W(re)}function oe(c){c.memoizedState!==null&&U(ne,c);var h=te.current,g=w8(h,c.type);h!==g&&(U(de,c),U(te,g))}function ce(c){de.current===c&&(W(te),W(de)),ne.current===c&&(W(ne),J_._currentValue=ee)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1L||(c.current=I[L],I[L]=null,L--)}function H(c,h){L++,I[L]=c.current,c.current=h}var ee=F(null),de=F(null),re=F(null),ne=F(null);function Q(c,h){switch(H(re,h),H(de,c),H(ee,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?x8(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=x8(h),c=w8(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}W(ee),H(ee,c)}function le(){W(ee),W(de),W(re)}function oe(c){c.memoizedState!==null&&H(ne,c);var h=ee.current,g=w8(h,c.type);h!==g&&(H(de,c),H(ee,g))}function ce(c){de.current===c&&(W(ee),W(de)),ne.current===c&&(W(ne),J_._currentValue=te)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1)":-1A||_e[k]!==Ce[A]){var De=` `+_e[k].replace(" at new "," at ");return c.displayName&&De.includes("")&&(De=De.replace("",c.displayName)),De}while(1<=k&&0<=A);break}}}finally{qe=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?ye(g):""}function Te(c,h){switch(c.tag){case 26:case 27:case 5:return ye(c.type);case 16:return ye("Lazy");case 13:return c.child!==h&&h!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ie(c.type,!1);case 11:return Ie(c.type.render,!1);case 1:return Ie(c.type,!0);case 31:return ye("Activity");default:return""}}function vt(c){try{var h="",g=null;do h+=Te(c,g),g=c,c=c.return;while(c);return h}catch(k){return` Error generating stack: `+k.message+` -`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Pr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=yy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=by(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function Ry(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function My(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Dy(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Ly=!1;function R_(){if(Ly){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Ly=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Ly=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,ex(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function Zy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,ee,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:ee},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function Jy(){return Ts(J_)}function Q7(){return qr().memoizedState}function Y7(){return qr().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:zy()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=gy(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=gy(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function ex(c,h,g,k){if(k={lane:2,revertLane:Rx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=gy(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Vy(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Yy,useDeferredValue:function(c,h){var g=ei();return Xy(g,c,h)},useTransition:function(){var c=Vy(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),_x(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Ox(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(Hr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return U(Hr,Hr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=Hr.current,U(Hr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),Iy(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(wy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ce(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(Hr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),Iy(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(wy(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ce(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(Hr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),Iy(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function px(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function mx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function gx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Fr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(gx(c,h,g),c=c.sibling;c!==null;)gx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,vx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,$x=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Px={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Cx,Cx=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=sx(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function jx(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(xx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):wx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Tx=!1,sg=!1,Ax=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Tx||(Tx=!0,bU())}function V_(c,h){if(!Ax&&sg){Ax=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Ax=!1}}function vU(){c8()}function c8(){sg=Tx=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Pr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Pr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Pr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Pr(g.imageSizes)+'"]')):A+='[href="'+Pr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Pr(k)+'"][href="'+Pr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Vx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Pr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Pr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Pr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Vx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Kx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Vx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Qx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Qx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),i2.exports=VG(),i2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(G1(e)&&G1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function W1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Wv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Wv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=V1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=F5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Wv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),F5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=F5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Wv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&P5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:V1(1e3),matchCache:V1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function F5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function K1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return K1(e,t)===K1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function c2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function m4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=m4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=m4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=m4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function u2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=u2(s):Array.isArray(i)?i.push(u2(s)):t[r]=[i,u2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=g4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function g4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Q1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=H5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Q1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=H5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),H=!!v;H||(_=u),u=Q1(O,B),v=[$,B,(v==null?void 0:v[2])||M],H||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,H=!B&&!$||d;d=!1;const q=H?"GO":$?"BACK":"FORWARD",Y=H?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:q})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const H=$.enableBeforeUnload??!0;if(H===!0){O=!0;break}if(typeof H=="function"&&H()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Q1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=H5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function H5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Vv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=V1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=g4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Q1(i.href,{});i={...i,to:g4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,H]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!H||H.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(W1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Vv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&W1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function v4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=v4(e,"component");let r=v4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?v4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function q5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Kv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function U5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:V5(e,n,t,U5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=V5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function G5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=G5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=G5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function W5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?U5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],V5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Kv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,H;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const q=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=q&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(q){o.invalid=!0,Ml(e,o),m=R0(e,n,l,q,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const q=o._flight;o._flight=w,(H=G5(e,o,q))==null||H.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(q=>(E&&(B9(o,q,u),q[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),q)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},q=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,q,i)]).then(q=>j.then(Y=>(E&&!q&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),q)));if(r.push([t,j,M]),!y)return j.then(q=>$9(o,q));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(q=>(o.isFetching=!1,B9(O,q,!1),q));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(q=>$9(O,q))}async function b4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function V5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:U5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Kv?b4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await b4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Kv){const w=await b4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:q5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function y4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>y4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!q5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=q5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));W5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Vv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Vv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});W5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>y4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&y4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),W5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||P5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},K5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Qv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const x4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){x4[w4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,X1(e))}});let Eg=0,w4=0,Co,S4=0;function dV(e){try{++S4,e()}finally{--S4||YM()}}function X1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(S4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),X1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,X1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,X1(this)}};return n(),t}var d2={exports:{}},f2={},h2={exports:{}},_2={};/** +`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Pr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=yy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=by(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function Ry(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function My(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Dy(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Ly=!1;function R_(){if(Ly){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Ly=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Ly=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,ex(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function Zy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,te,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function Jy(){return Ts(J_)}function Q7(){return qr().memoizedState}function Y7(){return qr().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:zy()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=gy(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=gy(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function ex(c,h,g,k){if(k={lane:2,revertLane:Rx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=gy(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Vy(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Yy,useDeferredValue:function(c,h){var g=ei();return Xy(g,c,h)},useTransition:function(){var c=Vy(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),_x(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Ox(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(Hr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return H(Hr,Hr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=Hr.current,H(Hr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),Iy(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(wy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ce(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(Hr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),Iy(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(wy(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ce(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(Hr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),Iy(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function px(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function mx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function gx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Fr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(gx(c,h,g),c=c.sibling;c!==null;)gx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,vx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,$x=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Px={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Cx,Cx=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=sx(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function jx(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(xx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):wx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Tx=!1,sg=!1,Ax=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Tx||(Tx=!0,bU())}function V_(c,h){if(!Ax&&sg){Ax=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Ax=!1}}function vU(){c8()}function c8(){sg=Tx=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Pr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Pr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Pr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Pr(g.imageSizes)+'"]')):A+='[href="'+Pr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Pr(k)+'"][href="'+Pr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Vx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Pr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Pr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Pr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Vx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Kx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Vx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Qx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Qx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),i2.exports=VG(),i2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(G1(e)&&G1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function W1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Wv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Wv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=V1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=F5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Wv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),F5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=F5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Wv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&P5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:V1(1e3),matchCache:V1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function F5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function K1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return K1(e,t)===K1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function c2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function m4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=m4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=m4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=m4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function u2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=u2(s):Array.isArray(i)?i.push(u2(s)):t[r]=[i,u2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=g4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function g4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Q1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=H5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Q1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=H5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),q=!!v;q||(_=u),u=Q1(O,B),v=[$,B,(v==null?void 0:v[2])||M],q||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,q=!B&&!$||d;d=!1;const U=q?"GO":$?"BACK":"FORWARD",Y=q?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:U})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const q=$.enableBeforeUnload??!0;if(q===!0){O=!0;break}if(typeof q=="function"&&q()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Q1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=H5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function H5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Vv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=V1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=g4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Q1(i.href,{});i={...i,to:g4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,q]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!q||q.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(W1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Vv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&W1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function v4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=v4(e,"component");let r=v4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?v4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function q5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Kv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function U5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:V5(e,n,t,U5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=V5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function G5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=G5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=G5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function W5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?U5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],V5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Kv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,q;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const U=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=U&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(U){o.invalid=!0,Ml(e,o),m=R0(e,n,l,U,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const U=o._flight;o._flight=w,(q=G5(e,o,U))==null||q.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(U=>(E&&(B9(o,U,u),U[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),U)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},U=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,U,i)]).then(U=>j.then(Y=>(E&&!U&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),U)));if(r.push([t,j,M]),!y)return j.then(U=>$9(o,U));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(U=>(o.isFetching=!1,B9(O,U,!1),U));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(U=>$9(O,U))}async function b4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function V5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:U5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Kv?b4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await b4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Kv){const w=await b4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:q5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function y4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>y4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!q5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=q5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));W5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Vv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Vv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});W5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>y4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&y4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),W5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||P5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},K5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Qv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const x4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){x4[w4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,X1(e))}});let Eg=0,w4=0,Co,S4=0;function dV(e){try{++S4,e()}finally{--S4||YM()}}function X1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(S4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),X1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,X1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,X1(this)}};return n(),t}var d2={exports:{}},f2={},h2={exports:{}},_2={};/** * @license React * use-sync-external-store-shim.production.js * @@ -62,7 +62,7 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var V9;function pV(){if(V9)return f2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return f2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},f2}var K9;function mV(){return K9||(K9=1,d2.exports=pV()),d2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Q5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Qv),r=e.from??t,s=n.stores.getMatchStore(r),i=Q5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&P5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Yv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Y5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function p2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return W1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),W1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=K1(e.pathname,r),o=K1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:H,hash:q,state:Y,mask:G,reloadDocument:X,unsafeRelative:ee,from:I,_fromLocation:L,...P}=e,W=VM(),U=p2(e.search),te=p2(e.params),de=p2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,U,te,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,de,t.basepath,W,we!==void 0)]},[de,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ce=oe?Bh(s,{})??SV:m2,pe=oe?m2:Bh(i,{})??m2,Se=[C,ce.className,pe.className].filter(Boolean).join(" "),ye=(y||ce.style||pe.style)&&{...y,...ce.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){g2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&g2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...P,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&g2(r)};return{...P,...ce,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var m2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,g2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Xv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Xv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Y5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Xv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(K5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function Zv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Zv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?K5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Qv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Zv(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Qv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:Zv(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Vv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=Zv(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Qv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(K5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Q5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Q5(e,n))}const Z1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))Z1.set(s,(Z1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?Z1.get(s):void 0,a=await t();if(!s||Z1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],X5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...X5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...X5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function Jv(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])$5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])Jv(r.id);$5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",Z5=["en","zh-CN","fa"],cD="orx:locale",J5=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=J5;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&J1.has(r)){const i=J1.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=J5;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&J1.has(l)){const u=J1.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Z5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&Z5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Z5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:J5}const J1=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,k4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,ev=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,v2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",b2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,y2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",tv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",C4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,e6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? + */var V9;function pV(){if(V9)return f2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return f2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},f2}var K9;function mV(){return K9||(K9=1,d2.exports=pV()),d2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Q5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Qv),r=e.from??t,s=n.stores.getMatchStore(r),i=Q5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&P5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Yv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Y5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function p2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return W1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),W1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=K1(e.pathname,r),o=K1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:q,hash:U,state:Y,mask:G,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,W=VM(),H=p2(e.search),ee=p2(e.params),de=p2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,H,ee,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,de,t.basepath,W,we!==void 0)]},[de,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ce=oe?Bh(s,{})??SV:m2,pe=oe?m2:Bh(i,{})??m2,Se=[C,ce.className,pe.className].filter(Boolean).join(" "),ye=(y||ce.style||pe.style)&&{...y,...ce.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){g2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&g2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&g2(r)};return{...F,...ce,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var m2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,g2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Xv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Xv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Y5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Xv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(K5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function Zv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Zv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?K5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Qv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Zv(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Qv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:Zv(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Vv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=Zv(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Qv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(K5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Q5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Q5(e,n))}const Z1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))Z1.set(s,(Z1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?Z1.get(s):void 0,a=await t();if(!s||Z1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],X5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...X5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...X5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function Jv(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])$5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])Jv(r.id);$5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",Z5=["en","zh-CN","fa"],cD="orx:locale",J5=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=J5;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&J1.has(r)){const i=J1.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=J5;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&J1.has(l)){const u=J1.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Z5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&Z5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Z5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:J5}const J1=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,k4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,ev=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,v2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",b2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,y2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",tv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",C4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,e6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? Its transcript will be permanently removed.`,Vie=e=>`删除“${e==null?void 0:e.title}”? @@ -77,15 +77,15 @@ ${e==null?void 0:e.path} 存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,Tit=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ ${e==null?void 0:e.path} -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",E2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),N2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",p6="chat_demo_nanochat_figures_v1",m6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[p6]:"figures",[m6]:"literature"},S1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class D4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new D4(s,a,i.exists)}}catch(i){if(i instanceof D4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),tb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??O4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?r6():n,r=O4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const rv="default";function nb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===rv)?rv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const L4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:L4,label:pBe(),description:dBe()},...t]:[]}function sv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?L4:t!=null&&s.some(a=>a.id===t)?t:L4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=nb(e,n);return r.length===0?rv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function O4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(Jv(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),iv=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),v6=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function rb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const k1=new Map;function kht(e,n){let t=k1.get(e);return t||(t=new Set,k1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&k1.delete(e)}}function Cht(e){var n;(n=k1.get(e.runId))==null||n.forEach(t=>t(e))}const I4=new Set;function av(e){return I4.add(e),()=>{I4.delete(e)}}function bl(e){I4.forEach(n=>n(e))}const B4=new Set;function Eht(e){return B4.add(e),()=>{B4.delete(e)}}function yl(){B4.forEach(e=>e())}const $4=new Set;function Nht(e){return $4.add(e),()=>{$4.delete(e)}}function WN(e){$4.forEach(n=>n(e))}const P4=new Set;function tO(e){return P4.add(e),()=>{P4.delete(e)}}function z2(e){P4.forEach(n=>n(e))}const F4=new Set;function zht(e){return F4.add(e),()=>{F4.delete(e)}}function VN(e){F4.forEach(n=>n(e))}const H4=new Set;function jht(e){return H4.add(e),()=>{H4.delete(e)}}function Tht(e){H4.forEach(n=>n(e))}let q4=!0;const U4=new Set;function Aht(e){return U4.add(e),()=>{U4.delete(e)}}function KN(){return q4}function QN(e){e!==q4&&(q4=e,U4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&z2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&z2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&z2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const ov=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return ov.add(t),()=>{ov.delete(t)}},[])}const YN={onRun:e=>ov.forEach(n=>n.onRun(e)),onReconnect:()=>ov.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),G4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),W4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,W4(n.projectId).queryKey,n.id),nt.setQueryData(W4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(X5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=av(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?Jv(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&rb(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,iv().queryKey),nt.setQueryData(iv().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const V4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of V4)n()}}function Pht(e){return V4.add(e),()=>V4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const K4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of K4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return K4.add(e),()=>K4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),lv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(lv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(lv):e.slice(n).join(lv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(lv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Q4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Q4)?(p=d.slice(0,-1),m=!0):d.startsWith(Q4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Q4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),j2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],H=()=>["auto","min","max","fr",pt,ht],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],ee=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],P=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],te=()=>[j2,c0,Qu],de=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,j2,iz,sz],oe=()=>["","none",x,pt,ht],ce=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...ee()]}],"min-inline-size":[{"min-inline":["auto",...ee()]}],"max-inline-size":[{"max-inline":["none",...ee()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",j2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Y4(e,s,"postfixLookupClassGroups"),Y4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)Y4(e,n,t)},Y4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function sb({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ib({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:H,gap:q,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:ee="Close toast"}=e,[I,L]=Je.useState(null),[P,W]=Je.useState(null),[U,te]=Je.useState(!1),[de,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ce,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=H.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(H)},[e.swipeDirections,H]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*q+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{te(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!U)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ce,"data-removed":de,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":P,"data-expanded":!!(y||Y&&U),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${de?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":ee,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(te=>te.toasterId===r):T.filter(te=>!te.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(te=>te.position).map(te=>te.position)))),[M,i]),[B,$]=Je.useState([]),[H,q]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,ee]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Je.useRef(null),W=Je.useRef(!1),U=Je.useCallback(te=>{j(de=>{var re;return(re=de.find(ne=>ne.id===te.id))!=null&&re.delete||wi.dismiss(te.id),de.filter(({id:ne})=>ne!==te.id)})},[]);return Je.useEffect(()=>wi.subscribe(te=>{if(te.dismiss){requestAnimationFrame(()=>{j(de=>de.map(re=>re.id===te.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(de=>{const re=de.findIndex(ne=>ne.id===te.id);return re!==-1?[...de.slice(0,re),{...de[re],...te},...de.slice(re+1)]:[te,...de]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){ee(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ee("dark"):ee("light")),typeof window>"u")return;const te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:de})=>{ee(de?"dark":"light")})}catch{te.addListener(({matches:re})=>{try{ee(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&q(!1)},[T]),Je.useEffect(()=>{const te=de=>{var re;if(a.length>0&&a.every(le=>de[le]||de.code===le)){var Q;q(!0),(Q=I.current)==null||Q.focus()}de.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[a]),Je.useEffect(()=>{if(I.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((te,de)=>{var re;const[ne,Q]=te.split("-");return M.length?Je.createElement("ol",{key:te,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,P.current=le.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Y||q(!1)},onDragEnd:()=>q(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&de===0||le.position===te).map((le,oe)=>{var ce,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ce=b==null?void 0:b.duration)!=null?ce:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:te,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:H,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ab(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),ab(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var T2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(T2)),T2.exports}var N0t=E0t(),A2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(A2)),A2.exports}var j0t=z0t(),R2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",E2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),N2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",p6="chat_demo_nanochat_figures_v1",m6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[p6]:"figures",[m6]:"literature"},S1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class D4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new D4(s,a,i.exists)}}catch(i){if(i instanceof D4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),tb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??O4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?r6():n,r=O4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const rv="default";function nb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===rv)?rv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const L4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:L4,label:pBe(),description:dBe()},...t]:[]}function sv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?L4:t!=null&&s.some(a=>a.id===t)?t:L4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=nb(e,n);return r.length===0?rv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function O4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(Jv(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),iv=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),v6=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function rb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const k1=new Map;function kht(e,n){let t=k1.get(e);return t||(t=new Set,k1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&k1.delete(e)}}function Cht(e){var n;(n=k1.get(e.runId))==null||n.forEach(t=>t(e))}const I4=new Set;function av(e){return I4.add(e),()=>{I4.delete(e)}}function bl(e){I4.forEach(n=>n(e))}const B4=new Set;function Eht(e){return B4.add(e),()=>{B4.delete(e)}}function yl(){B4.forEach(e=>e())}const $4=new Set;function Nht(e){return $4.add(e),()=>{$4.delete(e)}}function WN(e){$4.forEach(n=>n(e))}const P4=new Set;function tO(e){return P4.add(e),()=>{P4.delete(e)}}function z2(e){P4.forEach(n=>n(e))}const F4=new Set;function zht(e){return F4.add(e),()=>{F4.delete(e)}}function VN(e){F4.forEach(n=>n(e))}const H4=new Set;function jht(e){return H4.add(e),()=>{H4.delete(e)}}function Tht(e){H4.forEach(n=>n(e))}let q4=!0;const U4=new Set;function Aht(e){return U4.add(e),()=>{U4.delete(e)}}function KN(){return q4}function QN(e){e!==q4&&(q4=e,U4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&z2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&z2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&z2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const ov=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return ov.add(t),()=>{ov.delete(t)}},[])}const YN={onRun:e=>ov.forEach(n=>n.onRun(e)),onReconnect:()=>ov.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),G4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),W4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,W4(n.projectId).queryKey,n.id),nt.setQueryData(W4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(X5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=av(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?Jv(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&rb(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,iv().queryKey),nt.setQueryData(iv().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const V4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of V4)n()}}function Pht(e){return V4.add(e),()=>V4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const K4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of K4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return K4.add(e),()=>K4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),lv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(lv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(lv):e.slice(n).join(lv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(lv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Q4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Q4)?(p=d.slice(0,-1),m=!0):d.startsWith(Q4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Q4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),j2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],q=()=>["auto","min","max","fr",pt,ht],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],F=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],ee=()=>[j2,c0,Qu],de=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,j2,iz,sz],oe=()=>["","none",x,pt,ht],ce=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",j2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Y4(e,s,"postfixLookupClassGroups"),Y4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)Y4(e,n,t)},Y4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function sb({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ib({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:q,gap:U,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,W]=Je.useState(null),[H,ee]=Je.useState(!1),[de,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ce,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=q.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(q)},[e.swipeDirections,q]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*U+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{ee(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!H)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[H,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":H,"data-promise":!!d.promise,"data-swiped":ce,"data-removed":de,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&H),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${de?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(ee=>ee.toasterId===r):T.filter(ee=>!ee.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(ee=>ee.position).map(ee=>ee.position)))),[M,i]),[B,$]=Je.useState([]),[q,U]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),W=Je.useRef(!1),H=Je.useCallback(ee=>{j(de=>{var re;return(re=de.find(ne=>ne.id===ee.id))!=null&&re.delete||wi.dismiss(ee.id),de.filter(({id:ne})=>ne!==ee.id)})},[]);return Je.useEffect(()=>wi.subscribe(ee=>{if(ee.dismiss){requestAnimationFrame(()=>{j(de=>de.map(re=>re.id===ee.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(de=>{const re=de.findIndex(ne=>ne.id===ee.id);return re!==-1?[...de.slice(0,re),{...de[re],...ee},...de.slice(re+1)]:[ee,...de]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:de})=>{te(de?"dark":"light")})}catch{ee.addListener(({matches:re})=>{try{te(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&U(!1)},[T]),Je.useEffect(()=>{const ee=de=>{var re;if(a.length>0&&a.every(le=>de[le]||de.code===le)){var Q;U(!0),(Q=I.current)==null||Q.focus()}de.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((ee,de)=>{var re;const[ne,Q]=ee.split("-");return M.length?Je.createElement("ol",{key:ee,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{Y||U(!1)},onDragEnd:()=>U(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&de===0||le.position===ee).map((le,oe)=>{var ce,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ce=b==null?void 0:b.duration)!=null?ce:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:ee,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:H,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:q,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ab(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),ab(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var T2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(T2)),T2.exports}var N0t=E0t(),A2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(A2)),A2.exports}var j0t=z0t(),R2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let H=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const q=this._rowColumns.get($);if(!q)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++H,Y=0),{row:H,column:Y}},T=N(y),j=N(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var O,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=j;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let O=0;Oy?y.activate(q,Y,$):x(0,Y),hover:(q,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,q,Y,$)},leave:(q,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,q,Y,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let q=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get($);if(!U)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++q,Y=0),{row:q,column:Y}},T=N(y),j=N(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var O,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=j;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let O=0;Oy?y.activate(U,Y,$):x(0,Y),hover:(U,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,U,Y,$)},leave:(U,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,U,Y,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? -WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=l(3614),_=l(3656),d=l(3551),p=l(9042),m=l(3730),x=l(1680),S=l(3107),v=l(5744),b=l(2950),w=l(1296),y=l(428),C=l(4269),E=l(5114),N=l(8934),T=l(3230),j=l(9312),M=l(4725),O=l(6731),B=l(8055),$=l(8969),H=l(8460),q=l(844),Y=l(6114),G=l(8437),X=l(2584),ee=l(7399),I=l(5941),L=l(9074),P=l(2585),W=l(5435),U=l(4567),te=l(779);class de extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ne={}){super(ne),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new q.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(te.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((Q,le)=>this.refresh(Q,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((Q=>this._reportWindowsOptions(Q)))),this.register(this._inputHandler.onColor((Q=>this._handleColorEvent(Q)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((Q=>this._afterResize(Q.cols,Q.rows)))),this.register((0,q.toDisposable)((()=>{var Q,le;this._customKeyEventHandler=void 0,(le=(Q=this.element)==null?void 0:Q.parentNode)==null||le.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const Q of ne){let le,oe="";switch(Q.index){case 256:le="foreground",oe="10";break;case 257:le="background",oe="11";break;case 258:le="cursor",oe="12";break;default:le="ansi",oe="4;"+Q.index}switch(Q.type){case 0:const ce=B.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[Q.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${oe};${(0,I.toRgbString)(ce)}${X.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((pe=>pe.ansi[Q.index]=B.channels.toColor(...Q.color)));else{const pe=le;this._themeService.modifyColors((Se=>Se[pe]=B.channels.toColor(...Q.color)))}break;case 2:this._themeService.restoreColor(Q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ne=this.buffer.ybase+this.buffer.y,Q=this.buffer.lines.get(ne);if(!Q)return;const le=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ce=Q.getWidth(le),pe=this._renderService.dimensions.css.cell.width*ce,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,ye=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ye+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(Q=>{this.hasSelection()&&(0,u.copyHandler)(Q,this._selectionService)})));const ne=Q=>(0,u.handlePasteEvent)(Q,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,_.addDisposableDomListener)(this.element,"paste",ne)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(Q=>{Q.button===2&&(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(Q=>{(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(Q=>{Q.button===1&&(0,u.moveTextAreaUnderMouseCursor)(Q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var le;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((le=this.element)==null?void 0:le.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ne.appendChild(this.element);const Q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,Q=this.element;function le(pe){const Se=ne._mouseService.getMouseReportCoords(pe,ne.screenElement);if(!Se)return!1;let ye,qe;switch(pe.overrideType||pe.type){case"mousemove":qe=32,pe.buttons===void 0?(ye=3,pe.button!==void 0&&(ye=pe.button<3?pe.button:3)):ye=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":qe=0,ye=pe.button<3?pe.button:3;break;case"mousedown":qe=1,ye=pe.button<3?pe.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(pe)===!1||ne.viewport.getLinesScrolled(pe)===0)return!1;qe=pe.deltaY<0?0:1,ye=4;break;default:return!1}return!(qe===void 0||ye===void 0||ye>4)&&ne.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:ye,action:qe,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:pe=>(le(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(le(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&le(pe)},mousemove:pe=>{pe.buttons||le(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?oe.mousemove||(Q.addEventListener("mousemove",ce.mousemove),oe.mousemove=ce.mousemove):(Q.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(Q.addEventListener("wheel",ce.wheel,{passive:!1}),oe.wheel=ce.wheel):(Q.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(Q,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return le(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,_.addDisposableDomListener)(Q,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(pe);if(Se===0)return;const ye=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let qe="";for(let Ie=0;Ie{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(Q,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(ne,Q){var le;(le=this._renderService)==null||le.refreshRows(ne,Q)}updateCursorStyle(ne){var Q;(Q=this._selectionService)!=null&&Q.shouldColumnSelect(ne)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ne,Q,le=0){var oe;le===1?(super.scrollLines(ne,Q,le),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(ne)}paste(ne){(0,u.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const Q=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),Q}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,Q,le){this._selectionService.setSelection(ne,Q,le)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,Q){var le;(le=this._selectionService)==null||le.selectLines(ne,Q)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const Q=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!Q&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;Q||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,ee.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),le.type===3||le.type===2){const oe=this.rows-1;return this.scrollLines(le.type===2?-oe:oe),this.cancel(ne,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(le.cancel&&this.cancel(ne,!0),!le.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==X.C0.ETX&&le.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,Q){const le=ne.isMac&&!this.options.macOptionIsMeta&&Q.altKey&&!Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.altKey&&Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.getModifierState("AltGraph");return Q.type==="keypress"?le:le&&(!Q.keyCode||Q.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(Q){return Q.keyCode===16||Q.keyCode===17||Q.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let Q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)Q=ne.charCode;else if(ne.which===null||ne.which===void 0)Q=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;Q=ne.which}return!(!Q||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(Q=String.fromCharCode(Q),this._onKey.fire({key:Q,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(Q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const Q=ne.data;return this.coreService.triggerDataEvent(Q,!0),this.cancel(ne),!0}return!1}resize(ne,Q){ne!==this.cols||Q!==this.rows?super.resize(ne,Q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,Q){var le,oe;(le=this._charSizeService)==null||le.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var ne;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Q=1;Q{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,u=1e3){this._renderCallback=l,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=d-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u)}}},1680:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),p=l(4725),m=l(8460),x=l(844),S=l(2585);let v=o.Viewport=class extends x.Disposable{constructor(b,w,y,C,E,N,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=E,this._renderService=N,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=$),C=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let w=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(b,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const w=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(b,w))}};o.Viewport=v=u([_(2,S.IBufferService),_(3,S.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],v)},3107:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),p=l(844),m=l(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(S,v,b,w,y){super(),this._screenElement=S,this._bufferService=v,this._coreBrowserService=b,this._decorationService=w,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),v.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=S.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(S,v),v}_refreshStyle(S){const v=S.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let b=this._decorationElements.get(S);b||(b=this._createElement(S),S.element=b,this._decorationElements.set(S,b),this._container.appendChild(b),S.onDispose((()=>{this._decorationElements.delete(S),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(b)}}_refreshXPosition(S,v=S.element){if(!v)return;const b=S.options.x??0;(S.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var v;(v=this._decorationElements.get(S))==null||v.remove(),this._decorationElements.delete(S),S.dispose()}};o.BufferDecorationRenderer=x=u([_(1,m.IBufferService),_(2,d.ICoreBrowserService),_(3,m.IDecorationService),_(4,d.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const u of this._zones)if(u.color===l.options.overviewRulerOptions.color&&u.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,l.marker.line))return;if(this._lineAdjacentToZone(u,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(u,l.marker.line)}if(this._zonePoolIndex=l.startBufferLine&&u<=l.endBufferLine}_lineAdjacentToZone(l,u,_){return u>=l.startBufferLine-this._linePadding[_||"full"]&&u<=l.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(l,u){l.startBufferLine=Math.min(l.startBufferLine,u),l.endBufferLine=Math.max(l.endBufferLine,u)}}},5744:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),p=l(4725),m=l(844),x=l(2585),S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let w=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,E,N,T,j,M){var B;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=E,this._decorationService=N,this._renderService=T,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=w=u([_(2,x.IBufferService),_(3,x.IDecorationService),_(4,p.IRenderService),_(5,x.IOptionsService),_(6,p.ICoreBrowserService)],w)},2950:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),p=l(2585),m=l(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,v,b,w,y,C){this._textarea=S,this._compositionView=v,this._bufferService=b,this._optionsService=w,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(S,"");this._dataAlreadySent=b,v.length>S.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,d.IRenderService)],x)},9806:(a,o)=>{function l(u,_,d){const p=d.getBoundingClientRect(),m=u.getComputedStyle(d),x=parseInt(m.getPropertyValue("padding-left")),S=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-x,_.clientY-p.top-S]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(u,_,d,p,m,x,S,v,b){if(!x)return;const w=l(u,_,d);return w?(w[0]=Math.ceil((w[0]+(b?S/2:0))/S),w[1]=Math.ceil(w[1]/v),w[0]=Math.min(Math.max(w[0],1),p+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),m),w):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=l(2584);function _(v,b,w,y){const C=v-d(v,w),E=b-d(b,w),N=Math.abs(C-E)-(function(T,j,M){let O=0;const B=T-d(T,M),$=j-d(j,M);for(let H=0;H=0&&vb?"A":"B"}function m(v,b,w,y,C,E){let N=v,T=b,j="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>E.cols-1?(j+=E.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(j+=E.buffer.translateBufferLineToString(T,!1,0,v+1),N=E.cols-1,v=N,T--);return j+E.buffer.translateBufferLineToString(T,!1,v,N)}function x(v,b){const w=b?"O":"[";return u.C0.ESC+w+v}function S(v,b){v=Math.floor(v);let w="";for(let y=0;y0?B-d(B,$):M;const Y=B,G=(function(X,ee,I,L,P,W){let U;return U=_(I,L,P,W).length>0?L-d(L,P):ee,X=I&&Uv?"D":"C",S(Math.abs(C-v),x(N,y));N=E>b?"D":"C";const T=Math.abs(E-b);return S((function(j,M){return M.cols-j})(E>b?v:C,w)+(T-1)*w.cols+1+((E>b?C:v)-1),x(N,y))}},1296:function(a,o,l){var u=this&&this.__decorate||function(H,q,Y,G){var X,ee=arguments.length,I=ee<3?q:G===null?G=Object.getOwnPropertyDescriptor(q,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(H,q,Y,G);else for(var L=H.length-1;L>=0;L--)(X=H[L])&&(I=(ee<3?X(I):ee>3?X(q,Y,I):X(q,Y))||I);return ee>3&&I&&Object.defineProperty(q,Y,I),I},_=this&&this.__param||function(H,q){return function(Y,G){q(Y,G,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),p=l(2550),m=l(2223),x=l(6171),S=l(6052),v=l(4725),b=l(8055),w=l(8460),y=l(844),C=l(2585),E="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",j="xterm-bg-",M="xterm-focus",O="xterm-selection";let B=1,$=o.DomRenderer=class extends y.Disposable{constructor(H,q,Y,G,X,ee,I,L,P,W,U,te,de){super(),this._terminal=H,this._document=q,this._element=Y,this._screenElement=G,this._viewportElement=X,this._helperContainer=ee,this._linkifier2=I,this._charSizeService=P,this._optionsService=W,this._bufferService=U,this._coreBrowserService=te,this._themeService=de,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((re=>this._injectCss(re)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((re=>this._handleLinkHover(re)))),this.register(this._linkifier2.onHideLinkUnderline((re=>this._handleLinkLeave(re)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const q=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let q=`${this._terminalSelector} .${N} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;q+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(H.foreground,.5).css};}`,q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;q+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,q+=`@keyframes ${X} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,q+=`${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,q+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,I]of H.ansi.entries())q+=`${this._terminalSelector} .${T}${ee} { color: ${I.css}; }${this._terminalSelector} .${T}${ee}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${j}${ee} { background-color: ${I.css}; }`;q+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(H.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${j}${m.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=q}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,q){for(let Y=this._rowElements.length;Y<=q;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,q){this._refreshRowElements(H,q),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,q,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,q,Y),this.renderRows(0,this._bufferService.rows-1),!H||!q)return;this._selectionRenderModel.update(this._terminal,H,q,Y);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(Y){const P=H[0]>q[0];L.appendChild(this._createSelectionElement(ee,P?q[0]:H[0],P?H[0]:q[0],I-ee+1))}else{const P=G===ee?H[0]:0,W=ee===X?q[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(ee,P,W));const U=I-ee-1;if(L.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,U)),ee!==I){const te=X===I?q[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,te))}}this._selectionContainer.appendChild(L)}_createSelectionElement(H,q,Y,G=1){const X=this._document.createElement("div"),ee=q*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(Y-q);return ee+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-ee),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=H*this.dimensions.css.cell.height+"px",X.style.left=`${ee}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,q){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=H;P<=q;P++){const W=P+Y.ydisp,U=this._rowElements[P],te=Y.lines.get(W);if(!U||!te)break;U.replaceChildren(...this._rowFactory.createRow(te,W,W===G,I,L,X,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,q,Y,G,X,ee){Y<0&&(H=0),G<0&&(q=0);const I=this._bufferService.rows-1;Y=Math.max(Math.min(Y,I),0),G=Math.max(Math.min(G,I),0),X=Math.min(X,this._bufferService.cols);const L=this._bufferService.buffer,P=L.ybase+L.y,W=Math.min(L.x,X-1),U=this._optionsService.rawOptions.cursorBlink,te=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=Y;re<=G;++re){const ne=re+L.ydisp,Q=this._rowElements[re],le=L.lines.get(ne);if(!Q||!le)break;Q.replaceChildren(...this._rowFactory.createRow(le,ne,ne===P,te,de,W,U,this.dimensions.css.cell.width,this._widthCache,ee?re===Y?H:0:-1,ee?(re===G?q:X)-1:-1))}}};o.DomRenderer=$=u([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],$)},3787:function(a,o,l){var u=this&&this.__decorate||function(N,T,j,M){var O,B=arguments.length,$=B<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,T,j,M);else for(var H=N.length-1;H>=0;H--)(O=N[H])&&($=(B<3?O($):B>3?O(T,j,$):O(T,j))||$);return B>3&&$&&Object.defineProperty(T,j,$),$},_=this&&this.__param||function(N,T){return function(j,M){T(j,M,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),p=l(643),m=l(511),x=l(2585),S=l(8055),v=l(4725),b=l(4269),w=l(6171),y=l(3734);let C=o.DomRendererRowFactory=class{constructor(N,T,j,M,O,B,$){this._document=N,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=M,this._coreService=O,this._decorationService=B,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,j){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=j}createRow(N,T,j,M,O,B,$,H,q,Y,G){const X=[],ee=this._characterJoinerService.getJoinedCharacters(T),I=this._themeService.colors;let L,P=N.getNoBgTrimmedLength();j&&P0&&Se===ee[0][0]){qe=!0;const We=ee.shift();Te=new b.JoinedCellData(this._workCell,N.translateToString(!0,We[0],We[1]),We[1]-We[0]),Ie=We[1]-1,ye=Te.getWidth()}const vt=this._isCellInSelection(Se,T),Dt=j&&Se===B,Ut=pe&&Se>=Y&&Se<=G;let Ft=!1;this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{Ft=!0}));let mt=Te.getChars()||p.WHITESPACE_CELL_CHAR;if(mt===" "&&(Te.isUnderline()||Te.isOverline())&&(mt=" "),oe=ye*H-q.get(mt,Te.isBold(),Te.isItalic()),L){if(W&&(vt&&le||!vt&&!le&&Te.bg===te)&&(vt&&le&&I.selectionForeground||Te.fg===de)&&Te.extended.ext===re&&Ut===ne&&oe===Q&&!Dt&&!qe&&!Ft){Te.isInvisible()?U+=p.WHITESPACE_CELL_CHAR:U+=mt,W++;continue}W&&(L.textContent=U),L=this._document.createElement("span"),W=0,U=""}else L=this._document.createElement("span");if(te=Te.bg,de=Te.fg,re=Te.extended.ext,ne=Ut,Q=oe,le=vt,qe&&B>=Se&&B<=Ie&&(B=Se),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ce.push("xterm-cursor-blink"),ce.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(Te.isBold()&&ce.push("xterm-bold"),Te.isItalic()&&ce.push("xterm-italic"),Te.isDim()&&ce.push("xterm-dim"),U=Te.isInvisible()?p.WHITESPACE_CELL_CHAR:Te.getChars()||p.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(ce.push(`xterm-underline-${Te.extended.underlineStyle}`),U===" "&&(U=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let We=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&We<8&&(We+=8),L.style.textDecorationColor=I.ansi[We].css}Te.isOverline()&&(ce.push("xterm-overline"),U===" "&&(U=" ")),Te.isStrikethrough()&&ce.push("xterm-strikethrough"),Ut&&(L.style.textDecoration="underline");let rt=Te.getFgColor(),ut=Te.getFgColorMode(),Ct=Te.getBgColor(),we=Te.getBgColorMode();const Re=!!Te.isInverse();if(Re){const We=rt;rt=Ct,Ct=We;const Gt=ut;ut=we,we=Gt}let Ze,_t,wt,Zt=!1;switch(this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{We.options.layer!=="top"&&Zt||(We.backgroundColorRGB&&(we=50331648,Ct=We.backgroundColorRGB.rgba>>8&16777215,Ze=We.backgroundColorRGB),We.foregroundColorRGB&&(ut=50331648,rt=We.foregroundColorRGB.rgba>>8&16777215,_t=We.foregroundColorRGB),Zt=We.options.layer==="top")})),!Zt&&vt&&(Ze=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ct=Ze.rgba>>8&16777215,we=50331648,Zt=!0,I.selectionForeground&&(ut=50331648,rt=I.selectionForeground.rgba>>8&16777215,_t=I.selectionForeground)),Zt&&ce.push("xterm-decoration-top"),we){case 16777216:case 33554432:wt=I.ansi[Ct],ce.push(`xterm-bg-${Ct}`);break;case 50331648:wt=S.channels.toColor(Ct>>16,Ct>>8&255,255&Ct),this._addStyle(L,`background-color:#${E((Ct>>>0).toString(16),"0",6)}`);break;default:Re?(wt=I.foreground,ce.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):wt=I.background}switch(Ze||Te.isDim()&&(Ze=S.color.multiplyOpacity(wt,.5)),ut){case 16777216:case 33554432:Te.isBold()&&rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(rt+=8),this._applyMinimumContrast(L,wt,I.ansi[rt],Te,Ze,void 0)||ce.push(`xterm-fg-${rt}`);break;case 50331648:const We=S.channels.toColor(rt>>16&255,rt>>8&255,255&rt);this._applyMinimumContrast(L,wt,We,Te,Ze,_t)||this._addStyle(L,`color:#${E(rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,wt,I.foreground,Te,Ze,_t)||Re&&ce.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ce.length&&(L.className=ce.join(" "),ce.length=0),Dt||qe||Ft?L.textContent=U:W++,oe!==this.defaultSpacing&&(L.style.letterSpacing=`${oe}px`),X.push(L),Se=Ie}return L&&W&&(L.textContent=U),X}_applyMinimumContrast(N,T,j,M,O,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let H;if(O||B||(H=$.getColor(T.rgba,j.rgba)),H===void 0){const q=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);H=S.color.ensureContrastRatio(O||T,B||j,q),$.setColor((O||T).rgba,(B||j).rgba,H??null)}return!!H&&(this._addStyle(N,`color:${H.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?N>=j[0]&&T>=j[1]&&N=j[1]&&N>=M[0]&&T<=M[1]:T>j[1]&&T=j[0]&&N=j[0])}};function E(N,T,j){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=l.createElement("span");_.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=l.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,d,p,m],this._container.appendChild(_),this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(m),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,u,_,d){l===this._font&&u===this._fontSize&&_===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=u,this._weight=_,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,u,_){let d=0;if(!u&&!_&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const x=this._measure(l,0);return x>0&&(this._flat[d]=x),x}let p=l;u&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),_&&(x|=2),m=this._measure(l,x),m>0&&this._holey.set(p,m)}return m}_measure(l,u){const _=this._measureElements[u];return _.textContent=l.repeat(32),_.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(_){return 57508<=_&&_<=57558}function u(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=u,o.allowRescaling=function(_,d,p,m){return d===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!u(_)&&!l(_)&&!(function(x){return 57344<=x&&x<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return l(_)||(function(d){return 9472<=d&&d<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,d,p=0){return(_-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,d,p,m=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const x=_.buffers.active.ydisp,S=d[1]-x,v=p[1]-x,b=Math.max(S,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=S,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=d[0],this.endCol=p[0])}isCellSelected(_,d,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,u=this.selectionEnd;return!(!l||!u)&&(l[1]>u[1]||l[1]===u[1]&&l[0]>u[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),p=l(8460),m=l(844);let x=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=u([_(2,d.IOptionsService)],x);class S extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class v extends S{constructor(y,C,E){super(),this._document=y,this._parentElement=C,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),p=l(643),m=l(511),x=l(2585);class S extends d.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=S;let v=o.CharacterJoinerService=class CO{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const $=this._getJoinedRanges(E,j,T,y,N);for(let H=0;H<$.length;H++)C.push($[H])}N=B,j=T,M=this._workCell.fg,O=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const B=this._getJoinedRanges(E,j,T,y,N);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=l(844),_=l(8460),d=l(3656);class p extends u.Disposable{constructor(S,v,b){super(),this._textarea=S,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=l(844);class _ extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=_},8934:function(a,o,l){var u=this&&this.__decorate||function(x,S,v,b){var w,y=arguments.length,C=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,S,v,b);else for(var E=x.length-1;E>=0;E--)(w=x[E])&&(C=(y<3?w(C):y>3?w(S,v,C):w(S,v))||C);return y>3&&C&&Object.defineProperty(S,v,C),C},_=this&&this.__param||function(x,S){return function(v,b){S(v,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),p=l(9806);let m=o.MouseService=class{constructor(x,S){this._renderService=x,this._charSizeService=S}getCoords(x,S,v,b,w){return(0,p.getCoords)(window,x,S,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(x,S){const v=(0,p.getCoordsRelativeToElement)(window,x,S);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([_(0,d.IRenderService),_(1,d.ICharSizeService)],m)},3230:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),p=l(4725),m=l(8460),x=l(844),S=l(7226),v=l(2585);let b=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,E,N,T,j,M){super(),this._rowCount=w,this._charSizeService=E,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((O,B)=>this._renderRows(O,B)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((O=>this._registerIntersectionObserver(O,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,x.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var E;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(E=this._renderer.value)==null||E.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};o.RenderService=b=u([_(2,v.IOptionsService),_(3,p.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],b)},9312:function(a,o,l){var u=this&&this.__decorate||function(j,M,O,B){var $,H=arguments.length,q=H<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,O):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(j,M,O,B);else for(var Y=j.length-1;Y>=0;Y--)($=j[Y])&&(q=(H<3?$(q):H>3?$(M,O,q):$(M,O))||q);return H>3&&q&&Object.defineProperty(M,O,q),q},_=this&&this.__param||function(j,M){return function(O,B){M(O,B,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),p=l(9504),m=l(456),x=l(4725),S=l(8460),v=l(844),b=l(6114),w=l(4841),y=l(511),C=l(2585),E=" ",N=new RegExp(E,"g");let T=o.SelectionService=class extends v.Disposable{constructor(j,M,O,B,$,H,q,Y,G){super(),this._element=j,this._screenElement=M,this._linkifier=O,this._bufferService=B,this._coreService=$,this._mouseService=H,this._optionsService=q,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const O=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const $=j[0]$.replace(N," "))).join(b.isWindows?`\r +WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=l(3614),_=l(3656),d=l(3551),p=l(9042),m=l(3730),x=l(1680),S=l(3107),v=l(5744),b=l(2950),w=l(1296),y=l(428),C=l(4269),E=l(5114),N=l(8934),T=l(3230),j=l(9312),M=l(4725),O=l(6731),B=l(8055),$=l(8969),q=l(8460),U=l(844),Y=l(6114),G=l(8437),X=l(2584),te=l(7399),I=l(5941),L=l(9074),F=l(2585),W=l(5435),H=l(4567),ee=l(779);class de extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ne={}){super(ne),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new q.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new q.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new q.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new q.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new q.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new q.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new q.EventEmitter),this._onBlur=this.register(new q.EventEmitter),this._onA11yCharEmitter=this.register(new q.EventEmitter),this._onA11yTabEmitter=this.register(new q.EventEmitter),this._onWillOpen=this.register(new q.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((Q,le)=>this.refresh(Q,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((Q=>this._reportWindowsOptions(Q)))),this.register(this._inputHandler.onColor((Q=>this._handleColorEvent(Q)))),this.register((0,q.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,q.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((Q=>this._afterResize(Q.cols,Q.rows)))),this.register((0,U.toDisposable)((()=>{var Q,le;this._customKeyEventHandler=void 0,(le=(Q=this.element)==null?void 0:Q.parentNode)==null||le.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const Q of ne){let le,oe="";switch(Q.index){case 256:le="foreground",oe="10";break;case 257:le="background",oe="11";break;case 258:le="cursor",oe="12";break;default:le="ansi",oe="4;"+Q.index}switch(Q.type){case 0:const ce=B.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[Q.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${oe};${(0,I.toRgbString)(ce)}${X.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((pe=>pe.ansi[Q.index]=B.channels.toColor(...Q.color)));else{const pe=le;this._themeService.modifyColors((Se=>Se[pe]=B.channels.toColor(...Q.color)))}break;case 2:this._themeService.restoreColor(Q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ne=this.buffer.ybase+this.buffer.y,Q=this.buffer.lines.get(ne);if(!Q)return;const le=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ce=Q.getWidth(le),pe=this._renderService.dimensions.css.cell.width*ce,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,ye=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ye+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(Q=>{this.hasSelection()&&(0,u.copyHandler)(Q,this._selectionService)})));const ne=Q=>(0,u.handlePasteEvent)(Q,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,_.addDisposableDomListener)(this.element,"paste",ne)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(Q=>{Q.button===2&&(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(Q=>{(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(Q=>{Q.button===1&&(0,u.moveTextAreaUnderMouseCursor)(Q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var le;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((le=this.element)==null?void 0:le.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ne.appendChild(this.element);const Q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,Q=this.element;function le(pe){const Se=ne._mouseService.getMouseReportCoords(pe,ne.screenElement);if(!Se)return!1;let ye,qe;switch(pe.overrideType||pe.type){case"mousemove":qe=32,pe.buttons===void 0?(ye=3,pe.button!==void 0&&(ye=pe.button<3?pe.button:3)):ye=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":qe=0,ye=pe.button<3?pe.button:3;break;case"mousedown":qe=1,ye=pe.button<3?pe.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(pe)===!1||ne.viewport.getLinesScrolled(pe)===0)return!1;qe=pe.deltaY<0?0:1,ye=4;break;default:return!1}return!(qe===void 0||ye===void 0||ye>4)&&ne.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:ye,action:qe,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:pe=>(le(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(le(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&le(pe)},mousemove:pe=>{pe.buttons||le(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?oe.mousemove||(Q.addEventListener("mousemove",ce.mousemove),oe.mousemove=ce.mousemove):(Q.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(Q.addEventListener("wheel",ce.wheel,{passive:!1}),oe.wheel=ce.wheel):(Q.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(Q,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return le(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,_.addDisposableDomListener)(Q,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(pe);if(Se===0)return;const ye=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let qe="";for(let Ie=0;Ie{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(Q,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(ne,Q){var le;(le=this._renderService)==null||le.refreshRows(ne,Q)}updateCursorStyle(ne){var Q;(Q=this._selectionService)!=null&&Q.shouldColumnSelect(ne)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ne,Q,le=0){var oe;le===1?(super.scrollLines(ne,Q,le),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(ne)}paste(ne){(0,u.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const Q=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),Q}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,Q,le){this._selectionService.setSelection(ne,Q,le)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,Q){var le;(le=this._selectionService)==null||le.selectLines(ne,Q)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const Q=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!Q&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;Q||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,te.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),le.type===3||le.type===2){const oe=this.rows-1;return this.scrollLines(le.type===2?-oe:oe),this.cancel(ne,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(le.cancel&&this.cancel(ne,!0),!le.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==X.C0.ETX&&le.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,Q){const le=ne.isMac&&!this.options.macOptionIsMeta&&Q.altKey&&!Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.altKey&&Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.getModifierState("AltGraph");return Q.type==="keypress"?le:le&&(!Q.keyCode||Q.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(Q){return Q.keyCode===16||Q.keyCode===17||Q.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let Q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)Q=ne.charCode;else if(ne.which===null||ne.which===void 0)Q=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;Q=ne.which}return!(!Q||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(Q=String.fromCharCode(Q),this._onKey.fire({key:Q,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(Q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const Q=ne.data;return this.coreService.triggerDataEvent(Q,!0),this.cancel(ne),!0}return!1}resize(ne,Q){ne!==this.cols||Q!==this.rows?super.resize(ne,Q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,Q){var le,oe;(le=this._charSizeService)==null||le.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var ne;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Q=1;Q{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,u=1e3){this._renderCallback=l,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=d-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u)}}},1680:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),p=l(4725),m=l(8460),x=l(844),S=l(2585);let v=o.Viewport=class extends x.Disposable{constructor(b,w,y,C,E,N,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=E,this._renderService=N,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=$),C=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let w=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(b,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const w=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(b,w))}};o.Viewport=v=u([_(2,S.IBufferService),_(3,S.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],v)},3107:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),p=l(844),m=l(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(S,v,b,w,y){super(),this._screenElement=S,this._bufferService=v,this._coreBrowserService=b,this._decorationService=w,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),v.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=S.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(S,v),v}_refreshStyle(S){const v=S.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let b=this._decorationElements.get(S);b||(b=this._createElement(S),S.element=b,this._decorationElements.set(S,b),this._container.appendChild(b),S.onDispose((()=>{this._decorationElements.delete(S),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(b)}}_refreshXPosition(S,v=S.element){if(!v)return;const b=S.options.x??0;(S.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var v;(v=this._decorationElements.get(S))==null||v.remove(),this._decorationElements.delete(S),S.dispose()}};o.BufferDecorationRenderer=x=u([_(1,m.IBufferService),_(2,d.ICoreBrowserService),_(3,m.IDecorationService),_(4,d.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const u of this._zones)if(u.color===l.options.overviewRulerOptions.color&&u.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,l.marker.line))return;if(this._lineAdjacentToZone(u,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(u,l.marker.line)}if(this._zonePoolIndex=l.startBufferLine&&u<=l.endBufferLine}_lineAdjacentToZone(l,u,_){return u>=l.startBufferLine-this._linePadding[_||"full"]&&u<=l.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(l,u){l.startBufferLine=Math.min(l.startBufferLine,u),l.endBufferLine=Math.max(l.endBufferLine,u)}}},5744:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),p=l(4725),m=l(844),x=l(2585),S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let w=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,E,N,T,j,M){var B;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=E,this._decorationService=N,this._renderService=T,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=w=u([_(2,x.IBufferService),_(3,x.IDecorationService),_(4,p.IRenderService),_(5,x.IOptionsService),_(6,p.ICoreBrowserService)],w)},2950:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),p=l(2585),m=l(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,v,b,w,y,C){this._textarea=S,this._compositionView=v,this._bufferService=b,this._optionsService=w,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(S,"");this._dataAlreadySent=b,v.length>S.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,d.IRenderService)],x)},9806:(a,o)=>{function l(u,_,d){const p=d.getBoundingClientRect(),m=u.getComputedStyle(d),x=parseInt(m.getPropertyValue("padding-left")),S=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-x,_.clientY-p.top-S]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(u,_,d,p,m,x,S,v,b){if(!x)return;const w=l(u,_,d);return w?(w[0]=Math.ceil((w[0]+(b?S/2:0))/S),w[1]=Math.ceil(w[1]/v),w[0]=Math.min(Math.max(w[0],1),p+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),m),w):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=l(2584);function _(v,b,w,y){const C=v-d(v,w),E=b-d(b,w),N=Math.abs(C-E)-(function(T,j,M){let O=0;const B=T-d(T,M),$=j-d(j,M);for(let q=0;q=0&&vb?"A":"B"}function m(v,b,w,y,C,E){let N=v,T=b,j="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>E.cols-1?(j+=E.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(j+=E.buffer.translateBufferLineToString(T,!1,0,v+1),N=E.cols-1,v=N,T--);return j+E.buffer.translateBufferLineToString(T,!1,v,N)}function x(v,b){const w=b?"O":"[";return u.C0.ESC+w+v}function S(v,b){v=Math.floor(v);let w="";for(let y=0;y0?B-d(B,$):M;const Y=B,G=(function(X,te,I,L,F,W){let H;return H=_(I,L,F,W).length>0?L-d(L,F):te,X=I&&Hv?"D":"C",S(Math.abs(C-v),x(N,y));N=E>b?"D":"C";const T=Math.abs(E-b);return S((function(j,M){return M.cols-j})(E>b?v:C,w)+(T-1)*w.cols+1+((E>b?C:v)-1),x(N,y))}},1296:function(a,o,l){var u=this&&this.__decorate||function(q,U,Y,G){var X,te=arguments.length,I=te<3?U:G===null?G=Object.getOwnPropertyDescriptor(U,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(q,U,Y,G);else for(var L=q.length-1;L>=0;L--)(X=q[L])&&(I=(te<3?X(I):te>3?X(U,Y,I):X(U,Y))||I);return te>3&&I&&Object.defineProperty(U,Y,I),I},_=this&&this.__param||function(q,U){return function(Y,G){U(Y,G,q)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),p=l(2550),m=l(2223),x=l(6171),S=l(6052),v=l(4725),b=l(8055),w=l(8460),y=l(844),C=l(2585),E="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",j="xterm-bg-",M="xterm-focus",O="xterm-selection";let B=1,$=o.DomRenderer=class extends y.Disposable{constructor(q,U,Y,G,X,te,I,L,F,W,H,ee,de){super(),this._terminal=q,this._document=U,this._element=Y,this._screenElement=G,this._viewportElement=X,this._helperContainer=te,this._linkifier2=I,this._charSizeService=F,this._optionsService=W,this._bufferService=H,this._coreBrowserService=ee,this._themeService=de,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((re=>this._injectCss(re)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((re=>this._handleLinkHover(re)))),this.register(this._linkifier2.onHideLinkUnderline((re=>this._handleLinkLeave(re)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const q=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*q,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*q),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/q),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/q),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(q){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${N} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(q.foreground,.5).css};}`,U+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;U+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${G} { 50% { box-shadow: none; }}`,U+=`@keyframes ${X} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,U+=`${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[te,I]of q.ansi.entries())U+=`${this._terminalSelector} .${T}${te} { color: ${I.css}; }${this._terminalSelector} .${T}${te}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${j}${te} { background-color: ${I.css}; }`;U+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(q.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${j}${m.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const q=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${q}px`,this._rowFactory.defaultSpacing=q}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(q,U){for(let Y=this._rowElements.length;Y<=U;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,U){this._refreshRowElements(q,U),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(q,U,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,U,Y),this.renderRows(0,this._bufferService.rows-1),!q||!U)return;this._selectionRenderModel.update(this._terminal,q,U,Y);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(Y){const F=q[0]>U[0];L.appendChild(this._createSelectionElement(te,F?U[0]:q[0],F?q[0]:U[0],I-te+1))}else{const F=G===te?q[0]:0,W=te===X?U[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(te,F,W));const H=I-te-1;if(L.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,H)),te!==I){const ee=X===I?U[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,ee))}}this._selectionContainer.appendChild(L)}_createSelectionElement(q,U,Y,G=1){const X=this._document.createElement("div"),te=U*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(Y-U);return te+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-te),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=q*this.dimensions.css.cell.height+"px",X.style.left=`${te}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const q of this._rowElements)q.replaceChildren()}renderRows(q,U){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=q;F<=U;F++){const W=F+Y.ydisp,H=this._rowElements[F],ee=Y.lines.get(W);if(!H||!ee)break;H.replaceChildren(...this._rowFactory.createRow(ee,W,W===G,I,L,X,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!0)}_handleLinkLeave(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!1)}_setCellUnderline(q,U,Y,G,X,te){Y<0&&(q=0),G<0&&(U=0);const I=this._bufferService.rows-1;Y=Math.max(Math.min(Y,I),0),G=Math.max(Math.min(G,I),0),X=Math.min(X,this._bufferService.cols);const L=this._bufferService.buffer,F=L.ybase+L.y,W=Math.min(L.x,X-1),H=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=Y;re<=G;++re){const ne=re+L.ydisp,Q=this._rowElements[re],le=L.lines.get(ne);if(!Q||!le)break;Q.replaceChildren(...this._rowFactory.createRow(le,ne,ne===F,ee,de,W,H,this.dimensions.css.cell.width,this._widthCache,te?re===Y?q:0:-1,te?(re===G?U:X)-1:-1))}}};o.DomRenderer=$=u([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],$)},3787:function(a,o,l){var u=this&&this.__decorate||function(N,T,j,M){var O,B=arguments.length,$=B<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,T,j,M);else for(var q=N.length-1;q>=0;q--)(O=N[q])&&($=(B<3?O($):B>3?O(T,j,$):O(T,j))||$);return B>3&&$&&Object.defineProperty(T,j,$),$},_=this&&this.__param||function(N,T){return function(j,M){T(j,M,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),p=l(643),m=l(511),x=l(2585),S=l(8055),v=l(4725),b=l(4269),w=l(6171),y=l(3734);let C=o.DomRendererRowFactory=class{constructor(N,T,j,M,O,B,$){this._document=N,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=M,this._coreService=O,this._decorationService=B,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,j){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=j}createRow(N,T,j,M,O,B,$,q,U,Y,G){const X=[],te=this._characterJoinerService.getJoinedCharacters(T),I=this._themeService.colors;let L,F=N.getNoBgTrimmedLength();j&&F0&&Se===te[0][0]){qe=!0;const We=te.shift();Te=new b.JoinedCellData(this._workCell,N.translateToString(!0,We[0],We[1]),We[1]-We[0]),Ie=We[1]-1,ye=Te.getWidth()}const vt=this._isCellInSelection(Se,T),Dt=j&&Se===B,Ut=pe&&Se>=Y&&Se<=G;let Ft=!1;this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{Ft=!0}));let mt=Te.getChars()||p.WHITESPACE_CELL_CHAR;if(mt===" "&&(Te.isUnderline()||Te.isOverline())&&(mt=" "),oe=ye*q-U.get(mt,Te.isBold(),Te.isItalic()),L){if(W&&(vt&&le||!vt&&!le&&Te.bg===ee)&&(vt&&le&&I.selectionForeground||Te.fg===de)&&Te.extended.ext===re&&Ut===ne&&oe===Q&&!Dt&&!qe&&!Ft){Te.isInvisible()?H+=p.WHITESPACE_CELL_CHAR:H+=mt,W++;continue}W&&(L.textContent=H),L=this._document.createElement("span"),W=0,H=""}else L=this._document.createElement("span");if(ee=Te.bg,de=Te.fg,re=Te.extended.ext,ne=Ut,Q=oe,le=vt,qe&&B>=Se&&B<=Ie&&(B=Se),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ce.push("xterm-cursor-blink"),ce.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(Te.isBold()&&ce.push("xterm-bold"),Te.isItalic()&&ce.push("xterm-italic"),Te.isDim()&&ce.push("xterm-dim"),H=Te.isInvisible()?p.WHITESPACE_CELL_CHAR:Te.getChars()||p.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(ce.push(`xterm-underline-${Te.extended.underlineStyle}`),H===" "&&(H=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let We=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&We<8&&(We+=8),L.style.textDecorationColor=I.ansi[We].css}Te.isOverline()&&(ce.push("xterm-overline"),H===" "&&(H=" ")),Te.isStrikethrough()&&ce.push("xterm-strikethrough"),Ut&&(L.style.textDecoration="underline");let rt=Te.getFgColor(),ut=Te.getFgColorMode(),Ct=Te.getBgColor(),we=Te.getBgColorMode();const Re=!!Te.isInverse();if(Re){const We=rt;rt=Ct,Ct=We;const Gt=ut;ut=we,we=Gt}let Ze,_t,wt,Zt=!1;switch(this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{We.options.layer!=="top"&&Zt||(We.backgroundColorRGB&&(we=50331648,Ct=We.backgroundColorRGB.rgba>>8&16777215,Ze=We.backgroundColorRGB),We.foregroundColorRGB&&(ut=50331648,rt=We.foregroundColorRGB.rgba>>8&16777215,_t=We.foregroundColorRGB),Zt=We.options.layer==="top")})),!Zt&&vt&&(Ze=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ct=Ze.rgba>>8&16777215,we=50331648,Zt=!0,I.selectionForeground&&(ut=50331648,rt=I.selectionForeground.rgba>>8&16777215,_t=I.selectionForeground)),Zt&&ce.push("xterm-decoration-top"),we){case 16777216:case 33554432:wt=I.ansi[Ct],ce.push(`xterm-bg-${Ct}`);break;case 50331648:wt=S.channels.toColor(Ct>>16,Ct>>8&255,255&Ct),this._addStyle(L,`background-color:#${E((Ct>>>0).toString(16),"0",6)}`);break;default:Re?(wt=I.foreground,ce.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):wt=I.background}switch(Ze||Te.isDim()&&(Ze=S.color.multiplyOpacity(wt,.5)),ut){case 16777216:case 33554432:Te.isBold()&&rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(rt+=8),this._applyMinimumContrast(L,wt,I.ansi[rt],Te,Ze,void 0)||ce.push(`xterm-fg-${rt}`);break;case 50331648:const We=S.channels.toColor(rt>>16&255,rt>>8&255,255&rt);this._applyMinimumContrast(L,wt,We,Te,Ze,_t)||this._addStyle(L,`color:#${E(rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,wt,I.foreground,Te,Ze,_t)||Re&&ce.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ce.length&&(L.className=ce.join(" "),ce.length=0),Dt||qe||Ft?L.textContent=H:W++,oe!==this.defaultSpacing&&(L.style.letterSpacing=`${oe}px`),X.push(L),Se=Ie}return L&&W&&(L.textContent=H),X}_applyMinimumContrast(N,T,j,M,O,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let q;if(O||B||(q=$.getColor(T.rgba,j.rgba)),q===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);q=S.color.ensureContrastRatio(O||T,B||j,U),$.setColor((O||T).rgba,(B||j).rgba,q??null)}return!!q&&(this._addStyle(N,`color:${q.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?N>=j[0]&&T>=j[1]&&N=j[1]&&N>=M[0]&&T<=M[1]:T>j[1]&&T=j[0]&&N=j[0])}};function E(N,T,j){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=l.createElement("span");_.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=l.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,d,p,m],this._container.appendChild(_),this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(m),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,u,_,d){l===this._font&&u===this._fontSize&&_===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=u,this._weight=_,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,u,_){let d=0;if(!u&&!_&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const x=this._measure(l,0);return x>0&&(this._flat[d]=x),x}let p=l;u&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),_&&(x|=2),m=this._measure(l,x),m>0&&this._holey.set(p,m)}return m}_measure(l,u){const _=this._measureElements[u];return _.textContent=l.repeat(32),_.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(_){return 57508<=_&&_<=57558}function u(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=u,o.allowRescaling=function(_,d,p,m){return d===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!u(_)&&!l(_)&&!(function(x){return 57344<=x&&x<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return l(_)||(function(d){return 9472<=d&&d<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,d,p=0){return(_-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,d,p,m=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const x=_.buffers.active.ydisp,S=d[1]-x,v=p[1]-x,b=Math.max(S,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=S,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=d[0],this.endCol=p[0])}isCellSelected(_,d,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,u=this.selectionEnd;return!(!l||!u)&&(l[1]>u[1]||l[1]===u[1]&&l[0]>u[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),p=l(8460),m=l(844);let x=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=u([_(2,d.IOptionsService)],x);class S extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class v extends S{constructor(y,C,E){super(),this._document=y,this._parentElement=C,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),p=l(643),m=l(511),x=l(2585);class S extends d.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=S;let v=o.CharacterJoinerService=class CO{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const $=this._getJoinedRanges(E,j,T,y,N);for(let q=0;q<$.length;q++)C.push($[q])}N=B,j=T,M=this._workCell.fg,O=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const B=this._getJoinedRanges(E,j,T,y,N);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=l(844),_=l(8460),d=l(3656);class p extends u.Disposable{constructor(S,v,b){super(),this._textarea=S,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=l(844);class _ extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=_},8934:function(a,o,l){var u=this&&this.__decorate||function(x,S,v,b){var w,y=arguments.length,C=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,S,v,b);else for(var E=x.length-1;E>=0;E--)(w=x[E])&&(C=(y<3?w(C):y>3?w(S,v,C):w(S,v))||C);return y>3&&C&&Object.defineProperty(S,v,C),C},_=this&&this.__param||function(x,S){return function(v,b){S(v,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),p=l(9806);let m=o.MouseService=class{constructor(x,S){this._renderService=x,this._charSizeService=S}getCoords(x,S,v,b,w){return(0,p.getCoords)(window,x,S,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(x,S){const v=(0,p.getCoordsRelativeToElement)(window,x,S);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([_(0,d.IRenderService),_(1,d.ICharSizeService)],m)},3230:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),p=l(4725),m=l(8460),x=l(844),S=l(7226),v=l(2585);let b=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,E,N,T,j,M){super(),this._rowCount=w,this._charSizeService=E,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((O,B)=>this._renderRows(O,B)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((O=>this._registerIntersectionObserver(O,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,x.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var E;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(E=this._renderer.value)==null||E.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};o.RenderService=b=u([_(2,v.IOptionsService),_(3,p.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],b)},9312:function(a,o,l){var u=this&&this.__decorate||function(j,M,O,B){var $,q=arguments.length,U=q<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,O):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(j,M,O,B);else for(var Y=j.length-1;Y>=0;Y--)($=j[Y])&&(U=(q<3?$(U):q>3?$(M,O,U):$(M,O))||U);return q>3&&U&&Object.defineProperty(M,O,U),U},_=this&&this.__param||function(j,M){return function(O,B){M(O,B,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),p=l(9504),m=l(456),x=l(4725),S=l(8460),v=l(844),b=l(6114),w=l(4841),y=l(511),C=l(2585),E=" ",N=new RegExp(E,"g");let T=o.SelectionService=class extends v.Disposable{constructor(j,M,O,B,$,q,U,Y,G){super(),this._element=j,this._screenElement=M,this._linkifier=O,this._bufferService=B,this._coreService=$,this._mouseService=q,this._optionsService=U,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const O=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const $=j[0]$.replace(N," "))).join(b.isWindows?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(j){const M=this._getMouseBufferCoords(j),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(j,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([j,M],O,B)}_areCoordsInSelection(j,M,O){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,H;const O=(H=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:H.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(j);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);O?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,O)}_fireOnSelectionChange(j,M,O){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let O=M;for(let B=0;M>=B;B++){const $=j.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(j,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,O=!0,B=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,H=$.lines.get(j[1]);if(!H)return;const q=$.translateBufferLineToString(j[1],!1);let Y=this._convertViewportColToCharacterIndex(H,j[0]),G=Y;const X=j[0]-Y;let ee=0,I=0,L=0,P=0;if(q.charAt(Y)===" "){for(;Y>0&&q.charAt(Y-1)===" ";)Y--;for(;G1&&(P+=re-1,G+=re-1);te>0&&Y>0&&!this._isCharWordSeparator(H.loadCell(te-1,this._workCell));){H.loadCell(te-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,te--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,te--}for(;de1&&(P+=ne-1,G+=ne-1),G++,de++}}G++;let W=Y+X-ee+L,U=Math.min(this._bufferService.cols,G-Y+ee+I-L-P);if(M||q.slice(Y,G).trim()!==""){if(O&&W===0&&H.getCodePoint(0)!==32){const te=$.lines.get(j[1]-1);if(te&&H.isWrapped&&te.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(de){const re=this._bufferService.cols-de.start;W-=re,U+=re}}}if(B&&W+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const te=$.lines.get(j[1]+1);if(te!=null&&te.isWrapped&&te.getCodePoint(0)!==32){const de=this._getWordAt([0,j[1]+1],!1,!1,!0);de&&(U+=de.length)}}return{start:W,length:U}}}_selectWordAt(j,M){const O=this._getWordAt(j,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[O.start,j[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let O=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,j,M,O){var B,$=arguments.length,H=$<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(T,j,M,O);else for(var q=T.length-1;q>=0;q--)(B=T[q])&&(H=($<3?B(H):$>3?B(j,M,H):B(j,M))||H);return $>3&&H&&Object.defineProperty(j,M,H),H},_=this&&this.__param||function(T,j){return function(M,O){j(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=j[M/36%6|0],B=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((j-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const j=v.ensureContrastRatio(E.rgba,N.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const j=E/255,M=N/255,O=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y0||H>0||q>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),q-=Math.max(0,Math.ceil(.1*q)),Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));return($<<24|H<<16|q<<8|255)>>>0}function E(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,H=N>>8&255;return l=B+Math.round((j-B)*d),u=$+Math.round((M-$)*d),_=H+Math.round((O-H)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,j){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(qw(M,S.relativeLuminance(Y>>8))?H:Y}return H}const B=E(N,T,j),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(H>>8))?B:H}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,H)=>this._inputHandler.parse($,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,H){this._bufferService.scrollLines(B,$,H)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(ee,I,L,P){var W,U=arguments.length,te=U<3?I:P===null?P=Object.getOwnPropertyDescriptor(I,L):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(ee,I,L,P);else for(var de=ee.length-1;de>=0;de--)(W=ee[de])&&(te=(U<3?W(te):U>3?W(I,L,te):W(I,L))||te);return U>3&&te&&Object.defineProperty(I,L,te),te},_=this&&this.__param||function(ee,I){return function(L,P){I(L,P,ee)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),j=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(ee,I){if(ee>24)return I.setWinLines||!1;switch(ee){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var H;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let q=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,P,W,U,te,de,re,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=P,this._logService=W,this._optionsService=U,this._oscLinkService=te,this._coreMouseService=de,this._unicodeService=re,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:oe})})),this._parser.setDcsHandlerFallback(((Q,le,oe)=>{le==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:oe})})),this._parser.setPrintHandler(((Q,le,oe)=>this.print(Q,le,oe))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,P,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=P,this._parseStack.position=W}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let P,W=this._activeBuffer.x,U=this._activeBuffer.y,te=0;const de=this._parseStack.paused;if(de){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(P),P;W=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(te=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=te;Q0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ce=this._parser.precedingJoinState;for(let pe=L;pere){if(ne){const Ie=oe;let Te=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(Ie,Te,0,qe,!1);Te=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(oe.insertCells(this._activeBuffer.x,U-qe,this._activeBuffer.getNullCell(le)),oe.getWidth(re-1)===2&&oe.setCellFromCodepoint(re-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,U,le),U>0)for(;--U;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ce,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(P=>!$(P.params[0],this._optionsService.rawOptions.windowOptions)||L(P)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new j.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,P,W=!1,U=!1){const te=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);te.replaceCells(L,P,this._activeBuffer.getNullCell(this._eraseAttrData()),U),W&&(te.isWrapped=!1)}_resetBufferLine(I,L=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),P.isWrapped=!1)}eraseInDisplay(I,L=!1){let P;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);P=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,L);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=re;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ce=I.params[0];return pe=ce,Se=L?ce===2?4:ce===4?oe(te.modes.insertMode):ce===12?3:ce===20?oe(le.convertEol):0:ce===1?oe(P.applicationCursorKeys):ce===3?le.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ce===6?oe(P.origin):ce===7?oe(P.wraparound):ce===8?3:ce===9?oe(W==="X10"):ce===12?oe(le.cursorBlink):ce===25?oe(!te.isCursorHidden):ce===45?oe(P.reverseWraparound):ce===66?oe(P.applicationKeypad):ce===67?4:ce===1e3?oe(W==="VT200"):ce===1002?oe(W==="DRAG"):ce===1003?oe(W==="ANY"):ce===1004?oe(P.sendFocus):ce===1005?4:ce===1006?oe(U==="SGR"):ce===1015?4:ce===1016?oe(U==="SGR_PIXELS"):ce===1048?1:ce===47||ce===1047||ce===1049?oe(ne===Q):ce===2004?oe(P.bracketedPasteMode):0,te.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,P,W,U){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([P,W,U])):L===5&&(I&=-50331904,I|=33554432|255&P),I}_extractColor(I,L,P){const W=[0,0,-1,0,0,0];let U=0,te=0;do{if(W[te+U]=I.params[L+te],I.hasSubParams(L+te)){const de=I.getSubParams(L+te);let re=0;do W[1]===5&&(U=1),W[te+re+1+U]=de[re];while(++re=2||W[1]===2&&te+U>=5)break;W[1]&&(U=1)}while(++te+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let P;const W=this._curAttrData;for(let U=0;U=30&&P<=37?(W.fg&=-50331904,W.fg|=16777216|P-30):P>=40&&P<=47?(W.bg&=-50331904,W.bg|=16777216|P-40):P>=90&&P<=97?(W.fg&=-50331904,W.fg|=16777224|P-90):P>=100&&P<=107?(W.bg&=-50331904,W.bg|=16777224|P-100):P===0?this._processSGR0(W):P===1?W.fg|=134217728:P===3?W.bg|=67108864:P===4?(W.fg|=268435456,this._processUnderline(I.hasSubParams(U)?I.getSubParams(U)[0]:1,W)):P===5?W.fg|=536870912:P===7?W.fg|=67108864:P===8?W.fg|=1073741824:P===9?W.fg|=2147483648:P===2?W.bg|=134217728:P===21?this._processUnderline(2,W):P===22?(W.fg&=-134217729,W.bg&=-134217729):P===23?W.bg&=-67108865:P===24?(W.fg&=-268435457,this._processUnderline(0,W)):P===25?W.fg&=-536870913:P===27?W.fg&=-67108865:P===28?W.fg&=-1073741825:P===29?W.fg&=2147483647:P===39?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):P===49?(W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?U+=this._extractColor(I,U,W):P===53?W.bg|=1073741824:P===55?W.bg&=-1073741825:P===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):P===100?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${P}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${P}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=L%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(I){const L=I.params[0]||1;let P;return(I.length<2||(P=I.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],P=I.split(";");for(;P.length>1;){const W=P.shift(),U=P.shift();if(/^\d+$/.exec(W)){const te=parseInt(W);if(X(te))if(U==="?")L.push({type:0,index:te});else{const de=(0,M.parseColor)(U);de&&L.push({type:1,index:te,color:de})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const P=I.split(":");let W;const U=P.findIndex((te=>te.startsWith("id=")));return U!==-1&&(W=P[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const P=I.split(";");for(let W=0;W=this._specialColors.length);++W,++L)if(P[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const U=(0,M.parseColor)(P[W]);U&&this._onColor.fire([{type:1,index:this._specialColors[L],color:U}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],P=I.split(";");for(let W=0;W=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${U}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let G=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){eethis.end&&(this.end=ee)}markRangeDirty(ee,I){ee>I&&(q=ee,ee=I,I=q),eethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(ee){return 0<=ee&&ee<256}G=u([_(0,E.IBufferService)],G)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let G=$.length-1,X=$[G];X===0&&(G--,X=$[G]);let ee=M.length-H-1,I=B;for(;ee>=0;){const P=Math.min(I,X);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[ee],I-P,X-P,P,!0),X-=P,X===0&&(G--,X=$[G]),I-=P,I===0){ee--;const W=Math.max(ee,0);I=(0,m.getWrappedLineTrimmedLength)(M,W,this._cols)}}for(let P=0;P0;)this.ybase===0?this.y0){const T=[],j=[];for(let G=0;G=0;G--)if($&&$.start>O+H){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(G--,$.newLines[X]);G++,T.push({index:O+1,amount:$.newLines.length}),H+=$.newLines.length,$=E[++B]}else this.lines.set(G,j[O--]);let q=0;for(let G=T.length-1;G>=0;G--)T[G].index+=q,this.lines.onInsertEmitter.fire(T[G]),q+=T[G].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=E[3*(b+T)+j];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` -`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(j===2?E<128?b--:u[S++]=E:j===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ej)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let H=j+1;;++H){if(H>=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,j),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++j47&&E<60);j--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,j),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let H=j+1;;++H)if(H>=w||(E=b[H])===24||E===26||E===27||E>127&&E=w||(E=b[H])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r -`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(R2)),R2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function ob(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function C1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let cv=null,C0=0;const N6=()=>cv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void lb.retry()}})})}let E1=TO();function F0t(){C0++,cv=null,E1=TO()}const lb={flush:(e=!1)=>E1.flush(e),retry:()=>E1.retry(),queue(e,n=0){const t=cv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(cv=e,E1.queue(e,n))}};window.addEventListener("pagehide",()=>void lb.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const M2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:S1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===p6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,uv=new Map,X4=new Set,Z4=()=>{for(const e of X4)e()},U0t=e=>(X4.add(e),()=>{X4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),uv.clear(),Z4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&uv.delete(e)&&Z4()},r=>{t===Va&&(uv.set(e,r instanceof Error?r.message:String(r)),Z4())}),ip.set(e,n)}return n}function D2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=ob(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?uv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const q=j.current;if(!q)return;const Y=_z({...M.current,state:q.state,pane:q.pane},cu(Ka.get(q.projectId),q.taskKey),q.projectId,q.taskKey);D2(q.projectId,q.location,q.taskKey,Y)},[]);R.useEffect(()=>{let q=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!q||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{q&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{q=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const q=Ka.get(n);if(!q)return;if(p.current=q,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(q,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(D2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(q,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):D2(n,r),p.current=Ka.get(n)??q},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const q=Va,Y=X=>{if(q===Va){$();for(const ee of ip.values())ee.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const H=R.useCallback(()=>{var q;n&&(x?b(Y=>Y+1):(q=ip.get(n))==null||q.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:H,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),J4=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(J4);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:N4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(H){Qn(H instanceof Error?H.message:String(H),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,H])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[H,f.jsx(Gr,{value:i[$],onChange:q=>a({...i,[$]:q.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const cb=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=ob((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=ob(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return C1(e,(a==null?void 0:a.id)??null,u)}/** +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(j){const M=this._getMouseBufferCoords(j),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(j,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([j,M],O,B)}_areCoordsInSelection(j,M,O){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,q;const O=(q=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:q.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(j);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);O?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,O)}_fireOnSelectionChange(j,M,O){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let O=M;for(let B=0;M>=B;B++){const $=j.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(j,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,O=!0,B=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,q=$.lines.get(j[1]);if(!q)return;const U=$.translateBufferLineToString(j[1],!1);let Y=this._convertViewportColToCharacterIndex(q,j[0]),G=Y;const X=j[0]-Y;let te=0,I=0,L=0,F=0;if(U.charAt(Y)===" "){for(;Y>0&&U.charAt(Y-1)===" ";)Y--;for(;G1&&(F+=re-1,G+=re-1);ee>0&&Y>0&&!this._isCharWordSeparator(q.loadCell(ee-1,this._workCell));){q.loadCell(ee-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,ee--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,ee--}for(;de1&&(F+=ne-1,G+=ne-1),G++,de++}}G++;let W=Y+X-te+L,H=Math.min(this._bufferService.cols,G-Y+te+I-L-F);if(M||U.slice(Y,G).trim()!==""){if(O&&W===0&&q.getCodePoint(0)!==32){const ee=$.lines.get(j[1]-1);if(ee&&q.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(de){const re=this._bufferService.cols-de.start;W-=re,H+=re}}}if(B&&W+H===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const ee=$.lines.get(j[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const de=this._getWordAt([0,j[1]+1],!1,!1,!0);de&&(H+=de.length)}}return{start:W,length:H}}}_selectWordAt(j,M){const O=this._getWordAt(j,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[O.start,j[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let O=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,j,M,O){var B,$=arguments.length,q=$<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(T,j,M,O);else for(var U=T.length-1;U>=0;U--)(B=T[U])&&(q=($<3?B(q):$>3?B(j,M,q):B(j,M))||q);return $>3&&q&&Object.defineProperty(j,M,q),q},_=this&&this.__param||function(T,j){return function(M,O){j(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=j[M/36%6|0],B=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((j-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const j=v.ensureContrastRatio(E.rgba,N.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const j=E/255,M=N/255,O=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,q=T>>16&255,U=T>>8&255,Y=w(S.relativeLuminance2($,q,U),S.relativeLuminance2(M,O,B));for(;Y0||q>0||U>0);)$-=Math.max(0,Math.ceil(.1*$)),q-=Math.max(0,Math.ceil(.1*q)),U-=Math.max(0,Math.ceil(.1*U)),Y=w(S.relativeLuminance2($,q,U),S.relativeLuminance2(M,O,B));return($<<24|q<<16|U<<8|255)>>>0}function E(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,q=T>>16&255,U=T>>8&255,Y=w(S.relativeLuminance2($,q,U),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,q=N>>8&255;return l=B+Math.round((j-B)*d),u=$+Math.round((M-$)*d),_=q+Math.round((O-q)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,j){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(Uw(M,S.relativeLuminance(Y>>8))?q:Y}return q}const B=E(N,T,j),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(q>>8))?B:q}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,q)=>this._inputHandler.parse($,q)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,q){this._bufferService.scrollLines(B,$,q)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(te,I,L,F){var W,H=arguments.length,ee=H<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(te,I,L,F);else for(var de=te.length-1;de>=0;de--)(W=te[de])&&(ee=(H<3?W(ee):H>3?W(I,L,ee):W(I,L))||ee);return H>3&&ee&&Object.defineProperty(I,L,ee),ee},_=this&&this.__param||function(te,I){return function(L,F){I(L,F,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),j=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var q;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(o.WindowsOptionsReportType=q={}));let U=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,F,W,H,ee,de,re,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=F,this._logService=W,this._optionsService=H,this._oscLinkService=ee,this._coreMouseService=de,this._unicodeService=re,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:oe})})),this._parser.setDcsHandlerFallback(((Q,le,oe)=>{le==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:oe})})),this._parser.setPrintHandler(((Q,le,oe)=>this.print(Q,le,oe))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,F,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=W}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let F,W=this._activeBuffer.x,H=this._activeBuffer.y,ee=0;const de=this._parseStack.paused;if(de){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;W=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(ee=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=ee;Q0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ce=this._parser.precedingJoinState;for(let pe=L;pere){if(ne){const Ie=oe;let Te=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(Ie,Te,0,qe,!1);Te=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(oe.insertCells(this._activeBuffer.x,H-qe,this._activeBuffer.getNullCell(le)),oe.getWidth(re-1)===2&&oe.setCellFromCodepoint(re-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,H,le),H>0)for(;--H;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ce,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new j.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,F,W=!1,H=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);ee.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),H),W&&(ee.isWrapped=!1)}_resetBufferLine(I,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),F.isWrapped=!1)}eraseInDisplay(I,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=re;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ce=I.params[0];return pe=ce,Se=L?ce===2?4:ce===4?oe(ee.modes.insertMode):ce===12?3:ce===20?oe(le.convertEol):0:ce===1?oe(F.applicationCursorKeys):ce===3?le.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ce===6?oe(F.origin):ce===7?oe(F.wraparound):ce===8?3:ce===9?oe(W==="X10"):ce===12?oe(le.cursorBlink):ce===25?oe(!ee.isCursorHidden):ce===45?oe(F.reverseWraparound):ce===66?oe(F.applicationKeypad):ce===67?4:ce===1e3?oe(W==="VT200"):ce===1002?oe(W==="DRAG"):ce===1003?oe(W==="ANY"):ce===1004?oe(F.sendFocus):ce===1005?4:ce===1006?oe(H==="SGR"):ce===1015?4:ce===1016?oe(H==="SGR_PIXELS"):ce===1048?1:ce===47||ce===1047||ce===1049?oe(ne===Q):ce===2004?oe(F.bracketedPasteMode):0,ee.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,F,W,H){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([F,W,H])):L===5&&(I&=-50331904,I|=33554432|255&F),I}_extractColor(I,L,F){const W=[0,0,-1,0,0,0];let H=0,ee=0;do{if(W[ee+H]=I.params[L+ee],I.hasSubParams(L+ee)){const de=I.getSubParams(L+ee);let re=0;do W[1]===5&&(H=1),W[ee+re+1+H]=de[re];while(++re=2||W[1]===2&&ee+H>=5)break;W[1]&&(H=1)}while(++ee+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let F;const W=this._curAttrData;for(let H=0;H=30&&F<=37?(W.fg&=-50331904,W.fg|=16777216|F-30):F>=40&&F<=47?(W.bg&=-50331904,W.bg|=16777216|F-40):F>=90&&F<=97?(W.fg&=-50331904,W.fg|=16777224|F-90):F>=100&&F<=107?(W.bg&=-50331904,W.bg|=16777224|F-100):F===0?this._processSGR0(W):F===1?W.fg|=134217728:F===3?W.bg|=67108864:F===4?(W.fg|=268435456,this._processUnderline(I.hasSubParams(H)?I.getSubParams(H)[0]:1,W)):F===5?W.fg|=536870912:F===7?W.fg|=67108864:F===8?W.fg|=1073741824:F===9?W.fg|=2147483648:F===2?W.bg|=134217728:F===21?this._processUnderline(2,W):F===22?(W.fg&=-134217729,W.bg&=-134217729):F===23?W.bg&=-67108865:F===24?(W.fg&=-268435457,this._processUnderline(0,W)):F===25?W.fg&=-536870913:F===27?W.fg&=-67108865:F===28?W.fg&=-1073741825:F===29?W.fg&=2147483647:F===39?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?H+=this._extractColor(I,H,W):F===53?W.bg|=1073741824:F===55?W.bg&=-1073741825:F===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):F===100?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${F}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(I){const L=I.params[0]||1;let F;return(I.length<2||(F=I.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(q.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(q.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],F=I.split(";");for(;F.length>1;){const W=F.shift(),H=F.shift();if(/^\d+$/.exec(W)){const ee=parseInt(W);if(X(ee))if(H==="?")L.push({type:0,index:ee});else{const de=(0,M.parseColor)(H);de&&L.push({type:1,index:ee,color:de})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=I.split(":");let W;const H=F.findIndex((ee=>ee.startsWith("id=")));return H!==-1&&(W=F[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const F=I.split(";");for(let W=0;W=this._specialColors.length);++W,++L)if(F[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const H=(0,M.parseColor)(F[W]);H&&this._onColor.fire([{type:1,index:this._specialColors[L],color:H}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],F=I.split(";");for(let W=0;W=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${H}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let G=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(U=te,te=I,I=U),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(te){return 0<=te&&te<256}G=u([_(0,E.IBufferService)],G)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let G=$.length-1,X=$[G];X===0&&(G--,X=$[G]);let te=M.length-q-1,I=B;for(;te>=0;){const F=Math.min(I,X);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[te],I-F,X-F,F,!0),X-=F,X===0&&(G--,X=$[G]),I-=F,I===0){te--;const W=Math.max(te,0);I=(0,m.getWrappedLineTrimmedLength)(M,W,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],j=[];for(let G=0;G=0;G--)if($&&$.start>O+q){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(G--,$.newLines[X]);G++,T.push({index:O+1,amount:$.newLines.length}),q+=$.newLines.length,$=E[++B]}else this.lines.set(G,j[O--]);let U=0;for(let G=T.length-1;G>=0;G--)T[G].index+=U,this.lines.onInsertEmitter.fire(T[G]),U+=T[G].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=E[3*(b+T)+j];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` +`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(j===2?E<128?b--:u[S++]=E:j===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ej)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let q=j+1;;++q){if(q>=w||(E=b[q])<32||E>126&&E=w||(E=b[q])<32||E>126&&E=w||(E=b[q])<32||E>126&&E=w||(E=b[q])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,j),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++j47&&E<60);j--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,j),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let q=j+1;;++q)if(q>=w||(E=b[q])===24||E===26||E===27||E>127&&E=w||(E=b[q])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r +`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(R2)),R2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function ob(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function C1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let cv=null,C0=0;const N6=()=>cv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void lb.retry()}})})}let E1=TO();function F0t(){C0++,cv=null,E1=TO()}const lb={flush:(e=!1)=>E1.flush(e),retry:()=>E1.retry(),queue(e,n=0){const t=cv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(cv=e,E1.queue(e,n))}};window.addEventListener("pagehide",()=>void lb.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const M2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:S1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===p6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,uv=new Map,X4=new Set,Z4=()=>{for(const e of X4)e()},U0t=e=>(X4.add(e),()=>{X4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),uv.clear(),Z4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&uv.delete(e)&&Z4()},r=>{t===Va&&(uv.set(e,r instanceof Error?r.message:String(r)),Z4())}),ip.set(e,n)}return n}function D2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=ob(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?uv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const U=j.current;if(!U)return;const Y=_z({...M.current,state:U.state,pane:U.pane},cu(Ka.get(U.projectId),U.taskKey),U.projectId,U.taskKey);D2(U.projectId,U.location,U.taskKey,Y)},[]);R.useEffect(()=>{let U=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!U||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{U&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{U=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const U=Ka.get(n);if(!U)return;if(p.current=U,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(U,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(D2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(U,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):D2(n,r),p.current=Ka.get(n)??U},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const U=Va,Y=X=>{if(U===Va){$();for(const te of ip.values())te.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const q=R.useCallback(()=>{var U;n&&(x?b(Y=>Y+1):(U=ip.get(n))==null||U.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:q,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),J4=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(J4);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:N4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(q){Qn(q instanceof Error?q.message:String(q),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,q])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[q,f.jsx(Gr,{value:i[$],onChange:U=>a({...i,[$]:U.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const cb=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=ob((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=ob(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return C1(e,(a==null?void 0:a.id)??null,u)}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -500,7 +500,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function O2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():s6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(ub,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function t3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[ee,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,P=l!=null,W=R.useRef(0),U=(oe,ce=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([rb(oe,ce),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ce=>ce.agentReady);x(ce=>{var Se;if(ce&&oe.some(ye=>ye.id===ce))return ce;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ce=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ce===Y.current&&$(Se)).catch(()=>ce===Y.current&&$([])).finally(()=>ce===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const te=oe=>{const ce=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ce||nt.fetchQuery(G4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},de=oe=>j(ce=>ce.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ce=>ce.includes(oe)?ce.filter(pe=>pe!==oe):[...ce,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ce=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ce,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(O2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(N1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||ee)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:ee}),ee?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!P,title:S?LNe():L?m===null?z8e():ee?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(N1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>te(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>de(oe.paperId),disabled:u,children:f.jsx(Ur,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(N1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?a6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:nb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(t3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ib,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??i6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ib,{tone:e?"success":n||e===null?"danger":"warning",children:e?a6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function _b({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=g6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function I2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),ee=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,P=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?P:r==="paper"&&H&&!d?W:u,te=I2(U.trim(),200),de=ct({...B0(te),enabled:!!te&&te===U.trim()}),re=te===U.trim()?de.data??null:null,ne=te===U.trim()?((rr=de.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(te!==U.trim()||de.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ce=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(v6()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=I2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=I2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...G4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(G4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,ee.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,ee.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++ee.current;x(!0),w(null);try{const ft=await $ut();if(lt!==ee.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===ee.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===ee.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(S2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?S2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?S2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ce=="string"&&!Te&&!Dt),un=Ut??`github.com/${ce??"you"}/${Ie}`,Mn=ce===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():k2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ce===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ce===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ce===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):o6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?u6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":k4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":ev({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(_b,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":N4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:N4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},z1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,ee;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=z1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(ee=i.data)==null?void 0:ee.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:z1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?r6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var P;const L=(P=z1.find(W=>W.id===I.id))==null?void 0:P.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Gr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await rb(!0)}}}),l=z1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?r6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ab(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:sv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:nb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ce,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:sv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):O4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ce=t.find(ye=>ye.id===q))==null?void 0:ce.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),ee=WL(X,e==null?void 0:e.model),I=sv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=ee.find(ye=>ye.id===I))==null?void 0:pe.label,P=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},te=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),de=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(t3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[te(L0(),B,"models"),i.length>0&&te(G,H,"reasoning"),ee.length>0&&te(tN(),L,"speed"),t.length>0&&te(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[de(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(t3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[de(G),re(i,$,a,P)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[de(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[de(tN()),re(ee,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,ee=y.current;if(!b||!m||!X||!ee)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const P=ee.getBoundingClientRect(),W=window.innerHeight-P.bottom-12,U=P.top-12,te=Math.min(380,X.scrollHeight),de=i?W>=te||W>=U:UU;X.style.width=`${P.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,de?W:U))}px`,X.style.left=`${P.left}px`,X.style.top=`${de?P.bottom+4:P.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===rv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var ee;x(X),w(!1),(ee=v.current)==null||ee.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,ee)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:ee+1})]},X.id))]})]})]})}const Pgt=[];function n3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function dv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():T4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(n3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:C2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":C2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:C2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=iv(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Vr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=iv(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Ur,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=Y5({from:"__root__"}),t=Yv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Yv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&lb.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Vr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),fv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),hv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(fv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(fv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[fv(e,n,{sessionId:r,ref:s}).queryKey,fv(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ib,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||pb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||pb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return s3(n)})(e)||SI(e)||pb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. + */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function O2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():s6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(ub,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function t3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[q,U]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),H=(oe,ce=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([rb(oe,ce),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>H(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ce=>ce.agentReady);x(ce=>{var Se;if(ce&&oe.some(ye=>ye.id===ce))return ce;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),U(!1);return}const ce=++Y.current;U(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ce===Y.current&&$(Se)).catch(()=>ce===Y.current&&$([])).finally(()=>ce===Y.current&&U(!1))},350);return()=>clearTimeout(pe)},[M]);const ee=oe=>{const ce=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ce||nt.fetchQuery(G4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},de=oe=>j(ce=>ce.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ce=>ce.includes(oe)?ce.filter(pe=>pe!==oe):[...ce,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ce=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ce,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(O2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(N1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>H(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(N1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),q?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>ee(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>de(oe.paperId),disabled:u,children:f.jsx(Ur,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(N1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?a6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:nb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(t3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ib,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??i6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ib,{tone:e?"success":n||e===null?"danger":"warning",children:e?a6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function _b({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=g6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function I2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[q,U]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(q==null?void 0:q.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(q==null?void 0:q.title)||(q==null?void 0:q.paperId)||"")}`,H=r==="blank"&&!d?F:r==="paper"&&q&&!d?W:u,ee=I2(H.trim(),200),de=ct({...B0(ee),enabled:!!ee&&ee===H.trim()}),re=ee===H.trim()?de.data??null:null,ne=ee===H.trim()?((rr=de.error)==null?void 0:rr.message)??null:null,Q=!!H.trim()&&(ee!==H.trim()||de.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ce=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(v6()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=I2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=I2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!q&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...G4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!q&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(U(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(G4(lt));if(ft!==X.current)return;U(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,U(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(H.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(S2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:H.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&q?{paperId:q.paperId,cloneUrl:q.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&q&&!q.repoUrl?q.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!H.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!H.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(q!=null&&q.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!q&&!(q!=null&&q.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!H.trim()||Zn||Rn||Rr,fn=d&&!H.trim()||Zn||Xn,Cn=d&&!H.trim()?lN():Zn?S2():Xn?sN():null,tn=d&&!H.trim()?lN():Zn?S2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&H.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!q)&&(!E||typeof ce=="string"&&!Te&&!Dt),un=Ut??`github.com/${ce??"you"}/${Ie}`,Mn=ce===void 0||Te||Dt,on=r==="paper"&&!q&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!q&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),q&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:q.title||q.paperId}),q.repoUrl&&f.jsx("div",{className:"id",children:Rgt(q.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!q.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||q)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:q!=null&&q.repoUrl?MSe():k2()}),f.jsx("input",{className:"text-sm font-normal",value:H,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{className:"text-sm font-normal",value:H,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&H&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||q)&&H&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ce===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ce===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ce===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?q!=null&&q.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):o6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?u6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":k4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":ev({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(_b,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":N4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:N4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},z1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=z1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(H=>H.id==="opencode"))!=null&&W.models.some(H=>H.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,q=(I={})=>T({models:[],model:null,error:null,...I}),U=async()=>{q();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():U()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:z1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?r6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=z1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Gr,{value:b,disabled:$,onChange:I=>{q({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>q({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await rb(!0)}}}),l=z1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?r6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ab(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:sv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:nb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ce,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:sv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):O4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),q=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,U=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ce=t.find(ye=>ye.id===U))==null?void 0:ce.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=sv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},H=ye=>{e&&n({...e,serviceTier:ye}),T()},ee=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),de=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${q?` · ${q}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(t3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,q&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:q})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[ee(L0(),B,"models"),i.length>0&&ee(G,q,"reasoning"),te.length>0&&ee(tN(),L,"speed"),t.length>0&&ee(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[de(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(t3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[de(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[de(eN()),re(t,U,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[de(tN()),re(te,I??void 0,"default",H)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,H=F.top-12,ee=Math.min(380,X.scrollHeight),de=i?W>=ee||W>=H:HH;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,de?W:H))}px`,X.style.left=`${F.left}px`,X.style.top=`${de?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===rv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),q=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",U=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??q:q})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>U(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>U(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function n3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function dv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():T4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(n3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:C2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":C2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:C2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=iv(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Vr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=iv(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Ur,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=Y5({from:"__root__"}),t=Yv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Yv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&lb.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Vr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),fv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),hv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(fv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(fv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[fv(e,n,{sessionId:r,ref:s}).queryKey,fv(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ib,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||pb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||pb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return s3(n)})(e)||SI(e)||pb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pb(e,n){if(e){if(typeof e=="string")return s3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s3(e,n):void 0}}function s3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,i=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var Pg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rm(e,n){return e(n={exports:{}},n.exports),n.exports}var Ui=rm((function(e){/*! @@ -508,10 +508,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),H={content:v.slice(1)};switch($){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=u,u++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=l,l++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=l,H.newLineNumber=u,l++,u++;break;case"\\":var q=o.changes[o.changes.length-1];q.isDelete||(a.newEndingNewLine=!1),q.isInsert||(a.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function i3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` +`),x=m.length,S=0;S-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),q={content:v.slice(1)};switch($){case"+":q.type="insert",q.isInsert=!0,q.lineNumber=u,u++;break;case"-":q.type="delete",q.isDelete=!0,q.lineNumber=l,l++;break;case" ":q.type="normal",q.isNormal=!0,q.oldLineNumber=l,q.newLineNumber=u,l++,u++;break;case"\\":var U=o.changes[o.changes.length-1];U.isDelete||(a.newEndingNewLine=!1),U.isInsert||(a.oldEndingNewLine=!1)}q.type&&o.changes.push(q)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function i3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` `),i=r.indexOf(` `,s+1),a=r.slice(0,s),o=r.slice(s+1,i),l=a.split(" ").slice(1,-3).join(" "),u=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(l," b/").concat(u),"index 1111111..2222222 100644","--- a/".concat(l),"+++ b/".concat(u),r.slice(i+1)].join(` -`)})(e.trimStart());return c1t.parse(t).map((function(r){return(function(s,i){var a=s.hunks.map((function(o){return u1t(o,i)}));return Hn(Hn({},s),{},{hunks:a})})(r,n)}))}function d1t(e){return e[0]}function f1t(e){return e[e.length-1]}function a3(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function up(e){return e==="old"?function(n){return ku(n)?-1:Hl(n)?n.oldLineNumber:n.lineNumber}:function(n){return Ki(n)?-1:Hl(n)?n.newLineNumber:n.lineNumber}}function EI(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=mb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&yb(e),s=!t&&!r&&_v(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},xb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return xb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?Eb(e):Nb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function pv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=pv(t,s.onMouseEnter),s.onMouseLeave=pv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),H=S(s),q=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:H,className:Ui("diff-line",q),children:[!m&&Gz(Y,s,C,"old",x,H,B,T,b),!m&&Gz(Y,s,C,"new",x,H,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?Eb(p):Nb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=pv(s,a.onMouseEnter),a.onMouseLeave=pv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function P2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),r3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),r3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),H={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},q=Hn(Hn({},H),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},H),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:P2(t?q:Y)});var G=(function(X,ee){return X&&!ee?"diff-line-old-only":!X&&ee?"diff-line-new-only":X===ee?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[P2(q),P2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=mb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&yb(e),s=!t&&!r&&_v(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},xb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return xb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?Eb(e):Nb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function pv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=pv(t,s.onMouseEnter),s.onMouseLeave=pv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),q=S(s),U=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:q,className:Ui("diff-line",U),children:[!m&&Gz(Y,s,C,"old",x,q,B,T,b),!m&&Gz(Y,s,C,"new",x,q,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?Eb(p):Nb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=pv(s,a.onMouseEnter),a.onMouseLeave=pv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function P2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),r3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),r3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),q={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},U=Hn(Hn({},q),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},q),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:P2(t?U:Y)});var G=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[P2(U),P2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}jb.displayName="cpp";jb.aliases=[];function jb(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(jb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,U){return"(?:"+P[+U]+")"})}function r(L,P,W){return RegExp(t(L,P),"")}function s(L,P){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var q=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,q]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),ee=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,q]);function I(L,P){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[P,q]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[ee]),lookbehind:!0,greedy:!0,inside:I(ee,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`:"")+_.content]}),["",""]),t=kn(n,2),r=kn(eB(t[0],t[1]),2),s=r[0],i=r[1];if(s.length===0&&i.length===0)return[[],[]];var a=function(u){if(u&&!Hl(u))return u.lineNumber},o=a(e.find(Ki)),l=a(e.find(ku));if(o===void 0||l===void 0)throw new Error("Could not find start line number for edit");return[tj(ej(s),o),tj(ej(i),l)]}function uyt(e){var n=e.reduce((function(r,s){var i=kn(r,3),a=i[0],o=i[1],l=i[2];if(!l||!Ki(l)||!ku(s))return[a,o,s];var u=kn(eB(l.content,s.content),2),_=u[0],d=u[1];return[a.concat(f3(_,l.lineNumber)),o.concat(f3(d,s.lineNumber)),s]}),[[],[],null]),t=kn(n,2);return[t[0],t[1]]}function dyt(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}jb.displayName="cpp";jb.aliases=[];function jb(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(jb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,H){return"(?:"+F[+H]+")"})}function r(L,F,W){return RegExp(t(L,F),"")}function s(L,F){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,q=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,q]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var U=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,U]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,U]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,U]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}aS.displayName="go";aS.aliases=[];function aS(e){e.register(Go),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ab.displayName="markup-templating";Ab.aliases=[];function Ab(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Ab),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Tb),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Rb.displayName="basic";Rb.aliases=[];function Rb(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Rb),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),h3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const _3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:h3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),F2=Object.keys(_3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Mb=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const H=e.charCodeAt(C);H===88||H===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const H=e.charCodeAt(C);if(!M(H))break;j+=String.fromCharCode(H),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const H=E==="named"?pp(j):!1;H&&(N=j,T=H)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const H=N?1:3;if(t.attribute){const q=e.charCodeAt(C);q===61?(S(H,B),T=""):uj(q)?T="":S(H,B)}else S(H,B)}$=T}else{O||S(2,B);let H=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(H))S(7,B),$="�";else if(H in cj)S(6,B),$=cj[H];else{let q="";Oyt(H)&&S(6,B),H>65535&&(H-=65536,q+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),$=q+String.fromCharCode(H)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const H=x();H.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:H},e.slice(w-1,C)),p=H}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return A1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var H=v.prev;O&&(H=A1(n,H,O),b+=O.length),$yt(n,H,y);var q=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=A1(n,H,q),B&&A1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function A1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Db(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function b3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:i3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:i3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Db(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:b3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${v3} ${n}`:v3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Db(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:b3(m.file),children:b3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${v3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():A4(),w=[{id:"files",label:C4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:fb,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":E2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:E2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),C4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ib,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":E2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({...hv(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Db).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??c6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const H2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},mv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,mv),i&&r.addEventListener("scrollend",_,mv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!H2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,mv),i.addEventListener("touchend",o,mv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let H=1;Hthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const q2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),q2(()=>u._didMount(),[]),q2(()=>(a(u),u._willUpdate())),q2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function y3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ab.displayName="markup-templating";Ab.aliases=[];function Ab(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Ab),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Tb),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Rb.displayName="basic";Rb.aliases=[];function Rb(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Rb),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),h3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const _3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:h3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),F2=Object.keys(_3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Mb=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const q=e.charCodeAt(C);q===88||q===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const q=e.charCodeAt(C);if(!M(q))break;j+=String.fromCharCode(q),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const q=E==="named"?pp(j):!1;q&&(N=j,T=q)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const q=N?1:3;if(t.attribute){const U=e.charCodeAt(C);U===61?(S(q,B),T=""):uj(U)?T="":S(q,B)}else S(q,B)}$=T}else{O||S(2,B);let q=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(q))S(7,B),$="�";else if(q in cj)S(6,B),$=cj[q];else{let U="";Oyt(q)&&S(6,B),q>65535&&(q-=65536,U+=String.fromCharCode(q>>>10|55296),q=56320|q&1023),$=U+String.fromCharCode(q)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const q=x();q.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:q},e.slice(w-1,C)),p=q}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return A1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var q=v.prev;O&&(q=A1(n,q,O),b+=O.length),$yt(n,q,y);var U=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=A1(n,q,U),B&&A1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function A1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Db(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function b3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:i3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:i3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Db(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:b3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${v3} ${n}`:v3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Db(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:b3(m.file),children:b3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${v3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():A4(),w=[{id:"files",label:C4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:fb,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":E2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:E2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),C4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ib,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":E2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({...hv(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Db).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??c6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const H2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},mv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,mv),i&&r.addEventListener("scrollend",_,mv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!H2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,mv),i.addEventListener("touchend",o,mv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let q=1;qthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const q2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),q2(()=>u._didMount(),[]),q2(()=>(a(u),u._willUpdate())),q2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function y3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Mxt(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=RS(e);if(t.length===1)return t[0]}return e}function Dxt(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function Vh(e){return Dxt(typeof e=="string"?RS(e):e)}function Lxt(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function Oxt(e,n){const t=Vh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function Ixt(e){var l;const n=Vh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u @@ -686,9 +686,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:` `}),t}function wj(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Sj(e,n){const t=B2t(e,n),r=t.one(e,void 0),s=j2t(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` `},s),i}function yv(e,n){return e&&"run"in e?async function(t,r){const s=Sj(t,{file:r,...n});await e.run(s,r)}:function(t,r){return Sj(t,{file:r,...e||n})}}function kj(e){if(e)throw e}var G2,Cj;function q2t(){if(Cj)return G2;Cj=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},i=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var _=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!_&&!d)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return G2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ej(e.position):"start"in e||"end"in e?Ej(e):"line"in e||"column"in e?C3(e):""}function C3(e){return Nj(e&&e.line)+":"+Nj(e&&e.column)}function Ej(e){return C3(e&&e.start)+"-"+C3(e&&e.end)}function Nj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:V2t,dirname:K2t,extname:Q2t,join:Y2t,sep:"/"};function V2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function K2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Q2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Y2t(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Z2t(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J2t={cwd:ewt};function ewt(){return"/"}function E3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function twt(e){if(typeof e=="string")e=new URL(e);else if(!E3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nwt(e)}function nwt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];k3(S)&&k3(m)&&(m=W2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function Y2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function X2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Z2(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jj(e){if(!k3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return awt(e)?e:new IB(e)}function awt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function owt(e){return typeof e=="string"||lwt(e)}function lwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Aj=Object.prototype.hasOwnProperty;function Rj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Rj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Rj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Aj.call(e,t)&&++r&&!Aj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const cwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uwt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dwt={};function Mj(e,n){return(dwt.jsx?uwt:cwt).test(e)}const fwt=/[ \t\n\f\r]/g;function hwt(e){return typeof e=="object"?e.type==="text"?Dj(e.value):!1:Dj(e)}function Dj(e){return e.replace(fwt,"")===""}var Gf={},J2,Lj;function _wt(){if(Lj)return J2;Lj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` -`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(q){var Y=q.match(n);Y&&(w+=Y.length);var G=q.lastIndexOf(l);y=~G?q.length-G:y+q.length}function E(){var q={line:w,column:y};return function(Y){return Y.position=new N(q),M(),Y}}function N(q){this.start=q,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(q){var Y=new Error(b.source+":"+w+":"+y+": "+q);if(Y.reason=q,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(q){var Y=q.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(q){var Y;for(q=q||[];Y=B();)Y!==!1&&q.push(Y);return q}function B(){var q=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,q({type:p,comment:G})}}function $(){var q=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=q({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function H(){var q=[];O(q);for(var Y;Y=$();)Y!==!1&&(q.push(Y),O(q));return q}return M(),H()}function S(v){return v?v.replace(o,d):d}return J2=x,J2}var Oj;function pwt(){if(Oj)return Gf;Oj=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(_wt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Mb:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Lb(e))return 2}function Bb(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,Bb(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),H(Y)):j(Y)}function H(Y){return Y===o?(M++,N.consume(Y),H):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,q,"whitespace")(Y):q(Y)):j(Y)}function q(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const ew={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||gv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(U){return _(U)}function _(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),p):U===47?(e.consume(U),i=!0,S):U===63?(e.consume(U),s=3,r.interrupt?n:L):ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function p(U){return U===45?(e.consume(U),s=2,m):U===91?(e.consume(U),s=5,o=0,x):ai(U)?(e.consume(U),s=4,r.interrupt?n:L):t(U)}function m(U){return U===45?(e.consume(U),r.interrupt?n:L):t(U)}function x(U){const te="CDATA[";return U===te.charCodeAt(o++)?(e.consume(U),o===te.length?r.interrupt?n:$:x):t(U)}function S(U){return ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function v(U){if(U===null||U===47||U===62||lr(U)){const te=U===47,de=a.toLowerCase();return!te&&!i&&Gj.includes(de)?(s=1,r.interrupt?n(U):$(U)):M4t.includes(a.toLowerCase())?(s=6,te?(e.consume(U),b):r.interrupt?n(U):$(U)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(U):i?w(U):y(U))}return U===45||Vs(U)?(e.consume(U),a+=String.fromCharCode(U),v):t(U)}function b(U){return U===62?(e.consume(U),r.interrupt?n:$):t(U)}function w(U){return gn(U)?(e.consume(U),w):O(U)}function y(U){return U===47?(e.consume(U),O):U===58||U===95||ai(U)?(e.consume(U),C):gn(U)?(e.consume(U),y):O(U)}function C(U){return U===45||U===46||U===58||U===95||Vs(U)?(e.consume(U),C):E(U)}function E(U){return U===61?(e.consume(U),N):gn(U)?(e.consume(U),E):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(e.consume(U),l=U,T):gn(U)?(e.consume(U),N):j(U)}function T(U){return U===l?(e.consume(U),l=null,M):U===null||St(U)?t(U):(e.consume(U),T)}function j(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||lr(U)?E(U):(e.consume(U),j)}function M(U){return U===47||U===62||gn(U)?y(U):t(U)}function O(U){return U===62?(e.consume(U),B):t(U)}function B(U){return U===null||St(U)?$(U):gn(U)?(e.consume(U),B):t(U)}function $(U){return U===45&&s===2?(e.consume(U),G):U===60&&s===1?(e.consume(U),X):U===62&&s===4?(e.consume(U),P):U===63&&s===3?(e.consume(U),L):U===93&&s===5?(e.consume(U),I):St(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,H)(U)):U===null||St(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),$)}function H(U){return e.check(O4t,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),Y}function Y(U){return U===null||St(U)?H(U):(e.enter("htmlFlowData"),$(U))}function G(U){return U===45?(e.consume(U),L):$(U)}function X(U){return U===47?(e.consume(U),a="",ee):$(U)}function ee(U){if(U===62){const te=a.toLowerCase();return Gj.includes(te)?(e.consume(U),P):$(U)}return ai(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),ee):$(U)}function I(U){return U===93?(e.consume(U),L):$(U)}function L(U){return U===62?(e.consume(U),P):U===45&&s===2?(e.consume(U),L):$(U)}function P(U){return U===null||St(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),P)}function W(U){return e.exit("htmlFlow"),n(U)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const P="CDATA[";return L===P.charCodeAt(i++)?(e.consume(L),i===P.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,H):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),q)}function H(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=H,X(L)):(e.consume(L),H)}function q(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),q)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ee}function ee(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:x3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(R1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return x3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Mb:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Lb(e))return 2}function Bb(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,Bb(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),q(Y)):j(Y)}function q(Y){return Y===o?(M++,N.consume(Y),q):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,U,"whitespace")(Y):U(Y)):j(Y)}function U(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const ew={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||gv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(H){return _(H)}function _(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),d}function d(H){return H===33?(e.consume(H),p):H===47?(e.consume(H),i=!0,S):H===63?(e.consume(H),s=3,r.interrupt?n:L):ai(H)?(e.consume(H),a=String.fromCharCode(H),v):t(H)}function p(H){return H===45?(e.consume(H),s=2,m):H===91?(e.consume(H),s=5,o=0,x):ai(H)?(e.consume(H),s=4,r.interrupt?n:L):t(H)}function m(H){return H===45?(e.consume(H),r.interrupt?n:L):t(H)}function x(H){const ee="CDATA[";return H===ee.charCodeAt(o++)?(e.consume(H),o===ee.length?r.interrupt?n:$:x):t(H)}function S(H){return ai(H)?(e.consume(H),a=String.fromCharCode(H),v):t(H)}function v(H){if(H===null||H===47||H===62||lr(H)){const ee=H===47,de=a.toLowerCase();return!ee&&!i&&Gj.includes(de)?(s=1,r.interrupt?n(H):$(H)):M4t.includes(a.toLowerCase())?(s=6,ee?(e.consume(H),b):r.interrupt?n(H):$(H)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(H):i?w(H):y(H))}return H===45||Vs(H)?(e.consume(H),a+=String.fromCharCode(H),v):t(H)}function b(H){return H===62?(e.consume(H),r.interrupt?n:$):t(H)}function w(H){return gn(H)?(e.consume(H),w):O(H)}function y(H){return H===47?(e.consume(H),O):H===58||H===95||ai(H)?(e.consume(H),C):gn(H)?(e.consume(H),y):O(H)}function C(H){return H===45||H===46||H===58||H===95||Vs(H)?(e.consume(H),C):E(H)}function E(H){return H===61?(e.consume(H),N):gn(H)?(e.consume(H),E):y(H)}function N(H){return H===null||H===60||H===61||H===62||H===96?t(H):H===34||H===39?(e.consume(H),l=H,T):gn(H)?(e.consume(H),N):j(H)}function T(H){return H===l?(e.consume(H),l=null,M):H===null||St(H)?t(H):(e.consume(H),T)}function j(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||lr(H)?E(H):(e.consume(H),j)}function M(H){return H===47||H===62||gn(H)?y(H):t(H)}function O(H){return H===62?(e.consume(H),B):t(H)}function B(H){return H===null||St(H)?$(H):gn(H)?(e.consume(H),B):t(H)}function $(H){return H===45&&s===2?(e.consume(H),G):H===60&&s===1?(e.consume(H),X):H===62&&s===4?(e.consume(H),F):H===63&&s===3?(e.consume(H),L):H===93&&s===5?(e.consume(H),I):St(H)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,q)(H)):H===null||St(H)?(e.exit("htmlFlowData"),q(H)):(e.consume(H),$)}function q(H){return e.check(O4t,U,W)(H)}function U(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),Y}function Y(H){return H===null||St(H)?q(H):(e.enter("htmlFlowData"),$(H))}function G(H){return H===45?(e.consume(H),L):$(H)}function X(H){return H===47?(e.consume(H),a="",te):$(H)}function te(H){if(H===62){const ee=a.toLowerCase();return Gj.includes(ee)?(e.consume(H),F):$(H)}return ai(H)&&a.length<8?(e.consume(H),a+=String.fromCharCode(H),te):$(H)}function I(H){return H===93?(e.consume(H),L):$(H)}function L(H){return H===62?(e.consume(H),F):H===45&&s===2?(e.consume(H),L):$(H)}function F(H){return H===null||St(H)?(e.exit("htmlFlowData"),W(H)):(e.consume(H),F)}function W(H){return e.exit("htmlFlow"),n(H)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,q):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),U)}function q(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=q,X(L)):(e.consume(L),q)}function U(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),U)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:x3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(R1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return x3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Kj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,ue(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Qj(t)),ue(this,ru)+J3t(t,r)}}ru=new WeakMap;const H3t=new Set(["*","**","_","__"]);function Qj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Kj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,ue(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Qj(t)),ue(this,ru)+J3t(t,r)}}ru=new WeakMap;const H3t=new Set(["*","**","_","__"]);function Qj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(Z3t(n)){Yj(n,t,r);continue}const i=V3t(n,e,t);if(i>t){t=i-1;continue}const a=K3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Yj(n,t,r)}return n}function q3t(e,n,t){const r=n[t];return r==="`"?U3t(e,n,t):r==="$"?G3t(e,n,t):r==="~"?W3t(e,n,t):t}function U3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&xv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&xv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function G3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function W3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(xv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!xv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function V3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` `)return e.pendingHtml=null,s+1;return n.length}function K3t(e,n,t){const r=Q3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Y3t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Q3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Y3t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Jj(s)||!Jj(r)}function Yj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function X3t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Z3t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function J3t(e,n){n.pendingHtml!==null&&(e=e.slice(0,n5t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return xo(e5t(e,t));const r=t5t(n);if(r)return xo(ih(e,r));const s=i5t(n);return s?s.kind==="delim"?xo(z3(e,s.start,s.token.length)?s$(e,s.token):e.slice(0,s.start)):z3(e,s.start,s.token.length)?s.kind==="fence"?xo(e):s.kind==="code"?xo(ih(e,s.token)):s.token==="$$"?xo(ih(e,(e.endsWith(` @@ -703,7 +703,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `+Zj(o,b)+S}return r+l+` `+p+` `+d}function ih(e,n){return e+n.slice(s5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function s5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function i5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Xj(e){let n=0;for(let t=0;t0}function Zj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function o5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function xv(e,n){return n===0||e[n-1]===` -`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){ue(this,Dh)!==null&&ue(this,Fp)===n&&l$(ue(this,Lh),r)&&!!ue(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===yv)||(n=n(),n.use(yv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){ue(this,xd)&&(n=ue(this,xd).update(n));let t=ue(this,Oh);if(n===t)return ue(this,Sd);const r=ue(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(ue(this,Dh)),l=ue(this,qp),u=l.slice(i).some(N=>N.some(j3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),U2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=nw(_,d,a);U2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||j3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=nw(_,d,a);U2(N.length===d.length),l.splice(0,l.length,...N)}const p=nw(o.runSync(_),d,a),m=ue(this,Up),x=ue(this,Gp),S=ue(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(ue(this,wd)),Fe(this,wd,ue(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const sw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===sw.svg?jyt:dB,s=t===sw.html?e.tagName.toLowerCase():e.tagName,i=t===sw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` +`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){ue(this,Dh)!==null&&ue(this,Fp)===n&&l$(ue(this,Lh),r)&&!!ue(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===yv)||(n=n(),n.use(yv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){ue(this,xd)&&(n=ue(this,xd).update(n));let t=ue(this,Oh);if(n===t)return ue(this,Sd);const r=ue(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(ue(this,Dh)),l=ue(this,qp),u=l.slice(i).some(N=>N.some(j3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),U2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=nw(_,d,a);U2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||j3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=nw(_,d,a);U2(N.length===d.length),l.splice(0,l.length,...N)}const p=nw(o.runSync(_),d,a),m=ue(this,Up),x=ue(this,Gp),S=ue(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(ue(this,wd)),Fe(this,wd,ue(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const sw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===sw.svg?jyt:dB,s=t===sw.html?e.tagName.toLowerCase():e.tagName,i=t===sw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` `.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function h$(e,n,t){return e.type==="element"?I5t(e,n,t):e.type==="text"?t.whitespace==="normal"?_$(e,t):B5t(e):[]}function I5t(e,n,t){const r=p$(e,t),s=e.children||[];let i=-1,a=[];if(L5t(e))return a;let o,l;for(T3(e)||lT(e)&&sT(n,e,lT)?l=` `:D5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(q5t,"-$1").toLowerCase(),G5t={"&":"&",">":">","<":"<",'"':""","'":"'"},W5t=/[&><"']/g,Ks=e=>String(e).replace(W5t,n=>G5t[n]),M1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?M1(e.body[0]):e:e.type==="font"?M1(e.body):e,V5t=new Set(["mathord","textord","atom"]),Wl=e=>V5t.has(M1(e).type),K5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},A3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Q5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Y5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Q5t(n)}function X5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Y5t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(A3)){var r=A3[t];r&&X5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=K5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[Z5t[this.id]]}sub(){return jo[J5t[this.id]]}fracNum(){return jo[e6t[this.id]]}fracDen(){return jo[t6t[this.id]]}cramp(){return jo[n6t[this.id]]}text(){return jo[r6t[this.id]]}isTight(){return this.size>=2}}var XS=0,wv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(wv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],Z5t=[gp,ka,gp,ka,Qh,oi,Qh,oi],J5t=[ka,ka,ka,ka,oi,oi,oi,oi],e6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],t6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],n6t=[wv,wv,Pl,Pl,ka,ka,oi,oi],r6t=[XS,wv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},R3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function s6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var D1=[];R3.forEach(e=>e.blocks.forEach(n=>D1.push(...n)));function m$(e){for(var n=0;n=D1[n]&&e<=D1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,i6t=function(n,t){return"M95,"+(622+n+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 @@ -955,13 +955,13 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var M3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in M3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in M3)r=M3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class $b{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class D3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof $b||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var iw={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!iw[n]){var t=iw[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return iw[n]}var Sr={math:{},text:{}};function F(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",J="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";F(V,J,he,"≡","\\equiv",!0);F(V,J,he,"≺","\\prec",!0);F(V,J,he,"≻","\\succ",!0);F(V,J,he,"∼","\\sim",!0);F(V,J,he,"⊥","\\perp");F(V,J,he,"⪯","\\preceq",!0);F(V,J,he,"⪰","\\succeq",!0);F(V,J,he,"≃","\\simeq",!0);F(V,J,he,"∣","\\mid",!0);F(V,J,he,"≪","\\ll",!0);F(V,J,he,"≫","\\gg",!0);F(V,J,he,"≍","\\asymp",!0);F(V,J,he,"∥","\\parallel");F(V,J,he,"⋈","\\bowtie",!0);F(V,J,he,"⌣","\\smile",!0);F(V,J,he,"⊑","\\sqsubseteq",!0);F(V,J,he,"⊒","\\sqsupseteq",!0);F(V,J,he,"≐","\\doteq",!0);F(V,J,he,"⌢","\\frown",!0);F(V,J,he,"∋","\\ni",!0);F(V,J,he,"∝","\\propto",!0);F(V,J,he,"⊢","\\vdash",!0);F(V,J,he,"⊣","\\dashv",!0);F(V,J,he,"∋","\\owns");F(V,J,dm,".","\\ldotp");F(V,J,dm,"⋅","\\cdotp");F(V,J,dm,"⋅","·");F(He,J,ve,"⋅","·");F(V,J,ve,"#","\\#");F(He,J,ve,"#","\\#");F(V,J,ve,"&","\\&");F(He,J,ve,"&","\\&");F(V,J,ve,"ℵ","\\aleph",!0);F(V,J,ve,"∀","\\forall",!0);F(V,J,ve,"ℏ","\\hbar",!0);F(V,J,ve,"∃","\\exists",!0);F(V,J,ve,"∇","\\nabla",!0);F(V,J,ve,"♭","\\flat",!0);F(V,J,ve,"ℓ","\\ell",!0);F(V,J,ve,"♮","\\natural",!0);F(V,J,ve,"♣","\\clubsuit",!0);F(V,J,ve,"℘","\\wp",!0);F(V,J,ve,"♯","\\sharp",!0);F(V,J,ve,"♢","\\diamondsuit",!0);F(V,J,ve,"ℜ","\\Re",!0);F(V,J,ve,"♡","\\heartsuit",!0);F(V,J,ve,"ℑ","\\Im",!0);F(V,J,ve,"♠","\\spadesuit",!0);F(V,J,ve,"§","\\S",!0);F(He,J,ve,"§","\\S");F(V,J,ve,"¶","\\P",!0);F(He,J,ve,"¶","\\P");F(V,J,ve,"†","\\dag");F(He,J,ve,"†","\\dag");F(He,J,ve,"†","\\textdagger");F(V,J,ve,"‡","\\ddag");F(He,J,ve,"‡","\\ddag");F(He,J,ve,"‡","\\textdaggerdbl");F(V,J,ui,"⎱","\\rmoustache",!0);F(V,J,na,"⎰","\\lmoustache",!0);F(V,J,ui,"⟯","\\rgroup",!0);F(V,J,na,"⟮","\\lgroup",!0);F(V,J,dt,"∓","\\mp",!0);F(V,J,dt,"⊖","\\ominus",!0);F(V,J,dt,"⊎","\\uplus",!0);F(V,J,dt,"⊓","\\sqcap",!0);F(V,J,dt,"∗","\\ast");F(V,J,dt,"⊔","\\sqcup",!0);F(V,J,dt,"◯","\\bigcirc",!0);F(V,J,dt,"∙","\\bullet",!0);F(V,J,dt,"‡","\\ddagger");F(V,J,dt,"≀","\\wr",!0);F(V,J,dt,"⨿","\\amalg");F(V,J,dt,"&","\\And");F(V,J,he,"⟵","\\longleftarrow",!0);F(V,J,he,"⇐","\\Leftarrow",!0);F(V,J,he,"⟸","\\Longleftarrow",!0);F(V,J,he,"⟶","\\longrightarrow",!0);F(V,J,he,"⇒","\\Rightarrow",!0);F(V,J,he,"⟹","\\Longrightarrow",!0);F(V,J,he,"↔","\\leftrightarrow",!0);F(V,J,he,"⟷","\\longleftrightarrow",!0);F(V,J,he,"⇔","\\Leftrightarrow",!0);F(V,J,he,"⟺","\\Longleftrightarrow",!0);F(V,J,he,"↦","\\mapsto",!0);F(V,J,he,"⟼","\\longmapsto",!0);F(V,J,he,"↗","\\nearrow",!0);F(V,J,he,"↩","\\hookleftarrow",!0);F(V,J,he,"↪","\\hookrightarrow",!0);F(V,J,he,"↘","\\searrow",!0);F(V,J,he,"↼","\\leftharpoonup",!0);F(V,J,he,"⇀","\\rightharpoonup",!0);F(V,J,he,"↙","\\swarrow",!0);F(V,J,he,"↽","\\leftharpoondown",!0);F(V,J,he,"⇁","\\rightharpoondown",!0);F(V,J,he,"↖","\\nwarrow",!0);F(V,J,he,"⇌","\\rightleftharpoons",!0);F(V,fe,he,"≮","\\nless",!0);F(V,fe,he,"","\\@nleqslant");F(V,fe,he,"","\\@nleqq");F(V,fe,he,"⪇","\\lneq",!0);F(V,fe,he,"≨","\\lneqq",!0);F(V,fe,he,"","\\@lvertneqq");F(V,fe,he,"⋦","\\lnsim",!0);F(V,fe,he,"⪉","\\lnapprox",!0);F(V,fe,he,"⊀","\\nprec",!0);F(V,fe,he,"⋠","\\npreceq",!0);F(V,fe,he,"⋨","\\precnsim",!0);F(V,fe,he,"⪹","\\precnapprox",!0);F(V,fe,he,"≁","\\nsim",!0);F(V,fe,he,"","\\@nshortmid");F(V,fe,he,"∤","\\nmid",!0);F(V,fe,he,"⊬","\\nvdash",!0);F(V,fe,he,"⊭","\\nvDash",!0);F(V,fe,he,"⋪","\\ntriangleleft");F(V,fe,he,"⋬","\\ntrianglelefteq",!0);F(V,fe,he,"⊊","\\subsetneq",!0);F(V,fe,he,"","\\@varsubsetneq");F(V,fe,he,"⫋","\\subsetneqq",!0);F(V,fe,he,"","\\@varsubsetneqq");F(V,fe,he,"≯","\\ngtr",!0);F(V,fe,he,"","\\@ngeqslant");F(V,fe,he,"","\\@ngeqq");F(V,fe,he,"⪈","\\gneq",!0);F(V,fe,he,"≩","\\gneqq",!0);F(V,fe,he,"","\\@gvertneqq");F(V,fe,he,"⋧","\\gnsim",!0);F(V,fe,he,"⪊","\\gnapprox",!0);F(V,fe,he,"⊁","\\nsucc",!0);F(V,fe,he,"⋡","\\nsucceq",!0);F(V,fe,he,"⋩","\\succnsim",!0);F(V,fe,he,"⪺","\\succnapprox",!0);F(V,fe,he,"≆","\\ncong",!0);F(V,fe,he,"","\\@nshortparallel");F(V,fe,he,"∦","\\nparallel",!0);F(V,fe,he,"⊯","\\nVDash",!0);F(V,fe,he,"⋫","\\ntriangleright");F(V,fe,he,"⋭","\\ntrianglerighteq",!0);F(V,fe,he,"","\\@nsupseteqq");F(V,fe,he,"⊋","\\supsetneq",!0);F(V,fe,he,"","\\@varsupsetneq");F(V,fe,he,"⫌","\\supsetneqq",!0);F(V,fe,he,"","\\@varsupsetneqq");F(V,fe,he,"⊮","\\nVdash",!0);F(V,fe,he,"⪵","\\precneqq",!0);F(V,fe,he,"⪶","\\succneqq",!0);F(V,fe,he,"","\\@nsubseteqq");F(V,fe,dt,"⊴","\\unlhd");F(V,fe,dt,"⊵","\\unrhd");F(V,fe,he,"↚","\\nleftarrow",!0);F(V,fe,he,"↛","\\nrightarrow",!0);F(V,fe,he,"⇍","\\nLeftarrow",!0);F(V,fe,he,"⇏","\\nRightarrow",!0);F(V,fe,he,"↮","\\nleftrightarrow",!0);F(V,fe,he,"⇎","\\nLeftrightarrow",!0);F(V,fe,he,"△","\\vartriangle");F(V,fe,ve,"ℏ","\\hslash");F(V,fe,ve,"▽","\\triangledown");F(V,fe,ve,"◊","\\lozenge");F(V,fe,ve,"Ⓢ","\\circledS");F(V,fe,ve,"®","\\circledR");F(He,fe,ve,"®","\\circledR");F(V,fe,ve,"∡","\\measuredangle",!0);F(V,fe,ve,"∄","\\nexists");F(V,fe,ve,"℧","\\mho");F(V,fe,ve,"Ⅎ","\\Finv",!0);F(V,fe,ve,"⅁","\\Game",!0);F(V,fe,ve,"‵","\\backprime");F(V,fe,ve,"▲","\\blacktriangle");F(V,fe,ve,"▼","\\blacktriangledown");F(V,fe,ve,"■","\\blacksquare");F(V,fe,ve,"⧫","\\blacklozenge");F(V,fe,ve,"★","\\bigstar");F(V,fe,ve,"∢","\\sphericalangle",!0);F(V,fe,ve,"∁","\\complement",!0);F(V,fe,ve,"ð","\\eth",!0);F(He,J,ve,"ð","ð");F(V,fe,ve,"╱","\\diagup");F(V,fe,ve,"╲","\\diagdown");F(V,fe,ve,"□","\\square");F(V,fe,ve,"□","\\Box");F(V,fe,ve,"◊","\\Diamond");F(V,fe,ve,"¥","\\yen",!0);F(He,fe,ve,"¥","\\yen",!0);F(V,fe,ve,"✓","\\checkmark",!0);F(He,fe,ve,"✓","\\checkmark");F(V,fe,ve,"ℶ","\\beth",!0);F(V,fe,ve,"ℸ","\\daleth",!0);F(V,fe,ve,"ℷ","\\gimel",!0);F(V,fe,ve,"ϝ","\\digamma",!0);F(V,fe,ve,"ϰ","\\varkappa");F(V,fe,na,"┌","\\@ulcorner",!0);F(V,fe,ui,"┐","\\@urcorner",!0);F(V,fe,na,"└","\\@llcorner",!0);F(V,fe,ui,"┘","\\@lrcorner",!0);F(V,fe,he,"≦","\\leqq",!0);F(V,fe,he,"⩽","\\leqslant",!0);F(V,fe,he,"⪕","\\eqslantless",!0);F(V,fe,he,"≲","\\lesssim",!0);F(V,fe,he,"⪅","\\lessapprox",!0);F(V,fe,he,"≊","\\approxeq",!0);F(V,fe,dt,"⋖","\\lessdot");F(V,fe,he,"⋘","\\lll",!0);F(V,fe,he,"≶","\\lessgtr",!0);F(V,fe,he,"⋚","\\lesseqgtr",!0);F(V,fe,he,"⪋","\\lesseqqgtr",!0);F(V,fe,he,"≑","\\doteqdot");F(V,fe,he,"≓","\\risingdotseq",!0);F(V,fe,he,"≒","\\fallingdotseq",!0);F(V,fe,he,"∽","\\backsim",!0);F(V,fe,he,"⋍","\\backsimeq",!0);F(V,fe,he,"⫅","\\subseteqq",!0);F(V,fe,he,"⋐","\\Subset",!0);F(V,fe,he,"⊏","\\sqsubset",!0);F(V,fe,he,"≼","\\preccurlyeq",!0);F(V,fe,he,"⋞","\\curlyeqprec",!0);F(V,fe,he,"≾","\\precsim",!0);F(V,fe,he,"⪷","\\precapprox",!0);F(V,fe,he,"⊲","\\vartriangleleft");F(V,fe,he,"⊴","\\trianglelefteq");F(V,fe,he,"⊨","\\vDash",!0);F(V,fe,he,"⊪","\\Vvdash",!0);F(V,fe,he,"⌣","\\smallsmile");F(V,fe,he,"⌢","\\smallfrown");F(V,fe,he,"≏","\\bumpeq",!0);F(V,fe,he,"≎","\\Bumpeq",!0);F(V,fe,he,"≧","\\geqq",!0);F(V,fe,he,"⩾","\\geqslant",!0);F(V,fe,he,"⪖","\\eqslantgtr",!0);F(V,fe,he,"≳","\\gtrsim",!0);F(V,fe,he,"⪆","\\gtrapprox",!0);F(V,fe,dt,"⋗","\\gtrdot");F(V,fe,he,"⋙","\\ggg",!0);F(V,fe,he,"≷","\\gtrless",!0);F(V,fe,he,"⋛","\\gtreqless",!0);F(V,fe,he,"⪌","\\gtreqqless",!0);F(V,fe,he,"≖","\\eqcirc",!0);F(V,fe,he,"≗","\\circeq",!0);F(V,fe,he,"≜","\\triangleq",!0);F(V,fe,he,"∼","\\thicksim");F(V,fe,he,"≈","\\thickapprox");F(V,fe,he,"⫆","\\supseteqq",!0);F(V,fe,he,"⋑","\\Supset",!0);F(V,fe,he,"⊐","\\sqsupset",!0);F(V,fe,he,"≽","\\succcurlyeq",!0);F(V,fe,he,"⋟","\\curlyeqsucc",!0);F(V,fe,he,"≿","\\succsim",!0);F(V,fe,he,"⪸","\\succapprox",!0);F(V,fe,he,"⊳","\\vartriangleright");F(V,fe,he,"⊵","\\trianglerighteq");F(V,fe,he,"⊩","\\Vdash",!0);F(V,fe,he,"∣","\\shortmid");F(V,fe,he,"∥","\\shortparallel");F(V,fe,he,"≬","\\between",!0);F(V,fe,he,"⋔","\\pitchfork",!0);F(V,fe,he,"∝","\\varpropto");F(V,fe,he,"◀","\\blacktriangleleft");F(V,fe,he,"∴","\\therefore",!0);F(V,fe,he,"∍","\\backepsilon");F(V,fe,he,"▶","\\blacktriangleright");F(V,fe,he,"∵","\\because",!0);F(V,fe,he,"⋘","\\llless");F(V,fe,he,"⋙","\\gggtr");F(V,fe,dt,"⊲","\\lhd");F(V,fe,dt,"⊳","\\rhd");F(V,fe,he,"≂","\\eqsim",!0);F(V,J,he,"⋈","\\Join");F(V,fe,he,"≑","\\Doteq",!0);F(V,fe,dt,"∔","\\dotplus",!0);F(V,fe,dt,"∖","\\smallsetminus");F(V,fe,dt,"⋒","\\Cap",!0);F(V,fe,dt,"⋓","\\Cup",!0);F(V,fe,dt,"⩞","\\doublebarwedge",!0);F(V,fe,dt,"⊟","\\boxminus",!0);F(V,fe,dt,"⊞","\\boxplus",!0);F(V,fe,dt,"⋇","\\divideontimes",!0);F(V,fe,dt,"⋉","\\ltimes",!0);F(V,fe,dt,"⋊","\\rtimes",!0);F(V,fe,dt,"⋋","\\leftthreetimes",!0);F(V,fe,dt,"⋌","\\rightthreetimes",!0);F(V,fe,dt,"⋏","\\curlywedge",!0);F(V,fe,dt,"⋎","\\curlyvee",!0);F(V,fe,dt,"⊝","\\circleddash",!0);F(V,fe,dt,"⊛","\\circledast",!0);F(V,fe,dt,"⋅","\\centerdot");F(V,fe,dt,"⊺","\\intercal",!0);F(V,fe,dt,"⋒","\\doublecap");F(V,fe,dt,"⋓","\\doublecup");F(V,fe,dt,"⊠","\\boxtimes",!0);F(V,fe,he,"⇢","\\dashrightarrow",!0);F(V,fe,he,"⇠","\\dashleftarrow",!0);F(V,fe,he,"⇇","\\leftleftarrows",!0);F(V,fe,he,"⇆","\\leftrightarrows",!0);F(V,fe,he,"⇚","\\Lleftarrow",!0);F(V,fe,he,"↞","\\twoheadleftarrow",!0);F(V,fe,he,"↢","\\leftarrowtail",!0);F(V,fe,he,"↫","\\looparrowleft",!0);F(V,fe,he,"⇋","\\leftrightharpoons",!0);F(V,fe,he,"↶","\\curvearrowleft",!0);F(V,fe,he,"↺","\\circlearrowleft",!0);F(V,fe,he,"↰","\\Lsh",!0);F(V,fe,he,"⇈","\\upuparrows",!0);F(V,fe,he,"↿","\\upharpoonleft",!0);F(V,fe,he,"⇃","\\downharpoonleft",!0);F(V,J,he,"⊶","\\origof",!0);F(V,J,he,"⊷","\\imageof",!0);F(V,fe,he,"⊸","\\multimap",!0);F(V,fe,he,"↭","\\leftrightsquigarrow",!0);F(V,fe,he,"⇉","\\rightrightarrows",!0);F(V,fe,he,"⇄","\\rightleftarrows",!0);F(V,fe,he,"↠","\\twoheadrightarrow",!0);F(V,fe,he,"↣","\\rightarrowtail",!0);F(V,fe,he,"↬","\\looparrowright",!0);F(V,fe,he,"↷","\\curvearrowright",!0);F(V,fe,he,"↻","\\circlearrowright",!0);F(V,fe,he,"↱","\\Rsh",!0);F(V,fe,he,"⇊","\\downdownarrows",!0);F(V,fe,he,"↾","\\upharpoonright",!0);F(V,fe,he,"⇂","\\downharpoonright",!0);F(V,fe,he,"⇝","\\rightsquigarrow",!0);F(V,fe,he,"⇝","\\leadsto");F(V,fe,he,"⇛","\\Rrightarrow",!0);F(V,fe,he,"↾","\\restriction");F(V,J,ve,"‘","`");F(V,J,ve,"$","\\$");F(He,J,ve,"$","\\$");F(He,J,ve,"$","\\textdollar");F(V,J,ve,"%","\\%");F(He,J,ve,"%","\\%");F(V,J,ve,"_","\\_");F(He,J,ve,"_","\\_");F(He,J,ve,"_","\\textunderscore");F(V,J,ve,"∠","\\angle",!0);F(V,J,ve,"∞","\\infty",!0);F(V,J,ve,"′","\\prime");F(V,J,ve,"△","\\triangle");F(V,J,ve,"Γ","\\Gamma",!0);F(V,J,ve,"Δ","\\Delta",!0);F(V,J,ve,"Θ","\\Theta",!0);F(V,J,ve,"Λ","\\Lambda",!0);F(V,J,ve,"Ξ","\\Xi",!0);F(V,J,ve,"Π","\\Pi",!0);F(V,J,ve,"Σ","\\Sigma",!0);F(V,J,ve,"Υ","\\Upsilon",!0);F(V,J,ve,"Φ","\\Phi",!0);F(V,J,ve,"Ψ","\\Psi",!0);F(V,J,ve,"Ω","\\Omega",!0);F(V,J,ve,"A","Α");F(V,J,ve,"B","Β");F(V,J,ve,"E","Ε");F(V,J,ve,"Z","Ζ");F(V,J,ve,"H","Η");F(V,J,ve,"I","Ι");F(V,J,ve,"K","Κ");F(V,J,ve,"M","Μ");F(V,J,ve,"N","Ν");F(V,J,ve,"O","Ο");F(V,J,ve,"P","Ρ");F(V,J,ve,"T","Τ");F(V,J,ve,"X","Χ");F(V,J,ve,"¬","\\neg",!0);F(V,J,ve,"¬","\\lnot");F(V,J,ve,"⊤","\\top");F(V,J,ve,"⊥","\\bot");F(V,J,ve,"∅","\\emptyset");F(V,fe,ve,"∅","\\varnothing");F(V,J,Bt,"α","\\alpha",!0);F(V,J,Bt,"β","\\beta",!0);F(V,J,Bt,"γ","\\gamma",!0);F(V,J,Bt,"δ","\\delta",!0);F(V,J,Bt,"ϵ","\\epsilon",!0);F(V,J,Bt,"ζ","\\zeta",!0);F(V,J,Bt,"η","\\eta",!0);F(V,J,Bt,"θ","\\theta",!0);F(V,J,Bt,"ι","\\iota",!0);F(V,J,Bt,"κ","\\kappa",!0);F(V,J,Bt,"λ","\\lambda",!0);F(V,J,Bt,"μ","\\mu",!0);F(V,J,Bt,"ν","\\nu",!0);F(V,J,Bt,"ξ","\\xi",!0);F(V,J,Bt,"ο","\\omicron",!0);F(V,J,Bt,"π","\\pi",!0);F(V,J,Bt,"ρ","\\rho",!0);F(V,J,Bt,"σ","\\sigma",!0);F(V,J,Bt,"τ","\\tau",!0);F(V,J,Bt,"υ","\\upsilon",!0);F(V,J,Bt,"ϕ","\\phi",!0);F(V,J,Bt,"χ","\\chi",!0);F(V,J,Bt,"ψ","\\psi",!0);F(V,J,Bt,"ω","\\omega",!0);F(V,J,Bt,"ε","\\varepsilon",!0);F(V,J,Bt,"ϑ","\\vartheta",!0);F(V,J,Bt,"ϖ","\\varpi",!0);F(V,J,Bt,"ϱ","\\varrho",!0);F(V,J,Bt,"ς","\\varsigma",!0);F(V,J,Bt,"φ","\\varphi",!0);F(V,J,dt,"∗","*",!0);F(V,J,dt,"+","+");F(V,J,dt,"−","-",!0);F(V,J,dt,"⋅","\\cdot",!0);F(V,J,dt,"∘","\\circ",!0);F(V,J,dt,"÷","\\div",!0);F(V,J,dt,"±","\\pm",!0);F(V,J,dt,"×","\\times",!0);F(V,J,dt,"∩","\\cap",!0);F(V,J,dt,"∪","\\cup",!0);F(V,J,dt,"∖","\\setminus",!0);F(V,J,dt,"∧","\\land");F(V,J,dt,"∨","\\lor");F(V,J,dt,"∧","\\wedge",!0);F(V,J,dt,"∨","\\vee",!0);F(V,J,ve,"√","\\surd");F(V,J,na,"⟨","\\langle",!0);F(V,J,na,"∣","\\lvert");F(V,J,na,"∥","\\lVert");F(V,J,ui,"?","?");F(V,J,ui,"!","!");F(V,J,ui,"⟩","\\rangle",!0);F(V,J,ui,"∣","\\rvert");F(V,J,ui,"∥","\\rVert");F(V,J,he,"=","=");F(V,J,he,":",":");F(V,J,he,"≈","\\approx",!0);F(V,J,he,"≅","\\cong",!0);F(V,J,he,"≥","\\ge");F(V,J,he,"≥","\\geq",!0);F(V,J,he,"←","\\gets");F(V,J,he,">","\\gt",!0);F(V,J,he,"∈","\\in",!0);F(V,J,he,"","\\@not");F(V,J,he,"⊂","\\subset",!0);F(V,J,he,"⊃","\\supset",!0);F(V,J,he,"⊆","\\subseteq",!0);F(V,J,he,"⊇","\\supseteq",!0);F(V,fe,he,"⊈","\\nsubseteq",!0);F(V,fe,he,"⊉","\\nsupseteq",!0);F(V,J,he,"⊨","\\models");F(V,J,he,"←","\\leftarrow",!0);F(V,J,he,"≤","\\le");F(V,J,he,"≤","\\leq",!0);F(V,J,he,"<","\\lt",!0);F(V,J,he,"→","\\rightarrow",!0);F(V,J,he,"→","\\to");F(V,fe,he,"≱","\\ngeq",!0);F(V,fe,he,"≰","\\nleq",!0);F(V,J,Vl," ","\\ ");F(V,J,Vl," ","\\space");F(V,J,Vl," ","\\nobreakspace");F(He,J,Vl," ","\\ ");F(He,J,Vl," "," ");F(He,J,Vl," ","\\space");F(He,J,Vl," ","\\nobreakspace");F(V,J,Vl,"","\\nobreak");F(V,J,Vl,"","\\allowbreak");F(V,J,dm,",",",");F(V,J,dm,";",";");F(V,fe,dt,"⊼","\\barwedge",!0);F(V,fe,dt,"⊻","\\veebar",!0);F(V,J,dt,"⊙","\\odot",!0);F(V,J,dt,"⊕","\\oplus",!0);F(V,J,dt,"⊗","\\otimes",!0);F(V,J,ve,"∂","\\partial",!0);F(V,J,dt,"⊘","\\oslash",!0);F(V,fe,dt,"⊚","\\circledcirc",!0);F(V,fe,dt,"⊡","\\boxdot",!0);F(V,J,dt,"△","\\bigtriangleup");F(V,J,dt,"▽","\\bigtriangledown");F(V,J,dt,"†","\\dagger");F(V,J,dt,"⋄","\\diamond");F(V,J,dt,"⋆","\\star");F(V,J,dt,"◃","\\triangleleft");F(V,J,dt,"▹","\\triangleright");F(V,J,na,"{","\\{");F(He,J,ve,"{","\\{");F(He,J,ve,"{","\\textbraceleft");F(V,J,ui,"}","\\}");F(He,J,ve,"}","\\}");F(He,J,ve,"}","\\textbraceright");F(V,J,na,"{","\\lbrace");F(V,J,ui,"}","\\rbrace");F(V,J,na,"[","\\lbrack",!0);F(He,J,ve,"[","\\lbrack",!0);F(V,J,ui,"]","\\rbrack",!0);F(He,J,ve,"]","\\rbrack",!0);F(V,J,na,"(","\\lparen",!0);F(V,J,ui,")","\\rparen",!0);F(He,J,ve,"<","\\textless",!0);F(He,J,ve,">","\\textgreater",!0);F(V,J,na,"⌊","\\lfloor",!0);F(V,J,ui,"⌋","\\rfloor",!0);F(V,J,na,"⌈","\\lceil",!0);F(V,J,ui,"⌉","\\rceil",!0);F(V,J,ve,"\\","\\backslash");F(V,J,ve,"∣","|");F(V,J,ve,"∣","\\vert");F(He,J,ve,"|","\\textbar",!0);F(V,J,ve,"∥","\\|");F(V,J,ve,"∥","\\Vert");F(He,J,ve,"∥","\\textbardbl");F(He,J,ve,"~","\\textasciitilde");F(He,J,ve,"\\","\\textbackslash");F(He,J,ve,"^","\\textasciicircum");F(V,J,he,"↑","\\uparrow",!0);F(V,J,he,"⇑","\\Uparrow",!0);F(V,J,he,"↓","\\downarrow",!0);F(V,J,he,"⇓","\\Downarrow",!0);F(V,J,he,"↕","\\updownarrow",!0);F(V,J,he,"⇕","\\Updownarrow",!0);F(V,J,is,"∐","\\coprod");F(V,J,is,"⋁","\\bigvee");F(V,J,is,"⋀","\\bigwedge");F(V,J,is,"⨄","\\biguplus");F(V,J,is,"⋂","\\bigcap");F(V,J,is,"⋃","\\bigcup");F(V,J,is,"∫","\\int");F(V,J,is,"∫","\\intop");F(V,J,is,"∬","\\iint");F(V,J,is,"∭","\\iiint");F(V,J,is,"∏","\\prod");F(V,J,is,"∑","\\sum");F(V,J,is,"⨂","\\bigotimes");F(V,J,is,"⨁","\\bigoplus");F(V,J,is,"⨀","\\bigodot");F(V,J,is,"∮","\\oint");F(V,J,is,"∯","\\oiint");F(V,J,is,"∰","\\oiiint");F(V,J,is,"⨆","\\bigsqcup");F(V,J,is,"∫","\\smallint");F(He,J,g_,"…","\\textellipsis");F(V,J,g_,"…","\\mathellipsis");F(He,J,g_,"…","\\ldots",!0);F(V,J,g_,"…","\\ldots",!0);F(V,J,g_,"⋯","\\@cdots",!0);F(V,J,g_,"⋱","\\ddots",!0);F(V,J,ve,"⋮","\\varvdots");F(He,J,ve,"⋮","\\varvdots");F(V,J,Cr,"ˊ","\\acute");F(V,J,Cr,"ˋ","\\grave");F(V,J,Cr,"¨","\\ddot");F(V,J,Cr,"~","\\tilde");F(V,J,Cr,"ˉ","\\bar");F(V,J,Cr,"˘","\\breve");F(V,J,Cr,"ˇ","\\check");F(V,J,Cr,"^","\\hat");F(V,J,Cr,"⃗","\\vec");F(V,J,Cr,"˙","\\dot");F(V,J,Cr,"˚","\\mathring");F(V,J,Bt,"","\\@imath");F(V,J,Bt,"","\\@jmath");F(V,J,ve,"ı","ı");F(V,J,ve,"ȷ","ȷ");F(He,J,ve,"ı","\\i",!0);F(He,J,ve,"ȷ","\\j",!0);F(He,J,ve,"ß","\\ss",!0);F(He,J,ve,"æ","\\ae",!0);F(He,J,ve,"œ","\\oe",!0);F(He,J,ve,"ø","\\o",!0);F(He,J,ve,"Æ","\\AE",!0);F(He,J,ve,"Œ","\\OE",!0);F(He,J,ve,"Ø","\\O",!0);F(He,J,Cr,"ˊ","\\'");F(He,J,Cr,"ˋ","\\`");F(He,J,Cr,"ˆ","\\^");F(He,J,Cr,"˜","\\~");F(He,J,Cr,"ˉ","\\=");F(He,J,Cr,"˘","\\u");F(He,J,Cr,"˙","\\.");F(He,J,Cr,"¸","\\c");F(He,J,Cr,"˚","\\r");F(He,J,Cr,"ˇ","\\v");F(He,J,Cr,"¨",'\\"');F(He,J,Cr,"˝","\\H");F(He,J,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};F(He,J,ve,"–","--",!0);F(He,J,ve,"–","\\textendash");F(He,J,ve,"—","---",!0);F(He,J,ve,"—","\\textemdash");F(He,J,ve,"‘","`",!0);F(He,J,ve,"‘","\\textquoteleft");F(He,J,ve,"’","'",!0);F(He,J,ve,"’","\\textquoteright");F(He,J,ve,"“","``",!0);F(He,J,ve,"“","\\textquotedblleft");F(He,J,ve,"”","''",!0);F(He,J,ve,"”","\\textquotedblright");F(V,J,ve,"°","\\degree",!0);F(He,J,ve,"°","\\degree");F(He,J,ve,"°","\\textdegree",!0);F(V,J,ve,"£","\\pounds");F(V,J,ve,"£","\\mathsterling",!0);F(He,J,ve,"£","\\pounds");F(He,J,ve,"£","\\textsterling",!0);F(V,fe,ve,"✠","\\maltese");F(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var aw=0;aw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new $b(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},P3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},kv={},Cv={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),F3(i,(x,S)=>{var v,b,w=q3(S),y=q3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},F3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof $b||n instanceof m_&&n.hasClass("enclosing")?n:null},H3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return H3(s[s.length-1],"right");if(t==="left")return H3(s[0],"left")}}return n},q3=function(n,t){if(!n)return null;t&&(n=H3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(kv[n.type]){var s=kv[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function U3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=P3[t].fontName;return JS(i,o,r)?P3[t].variant:null};function uw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||uw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Cv[n.type])return Cv[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=U3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=U3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=U3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Hb=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),qb=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Ub(e){var n=Gb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Gb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=qb(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=Fb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?Hb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Ev(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=qb(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=Hb(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=qb(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=Hb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Wb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Wb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Wb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Wb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var G3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(G3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=G3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===G3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},dw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},fw=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},W3=.008,t1={type:"kern",size:-1*W3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var H=M-S-y,q=Math.round(M*1e3),Y=_6t(d,Math.round(H*1e3)),G=new mu(d,Y),X=et(p/1e3),ee=et(q/1e3),I=new ql([G],{width:X,height:ee,viewBox:"0 0 "+p+" "+q}),L=gu([],[I],s);L.height=q/1e3,L.style.width=X,L.style.height=ee,$.push({type:"elem",elem:L})}else{if($.push(dw(_,m,i)),$.push(t1),l===null){var P=M-S-y+2*W3;$.push(fw(u,P,s))}else{var W=(M-S-y-C)/2+2*W3;$.push(fw(u,W,s)),$.push(t1),$.push(dw(l,m,i)),$.push(t1),$.push(fw(u,W,s))}$.push(t1),$.push(dw(o,m,i))}var U=s.havingBaseStyle(Yt.TEXT),te=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[te],U),Yt.TEXT,s,a)},hw=80,_w=.08,pw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+hw,n<1?i=1:n<1.4&&(i=.7),l=(1+a+_w)/i,u=(1+a)/i,o=pw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+hw)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+_w)/i,o=pw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+_w,u=n+a,_=Math.floor(1e3*n+a)+hw,o=pw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},V3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},mw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return V3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Vb(e,n){var t=Gb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Vb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Vb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Kb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Qb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ce;le=(oe=(ce=U)==null?void 0:ce.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),q.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Ub(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Ub(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Yb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Yb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Yb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Ev(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Wb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Ev(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=Ev(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=qb(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=Hb(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var gw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var K3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in K3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=q3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return Fb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return Fb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var vw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},bw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(bw.hasOwnProperty(e.text)){var t=bw[e.text].className||"";if(e.mode==="text"){var r=Fb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(vw.hasOwnProperty(e.text))return Ge(["mspace",vw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(bw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(vw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var M3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in M3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in M3)r=M3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class $b{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class D3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof $b||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var iw={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!iw[n]){var t=iw[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return iw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",J="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";P(V,J,he,"≡","\\equiv",!0);P(V,J,he,"≺","\\prec",!0);P(V,J,he,"≻","\\succ",!0);P(V,J,he,"∼","\\sim",!0);P(V,J,he,"⊥","\\perp");P(V,J,he,"⪯","\\preceq",!0);P(V,J,he,"⪰","\\succeq",!0);P(V,J,he,"≃","\\simeq",!0);P(V,J,he,"∣","\\mid",!0);P(V,J,he,"≪","\\ll",!0);P(V,J,he,"≫","\\gg",!0);P(V,J,he,"≍","\\asymp",!0);P(V,J,he,"∥","\\parallel");P(V,J,he,"⋈","\\bowtie",!0);P(V,J,he,"⌣","\\smile",!0);P(V,J,he,"⊑","\\sqsubseteq",!0);P(V,J,he,"⊒","\\sqsupseteq",!0);P(V,J,he,"≐","\\doteq",!0);P(V,J,he,"⌢","\\frown",!0);P(V,J,he,"∋","\\ni",!0);P(V,J,he,"∝","\\propto",!0);P(V,J,he,"⊢","\\vdash",!0);P(V,J,he,"⊣","\\dashv",!0);P(V,J,he,"∋","\\owns");P(V,J,dm,".","\\ldotp");P(V,J,dm,"⋅","\\cdotp");P(V,J,dm,"⋅","·");P(He,J,ve,"⋅","·");P(V,J,ve,"#","\\#");P(He,J,ve,"#","\\#");P(V,J,ve,"&","\\&");P(He,J,ve,"&","\\&");P(V,J,ve,"ℵ","\\aleph",!0);P(V,J,ve,"∀","\\forall",!0);P(V,J,ve,"ℏ","\\hbar",!0);P(V,J,ve,"∃","\\exists",!0);P(V,J,ve,"∇","\\nabla",!0);P(V,J,ve,"♭","\\flat",!0);P(V,J,ve,"ℓ","\\ell",!0);P(V,J,ve,"♮","\\natural",!0);P(V,J,ve,"♣","\\clubsuit",!0);P(V,J,ve,"℘","\\wp",!0);P(V,J,ve,"♯","\\sharp",!0);P(V,J,ve,"♢","\\diamondsuit",!0);P(V,J,ve,"ℜ","\\Re",!0);P(V,J,ve,"♡","\\heartsuit",!0);P(V,J,ve,"ℑ","\\Im",!0);P(V,J,ve,"♠","\\spadesuit",!0);P(V,J,ve,"§","\\S",!0);P(He,J,ve,"§","\\S");P(V,J,ve,"¶","\\P",!0);P(He,J,ve,"¶","\\P");P(V,J,ve,"†","\\dag");P(He,J,ve,"†","\\dag");P(He,J,ve,"†","\\textdagger");P(V,J,ve,"‡","\\ddag");P(He,J,ve,"‡","\\ddag");P(He,J,ve,"‡","\\textdaggerdbl");P(V,J,ui,"⎱","\\rmoustache",!0);P(V,J,na,"⎰","\\lmoustache",!0);P(V,J,ui,"⟯","\\rgroup",!0);P(V,J,na,"⟮","\\lgroup",!0);P(V,J,dt,"∓","\\mp",!0);P(V,J,dt,"⊖","\\ominus",!0);P(V,J,dt,"⊎","\\uplus",!0);P(V,J,dt,"⊓","\\sqcap",!0);P(V,J,dt,"∗","\\ast");P(V,J,dt,"⊔","\\sqcup",!0);P(V,J,dt,"◯","\\bigcirc",!0);P(V,J,dt,"∙","\\bullet",!0);P(V,J,dt,"‡","\\ddagger");P(V,J,dt,"≀","\\wr",!0);P(V,J,dt,"⨿","\\amalg");P(V,J,dt,"&","\\And");P(V,J,he,"⟵","\\longleftarrow",!0);P(V,J,he,"⇐","\\Leftarrow",!0);P(V,J,he,"⟸","\\Longleftarrow",!0);P(V,J,he,"⟶","\\longrightarrow",!0);P(V,J,he,"⇒","\\Rightarrow",!0);P(V,J,he,"⟹","\\Longrightarrow",!0);P(V,J,he,"↔","\\leftrightarrow",!0);P(V,J,he,"⟷","\\longleftrightarrow",!0);P(V,J,he,"⇔","\\Leftrightarrow",!0);P(V,J,he,"⟺","\\Longleftrightarrow",!0);P(V,J,he,"↦","\\mapsto",!0);P(V,J,he,"⟼","\\longmapsto",!0);P(V,J,he,"↗","\\nearrow",!0);P(V,J,he,"↩","\\hookleftarrow",!0);P(V,J,he,"↪","\\hookrightarrow",!0);P(V,J,he,"↘","\\searrow",!0);P(V,J,he,"↼","\\leftharpoonup",!0);P(V,J,he,"⇀","\\rightharpoonup",!0);P(V,J,he,"↙","\\swarrow",!0);P(V,J,he,"↽","\\leftharpoondown",!0);P(V,J,he,"⇁","\\rightharpoondown",!0);P(V,J,he,"↖","\\nwarrow",!0);P(V,J,he,"⇌","\\rightleftharpoons",!0);P(V,fe,he,"≮","\\nless",!0);P(V,fe,he,"","\\@nleqslant");P(V,fe,he,"","\\@nleqq");P(V,fe,he,"⪇","\\lneq",!0);P(V,fe,he,"≨","\\lneqq",!0);P(V,fe,he,"","\\@lvertneqq");P(V,fe,he,"⋦","\\lnsim",!0);P(V,fe,he,"⪉","\\lnapprox",!0);P(V,fe,he,"⊀","\\nprec",!0);P(V,fe,he,"⋠","\\npreceq",!0);P(V,fe,he,"⋨","\\precnsim",!0);P(V,fe,he,"⪹","\\precnapprox",!0);P(V,fe,he,"≁","\\nsim",!0);P(V,fe,he,"","\\@nshortmid");P(V,fe,he,"∤","\\nmid",!0);P(V,fe,he,"⊬","\\nvdash",!0);P(V,fe,he,"⊭","\\nvDash",!0);P(V,fe,he,"⋪","\\ntriangleleft");P(V,fe,he,"⋬","\\ntrianglelefteq",!0);P(V,fe,he,"⊊","\\subsetneq",!0);P(V,fe,he,"","\\@varsubsetneq");P(V,fe,he,"⫋","\\subsetneqq",!0);P(V,fe,he,"","\\@varsubsetneqq");P(V,fe,he,"≯","\\ngtr",!0);P(V,fe,he,"","\\@ngeqslant");P(V,fe,he,"","\\@ngeqq");P(V,fe,he,"⪈","\\gneq",!0);P(V,fe,he,"≩","\\gneqq",!0);P(V,fe,he,"","\\@gvertneqq");P(V,fe,he,"⋧","\\gnsim",!0);P(V,fe,he,"⪊","\\gnapprox",!0);P(V,fe,he,"⊁","\\nsucc",!0);P(V,fe,he,"⋡","\\nsucceq",!0);P(V,fe,he,"⋩","\\succnsim",!0);P(V,fe,he,"⪺","\\succnapprox",!0);P(V,fe,he,"≆","\\ncong",!0);P(V,fe,he,"","\\@nshortparallel");P(V,fe,he,"∦","\\nparallel",!0);P(V,fe,he,"⊯","\\nVDash",!0);P(V,fe,he,"⋫","\\ntriangleright");P(V,fe,he,"⋭","\\ntrianglerighteq",!0);P(V,fe,he,"","\\@nsupseteqq");P(V,fe,he,"⊋","\\supsetneq",!0);P(V,fe,he,"","\\@varsupsetneq");P(V,fe,he,"⫌","\\supsetneqq",!0);P(V,fe,he,"","\\@varsupsetneqq");P(V,fe,he,"⊮","\\nVdash",!0);P(V,fe,he,"⪵","\\precneqq",!0);P(V,fe,he,"⪶","\\succneqq",!0);P(V,fe,he,"","\\@nsubseteqq");P(V,fe,dt,"⊴","\\unlhd");P(V,fe,dt,"⊵","\\unrhd");P(V,fe,he,"↚","\\nleftarrow",!0);P(V,fe,he,"↛","\\nrightarrow",!0);P(V,fe,he,"⇍","\\nLeftarrow",!0);P(V,fe,he,"⇏","\\nRightarrow",!0);P(V,fe,he,"↮","\\nleftrightarrow",!0);P(V,fe,he,"⇎","\\nLeftrightarrow",!0);P(V,fe,he,"△","\\vartriangle");P(V,fe,ve,"ℏ","\\hslash");P(V,fe,ve,"▽","\\triangledown");P(V,fe,ve,"◊","\\lozenge");P(V,fe,ve,"Ⓢ","\\circledS");P(V,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(V,fe,ve,"∡","\\measuredangle",!0);P(V,fe,ve,"∄","\\nexists");P(V,fe,ve,"℧","\\mho");P(V,fe,ve,"Ⅎ","\\Finv",!0);P(V,fe,ve,"⅁","\\Game",!0);P(V,fe,ve,"‵","\\backprime");P(V,fe,ve,"▲","\\blacktriangle");P(V,fe,ve,"▼","\\blacktriangledown");P(V,fe,ve,"■","\\blacksquare");P(V,fe,ve,"⧫","\\blacklozenge");P(V,fe,ve,"★","\\bigstar");P(V,fe,ve,"∢","\\sphericalangle",!0);P(V,fe,ve,"∁","\\complement",!0);P(V,fe,ve,"ð","\\eth",!0);P(He,J,ve,"ð","ð");P(V,fe,ve,"╱","\\diagup");P(V,fe,ve,"╲","\\diagdown");P(V,fe,ve,"□","\\square");P(V,fe,ve,"□","\\Box");P(V,fe,ve,"◊","\\Diamond");P(V,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(V,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(V,fe,ve,"ℶ","\\beth",!0);P(V,fe,ve,"ℸ","\\daleth",!0);P(V,fe,ve,"ℷ","\\gimel",!0);P(V,fe,ve,"ϝ","\\digamma",!0);P(V,fe,ve,"ϰ","\\varkappa");P(V,fe,na,"┌","\\@ulcorner",!0);P(V,fe,ui,"┐","\\@urcorner",!0);P(V,fe,na,"└","\\@llcorner",!0);P(V,fe,ui,"┘","\\@lrcorner",!0);P(V,fe,he,"≦","\\leqq",!0);P(V,fe,he,"⩽","\\leqslant",!0);P(V,fe,he,"⪕","\\eqslantless",!0);P(V,fe,he,"≲","\\lesssim",!0);P(V,fe,he,"⪅","\\lessapprox",!0);P(V,fe,he,"≊","\\approxeq",!0);P(V,fe,dt,"⋖","\\lessdot");P(V,fe,he,"⋘","\\lll",!0);P(V,fe,he,"≶","\\lessgtr",!0);P(V,fe,he,"⋚","\\lesseqgtr",!0);P(V,fe,he,"⪋","\\lesseqqgtr",!0);P(V,fe,he,"≑","\\doteqdot");P(V,fe,he,"≓","\\risingdotseq",!0);P(V,fe,he,"≒","\\fallingdotseq",!0);P(V,fe,he,"∽","\\backsim",!0);P(V,fe,he,"⋍","\\backsimeq",!0);P(V,fe,he,"⫅","\\subseteqq",!0);P(V,fe,he,"⋐","\\Subset",!0);P(V,fe,he,"⊏","\\sqsubset",!0);P(V,fe,he,"≼","\\preccurlyeq",!0);P(V,fe,he,"⋞","\\curlyeqprec",!0);P(V,fe,he,"≾","\\precsim",!0);P(V,fe,he,"⪷","\\precapprox",!0);P(V,fe,he,"⊲","\\vartriangleleft");P(V,fe,he,"⊴","\\trianglelefteq");P(V,fe,he,"⊨","\\vDash",!0);P(V,fe,he,"⊪","\\Vvdash",!0);P(V,fe,he,"⌣","\\smallsmile");P(V,fe,he,"⌢","\\smallfrown");P(V,fe,he,"≏","\\bumpeq",!0);P(V,fe,he,"≎","\\Bumpeq",!0);P(V,fe,he,"≧","\\geqq",!0);P(V,fe,he,"⩾","\\geqslant",!0);P(V,fe,he,"⪖","\\eqslantgtr",!0);P(V,fe,he,"≳","\\gtrsim",!0);P(V,fe,he,"⪆","\\gtrapprox",!0);P(V,fe,dt,"⋗","\\gtrdot");P(V,fe,he,"⋙","\\ggg",!0);P(V,fe,he,"≷","\\gtrless",!0);P(V,fe,he,"⋛","\\gtreqless",!0);P(V,fe,he,"⪌","\\gtreqqless",!0);P(V,fe,he,"≖","\\eqcirc",!0);P(V,fe,he,"≗","\\circeq",!0);P(V,fe,he,"≜","\\triangleq",!0);P(V,fe,he,"∼","\\thicksim");P(V,fe,he,"≈","\\thickapprox");P(V,fe,he,"⫆","\\supseteqq",!0);P(V,fe,he,"⋑","\\Supset",!0);P(V,fe,he,"⊐","\\sqsupset",!0);P(V,fe,he,"≽","\\succcurlyeq",!0);P(V,fe,he,"⋟","\\curlyeqsucc",!0);P(V,fe,he,"≿","\\succsim",!0);P(V,fe,he,"⪸","\\succapprox",!0);P(V,fe,he,"⊳","\\vartriangleright");P(V,fe,he,"⊵","\\trianglerighteq");P(V,fe,he,"⊩","\\Vdash",!0);P(V,fe,he,"∣","\\shortmid");P(V,fe,he,"∥","\\shortparallel");P(V,fe,he,"≬","\\between",!0);P(V,fe,he,"⋔","\\pitchfork",!0);P(V,fe,he,"∝","\\varpropto");P(V,fe,he,"◀","\\blacktriangleleft");P(V,fe,he,"∴","\\therefore",!0);P(V,fe,he,"∍","\\backepsilon");P(V,fe,he,"▶","\\blacktriangleright");P(V,fe,he,"∵","\\because",!0);P(V,fe,he,"⋘","\\llless");P(V,fe,he,"⋙","\\gggtr");P(V,fe,dt,"⊲","\\lhd");P(V,fe,dt,"⊳","\\rhd");P(V,fe,he,"≂","\\eqsim",!0);P(V,J,he,"⋈","\\Join");P(V,fe,he,"≑","\\Doteq",!0);P(V,fe,dt,"∔","\\dotplus",!0);P(V,fe,dt,"∖","\\smallsetminus");P(V,fe,dt,"⋒","\\Cap",!0);P(V,fe,dt,"⋓","\\Cup",!0);P(V,fe,dt,"⩞","\\doublebarwedge",!0);P(V,fe,dt,"⊟","\\boxminus",!0);P(V,fe,dt,"⊞","\\boxplus",!0);P(V,fe,dt,"⋇","\\divideontimes",!0);P(V,fe,dt,"⋉","\\ltimes",!0);P(V,fe,dt,"⋊","\\rtimes",!0);P(V,fe,dt,"⋋","\\leftthreetimes",!0);P(V,fe,dt,"⋌","\\rightthreetimes",!0);P(V,fe,dt,"⋏","\\curlywedge",!0);P(V,fe,dt,"⋎","\\curlyvee",!0);P(V,fe,dt,"⊝","\\circleddash",!0);P(V,fe,dt,"⊛","\\circledast",!0);P(V,fe,dt,"⋅","\\centerdot");P(V,fe,dt,"⊺","\\intercal",!0);P(V,fe,dt,"⋒","\\doublecap");P(V,fe,dt,"⋓","\\doublecup");P(V,fe,dt,"⊠","\\boxtimes",!0);P(V,fe,he,"⇢","\\dashrightarrow",!0);P(V,fe,he,"⇠","\\dashleftarrow",!0);P(V,fe,he,"⇇","\\leftleftarrows",!0);P(V,fe,he,"⇆","\\leftrightarrows",!0);P(V,fe,he,"⇚","\\Lleftarrow",!0);P(V,fe,he,"↞","\\twoheadleftarrow",!0);P(V,fe,he,"↢","\\leftarrowtail",!0);P(V,fe,he,"↫","\\looparrowleft",!0);P(V,fe,he,"⇋","\\leftrightharpoons",!0);P(V,fe,he,"↶","\\curvearrowleft",!0);P(V,fe,he,"↺","\\circlearrowleft",!0);P(V,fe,he,"↰","\\Lsh",!0);P(V,fe,he,"⇈","\\upuparrows",!0);P(V,fe,he,"↿","\\upharpoonleft",!0);P(V,fe,he,"⇃","\\downharpoonleft",!0);P(V,J,he,"⊶","\\origof",!0);P(V,J,he,"⊷","\\imageof",!0);P(V,fe,he,"⊸","\\multimap",!0);P(V,fe,he,"↭","\\leftrightsquigarrow",!0);P(V,fe,he,"⇉","\\rightrightarrows",!0);P(V,fe,he,"⇄","\\rightleftarrows",!0);P(V,fe,he,"↠","\\twoheadrightarrow",!0);P(V,fe,he,"↣","\\rightarrowtail",!0);P(V,fe,he,"↬","\\looparrowright",!0);P(V,fe,he,"↷","\\curvearrowright",!0);P(V,fe,he,"↻","\\circlearrowright",!0);P(V,fe,he,"↱","\\Rsh",!0);P(V,fe,he,"⇊","\\downdownarrows",!0);P(V,fe,he,"↾","\\upharpoonright",!0);P(V,fe,he,"⇂","\\downharpoonright",!0);P(V,fe,he,"⇝","\\rightsquigarrow",!0);P(V,fe,he,"⇝","\\leadsto");P(V,fe,he,"⇛","\\Rrightarrow",!0);P(V,fe,he,"↾","\\restriction");P(V,J,ve,"‘","`");P(V,J,ve,"$","\\$");P(He,J,ve,"$","\\$");P(He,J,ve,"$","\\textdollar");P(V,J,ve,"%","\\%");P(He,J,ve,"%","\\%");P(V,J,ve,"_","\\_");P(He,J,ve,"_","\\_");P(He,J,ve,"_","\\textunderscore");P(V,J,ve,"∠","\\angle",!0);P(V,J,ve,"∞","\\infty",!0);P(V,J,ve,"′","\\prime");P(V,J,ve,"△","\\triangle");P(V,J,ve,"Γ","\\Gamma",!0);P(V,J,ve,"Δ","\\Delta",!0);P(V,J,ve,"Θ","\\Theta",!0);P(V,J,ve,"Λ","\\Lambda",!0);P(V,J,ve,"Ξ","\\Xi",!0);P(V,J,ve,"Π","\\Pi",!0);P(V,J,ve,"Σ","\\Sigma",!0);P(V,J,ve,"Υ","\\Upsilon",!0);P(V,J,ve,"Φ","\\Phi",!0);P(V,J,ve,"Ψ","\\Psi",!0);P(V,J,ve,"Ω","\\Omega",!0);P(V,J,ve,"A","Α");P(V,J,ve,"B","Β");P(V,J,ve,"E","Ε");P(V,J,ve,"Z","Ζ");P(V,J,ve,"H","Η");P(V,J,ve,"I","Ι");P(V,J,ve,"K","Κ");P(V,J,ve,"M","Μ");P(V,J,ve,"N","Ν");P(V,J,ve,"O","Ο");P(V,J,ve,"P","Ρ");P(V,J,ve,"T","Τ");P(V,J,ve,"X","Χ");P(V,J,ve,"¬","\\neg",!0);P(V,J,ve,"¬","\\lnot");P(V,J,ve,"⊤","\\top");P(V,J,ve,"⊥","\\bot");P(V,J,ve,"∅","\\emptyset");P(V,fe,ve,"∅","\\varnothing");P(V,J,Bt,"α","\\alpha",!0);P(V,J,Bt,"β","\\beta",!0);P(V,J,Bt,"γ","\\gamma",!0);P(V,J,Bt,"δ","\\delta",!0);P(V,J,Bt,"ϵ","\\epsilon",!0);P(V,J,Bt,"ζ","\\zeta",!0);P(V,J,Bt,"η","\\eta",!0);P(V,J,Bt,"θ","\\theta",!0);P(V,J,Bt,"ι","\\iota",!0);P(V,J,Bt,"κ","\\kappa",!0);P(V,J,Bt,"λ","\\lambda",!0);P(V,J,Bt,"μ","\\mu",!0);P(V,J,Bt,"ν","\\nu",!0);P(V,J,Bt,"ξ","\\xi",!0);P(V,J,Bt,"ο","\\omicron",!0);P(V,J,Bt,"π","\\pi",!0);P(V,J,Bt,"ρ","\\rho",!0);P(V,J,Bt,"σ","\\sigma",!0);P(V,J,Bt,"τ","\\tau",!0);P(V,J,Bt,"υ","\\upsilon",!0);P(V,J,Bt,"ϕ","\\phi",!0);P(V,J,Bt,"χ","\\chi",!0);P(V,J,Bt,"ψ","\\psi",!0);P(V,J,Bt,"ω","\\omega",!0);P(V,J,Bt,"ε","\\varepsilon",!0);P(V,J,Bt,"ϑ","\\vartheta",!0);P(V,J,Bt,"ϖ","\\varpi",!0);P(V,J,Bt,"ϱ","\\varrho",!0);P(V,J,Bt,"ς","\\varsigma",!0);P(V,J,Bt,"φ","\\varphi",!0);P(V,J,dt,"∗","*",!0);P(V,J,dt,"+","+");P(V,J,dt,"−","-",!0);P(V,J,dt,"⋅","\\cdot",!0);P(V,J,dt,"∘","\\circ",!0);P(V,J,dt,"÷","\\div",!0);P(V,J,dt,"±","\\pm",!0);P(V,J,dt,"×","\\times",!0);P(V,J,dt,"∩","\\cap",!0);P(V,J,dt,"∪","\\cup",!0);P(V,J,dt,"∖","\\setminus",!0);P(V,J,dt,"∧","\\land");P(V,J,dt,"∨","\\lor");P(V,J,dt,"∧","\\wedge",!0);P(V,J,dt,"∨","\\vee",!0);P(V,J,ve,"√","\\surd");P(V,J,na,"⟨","\\langle",!0);P(V,J,na,"∣","\\lvert");P(V,J,na,"∥","\\lVert");P(V,J,ui,"?","?");P(V,J,ui,"!","!");P(V,J,ui,"⟩","\\rangle",!0);P(V,J,ui,"∣","\\rvert");P(V,J,ui,"∥","\\rVert");P(V,J,he,"=","=");P(V,J,he,":",":");P(V,J,he,"≈","\\approx",!0);P(V,J,he,"≅","\\cong",!0);P(V,J,he,"≥","\\ge");P(V,J,he,"≥","\\geq",!0);P(V,J,he,"←","\\gets");P(V,J,he,">","\\gt",!0);P(V,J,he,"∈","\\in",!0);P(V,J,he,"","\\@not");P(V,J,he,"⊂","\\subset",!0);P(V,J,he,"⊃","\\supset",!0);P(V,J,he,"⊆","\\subseteq",!0);P(V,J,he,"⊇","\\supseteq",!0);P(V,fe,he,"⊈","\\nsubseteq",!0);P(V,fe,he,"⊉","\\nsupseteq",!0);P(V,J,he,"⊨","\\models");P(V,J,he,"←","\\leftarrow",!0);P(V,J,he,"≤","\\le");P(V,J,he,"≤","\\leq",!0);P(V,J,he,"<","\\lt",!0);P(V,J,he,"→","\\rightarrow",!0);P(V,J,he,"→","\\to");P(V,fe,he,"≱","\\ngeq",!0);P(V,fe,he,"≰","\\nleq",!0);P(V,J,Vl," ","\\ ");P(V,J,Vl," ","\\space");P(V,J,Vl," ","\\nobreakspace");P(He,J,Vl," ","\\ ");P(He,J,Vl," "," ");P(He,J,Vl," ","\\space");P(He,J,Vl," ","\\nobreakspace");P(V,J,Vl,"","\\nobreak");P(V,J,Vl,"","\\allowbreak");P(V,J,dm,",",",");P(V,J,dm,";",";");P(V,fe,dt,"⊼","\\barwedge",!0);P(V,fe,dt,"⊻","\\veebar",!0);P(V,J,dt,"⊙","\\odot",!0);P(V,J,dt,"⊕","\\oplus",!0);P(V,J,dt,"⊗","\\otimes",!0);P(V,J,ve,"∂","\\partial",!0);P(V,J,dt,"⊘","\\oslash",!0);P(V,fe,dt,"⊚","\\circledcirc",!0);P(V,fe,dt,"⊡","\\boxdot",!0);P(V,J,dt,"△","\\bigtriangleup");P(V,J,dt,"▽","\\bigtriangledown");P(V,J,dt,"†","\\dagger");P(V,J,dt,"⋄","\\diamond");P(V,J,dt,"⋆","\\star");P(V,J,dt,"◃","\\triangleleft");P(V,J,dt,"▹","\\triangleright");P(V,J,na,"{","\\{");P(He,J,ve,"{","\\{");P(He,J,ve,"{","\\textbraceleft");P(V,J,ui,"}","\\}");P(He,J,ve,"}","\\}");P(He,J,ve,"}","\\textbraceright");P(V,J,na,"{","\\lbrace");P(V,J,ui,"}","\\rbrace");P(V,J,na,"[","\\lbrack",!0);P(He,J,ve,"[","\\lbrack",!0);P(V,J,ui,"]","\\rbrack",!0);P(He,J,ve,"]","\\rbrack",!0);P(V,J,na,"(","\\lparen",!0);P(V,J,ui,")","\\rparen",!0);P(He,J,ve,"<","\\textless",!0);P(He,J,ve,">","\\textgreater",!0);P(V,J,na,"⌊","\\lfloor",!0);P(V,J,ui,"⌋","\\rfloor",!0);P(V,J,na,"⌈","\\lceil",!0);P(V,J,ui,"⌉","\\rceil",!0);P(V,J,ve,"\\","\\backslash");P(V,J,ve,"∣","|");P(V,J,ve,"∣","\\vert");P(He,J,ve,"|","\\textbar",!0);P(V,J,ve,"∥","\\|");P(V,J,ve,"∥","\\Vert");P(He,J,ve,"∥","\\textbardbl");P(He,J,ve,"~","\\textasciitilde");P(He,J,ve,"\\","\\textbackslash");P(He,J,ve,"^","\\textasciicircum");P(V,J,he,"↑","\\uparrow",!0);P(V,J,he,"⇑","\\Uparrow",!0);P(V,J,he,"↓","\\downarrow",!0);P(V,J,he,"⇓","\\Downarrow",!0);P(V,J,he,"↕","\\updownarrow",!0);P(V,J,he,"⇕","\\Updownarrow",!0);P(V,J,is,"∐","\\coprod");P(V,J,is,"⋁","\\bigvee");P(V,J,is,"⋀","\\bigwedge");P(V,J,is,"⨄","\\biguplus");P(V,J,is,"⋂","\\bigcap");P(V,J,is,"⋃","\\bigcup");P(V,J,is,"∫","\\int");P(V,J,is,"∫","\\intop");P(V,J,is,"∬","\\iint");P(V,J,is,"∭","\\iiint");P(V,J,is,"∏","\\prod");P(V,J,is,"∑","\\sum");P(V,J,is,"⨂","\\bigotimes");P(V,J,is,"⨁","\\bigoplus");P(V,J,is,"⨀","\\bigodot");P(V,J,is,"∮","\\oint");P(V,J,is,"∯","\\oiint");P(V,J,is,"∰","\\oiiint");P(V,J,is,"⨆","\\bigsqcup");P(V,J,is,"∫","\\smallint");P(He,J,g_,"…","\\textellipsis");P(V,J,g_,"…","\\mathellipsis");P(He,J,g_,"…","\\ldots",!0);P(V,J,g_,"…","\\ldots",!0);P(V,J,g_,"⋯","\\@cdots",!0);P(V,J,g_,"⋱","\\ddots",!0);P(V,J,ve,"⋮","\\varvdots");P(He,J,ve,"⋮","\\varvdots");P(V,J,Cr,"ˊ","\\acute");P(V,J,Cr,"ˋ","\\grave");P(V,J,Cr,"¨","\\ddot");P(V,J,Cr,"~","\\tilde");P(V,J,Cr,"ˉ","\\bar");P(V,J,Cr,"˘","\\breve");P(V,J,Cr,"ˇ","\\check");P(V,J,Cr,"^","\\hat");P(V,J,Cr,"⃗","\\vec");P(V,J,Cr,"˙","\\dot");P(V,J,Cr,"˚","\\mathring");P(V,J,Bt,"","\\@imath");P(V,J,Bt,"","\\@jmath");P(V,J,ve,"ı","ı");P(V,J,ve,"ȷ","ȷ");P(He,J,ve,"ı","\\i",!0);P(He,J,ve,"ȷ","\\j",!0);P(He,J,ve,"ß","\\ss",!0);P(He,J,ve,"æ","\\ae",!0);P(He,J,ve,"œ","\\oe",!0);P(He,J,ve,"ø","\\o",!0);P(He,J,ve,"Æ","\\AE",!0);P(He,J,ve,"Œ","\\OE",!0);P(He,J,ve,"Ø","\\O",!0);P(He,J,Cr,"ˊ","\\'");P(He,J,Cr,"ˋ","\\`");P(He,J,Cr,"ˆ","\\^");P(He,J,Cr,"˜","\\~");P(He,J,Cr,"ˉ","\\=");P(He,J,Cr,"˘","\\u");P(He,J,Cr,"˙","\\.");P(He,J,Cr,"¸","\\c");P(He,J,Cr,"˚","\\r");P(He,J,Cr,"ˇ","\\v");P(He,J,Cr,"¨",'\\"');P(He,J,Cr,"˝","\\H");P(He,J,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,J,ve,"–","--",!0);P(He,J,ve,"–","\\textendash");P(He,J,ve,"—","---",!0);P(He,J,ve,"—","\\textemdash");P(He,J,ve,"‘","`",!0);P(He,J,ve,"‘","\\textquoteleft");P(He,J,ve,"’","'",!0);P(He,J,ve,"’","\\textquoteright");P(He,J,ve,"“","``",!0);P(He,J,ve,"“","\\textquotedblleft");P(He,J,ve,"”","''",!0);P(He,J,ve,"”","\\textquotedblright");P(V,J,ve,"°","\\degree",!0);P(He,J,ve,"°","\\degree");P(He,J,ve,"°","\\textdegree",!0);P(V,J,ve,"£","\\pounds");P(V,J,ve,"£","\\mathsterling",!0);P(He,J,ve,"£","\\pounds");P(He,J,ve,"£","\\textsterling",!0);P(V,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var aw=0;aw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new $b(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},P3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},kv={},Cv={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),F3(i,(x,S)=>{var v,b,w=q3(S),y=q3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},F3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof $b||n instanceof m_&&n.hasClass("enclosing")?n:null},H3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return H3(s[s.length-1],"right");if(t==="left")return H3(s[0],"left")}}return n},q3=function(n,t){if(!n)return null;t&&(n=H3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(kv[n.type]){var s=kv[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function U3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=P3[t].fontName;return JS(i,o,r)?P3[t].variant:null};function uw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||uw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Cv[n.type])return Cv[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=U3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=U3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=U3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Hb=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),qb=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Ub(e){var n=Gb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Gb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=qb(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=Fb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?Hb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Ev(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=qb(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=Hb(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=qb(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=Hb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Wb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Wb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Wb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Wb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var G3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(G3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=G3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===G3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},dw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},fw=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},W3=.008,t1={type:"kern",size:-1*W3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var q=M-S-y,U=Math.round(M*1e3),Y=_6t(d,Math.round(q*1e3)),G=new mu(d,Y),X=et(p/1e3),te=et(U/1e3),I=new ql([G],{width:X,height:te,viewBox:"0 0 "+p+" "+U}),L=gu([],[I],s);L.height=U/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(dw(_,m,i)),$.push(t1),l===null){var F=M-S-y+2*W3;$.push(fw(u,F,s))}else{var W=(M-S-y-C)/2+2*W3;$.push(fw(u,W,s)),$.push(t1),$.push(dw(l,m,i)),$.push(t1),$.push(fw(u,W,s))}$.push(t1),$.push(dw(o,m,i))}var H=s.havingBaseStyle(Yt.TEXT),ee=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[ee],H),Yt.TEXT,s,a)},hw=80,_w=.08,pw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+hw,n<1?i=1:n<1.4&&(i=.7),l=(1+a+_w)/i,u=(1+a)/i,o=pw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+hw)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+_w)/i,o=pw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+_w,u=n+a,_=Math.floor(1e3*n+a)+hw,o=pw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},V3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},mw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return V3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Vb(e,n){var t=Gb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Vb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Vb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Kb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Qb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ce;le=(oe=(ce=H)==null?void 0:ce.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),U.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Ub(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Ub(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Yb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Yb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Yb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Ev(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Wb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Ev(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=Ev(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=qb(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=Hb(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var gw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var K3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in K3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=q3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return Fb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return Fb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var vw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},bw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(bw.hasOwnProperty(e.text)){var t=bw[e.text].className||"";if(e.mode==="text"){var r=Fb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(vw.hasOwnProperty(e.text))return Ge(["mspace",vw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(bw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(vw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r ]`,CSt="\\\\[a-zA-Z@]+",ESt="\\\\[^\uD800-\uDFFF]",NSt="("+CSt+")"+aP+"*",zSt=`\\\\( |[ \r ]+ ?)[ \r ]*`,Q3="[̀-ͯ]",jSt=new RegExp(Q3+"+$"),TSt="("+aP+"+)|"+(zSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Q3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Q3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+NSt)+("|"+ESt+")");class HT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(TSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Yi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Yi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class ASt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var RSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var qT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=qT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=qT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},MSt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in UT?n=UT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&MSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new ASt(RSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new HT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new HT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var GT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),yw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Xb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new DSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Xb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Lb(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` + please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:s}}WT.hasOwnProperty(t[0])&&!Sr[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',n),t=WT[t[0]]+t.slice(1));var i=jSt.exec(t);i&&(t=t.substring(0,i.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var a;if(Sr[this.mode][t]){this.settings.strict&&this.mode==="math"&&L3.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',n);var o=Sr[this.mode][t].group,l=Si.range(n),u;Y6t(o)?u={type:"atom",mode:this.mode,family:o,loc:l,text:t}:u={type:o,mode:this.mode,loc:l,text:t},a=u}else if(t.charCodeAt(0)>=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Lb(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` `:" ")+i.indentLines(i.containerFlow(r,o.current()),n?pP:mkt))),u(),l}}function mkt(e,n,t){return n===0?e:pP(e,n,t)}function pP(e,n,t){return(t?"":" ")+e}const gkt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mP.peek=wkt;function vkt(){return{canContainEols:["delete"],enter:{strikethrough:ykt},exit:{strikethrough:xkt}}}function bkt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gkt}],handlers:{delete:mP}}}function ykt(e){this.enter({type:"delete",children:[]},e)}function xkt(e){this.exit(e)}function mP(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function wkt(){return"~"}function Skt(e){return e.length}function kkt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||Skt,i=[],a=[],o=[],l=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++bl[b])&&(l[b]=y)}S.push(w)}a[_]=S,o[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dl[d]&&(l[d]=w),m[d]=w),p[d]=y}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),Nkt);return s(),a}function Nkt(e,n,t){return">"+(t?"":" ")+e}function zkt(e,n){return YT(e,n.inConstruct,!0)&&!YT(e,n.notInConstruct,!1)}function YT(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function $kt(){return"!"}xP.peek=Pkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pkt(){return"!"}wP.peek=Fkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Hkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Hkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=qkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function qkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ukt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Wkt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Gkt(t):hk(t);const o=e.ordered?a==="."?")":".":Ukt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Qkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Ykt=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xkt(e,n,t,r){return(e.children.some(function(a){return Ykt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zkt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=Jkt;function NP(e,n,t,r){const s=Zkt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=Nv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Nv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Jkt(e,n,t){return t.options.strong||"*"}function e7t(e,n,t,r){return t.safe(e.value,r)}function t7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(t7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Ekt,break:XT,code:Akt,definition:Mkt,emphasis:vP,hardBreak:XT,heading:Ikt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Wkt,listItem:Kkt,paragraph:Qkt,root:Xkt,strong:NP,text:e7t,thematicBreak:n7t};function r7t(){return{enter:{table:s7t,tableData:ZT,tableHeader:ZT,tableRow:a7t},exit:{codeText:o7t,table:i7t,tableData:kw,tableHeader:kw,tableRow:kw}}}function s7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function i7t(e){this.exit(e),this.data.inTable=void 0}function a7t(e){this.enter({type:"tableRow",children:[]},e)}function kw(e){this.exit(e)}function ZT(e){this.enter({type:"tableCell",children:[]},e)}function o7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function l7t(e,n){return n==="|"?n:e}function c7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:o}};function a(m,x,S,v){return u(_(m,S,v),m.align)}function o(m,x,S,v){const b=d(m,S,v),w=u([b]);return w.slice(0,w.indexOf(` -`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,H=$==="tableHead"||$==="tableRow"?N:l;return H===N&&r.parser.lazy[r.now().line]?t(O):H(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const U=r.events[B][1].type;if(U==="lineEnding"||U==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,q=$==="tableHead"||$==="tableRow"?N:l;return q===N&&r.parser.lazy[r.now().line]?t(O):q(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,l){const u=i.value||"",_=o.createTracker(l),d="$".repeat(Math.max(gP(u,"$")+1,2)),p=o.enter("mathFlow");let m=_.move(d);if(i.meta){const x=o.enter("mathFlowMeta");m+=_.move(o.safe(i.meta,{after:` `,before:m,encode:["$"],..._.current()})),x()}return m+=_.move(` `),u&&(m+=_.move(u+` @@ -993,7 +993,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, `,u+3),p=d===-1?e.length:d;/^[ \t]*$/.test(e.slice(_,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Wr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:s6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(ub,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Cw(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Cw(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Wr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Wr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(yv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` `)))return f.jsx("code",{className:s,...r,children:t});const l=i?g3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Wr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const zv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` -`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${zv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${zv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ab(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Zb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Ew(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),rb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Ew(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Ew(o).variant,children:Ew(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Zb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():eb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,P=>(typeof L=="function"?L(P??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function ee(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(P){w(P instanceof Error?P.message:String(P))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Zb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:ee,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Zb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:eb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},Jb={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],Nw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=Nw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||Nw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),Nw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:Jb[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":EN(),title:EN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:Jb[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(N1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:Jb[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:Jb[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():eb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:eb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Zb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:k4({name:Ne(e)}),"aria-label":k4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},zw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":jN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=zw[n.channel])==null?void 0:d.call(zw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x,r.githubDefaultPromptSeen]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:zN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":zN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:R4()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":R4(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:z4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var I;const t=mn({mutationFn:L=>GL(...L)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=L=>{Vr(r.queryKey,P=>(typeof L=="function"?L(P??null):L)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((I=s.error)==null?void 0:I.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(!1),[j,M]=R.useState(null),O=!!(i!=null&&i.github.owner&&i.github.repo);R.useEffect(()=>{!e||w!==null||(y(e.githubAutoTopicsEnabled),E(e.githubTopics.join(", ")))},[e,w]);const B=async()=>{await s.refetch({cancelRefetch:!1})},$=L=>{const P=L instanceof Error?L.message:String(L);return P.toLowerCase().includes("archived")?tPe():P.includes("(fetch first)")||P.includes("non-fast-forward")?iPe():P.includes("403")||P.toLowerCase().includes("permission denied")?cPe():P},H=()=>{e&&(l(!0),_(null),yft(e.id).then(L=>{a(L.git),n(L.project),nt.fetchQuery(v6()).then(P=>{!P.githubForNewProjects&&!P.githubDefaultPromptSeen&&m(!0)}).catch(()=>{})}).catch(L=>_($(L))).finally(()=>l(!1)))},q=L=>{S(!0),b(null),t.mutateAsync([L,L,!0]).then(()=>m(!1)).catch(P=>b(P instanceof Error?P.message:String(P))).finally(()=>S(!1))},Y=L=>L.split(",").map(P=>P.trim()).filter(P=>P.length>0),G=e?e.githubTopics.join(", "):"",X=!!(e&&w!==null&&C!==null&&(w!==e.githubAutoTopicsEnabled||C!==G)),ee=()=>{!e||w===null||C===null||(T(!0),M(null),Wut(e.id,{githubAutoTopicsEnabled:w,githubTopics:Y(C)}).then(L=>{y(L.githubAutoTopicsEnabled),E(L.githubTopics.join(", ")),n(L)}).catch(L=>M(L instanceof Error?L.message:String(L))).finally(()=>T(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(L=>`${L.name}: ${L.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(L=>_(String(L))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:O?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>B()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:O?Btt():j$e()}),f.jsxs("div",{className:G0,children:[O&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:H,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:RN()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:w??!1,"aria-label":R4(),disabled:w===null||N,onClick:()=>y(L=>!(L??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:C??"",onChange:L=>E(L.target.value),placeholder:GD(),disabled:C===null||N,"aria-label":RN()}),f.jsx(Le,{variant:"primary",disabled:!X||N,onClick:ee,children:N?Ei():no()})]}),j&&f.jsx("div",{className:"error mt-2",children:j})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(L=>{a(L.git),n(L.project)}).catch(L=>_(L instanceof Error?L.message:String(L))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:$(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>q(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:L=>L.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>q(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>q(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},jw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=jw[e])==null?void 0:n.call(jw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(sb,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:TN(),"aria-label":TN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function jv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${jv(e.plugin)}: `:""}${jv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Tw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${zv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${zv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ab(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Zb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Ew(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),rb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Ew(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Ew(o).variant,children:Ew(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Zb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():eb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(q=>({...q,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(q=>({...q,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,q]=tF(B);function U(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Zb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):U()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),q(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Zb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:eb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},Jb={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],Nw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=Nw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,q){const U=cA.includes($);if(!(p||Nw.includes($)&&!q.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:U&&q.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const q=e.targets.find(Y=>Y.id===$);if(!q)return;o(q.id);const U=q.id===s?i:"";u(U),d(g0(q.id,U)),Nw.includes(q.id)||M(q.id,U)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const q=e.targets.find(U=>U.id===$.id);return q?f.jsx(u_,{kind:Jb[q.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":EN(),title:EN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:Jb[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(N1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:Jb[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:Jb[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():eb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:eb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Zb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:k4({name:Ne(e)}),"aria-label":k4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},zw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":jN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=zw[n.channel])==null?void 0:d.call(zw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x,r.githubDefaultPromptSeen]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:zN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":zN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:R4()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":R4(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:z4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var W;const t=mn({mutationFn:H=>GL(...H)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=H=>{Vr(r.queryKey,ee=>(typeof H=="function"?H(ee??null):H)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((W=s.error)==null?void 0:W.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),q=R.useRef(null);R.useEffect(()=>{!e||q.current===e.id||(q.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const U=async()=>{await s.refetch({cancelRefetch:!1})},Y=H=>{const ee=H instanceof Error?H.message:String(H);return ee.toLowerCase().includes("archived")?tPe():ee.includes("(fetch first)")||ee.includes("non-fast-forward")?iPe():ee.includes("403")||ee.toLowerCase().includes("permission denied")?cPe():ee},G=()=>{e&&(l(!0),_(null),yft(e.id).then(H=>{a(H.git),n(H.project),nt.fetchQuery(v6()).then(ee=>{!ee.githubForNewProjects&&!ee.githubDefaultPromptSeen&&(y(ee.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(H=>_(Y(H))).finally(()=>l(!1)))},X=H=>{S(!0),b(null),t.mutateAsync([H,w??H,!0]).then(()=>m(!1)).catch(ee=>b(ee instanceof Error?ee.message:String(ee))).finally(()=>S(!1))},te=H=>H.split(",").map(ee=>ee.trim()).filter(ee=>ee.length>0),I=e?e.githubTopics.join(", "):"",L=!!(e&&C!==null&&N!==null&&(C!==e.githubAutoTopicsEnabled||N!==I)),F=()=>{!e||C===null||N===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:te(N)}).then(H=>{E(H.githubAutoTopicsEnabled),T(H.githubTopics.join(", ")),n(H)}).catch(H=>B(H instanceof Error?H.message:String(H))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(H=>`${H.name}: ${H.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(H=>_(String(H))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>U()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:RN()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":R4(),disabled:C===null||j,onClick:()=>E(H=>!(H??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:N??"",onChange:H=>T(H.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":RN()}),f.jsx(Le,{variant:"primary",disabled:!L||j,onClick:F,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(H=>{a(H.git),n(H.project)}).catch(H=>_(H instanceof Error?H.message:String(H))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:H=>H.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},jw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=jw[e])==null?void 0:n.call(jw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(sb,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:TN(),"aria-label":TN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function jv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${jv(e.plugin)}: `:""}${jv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Tw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||n5(r).localeCompare(n5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:n5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function r5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(jv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),jv(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` `)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const s5=6.5,pA=2*Math.PI*s5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Tv="!";function mA(e){return e.startsWith(Tv)?e.slice(Tv.length).trim():null}function T8t(e){return e.startsWith(Tv)?e.slice(Tv.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` @@ -1051,22 +1051,22 @@ ${n.trim()} `).trim()}function s9t(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function i9t(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Mxt(r),_F(r)}function _F(e){return o9t(e).replace(/[\t\r ]+/g," ").trim()}function a9t(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&mF(s)?{ref:r,path:s}:null}function u9t(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function wA(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function d9t(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const l=wA(s,o);if(!l)return null;s=l}return s?wA(s,e):e}const ko="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",f9t=new RegExp(`\\bchat_(${ko})\\b`,"gi"),Nd=`(?:${ko}|[0-9a-f]{8})`;function ph(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,d=null,p=!1;for(let m=u;m{let _=!1;for(let d=u;dOxt(t.raw,n))}function ya(e,n){return ty(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function o5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ty(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:o5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ty(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Lw(i,"targetIds")),_=_h(Lw(i,"runTargetIds")),d=_h(Lw(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Dw(i,"search_query","q"),N=Dw(i,"image_query","q"),T=Dw(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),H=ty(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),q=H?Iee():kZ(),Y=H?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Mw(X.path);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const ee=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=ee>=0?O[ee]:null,L=I?l9t(I):null,P=L?d9t(L,N,ee,Gs(i,"cwd","workdir")):null;if(L&&P){const re=Mw(P);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:P,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re??void 0}}const U=O.find(re=>(re==null?void 0:re.name)==="git"),te=U==null?void 0:U.args[0];if(te==="grep"){const re=U==null?void 0:U.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re}}if(te==="status")return{kind:"command",label:mle()};if(te==="diff")return{kind:"command",label:Ede()};if(te==="log")return{kind:"command",label:Kue()};const de=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return de("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||de("typecheck")?{kind:"command",label:Ole()}:de("lint")?{kind:"command",label:ile()}:de("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Mw(p):null;return N?{kind:"skill",label:v2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?y2({pattern:Ne(E)}):b2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Av({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Ow({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Wr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function l5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Wr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Wr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Wr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ey(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ey((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:y3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(l5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Av,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Av,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:H,activity:q})=>f.jsx(kA,{part:$,repeatCount:H,activity:q,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Ur,iconClass:"text-accent-red"}:{label:Cue(),icon:db,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Wr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:a5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:a5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":s6(),disabled:!e,onClick:p,children:f.jsx(ub,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const ee=n.parts.filter(te=>te.type==="text").map(te=>te.text??"").join(` -`),I=te=>!!(v!=null&&v.some(de=>de.name===te)),L=n.parts.filter(te=>te.type==="image"&&te.text).map(N9t),P=L.filter(te=>!te.isPdf),W=L.filter(te=>te.isPdf),U=n.parts.filter(te=>te.type==="annotation"&&te.text).map(te=>({id:te.id,text:te.text??""}));if(O!==null){const te=()=>{const de=O.trim();!de||N||(B(null),j(n.id,de))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:de=>B(de.target.value),onKeyDown:de=>{de.key==="Escape"?(de.preventDefault(),B(null)):de.key==="Enter"&&!de.shiftKey&&!de.nativeEvent.isComposing&&(de.preventDefault(),te())}}),f.jsxs("div",{className:`${a5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:te,disabled:N||!O.trim(),children:E4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[U.length>0&&f.jsx(vk,{annotations:U,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:ee,isCommand:I}),P.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:P.map((te,de)=>f.jsx("a",{href:te.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:te.src,alt:vie()})},de))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((te,de)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:te.src,target:"_blank",rel:"noreferrer",children:[f.jsx(db,{size:15}),f.jsx("span",{children:te.name})]},de))})]}),w!==void 0&&f.jsx(z9t,{text:ee,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(ee),editDisabled:N})]})}const H=n.parts.find(ee=>ee.type==="tool"&&y3(ee)),q=n.parts.find(om)??H,Y=n.parts.filter(ee=>ee!==q&&!(H&&y3(ee)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),q&&f.jsx(SF,{part:q,usageLimited:!!H,busy:m,recovering:x===((X=(G=q.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:L1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:L1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:L1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function L1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Rv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Rv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ey(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=L1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?n6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ey(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Wr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,P;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(U=>U.role==="user"&&!U.id.startsWith(Cd));return kxt(a,n,W,U=>U.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),H=R.useCallback(W=>j[W].id,[j]),q=R.useCallback(W=>{if(B)return j.map((te,de)=>de);const U=new Set(yB(W));return j.forEach((te,de)=>{O.current.has(te.id)&&U.add(de)}),[...U].sort((te,de)=>te-de)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:H,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((P=t.current)==null?void 0:P.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:q});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var de;const U=window.getSelection();if(!U||U.isCollapsed||!U.rangeCount)return;const te=U.getRangeAt(0);for(const re of((de=t.current)==null?void 0:de.querySelectorAll("[data-message-id]"))??[])te.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),ee=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ce,pe;const U=j[W.index],te=U.parts.find(om),de=(Q=(ne=te==null?void 0:te.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=te?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":U.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(U.id),onFocusCapture:()=>O.current.add(U.id),children:f.jsx(j9t,{message:U,forkCount:(le=M.get(U.id))==null?void 0:le.count,forkIndex:(oe=M.get(U.id))==null?void 0:oe.index,forkPrevId:(ce=M.get(U.id))==null?void 0:ce.prevId,forkNextId:(pe=M.get(U.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(ee==null?void 0:ee.messageId)===U.id?ee.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:de===C?C:null,onRecover:E,skills:N,predictTextTail:_&&U===G&&U.role==="assistant"})},U.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,fb],Iw=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ab(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:H=t9t}=ct($),q=R.useCallback(ie=>{Vr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,ee]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const P=R.useRef({projectId:e});P.current.projectId!==e&&(P.current={projectId:e});const[W,U]=R.useState(new Set),[te,de]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ce=R.useRef({projectId:e,activeId:I,mainView:i});(ce.current.projectId!==e||ce.current.activeId!==I||ce.current.mainView!==i)&&(ce.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=r5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Tw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==r5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=H.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Tw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:sv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=nb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Pr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Pr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(w2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=P.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(P.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{P.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();U(e===N2?new Set([p6,m6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=P.current;return()=>{P.current===be&&(P.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>av(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>av(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&U(be=>Ext(be,ie.ids,we.busySessions,H,i==="chat"?I:null))},[e,we.busySessions,H,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Fr=I?we.queuedBySession[I]??[]:[],oa=Fr.some(ie=>ie.dispatchState==="retrying"),Jl=Fr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Fr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Fr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Fr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===N2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Pr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ce.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(w2())}catch{Te(IE()),ho()}return}const Z=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!Z){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(Z,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&te==="archived"&&de("active");const Tn=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ce.current,Oe=P.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return P.current===Oe&&(q(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),P.current===Oe&&ce.current===Ae&&(L.current(Ue.id,{replace:!0}),ce.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ce.current;let Oe=I;const Ue=()=>{const Ln=ce.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(w2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&te==="archived"&&de("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){Jv(ie),ce.current.projectId===e&&ce.current.activeId===ie&&ce.current.mainView==="chat"&&L.current(null,{replace:!0}),U(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=H.filter(ie=>P9t(te,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{de("active"),w(null)},[w]),Ru=R.useCallback(ie=>{de("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===te))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:te,onChange:de})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===N2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:te==="archived"?Hae():H.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(dv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:o6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),ee(!0)}}),X&&f.jsx(ZP,{onClose:()=>{ee(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Iw[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Iw[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=Iw[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Fr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Fr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} +`){a();continue}t+=_,r+=_}return a(),n}function ty(e,n){return ph(e).filter(t=>Oxt(t.raw,n))}function ya(e,n){return ty(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function o5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ty(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:o5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ty(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Lw(i,"targetIds")),_=_h(Lw(i,"runTargetIds")),d=_h(Lw(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Dw(i,"search_query","q"),N=Dw(i,"image_query","q"),T=Dw(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),q=ty(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),U=q?Iee():kZ(),Y=q?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:U,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:U,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Mw(X.path);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const te=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=te>=0?O[te]:null,L=I?l9t(I):null,F=L?d9t(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const re=Mw(F);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re??void 0}}const H=O.find(re=>(re==null?void 0:re.name)==="git"),ee=H==null?void 0:H.args[0];if(ee==="grep"){const re=H==null?void 0:H.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re}}if(ee==="status")return{kind:"command",label:mle()};if(ee==="diff")return{kind:"command",label:Ede()};if(ee==="log")return{kind:"command",label:Kue()};const de=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return de("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||de("typecheck")?{kind:"command",label:Ole()}:de("lint")?{kind:"command",label:ile()}:de("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Mw(p):null;return N?{kind:"skill",label:v2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?y2({pattern:Ne(E)}):b2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Av({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Ow({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Wr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function l5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Wr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Wr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Wr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ey(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ey((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:y3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(l5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Av,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Av,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:q,activity:U})=>f.jsx(kA,{part:$,repeatCount:q,activity:U,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Ur,iconClass:"text-accent-red"}:{label:Cue(),icon:db,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Wr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:a5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:a5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":s6(),disabled:!e,onClick:p,children:f.jsx(ub,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const te=n.parts.filter(ee=>ee.type==="text").map(ee=>ee.text??"").join(` +`),I=ee=>!!(v!=null&&v.some(de=>de.name===ee)),L=n.parts.filter(ee=>ee.type==="image"&&ee.text).map(N9t),F=L.filter(ee=>!ee.isPdf),W=L.filter(ee=>ee.isPdf),H=n.parts.filter(ee=>ee.type==="annotation"&&ee.text).map(ee=>({id:ee.id,text:ee.text??""}));if(O!==null){const ee=()=>{const de=O.trim();!de||N||(B(null),j(n.id,de))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:de=>B(de.target.value),onKeyDown:de=>{de.key==="Escape"?(de.preventDefault(),B(null)):de.key==="Enter"&&!de.shiftKey&&!de.nativeEvent.isComposing&&(de.preventDefault(),ee())}}),f.jsxs("div",{className:`${a5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:ee,disabled:N||!O.trim(),children:E4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[H.length>0&&f.jsx(vk,{annotations:H,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((ee,de)=>f.jsx("a",{href:ee.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:ee.src,alt:vie()})},de))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((ee,de)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:ee.src,target:"_blank",rel:"noreferrer",children:[f.jsx(db,{size:15}),f.jsx("span",{children:ee.name})]},de))})]}),w!==void 0&&f.jsx(z9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const q=n.parts.find(te=>te.type==="tool"&&y3(te)),U=n.parts.find(om)??q,Y=n.parts.filter(te=>te!==U&&!(q&&y3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),U&&f.jsx(SF,{part:U,usageLimited:!!q,busy:m,recovering:x===((X=(G=U.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:L1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:L1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:L1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function L1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Rv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Rv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ey(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=L1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?n6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ey(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Wr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(H=>H.role==="user"&&!H.id.startsWith(Cd));return kxt(a,n,W,H=>H.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),q=R.useCallback(W=>j[W].id,[j]),U=R.useCallback(W=>{if(B)return j.map((ee,de)=>de);const H=new Set(yB(W));return j.forEach((ee,de)=>{O.current.has(ee.id)&&H.add(de)}),[...H].sort((ee,de)=>ee-de)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:q,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:U});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var de;const H=window.getSelection();if(!H||H.isCollapsed||!H.rangeCount)return;const ee=H.getRangeAt(0);for(const re of((de=t.current)==null?void 0:de.querySelectorAll("[data-message-id]"))??[])ee.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),te=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ce,pe;const H=j[W.index],ee=H.parts.find(om),de=(Q=(ne=ee==null?void 0:ee.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=ee?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":H.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(H.id),onFocusCapture:()=>O.current.add(H.id),children:f.jsx(j9t,{message:H,forkCount:(le=M.get(H.id))==null?void 0:le.count,forkIndex:(oe=M.get(H.id))==null?void 0:oe.index,forkPrevId:(ce=M.get(H.id))==null?void 0:ce.prevId,forkNextId:(pe=M.get(H.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===H.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:de===C?C:null,onRecover:E,skills:N,predictTextTail:_&&H===G&&H.role==="assistant"})},H.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,fb],Iw=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ab(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:q=t9t}=ct($),U=R.useCallback(ie=>{Vr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[W,H]=R.useState(new Set),[ee,de]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ce=R.useRef({projectId:e,activeId:I,mainView:i});(ce.current.projectId!==e||ce.current.activeId!==I||ce.current.mainView!==i)&&(ce.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=r5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Tw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==r5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=q.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Tw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:sv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=nb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{U(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Pr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));U(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Pr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(w2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=F.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(F.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{F.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();H(e===N2?new Set([p6,m6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>av(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>av(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&H(be=>Ext(be,ie.ids,we.busySessions,q,i==="chat"?I:null))},[e,we.busySessions,q,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Fr=I?we.queuedBySession[I]??[]:[],oa=Fr.some(ie=>ie.dispatchState==="retrying"),Jl=Fr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Fr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Fr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Fr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===N2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Pr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ce.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(w2())}catch{Te(IE()),ho()}return}const Z=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!Z){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(Z,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&ee==="archived"&&de("active");const Tn=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ce.current,Oe=F.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return F.current===Oe&&(U(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Oe&&ce.current===Ae&&(L.current(Ue.id,{replace:!0}),ce.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ce.current;let Oe=I;const Ue=()=>{const Ln=ce.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(w2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&ee==="archived"&&de("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){Jv(ie),ce.current.projectId===e&&ce.current.activeId===ie&&ce.current.mainView==="chat"&&L.current(null,{replace:!0}),H(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=q.filter(ie=>P9t(ee,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{de("active"),w(null)},[w]),Ru=R.useCallback(ie=>{de("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===ee))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:ee,onChange:de})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===N2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:ee==="archived"?Hae():q.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(dv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:o6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),te(!0)}}),X&&f.jsx(ZP,{onClose:()=>{te(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Iw[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Iw[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=Iw[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Fr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Fr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} -${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Ur,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(db,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Tw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:x2(),"aria-label":x2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:x2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Pr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Ur,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():E4(),"aria-label":xs?AE():E4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Rv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(sb,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(_b,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const c5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:c5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Wr(S=>i(m,S));return f.jsxs("button",{type:"button",className:c5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({...hv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?tb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,P;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({...hv(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(hv(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const U=new Set(r);U.has(W)?U.delete(W):U.add(W),i(U)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):c6()),$=((P=O==null?void 0:O.files)==null?void 0:P.length)??0,H=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),q=O?O.branch:n.baselineBranch,Y=(W,U)=>O?a(W,e,void 0,U):a(W,void 0,n.baselineBranch,U),G=(S==null?void 0:S.root)==="worktree",X=async(W,U)=>{try{await adt(l,W,U,{sessionId:e}),N()}catch(te){Qn(te instanceof Error?te.message:String(te),"error")}},ee=W=>{const U=(S==null?void 0:S.path)??n.repoPath;jF(U,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&q?tb(n.githubOwner,n.githubRepo,q):void 0,githubTitle:q?pD({branch:Ne(q)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,U)=>{y(AF(W,U))},onRename:(W,U)=>{E(null),X(W,{action:"rename",newName:U})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>ee(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` +${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Ur,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(db,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Tw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:x2(),"aria-label":x2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:x2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Pr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Ur,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():E4(),"aria-label":xs?AE():E4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Rv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(sb,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(_b,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const c5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:c5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Wr(S=>i(m,S));return f.jsxs("button",{type:"button",className:c5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({...hv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?tb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({...hv(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(hv(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const H=new Set(r);H.has(W)?H.delete(W):H.add(W),i(H)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):c6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,q=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),U=O?O.branch:n.baselineBranch,Y=(W,H)=>O?a(W,e,void 0,H):a(W,void 0,n.baselineBranch,H),G=(S==null?void 0:S.root)==="worktree",X=async(W,H)=>{try{await adt(l,W,H,{sessionId:e}),N()}catch(ee){Qn(ee instanceof Error?ee.message:String(ee),"error")}},te=W=>{const H=(S==null?void 0:S.path)??n.repoPath;jF(H,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:q,branchTitle:q,githubHref:n.githubEnabled&&U?tb(n.githubOwner,n.githubRepo,U):void 0,githubTitle:U?pD({branch:Ne(U)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,H)=>{y(AF(W,H))},onRename:(W,H)=>{E(null),X(W,{action:"rename",newName:H})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` `),d=FP(_,AS(n));return _.endsWith(` `)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${zv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${zv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function TA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[FD()," ",Ne(n)]})]})}function u5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(TA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(TA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[FD()," ",t]})})]})}const fEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...fEt(e),enabled:n,subscribed:n}).data??null}function hEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function _Et(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function pEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(u5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?nv():rh(),"data-tip-align":"end","aria-label":d?nv():rh(),onClick:()=>p(b=>!b),children:f.jsx(e3,{size:13})}),f.jsx(sb,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(e6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(e6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const H=Math.round($.clientX-((T==null?void 0:T.left)??0)),q=Math.min(Math.max(H,$F),PF);u(q);try{localStorage.setItem(IF,String(q))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(e6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Ur,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:tb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:ev({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(_b,{size:12})]})}const Bw=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Wr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Wr(i),children:[f.jsx(hb,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Wr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let d5=!1;function OA(e){d5=!0;try{return window.confirm(e)}finally{d5=!1}}const f5=e=>e.replace(/\r\n/g,` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(u5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?nv():rh(),"data-tip-align":"end","aria-label":d?nv():rh(),onClick:()=>p(b=>!b),children:f.jsx(e3,{size:13})}),f.jsx(sb,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(e6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(e6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const q=Math.round($.clientX-((T==null?void 0:T.left)??0)),U=Math.min(Math.max(q,$F),PF);u(U);try{localStorage.setItem(IF,String(U))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(e6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Ur,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:tb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:ev({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(_b,{size:12})]})}const Bw=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Wr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Wr(i),children:[f.jsx(hb,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Wr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let d5=!1;function OA(e){d5=!0;try{return window.confirm(e)}finally{d5=!1}}const f5=e=>e.replace(/\r\n/g,` `),IA=(e,n,t)=>{const r=f5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r `),conflict:null}},Cl=e=>e.draft!==e.baseline,$Et=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),PEt=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,ee,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((ee=l.data)==null?void 0:ee.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(P=>P+1)},[]),H=R.useRef(o);H.current=o;const q=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(q.current)return;Y.current=n,q.current=!0,m(!0);const L=H.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(P=>{var U,te;const W=P.pdfPath;if(P.ok&&W){S(de=>({path:W,version:((de==null?void 0:de.version)??0)+1,source:L})),y(P.hadErrors),E(P.note),P.hadErrors&&b(((U=P.log)==null?void 0:U.trim())||null),$(!0);return}S(null),y(!1),E(P.note),M(!1),b(((te=P.log)==null?void 0:te.trim())||S3e())}).catch(P=>{S(null),y(!1),E(null),M(!1),T(P instanceof Error?P.message:String(P))}).finally(()=>{q.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ce=>ce&&{...ce,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const H=R.useRef(!1),q=R.useRef(l);q.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||H.current||Y.current?!1:(H.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ce=>{G.current=!1,N(ce),ce.pulled.includes(n)&&(Y.current?O(!0):q.current(ce.pulled))}).catch(ce=>{G.current=!0,N(null),j(ce instanceof Error?ce.message:String(ce))}).finally(()=>{H.current=!1,C(!1)}),!0),[e,n,t,d,m]),ee=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;ee.current!==oe&&X()&&(ee.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const P=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),U=R.useRef(Promise.resolve()),te=R.useRef(!1);te.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const de=R.useRef(!1);return R.useEffect(()=>{if(!P)return;let oe=!1;const ce=()=>{const Se=de.current;de.current=!1,!(!Se&&te.current)&&(U.current=U.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ce();const pe=setInterval(ce,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),U.current=U.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[P,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):q.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{H.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ce=>{ce.remoteChanged&&X()}).catch(ce=>{G.current=!0,j(ce instanceof Error?ce.message:String(ce))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{de.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ce=await BL(oe);ee.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ce.hasToken})},saveSession:async oe=>{const ce=await $L(oe,{host:m==null?void 0:m.host});B(ce.hasSession),de.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),de.current=!0,w(ce=>ce+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,ee.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),ee.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(ee.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?j4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(j4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Ur,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":z4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:z4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?j4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:_6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(ub,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Vr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",H=t==="abs",q=xk(n),Y=zF(n),G=lEt(n),X=q||G,[ee,I]=R.useState(!1),L=!b||ee,P=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),U=S.set,te=S.saving,de=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ce=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,H))==null?void 0:xt.path)??null},[H,Se]),Ie=R.useCallback(Ve=>H?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,H,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,H);return xt?KEt(Ie(xt.path),xt):null},[H,Se,Ie]),vt=LF(ce==null?void 0:ce.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ce!=null&&!ce.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ce!=null&&!ce.binary&&!ce.truncated&&!vt&&!mt,ut=rt&&ce.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ce.version=="string"||Ct),Re=(W==null?void 0:W.draft)??f5((ce==null?void 0:ce.content)??""),Ze=(W==null?void 0:W.baseline)??f5((ce==null?void 0:ce.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);de(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof D4){const xn=S.getSnapshot();return!xn||!Cl(xn)||U({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{de(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:P,ready:ce!=null&&!ce.notFound,source:we?Re:(ce==null?void 0:ce.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:P,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{U(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!te);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?U({...xt,conflict:On}):!On&&xt.conflict&&U({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(U(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,te,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ce||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ce]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(te||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(te?Ei():I2e()),children:te?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(e3,{size:13}):f.jsx(db,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(sb,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?nv():rh(),"data-tip-align":"end","aria-label":y?nv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(e3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ce!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:te,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:te,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Ur,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ce===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ce===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ce&&typeof ce.version=="string"?IA(ce.path,ce.content,ce.version):null);xt&&U($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{d5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ce.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(u5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ce.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(u5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):q&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ce.content,entries:x}):f.jsx(Fo,{text:ce.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ce.content,truncated:ce.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ce.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ce.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const $w=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:$w,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:$w,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:$w,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:fb,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Wr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Wr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Wr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(hb,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ny(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}O1.prototype=ny.prototype={constructor:O1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===h5&&n.documentElement.namespaceURI===h5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=ry(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function _5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}_5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=ny("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Pw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function p5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,p5,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Lv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Lv(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Lv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Fw(e>=240?e-240:e+120,s,r),Fw(e,s,r),Fw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Lv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lv(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function Fw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Ov=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=p5(s)).r,(i=p5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=Hw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=(Bv=Ep.now())+sy,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-Bv;n>gH&&(sy-=n,Bv=e)}function Rjt(){for(var e,n=Iv,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Iv=t);j0=e,v5(r)}function v5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-sy)),y0&&(y0=clearInterval(y0))):(y0||(Bv=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new $v;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=ny("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,b5=2,B1=3,sR=4,y5=5,$1=6;function iy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>B1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===B1)return nR(a);m.state===sR?(m.state=$1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_b5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ay=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ay;return e.__zoom}function qw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||ay}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=I1,u=ny("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(q){q.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,Y,G,X){var ee=q.selection?q.selection():q;ee.property("__zoom",iR),q!==ee?E(q,Y,G,X):ee.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(q,Y,G,X){b.scaleTo(q,function(){var ee=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return ee*I},G,X)},b.scaleTo=function(q,Y,G,X){b.transform(q,function(){var ee=n.apply(this,arguments),I=this.__zoom,L=G==null?C(ee):typeof G=="function"?G.apply(this,arguments):G,P=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,P),ee,a)},G,X)},b.translateBy=function(q,Y,G,X){b.transform(q,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(q,Y,G,X,ee){b.transform(q,function(){var I=n.apply(this,arguments),L=this.__zoom,P=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(ay.translate(P[0],P[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,ee)};function w(q,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===q.k?q:new Ol(Y,q.x,q.y)}function y(q,Y,G){var X=Y[0]-G[0]*q.k,ee=Y[1]-G[1]*q.k;return X===q.x&&ee===q.y?q:new Ol(q.k,X,ee)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function E(q,Y,G,X){q.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var ee=this,I=arguments,L=N(ee,I).event(X),P=n.apply(ee,I),W=G==null?C(P):typeof G=="function"?G.apply(ee,I):G,U=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),te=ee.__zoom,de=typeof Y=="function"?Y.apply(ee,I):Y,re=l(te.invert(W).concat(U/te.k),de.invert(W).concat(U/de.k));return function(ne){if(ne===1)ne=de;else{var Q=re(ne),le=U/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(q,Y,G){return!G&&q.__zooming||new T(q,Y)}function T(q,Y){this.that=q,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,Y),this.taps=0}T.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Y){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Y=Hi(this.that).datum();u.call(q,this.that,new PTt(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(q,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(q),X=this.__zoom,ee=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(q);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===ee)return;G.mouse=[I,X.invert(I)],P1(this),G.start()}x0(q),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,ee),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(q,...Y){if(p||!e.apply(this,arguments))return;var G=q.currentTarget,X=N(this,Y,!0).event(q),ee=Hi(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",U,!0),I=Ua(q,G),L=q.clientX,P=q.clientY;lH(q.view),qw(q),X.mouse=[I,this.__zoom.invert(I)],P1(this),X.start();function W(te){if(x0(te),!X.moved){var de=te.clientX-L,re=te.clientY-P;X.moved=de*de+re*re>S}X.event(te).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(te,G),X.mouse[1]),X.extent,a))}function U(te){ee.on("mousemove.zoom mouseup.zoom",null),cH(te.view,X.moved),x0(te),X.event(te).end()}}function O(q,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(q.changedTouches?q.changedTouches[0]:q,this),ee=G.invert(X),I=G.k*(q.shiftKey?.5:2),L=t(y(w(G,I),X,ee),n.apply(this,Y),a);x0(q),o>0?Hi(this).transition().duration(o).call(E,L,X,q):Hi(this).call(b.transform,L,X,q)}}function B(q,...Y){if(e.apply(this,arguments)){var G=q.touches,X=G.length,ee=N(this,Y,q.changedTouches.length===X).event(q),I,L,P,W;for(qw(q),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Pv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pv||(Pv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?Fv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ly(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=oy(t,Fv(s)),r=!0)}),r?ly(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},oy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),x5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),ly=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Fv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>ly(oy(x5(e),x5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},Hv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const q=Math.abs(e[p]-t[p]);if(q<=i){const Y=Math.min(i-1,i-q);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const q=p==="x"?"y":"x",Y=o[p]===l[q],G=u[q]>_[q],X=u[q]<_[q];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),H=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=H?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function S5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=S5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function k5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Uw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:H}){const{nodeLookup:q,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:ee,onNodeDrag:I,onSelectionDrag:L,onError:P,updateNodePositions:W}=n();i={x:$,y:H};let U=!1;const te=o.size>1,de=te&&Y?x5(mm(o)):null,re=te&&X?wAt({dragItems:o,snapGrid:G,x:$,y:H}):null;for(const[ne,Q]of o){if(!q.has(ne))continue;let le={x:$-Q.distance.x,y:H-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(te&&Y&&!Q.extent&&de){const{positionAbsolute:Se}=Q.internals,ye=Se.x-de.x+Y[0][0],qe=Se.x+Q.measured.width-de.x2+Y[1][0],Ie=Se.y-de.y+Y[0][1],Te=Se.y+Q.measured.height-de.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ce,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:q,nodeExtent:oe||Y,nodeOrigin:ee,onError:P});U=U||Q.position.x!==ce.x||Q.position.y!==ce.y,Q.position=ce,Q.internals.positionAbsolute=pe}if(x=x||U,!!U&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Uw({nodeId:N,dragItems:o,nodeLookup:q});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:H,autoPanSpeed:q,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,q);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await H({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var te;const{nodeLookup:H,multiSelectionActive:q,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:ee,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:P,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!q&&N&&((te=H.get(N))!=null&&te.selected||W()),E&&I&&N&&(e==null||e(N));const U=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:ee,containerBounds:_});if(i=U,o=xAt(H,Y,U,N),o.size>0&&(t||L||!N&&P)){const[de,re]=Uw({nodeId:N,dragItems:o,nodeLookup:H});t==null||t($.sourceEvent,o,de,re),L==null||L($.sourceEvent,de,re),N||P==null||P($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:H,nodeDragThreshold:q,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,q===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:q,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:ee}=n(),I=V0($.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!ee.has(N))&&(m=!0),!m){if(!l&&H&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),P=L.x-u.x,W=L.y-u.y;Math.sqrt(P*P+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:H,updateNodePositions:q,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(q(o,!1),x=!1),s||Y||!N&&G){const[X,ee]=Uw({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,o,X,ee),Y==null||Y($.sourceEvent,X,ee),N||G==null||G($.sourceEvent,ee)}}}).filter($=>{const H=$.target;return!$.button&&(!w||!vR(H,`.${w}`,C))&&(!y||vR(H,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Hv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:H}=Za(e),q=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!q)return;const X=QH(s,q,r,l,n);if(!X)return;let ee=Za(e,Y),I=!1,L=null,P=!1,W=null;function U(){if(!_||!Y)return;const[ce,pe]=Mk(ee,Y,N);p({x:ce,y:pe}),O=requestAnimationFrame(U)}const te={...X,nodeId:s,type:q,position:X.position},de=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(de,te,Nt.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:de,to:ee,toHandle:null,toPosition:aR[te.position],toNode:null,pointer:ee};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:q})}T===0&&Q();function le(ce){if(!G){const{x:Te,y:vt}=Za(ce),Dt=Te-$,Ut=vt-H;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!te){oe(ce);return}const pe=C();ee=Za(ce,Y),B=EAt(vm(ee,pe,!1,[1,1]),t,l,te),I||(U(),I=!0);const Se=ZH(ce,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,P=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,te,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:P,to:Se.toHandle&&P?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):ee,toHandle:Se.toHandle,toPosition:P&&Se.toHandle?Se.toHandle.position:aR[te.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:ee};y(Ie),ne=Ie}function oe(ce){if(!("touches"in ce&&ce.touches.length>0)){if(G){(B||W)&&L&&P&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ce,ye),i&&(w==null||w(ce,ye))}m(),cancelAnimationFrame(O),I=!1,P=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const C5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const cy=e=>({x:e.x,y:e.y,zoom:e.k}),Gw=({x:e,y:n,zoom:t})=>ay.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ww=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=cy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=cy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,cy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=cy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).transform(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:q,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:ee,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:P,zoomOnDoubleClick:W,zoomActivationKeyPressed:U,lib:te,onTransformChange:de,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){q&&!u.isZoomingOrPanning&&b();const le=Y&&!U&&!q;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:ee,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ce=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ce);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:de});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:U,panOnDrag:G,zoomOnScroll:P,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:q,noPanClassName:$,noWheelClassName:B,lib:te,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,H){const q=Gw(B),Y=d==null?void 0:d.constrain()(q,$,H);return Y&&await S(Y),Y}async function y(B,$){const H=Gw(B);return await S(H,$),H}function C(B){if(p){const $=Gw(B),H=p.property("__zoom");(H.k!==B.zoom||H.x!==B.x||H.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleTo(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}async function T(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleBy(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,H=-i[1]*N;let q=f1(O,S,v),Y=f1(B,b,w);if(a){let ee=0,I=0;l&&j<0?ee=Hc(y+j+$,a[0][0]):!l&&j>0&&(ee=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+H,a[0][1]):!u&&M>0&&(I=qc(C+B+H,a[1][1])),q=Math.max(q,ee),Y=Math.max(Y,I)}if(o){let ee=0,I=0;l&&j>0?ee=qc(y+j,o[0][0]):!l&&j<0&&(ee=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),q=Math.max(q,ee),Y=Math.max(Y,I)}if(s){if(_){const ee=f1(O/T,b,w)*T;if(q=Math.max(q,ee),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+H+O/T,a[1][1])*T:I=Hc(C+H+(l?j:-j)/T,a[0][1])*T,q=Math.max(q,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,q=Math.max(q,I)}}if(d){const ee=f1(B*T,S,v)/T;if(Y=Math.max(Y,ee),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?q:-q),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:H,snapGrid:q,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:ee,ySnapped:I}=V0(B.sourceEvent,{transform:H,snapGrid:q,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:ee,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,P]of $)if(P.parentId===n&&(E.push({id:L,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const W=FAt(P,y,P.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:H,snapToGrid:q,containerBounds:C}),X=[];if(!y)return;const{x:ee,y:I,width:L,height:P}=b,W={},U=y.origin??Y,{width:te,height:de,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,U,T,j),Q=te!==L,le=de!==P,oe=re!==ee&&Q,ce=ne!==I&≤if(!oe&&!ce&&!Q&&!le)return;if((oe||ce||U[0]===1||U[1]===1)&&(W.x=oe?re:b.x,W.y=ce?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-ee,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+U[0]*(te-L),y:Te.position.y-Ie+U[1]*(de-P)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?te:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?de:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=U[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const uy=R.createContext(null),QAt=uy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(uy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(uy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const dy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});dy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(dy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` +`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),q=R.useRef(o);q.current=o;const U=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(U.current)return;Y.current=n,U.current=!0,m(!0);const L=q.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(F=>{var H,ee;const W=F.pdfPath;if(F.ok&&W){S(de=>({path:W,version:((de==null?void 0:de.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((H=F.log)==null?void 0:H.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((ee=F.log)==null?void 0:ee.trim())||S3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{U.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ce=>ce&&{...ce,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const q=R.useRef(!1),U=R.useRef(l);U.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||q.current||Y.current?!1:(q.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ce=>{G.current=!1,N(ce),ce.pulled.includes(n)&&(Y.current?O(!0):U.current(ce.pulled))}).catch(ce=>{G.current=!0,N(null),j(ce instanceof Error?ce.message:String(ce))}).finally(()=>{q.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;te.current!==oe&&X()&&(te.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),H=R.useRef(Promise.resolve()),ee=R.useRef(!1);ee.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const de=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let oe=!1;const ce=()=>{const Se=de.current;de.current=!1,!(!Se&&ee.current)&&(H.current=H.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ce();const pe=setInterval(ce,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),H.current=H.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):U.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{q.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ce=>{ce.remoteChanged&&X()}).catch(ce=>{G.current=!0,j(ce instanceof Error?ce.message:String(ce))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{de.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ce=await BL(oe);te.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ce.hasToken})},saveSession:async oe=>{const ce=await $L(oe,{host:m==null?void 0:m.host});B(ce.hasSession),de.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),de.current=!0,w(ce=>ce+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,te.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),te.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?j4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(j4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Ur,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":z4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:z4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?j4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:_6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(ub,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Vr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",q=t==="abs",U=xk(n),Y=zF(n),G=lEt(n),X=U||G,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),H=S.set,ee=S.saving,de=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ce=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,q))==null?void 0:xt.path)??null},[q,Se]),Ie=R.useCallback(Ve=>q?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,q,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,q);return xt?KEt(Ie(xt.path),xt):null},[q,Se,Ie]),vt=LF(ce==null?void 0:ce.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ce!=null&&!ce.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ce!=null&&!ce.binary&&!ce.truncated&&!vt&&!mt,ut=rt&&ce.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ce.version=="string"||Ct),Re=(W==null?void 0:W.draft)??f5((ce==null?void 0:ce.content)??""),Ze=(W==null?void 0:W.baseline)??f5((ce==null?void 0:ce.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);de(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof D4){const xn=S.getSnapshot();return!xn||!Cl(xn)||H({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{de(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,ready:ce!=null&&!ce.notFound,source:we?Re:(ce==null?void 0:ce.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{H(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!ee);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?H({...xt,conflict:On}):!On&&xt.conflict&&H({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(H(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,ee,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ce||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ce]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(ee||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(ee?Ei():I2e()),children:ee?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(e3,{size:13}):f.jsx(db,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(sb,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?nv():rh(),"data-tip-align":"end","aria-label":y?nv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(e3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ce!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:ee,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:ee,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Ur,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ce===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ce===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ce&&typeof ce.version=="string"?IA(ce.path,ce.content,ce.version):null);xt&&H($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{d5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ce.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(u5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ce.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(u5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):U&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ce.content,entries:x}):f.jsx(Fo,{text:ce.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ce.content,truncated:ce.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ce.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ce.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const $w=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:$w,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:$w,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:$w,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:fb,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Wr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Wr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Wr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(hb,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ny(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}O1.prototype=ny.prototype={constructor:O1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===h5&&n.documentElement.namespaceURI===h5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=ry(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function _5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}_5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=ny("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Pw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function p5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,p5,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Lv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Lv(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Lv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Fw(e>=240?e-240:e+120,s,r),Fw(e,s,r),Fw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Lv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lv(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function Fw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Ov=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=p5(s)).r,(i=p5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=Hw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=(Bv=Ep.now())+sy,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-Bv;n>gH&&(sy-=n,Bv=e)}function Rjt(){for(var e,n=Iv,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Iv=t);j0=e,v5(r)}function v5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-sy)),y0&&(y0=clearInterval(y0))):(y0||(Bv=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new $v;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=ny("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,b5=2,B1=3,sR=4,y5=5,$1=6;function iy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>B1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===B1)return nR(a);m.state===sR?(m.state=$1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_b5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ay=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ay;return e.__zoom}function qw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||ay}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=I1,u=ny("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(U){U.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(U,Y,G,X){var te=U.selection?U.selection():U;te.property("__zoom",iR),U!==te?E(U,Y,G,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(U,Y,G,X){b.scaleTo(U,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},G,X)},b.scaleTo=function(U,Y,G,X){b.transform(U,function(){var te=n.apply(this,arguments),I=this.__zoom,L=G==null?C(te):typeof G=="function"?G.apply(this,arguments):G,F=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,F),te,a)},G,X)},b.translateBy=function(U,Y,G,X){b.transform(U,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(U,Y,G,X,te){b.transform(U,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(ay.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,te)};function w(U,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===U.k?U:new Ol(Y,U.x,U.y)}function y(U,Y,G){var X=Y[0]-G[0]*U.k,te=Y[1]-G[1]*U.k;return X===U.x&&te===U.y?U:new Ol(U.k,X,te)}function C(U){return[(+U[0][0]+ +U[1][0])/2,(+U[0][1]+ +U[1][1])/2]}function E(U,Y,G,X){U.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),W=G==null?C(F):typeof G=="function"?G.apply(te,I):G,H=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ee=te.__zoom,de=typeof Y=="function"?Y.apply(te,I):Y,re=l(ee.invert(W).concat(H/ee.k),de.invert(W).concat(H/de.k));return function(ne){if(ne===1)ne=de;else{var Q=re(ne),le=H/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(U,Y,G){return!G&&U.__zooming||new T(U,Y)}function T(U,Y){this.that=U,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(U,Y),this.taps=0}T.prototype={event:function(U){return U&&(this.sourceEvent=U),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(U,Y){return this.mouse&&U!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&U!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&U!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(U){var Y=Hi(this.that).datum();u.call(U,this.that,new PTt(U,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(U,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(U),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(U);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===te)return;G.mouse=[I,X.invert(I)],P1(this),G.start()}x0(U),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,te),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(U,...Y){if(p||!e.apply(this,arguments))return;var G=U.currentTarget,X=N(this,Y,!0).event(U),te=Hi(U.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",H,!0),I=Ua(U,G),L=U.clientX,F=U.clientY;lH(U.view),qw(U),X.mouse=[I,this.__zoom.invert(I)],P1(this),X.start();function W(ee){if(x0(ee),!X.moved){var de=ee.clientX-L,re=ee.clientY-F;X.moved=de*de+re*re>S}X.event(ee).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(ee,G),X.mouse[1]),X.extent,a))}function H(ee){te.on("mousemove.zoom mouseup.zoom",null),cH(ee.view,X.moved),x0(ee),X.event(ee).end()}}function O(U,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(U.changedTouches?U.changedTouches[0]:U,this),te=G.invert(X),I=G.k*(U.shiftKey?.5:2),L=t(y(w(G,I),X,te),n.apply(this,Y),a);x0(U),o>0?Hi(this).transition().duration(o).call(E,L,X,U):Hi(this).call(b.transform,L,X,U)}}function B(U,...Y){if(e.apply(this,arguments)){var G=U.touches,X=G.length,te=N(this,Y,U.changedTouches.length===X).event(U),I,L,F,W;for(qw(U),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Pv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pv||(Pv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?Fv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ly(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=oy(t,Fv(s)),r=!0)}),r?ly(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},oy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),x5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),ly=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Fv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>ly(oy(x5(e),x5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},Hv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const U=Math.abs(e[p]-t[p]);if(U<=i){const Y=Math.min(i-1,i-U);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const U=p==="x"?"y":"x",Y=o[p]===l[U],G=u[U]>_[U],X=u[U]<_[U];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),q=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=q?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function S5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=S5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function k5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Uw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:q}){const{nodeLookup:U,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:W}=n();i={x:$,y:q};let H=!1;const ee=o.size>1,de=ee&&Y?x5(mm(o)):null,re=ee&&X?wAt({dragItems:o,snapGrid:G,x:$,y:q}):null;for(const[ne,Q]of o){if(!U.has(ne))continue;let le={x:$-Q.distance.x,y:q-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(ee&&Y&&!Q.extent&&de){const{positionAbsolute:Se}=Q.internals,ye=Se.x-de.x+Y[0][0],qe=Se.x+Q.measured.width-de.x2+Y[1][0],Ie=Se.y-de.y+Y[0][1],Te=Se.y+Q.measured.height-de.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ce,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:U,nodeExtent:oe||Y,nodeOrigin:te,onError:F});H=H||Q.position.x!==ce.x||Q.position.y!==ce.y,Q.position=ce,Q.internals.positionAbsolute=pe}if(x=x||H,!!H&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Uw({nodeId:N,dragItems:o,nodeLookup:U});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:q,autoPanSpeed:U,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,U);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await q({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var ee;const{nodeLookup:q,multiSelectionActive:U,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!U&&N&&((ee=q.get(N))!=null&&ee.selected||W()),E&&I&&N&&(e==null||e(N));const H=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=H,o=xAt(q,Y,H,N),o.size>0&&(t||L||!N&&F)){const[de,re]=Uw({nodeId:N,dragItems:o,nodeLookup:q});t==null||t($.sourceEvent,o,de,re),L==null||L($.sourceEvent,de,re),N||F==null||F($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:q,nodeDragThreshold:U,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(q==null?void 0:q.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,U===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:q,transform:U,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:U,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&q&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,W=L.y-u.y;Math.sqrt(F*F+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:q,updateNodePositions:U,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(U(o,!1),x=!1),s||Y||!N&&G){const[X,te]=Uw({nodeId:N,dragItems:o,nodeLookup:q,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||G==null||G($.sourceEvent,te)}}}).filter($=>{const q=$.target;return!$.button&&(!w||!vR(q,`.${w}`,C))&&(!y||vR(q,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Hv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:q}=Za(e),U=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!U)return;const X=QH(s,U,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,W=null;function H(){if(!_||!Y)return;const[ce,pe]=Mk(te,Y,N);p({x:ce,y:pe}),O=requestAnimationFrame(H)}const ee={...X,nodeId:s,type:U,position:X.position},de=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(de,ee,Nt.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:de,to:te,toHandle:null,toPosition:aR[ee.position],toNode:null,pointer:te};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:U})}T===0&&Q();function le(ce){if(!G){const{x:Te,y:vt}=Za(ce),Dt=Te-$,Ut=vt-q;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!ee){oe(ce);return}const pe=C();te=Za(ce,Y),B=EAt(vm(te,pe,!1,[1,1]),t,l,ee),I||(H(),I=!0);const Se=ZH(ce,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,F=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,ee,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:aR[ee.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function oe(ce){if(!("touches"in ce&&ce.touches.length>0)){if(G){(B||W)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ce,ye),i&&(w==null||w(ce,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const C5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const cy=e=>({x:e.x,y:e.y,zoom:e.k}),Gw=({x:e,y:n,zoom:t})=>ay.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ww=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=cy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=cy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,cy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=cy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(q=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).transform(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:q,userSelectionActive:U,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:W,zoomActivationKeyPressed:H,lib:ee,onTransformChange:de,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){U&&!u.isZoomingOrPanning&&b();const le=Y&&!H&&!U;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ce=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ce);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:de});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:q,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:H,panOnDrag:G,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:U,noPanClassName:$,noWheelClassName:B,lib:ee,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,q){const U=Gw(B),Y=d==null?void 0:d.constrain()(U,$,q);return Y&&await S(Y),Y}async function y(B,$){const q=Gw(B);return await S(q,$),q}function C(B){if(p){const $=Gw(B),q=p.property("__zoom");(q.k!==B.zoom||q.x!==B.x||q.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(q=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleTo(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),B)}):!1}async function T(B,$){return p?new Promise(q=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleBy(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,q=-i[1]*N;let U=f1(O,S,v),Y=f1(B,b,w);if(a){let te=0,I=0;l&&j<0?te=Hc(y+j+$,a[0][0]):!l&&j>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+q,a[0][1]):!u&&M>0&&(I=qc(C+B+q,a[1][1])),U=Math.max(U,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&j>0?te=qc(y+j,o[0][0]):!l&&j<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),U=Math.max(U,te),Y=Math.max(Y,I)}if(s){if(_){const te=f1(O/T,b,w)*T;if(U=Math.max(U,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+q+O/T,a[1][1])*T:I=Hc(C+q+(l?j:-j)/T,a[0][1])*T,U=Math.max(U,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,U=Math.max(U,I)}}if(d){const te=f1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?U:-U),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:q,snapGrid:U,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:q,snapGrid:U,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const W=FAt(F,y,F.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:q,snapToGrid:U,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:q,snapToGrid:U,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,W={},H=y.origin??Y,{width:ee,height:de,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,H,T,j),Q=ee!==L,le=de!==F,oe=re!==te&&Q,ce=ne!==I&≤if(!oe&&!ce&&!Q&&!le)return;if((oe||ce||H[0]===1||H[1]===1)&&(W.x=oe?re:b.x,W.y=ce?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-te,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+H[0]*(ee-L),y:Te.position.y-Ie+H[1]*(de-F)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ee:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?de:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=H[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const uy=R.createContext(null),QAt=uy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(uy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(uy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const dy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});dy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(dy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=Hv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=Hv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const fy={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(H=>{b==null||b({x:H[0],y:H[1],zoom:H[2]}),w||E.setState({transform:H})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:ee,onMoveStart:I}=E.getState();I==null||I(G,X),ee==null||ee(X)},onPanZoom:(G,X)=>{const{onViewportChange:ee,onMove:I}=E.getState();I==null||I(G,X),ee==null||ee(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:ee,onMoveEnd:I}=E.getState();I==null||I(G,X),ee==null||ee(X)}});const{x:H,y:q,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[H,q,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:fy,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Vw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),H=R.useRef(!1),q=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(H.current||$.current||b.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},ee=d?Q=>d(Q):void 0,I=Q=>{H.current&&(Q.stopPropagation(),H.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ce=Q.target===j.current;if(!ce&&!!Q.target.closest(".nokey")||!e||!(a&&ce||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),H.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ce||(Q.stopPropagation(),Q.preventDefault())};function P(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ce,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ce),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(q.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!H.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ce,y:pe}=q.current;P(ce,pe),v.current=requestAnimationFrame(W)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>U(),[]);const te=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ce}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);q.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!H.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ce(),o==null||o(Q)}H.current=!0,Y.current||(W(),Y.current=!0),P(pe,Se)},de=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),U())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),U()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Vw(G,j),onContextMenu:Vw(X,j),onWheel:Vw(ee,j),onPointerEnter:T?void 0:p,onPointerMove:T?te:m,onPointerUp:de,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:fy,children:[S,f.jsx(ARt,{})]})}function E5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{E5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:ee,onConnect:I,hasDefaultEdges:L}=v.getState(),P={...ee,...X};if(L){const{edges:W,setEdges:U,onError:te}=v.getState();U(vRt(P,W,{onError:te}))}I==null||I(P),o==null||o(P)},H=X=>{if(!b)return;const ee=PH(X.nativeEvent);if(s&&(ee&&X.button===0||!ee)){const I=v.getState();C5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var P,W;return(W=(P=v.getState()).onConnectEnd)==null?void 0:W.call(P,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var P,W;return((W=(P=v.getState()).isValidConnection)==null?void 0:W.call(P,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}ee?_==null||_(X):d==null||d(X)},q=X=>{const{onClickConnectStart:ee,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:P,isValidConnection:W,lib:U,rfId:te,nodeLookup:de,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){ee==null||ee(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=C5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:P,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:te,doc:ne,lib:U,nodeLookup:de});oe&&le&&$(le);const ce=structuredClone(re);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,I==null||I(X,ce),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:w?q:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const qv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(qv,m.key)&&(m.preventDefault(),l({direction:qv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,preventScrolling:q,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:ee,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:P,userSelectionActive:W}=An(QRt,kr),U=Ap(u,{target:IR}),te=Ap(S,{target:IR}),de=te||j,re=te||C,ne=_&&de!==!0,Q=U||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!U&&de,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,zoomActivationKeyCode:v,preventScrolling:q,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:de,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:ne,children:[e,P&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:ee})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),H=OH(y),q=tMt({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),Y=uq({nodeRef:q,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),ee=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,P=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,U=i?Q=>i(Q,{...C.userNode}):void 0,te=a?Q=>a(Q,{...C.userNode}):void 0,de=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&E5({id:e,store:$,nodeRef:q}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";E5({id:e,store:$,unselect:le,nodeRef:q})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(qv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:qv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=q.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ce,setCenter:pe}=$.getState();if(!ce)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:H?"visible":"hidden",...y.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:P,onMouseLeave:W,onContextMenu:U,onClick:de,onDoubleClick:te,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:fy,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Pv.Arrow]:oMt,[Pv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function hy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(hy,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=w5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(hy,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:H,rfId:q,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",ee=(P,W)=>{p(!1),d==null||d(P,t,E.type,W)},I=P=>u==null?void 0:u(t,P),L=(P,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(P,W)};C5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:q,cancelConnection:$,panBy:Y,isValidConnection:(...P)=>{var W,U;return((U=(W=x.getState()).isValidConnection)==null?void 0:U.call(W,...P))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...P)=>{var W,U;return(U=(W=x.getState()).onConnectEnd)==null?void 0:U.call(W,...P)},onReconnectEnd:ee,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[H,q]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:ee,targetX:I,targetY:L,sourcePosition:P,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),U=R.useMemo(()=>y.markerStart?`url('#${S5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),te=R.useMemo(()=>y.markerEnd?`url('#${S5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||ee===null||I===null||L===null)return null;const de=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ce=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:de,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ce:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!H&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:ee,targetX:I,targetY:L,sourcePosition:P,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:te,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:ee,targetX:I,targetY:L,sourcePosition:P,targetPosition:W,setUpdateHover:$,setReconnecting:q})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=w5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=w5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:ee,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:P,zoomOnDoubleClick:W,panOnDrag:U,autoPanOnSelection:te,onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ce,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ce,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:ee,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:P,panOnDrag:U,autoPanOnSelection:te,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=k5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=k5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),H={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const q=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:q})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(H)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(k5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(uy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:H,onSelectionDragStart:q,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:ee,onSelectionEnd:I,onBeforeDelete:L,connectionMode:P,connectionLineType:W=Kc.Bezier,connectionLineStyle:U,connectionLineComponent:te,connectionLineContainerStyle:de,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ce=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Pr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Pr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:P,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:q,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:U,connectionLineComponent:te,connectionLineContainerStyle:de,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ce,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:ee,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:H}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...fy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(dy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Kw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Kw(n),u=Kw(e),_=Kw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:H,ariaLabelConfig:q}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,ee=T.height/G,I=Math.max(X,ee),L=I*Y,P=I*G,W=C*I,U=T.x-(L-T.width)/2-W,te=T.y-(P-T.height)/2-W,de=L+W*2,re=P+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:H,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,H]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ce=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??q["minimap.ariaLabel"];return f.jsx(dy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${U} ${te} ${de} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ce,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-W},${te-W}h${de+W*2}v${re+W*2}h${-de-W*2}z - M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:H,nodeLookup:q,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],ee={x:B.x,y:B.y},I=q.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,P=B.width??I.measured.width??0,W=B.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:P,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:P,height:W},I.parentId,q,L)}},te=Pk([U],q,Y,G);X.push(...te),ee.x=B.x?Math.max(L[0]*P,B.x):void 0,ee.y=B.y?Math.max(L[1]*W,B.y):void 0}if(ee.x!==void 0&&ee.y!==void 0){const L={id:y,type:"position",position:{...ee}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const P={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(P)}for(const L of $){const P={...L,type:"position"};X.push(P)}H(X)},onEnd:({width:B,height:$})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Qw=380,Yw=12,vDt=350,bDt=150,N5=new EventTarget;function yDt(){N5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return N5.addEventListener("move",u),()=>{N5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Yw+Qw<=window.innerWidth,d=s.x-Yw-Qw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Yw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` +`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=Hv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=Hv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const fy={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),w||E.setState({transform:q})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoom:(G,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(G,X),te==null||te(X)}});const{x:q,y:U,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[q,U,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var q;(q=B.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:fy,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Vw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),q=R.useRef(!1),U=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(q.current||$.current||b.getState().connection.inProgress){q.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{q.current&&(Q.stopPropagation(),q.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ce=Q.target===j.current;if(!ce&&!!Q.target.closest(".nokey")||!e||!(a&&ce||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),q.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ce||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ce,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ce),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(U.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!q.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ce,y:pe}=U.current;F(ce,pe),v.current=requestAnimationFrame(W)})}const H=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>H(),[]);const ee=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ce}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);U.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!q.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ce(),o==null||o(Q)}q.current=!0,Y.current||(W(),Y.current=!0),F(pe,Se)},de=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),H())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),H()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Vw(G,j),onContextMenu:Vw(X,j),onWheel:Vw(te,j),onPointerEnter:T?void 0:p,onPointerMove:T?ee:m,onPointerUp:de,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:fy,children:[S,f.jsx(ARt,{})]})}function E5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{E5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:W,setEdges:H,onError:ee}=v.getState();H(vRt(F,W,{onError:ee}))}I==null||I(F),o==null||o(F)},q=X=>{if(!b)return;const te=PH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();C5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},U=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:W,lib:H,rfId:ee,nodeLookup:de,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=C5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:ee,doc:ne,lib:H,nodeLookup:de});oe&&le&&$(le);const ce=structuredClone(re);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,I==null||I(X,ce),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:q,onTouchStart:q,onClick:w?U:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const qv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(qv,m.key)&&(m.preventDefault(),l({direction:qv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:q,preventScrolling:U,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:W}=An(QRt,kr),H=Ap(u,{target:IR}),ee=Ap(S,{target:IR}),de=ee||j,re=ee||C,ne=_&&de!==!0,Q=H||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!H&&de,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:U,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:de,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:H,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),q=OH(y),U=tMt({node:y,nodeType:N,hasDimensions:q,resizeObserver:d}),Y=uq({nodeRef:U,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),te=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,H=i?Q=>i(Q,{...C.userNode}):void 0,ee=a?Q=>a(Q,{...C.userNode}):void 0,de=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&E5({id:e,store:$,nodeRef:U}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";E5({id:e,store:$,unselect:le,nodeRef:U})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(qv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:qv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=U.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ce,setCenter:pe}=$.getState();if(!ce)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:U,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:q?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:W,onContextMenu:H,onClick:de,onDoubleClick:ee,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:fy,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Pv.Arrow]:oMt,[Pv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function hy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(hy,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=w5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(hy,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:q,rfId:U,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",te=(F,W)=>{p(!1),d==null||d(F,t,E.type,W)},I=F=>u==null?void 0:u(t,F),L=(F,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,W)};C5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:q,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:U,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var W,H;return((H=(W=x.getState()).isValidConnection)==null?void 0:H.call(W,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var W,H;return(H=(W=x.getState()).onConnectEnd)==null?void 0:H.call(W,...F)},onReconnectEnd:te,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[q,U]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),H=R.useMemo(()=>y.markerStart?`url('#${S5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),ee=R.useMemo(()=>y.markerEnd?`url('#${S5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const de=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ce=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:de,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ce:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!q&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:H,markerEnd:ee,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,setUpdateHover:$,setReconnecting:U})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=w5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=w5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:q,maxZoom:U,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:H,autoPanOnSelection:ee,onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ce,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ce,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:H,autoPanOnSelection:ee,defaultViewport:B,translateExtent:$,minZoom:q,maxZoom:U,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=k5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=k5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),q={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const U=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:U})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(q)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(k5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(uy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:q,onSelectionDragStart:U,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:W=Kc.Bezier,connectionLineStyle:H,connectionLineComponent:ee,connectionLineContainerStyle:de,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ce=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Pr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Pr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:U,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:H,connectionLineComponent:ee,connectionLineContainerStyle:de,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ce,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:q}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...fy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(dy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Kw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Kw(n),u=Kw(e),_=Kw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:q,ariaLabelConfig:U}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,te=T.height/G,I=Math.max(X,te),L=I*Y,F=I*G,W=C*I,H=T.x-(L-T.width)/2-W,ee=T.y-(F-T.height)/2-W,de=L+W*2,re=F+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:q,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,q]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ce=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??U["minimap.ariaLabel"];return f.jsx(dy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${H} ${ee} ${de} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ce,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-W},${ee-W}h${de+W*2}v${re+W*2}h${-de-W*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:q,snapToGrid:U,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:q,snapToGrid:U,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:q,nodeLookup:U,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],te={x:B.x,y:B.y},I=U.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,F=B.width??I.measured.width??0,W=B.height??I.measured.height??0,H={id:I.id,parentId:I.parentId,rect:{width:F,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:W},I.parentId,U,L)}},ee=Pk([H],U,Y,G);X.push(...ee),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*W,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}q(X)},onEnd:({width:B,height:$})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Qw=380,Yw=12,vDt=350,bDt=150,N5=new EventTarget;function yDt(){N5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return N5.addEventListener("move",u),()=>{N5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Yw+Qw<=window.innerWidth,d=s.x-Yw-Qw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Yw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` diff --git `);$=G!==-1?$.slice(0,G+1):$.slice(0,$.lastIndexOf(` -`)+1)}let H=[];try{H=$.trim()?i3($):[]}catch{return null}if(B.truncated&&H.every(G=>G.hunks.length===0))return null;let q=0,Y=0;for(const G of H){const X=Db(G);q+=X.additions,Y+=X.deletions}return{fileCount:H.length,additions:q,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Qw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Wr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Wr(a),children:[f.jsx(hb,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&g6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,F1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function z5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function H1(e){if(e.children.length===0)return z5(e);const n=e.children.reduce((t,r)=>t+H1(r),0)+F1*(e.children.length-1);return Math.max(z5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Wr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Wr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Wr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(hb,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:ev({name:Ne(t.branchName)}),"aria-label":ev({name:Ne(t.branchName)}),href:tb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(_b,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-z5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+H1(O),0)+F1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=H1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+F1}}let w=0;for(const y of S){const C=H1(y);b(y,w+C/2,0),w+=C+F1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Uv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Uv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Uv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:Z=>Z.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const Z=t?Wa(t):"experiments";return typeof Z=="object"&&"path"in Z&&Z.line&&p!==v.current.value?{...Z,lineScrollRequest:v.current.value}:Z},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var Z;return((Z=w.data)==null?void 0:Z.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((Z,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:C1(je.projectId,je.activeSessionId,Z),replace:ge})},[s]),B=R.useCallback(Z=>{const ge=Ll(Z);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),H=R.useCallback(Z=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:Z??void 0})},[t,O]),q=R.useCallback(Z=>{s.navigate({href:Z?`/projects/${encodeURIComponent(Z)}`:"/projects"})},[s]),Y=R.useCallback(Z=>{var ge;if(n)if(Z==="chat"){const je=l.current;s.navigate({href:C1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${Z==="skills"?"skills":`settings/${Z}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),ee=R.useMemo(()=>rp(),[n]),I=ct(ee),L=I.data??null,P=R.useCallback(Z=>{Vr(ee.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[ee]),W=R.useMemo(()=>Zp(),[n]),U=ct(W),te=U.data??null,de=R.useCallback(Z=>{Vr(W.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[W]),re=R.useRef(void 0);re.current=te==null?void 0:te.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!U.data&&U.error?Bne():null].filter(Z=>Z!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(W4(n)),ce=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ce);Ct.current=ce;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ce.every(Z=>Z.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ce:ce.filter(Z=>Z.chatSessionId===u),[ce,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const Z=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>Z.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=Z=>{let ge=En.current.get(Z);return ge||(ge=new HEt,En.current.set(Z,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(Z=>{const ge=[...Z];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(Z=>{dr.current=Z,zi(Z)},[]),Pr=R.useCallback(Z=>{const ge=Et(Z);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in Z){const Me=Ms(je,en.current,Z);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(Z=>{const ge=Et(Z),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(Z)];vs.current=je,Rn(je),B(Z)},[B]),cs=R.useCallback((Z,ge,je)=>{const $e=Et(Z),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Pr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(Z));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(Z)];vs.current=tt,Rn(tt),O(Ll(Z,je))},[Pr,ls,Ls,O]),bs=R.useCallback(Z=>{const ge=dr.current;ge&&Et(ge)===Et(Z)&&Ls(null)},[Ls]);R.useEffect(()=>{let Z=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){Z=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),Z=!0;return}if(Z&&$e.key==="Enter"){$e.preventDefault(),Z=!1;const Lt=dr.current;Lt&&bs(Lt);return}Z=!1},je=()=>{Z=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((Z,ge)=>{const je=Et(Z),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(Z=>Z+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((Z,ge,je)=>{if(Rn(Z.tabHistory),vs.current=Z.tabHistory,Nr(Z.experimentsTabOpen),fn(Z.filesTabOpen),tn(Z.artifactsTabOpen),un(Z.expTabs),on(Z.fileTabs),lt(Me=>Me===Z.planTabs?Me:Z.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(Z.subagentTabs),On(Z.codeTabs),ls(Z.contentTabOrder),Ls(Z.previewTab),Jt(Z.filesView),ur(Z.filesToggled),Zt(Z.scope),Ke(Z.panelMax),ji(Z.treeViewport),Yn(M.current.activeSessionId===O0&&Z.fileTabs.some(Me=>Yu(Me,{path:S1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of Z.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Fr,workspace:oa}=K0t({projectId:te&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(te==null?void 0:te.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const Z=Jl.current;(Z==null?void 0:Z.projectId)===n&&Z.taskId===u&&Z.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((Z,ge)=>{var at;if(!n)return;Z&&ge!=null&&ge.replace&&u===null&&(Fr(),W0t(n,Z));const je=cu(DO(n),Z??"new"),$e=je?je.active:Wc(n)?(at=T6(Z??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&Z&&u===null?M.current.pane:$e;s.navigate({href:C1(n,Z,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Fr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(Z=>Z+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:Z})=>{var ge;return((ge=Rd(Z.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(Z=>Z.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const Z=ob(i.href);!te||!$n||!Z||(lb.queue({lastLocation:Z,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===Z?250:0),La.current=Z)},[i.href,te,$n,oo,os,Ze]);const ec=(te==null?void 0:te.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async Z=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:Z}),de($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||te!=null&&te.tourCompleted||Ai()},[n,ec,Ai,te==null?void 0:te.tourCompleted]);const Mt=(L==null?void 0:L.find(Z=>Z.id===n))??null;R.useEffect(()=>{const Z=Q||te===null?null:Mt==null?void 0:Mt.name;document.title=Z?`${Oo(Z)} — OpenResearch`:"OpenResearch"},[Q,te,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(Z=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:Z})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((Z=!1)=>{Z&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},Z))},[O,xs]),Ri=()=>{I.refetch(),U.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!te||lo.current)return;lo.current=!0,le.current=te.preferredAgent;const Z=N6()??te.workspace;Z&&(Cs(Z.railOpen),ks(Math.min(Z.panelWidth,T0())),_t(Z.experimentsView))},[te]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(Z=>{const ge=++sc.current;de($e=>$e&&{...$e,preferredAgent:Z});const je=co.current.then(()=>r.mutateAsync({preferredAgent:Z})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const Z=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const Os=R.useCallback(Z=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(Z)).then(je=>{if(hr.current!==Z||Ut.current!==Z||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const Z=hr.current;Z&&(Ut.current=Z,vt.current.clear(),Dt.current.clear(),Os(Z))},onRun:Z=>{if(Z.projectId!==hr.current||Z.projectId!==Ut.current)return;const ge=vt.current.get(Z.id),je=Dt.current.has(Z.id);if(ge&&ge.updatedAt>Z.updatedAt||(vt.current.set(Z.id,Z),Dt.current.add(Z.id),Z.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(Z.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=Z.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(Z.id,Z)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((Z,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:Z,view:ge};un(at=>at.some(tt=>M2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((Z,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===Z||Me.id.startsWith(Z)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ce.map(Z=>{var ge;return[Z.id,((ge=Z.title)==null?void 0:ge.trim())||Z.slug||El()]})),[ce,G]),Zs=YR(zu),el=R.useMemo(()=>{const Z=new Map;for(const ge of Ie)Z.set(ge.id,Zs.get(ge.experimentId)??El());return Z},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(Z=>{const ge=tl.get(Z);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(Z=>{const ge=Zs.get(Z);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((Z,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===Z||$e.id.startsWith(Z));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(Z=>{const ge=nr.findIndex(je=>M2(je,Z));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[nr,yr,b]),uo=R.useCallback((Z,ge="preview")=>{Z.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,Z);Dr.current.fileTabs.some(at=>Yu(at,Z))||C.current.delete(Me),E.current.add(Me)}const $e=RO(Z);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,Z));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(Z,ge)},[cs]),fi=R.useCallback((Z,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(Z,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((Z,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(Z,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(Z=>uo({path:Z,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((Z,ge,je,$e,Me,at="preview")=>{const tt=fi(Z,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((Z,ge)=>{bs(Z),ge()},[bs]),of=R.useCallback(Z=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,Z));if(ge===-1)return;const je=n?Ms(n,u,Z):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(Z,{path:S1,source:"artifacts"})&&Yn(!1),yr(Z,Et(b)===Et(Z)))},[u,Mn,yr,n,b]),lf=R.useCallback(Z=>{Z.lineScrollRequest!==void 0&&m(Z.lineScrollRequest)},[]),x_=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:Z};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(Z=>{const ge=xt.findIndex(je=>je.promptId===Z.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,xt,b]),lc=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:Z,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(Z=>{const ge=ft.findIndex(je=>je.spawnPartId===Z.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let Z=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Rv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{Z&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=av(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{Z=!1,at()}},[ft]);const uc=R.useCallback((Z,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:Z,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:Z,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((Z,ge)=>{On(je=>je.map($e=>qf($e,Z)?{...$e,...ge}:$e)),ge.view&&O(Ll({...Z,...ge}))},[]),S_=R.useCallback(Z=>{const ge=xn.findIndex(je=>qf(je,Z));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(Z=>{Z==="experiments"?Nr(!1):Z==="files"?fn(!1):tn(!1),yr(Z,b===Z)},[yr,b]),ff=Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=Z.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Uv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(Z,ge)=>{P(je=>je?QR(je,Z):[Z]),s.navigate({href:`/projects/${encodeURIComponent(Z.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(Z=>Yu(Z,{path:S1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const Z=nl.data.messages.flatMap(je=>{const $e=Rv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=Z==null?void 0:Z.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(Z=>qf(Z,Ae))??null:null,Ue=new Map;for(const Z of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(Z),Z);const zn=ca?Et(ca):null,jn=di.filter(Z=>Z!==zn).map(Z=>Ue.get(Z)).filter(q0t),fr=Z=>ao!==null&&Et(ao)===Et(Z),Ln=Z=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,Z),label:Z.path.split("/").pop()||Z.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>of(Z)},`file:${z6(Z)}`),_r=Bs?ce.find(Z=>Z.id===Bs.id)??null:null,da=Oe?ce.find(Z=>Z.id===Oe.experimentId&&Z.branchName===Oe.branch)??null:null,_f=Z=>{var je,$e;if("path"in Z)return Ln(Z);if("id"in Z){const Me=ce.find(at=>at.id===Z.id);return f.jsx(Fc,{active:Bs!==null&&M2(Bs,Z),label:Me?Me.title||Me.slug:"…",icon:Z.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>Tu(Z)},Et(Z))}if("kind"in Z&&Z.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===Z.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>w_(Z)},Et(Z));if("kind"in Z)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===Z.spawnPartId,label:((je=uf[Z.spawnPartId])==null?void 0:je.label)??Z.label??Wne(),shimmer:(($e=uf[Z.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>cf(Z)},Et(Z));const ge=ce.find(Me=>Me.id===Z.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,Z),label:(ge==null?void 0:ge.slug)??Z.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>S_(Z)},Et(Z))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||te===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(Z=>Z.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(te==null?void 0:te.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:te.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:Z=>{P(ge=>ge?QR(ge,Z):[Z])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ce,runs:Ie,onOpenExperiment:(Z,ge)=>Is(Z,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(Z=>Z.id===u&&Z.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:C4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(fb,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(Z=>!Z),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Ur,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(Z=>Z.id===d&&Z.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(Z=>!Z),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ce,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ce.length>0?gne():void 0,experiments:br,onOpen:(Z,ge)=>{Is(Z.id,"overview",ge)},onOpenLogs:(Z,ge,je)=>{Is(Z,"terminal",je,ge)},onOpenCode:(Z,ge)=>{const je=ce.find($e=>$e.id===Z);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(Z,ge,je,$e)=>oc(Z,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const Z=Ms(n,u,Dn);C.current.delete(Z),E.current.add(Z)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:Z=>{N.current[Ms(n,u,Dn)]=Z,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(Z,ge,je,$e)=>hi(Dn,()=>oc(Z,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:Z=>{rr.current.set(Ms(n,u,Dn),Z),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(Z=>Z.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(Z,ge,je,$e,Me)=>hi(Qr,()=>oc(Z,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(Z,ge,je,$e,Me)=>hi(be,()=>Au(Z,be.sessionId,ge,je,$e,Me)),onOpenRun:(Z,ge)=>hi(be,()=>Oa(Z,ge)),runExperimentName:ac,onOpenExperiment:(Z,ge)=>hi(be,()=>ju(Z,ge)),experimentName:sf,onOpenSubagent:(Z,ge,je)=>hi(be,()=>lc(be.sessionId,Z,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:Z=>df(Oe,{view:Z}),onToggledChange:Z=>df(Oe,{toggled:Z}),onOpenFile:(Z,ge,je,$e)=>hi(Oe,()=>oc(Z,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:H,parentExperiment:ce.find(Z=>Z.id===_r.parentExperimentId)??null,onOpenView:(Z,ge,je)=>{hi(Bs,()=>Is(_r.id,Z,je,ge))},onOpenCode:(Z,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,Z,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(Z,ge)=>{Kr(!1),k_(Z,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const j5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=j5.useParams(),{pane:n}=j5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>cb}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>cb}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>cb}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=j5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=cb._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); +`)+1)}let q=[];try{q=$.trim()?i3($):[]}catch{return null}if(B.truncated&&q.every(G=>G.hunks.length===0))return null;let U=0,Y=0;for(const G of q){const X=Db(G);U+=X.additions,Y+=X.deletions}return{fileCount:q.length,additions:U,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Qw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Wr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Wr(a),children:[f.jsx(hb,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&g6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,F1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function z5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function H1(e){if(e.children.length===0)return z5(e);const n=e.children.reduce((t,r)=>t+H1(r),0)+F1*(e.children.length-1);return Math.max(z5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Wr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Wr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Wr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(hb,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:ev({name:Ne(t.branchName)}),"aria-label":ev({name:Ne(t.branchName)}),href:tb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(_b,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-z5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+H1(O),0)+F1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=H1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+F1}}let w=0;for(const y of S){const C=H1(y);b(y,w+C/2,0),w+=C+F1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Uv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Uv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Uv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:Z=>Z.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const Z=t?Wa(t):"experiments";return typeof Z=="object"&&"path"in Z&&Z.line&&p!==v.current.value?{...Z,lineScrollRequest:v.current.value}:Z},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var Z;return((Z=w.data)==null?void 0:Z.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((Z,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:C1(je.projectId,je.activeSessionId,Z),replace:ge})},[s]),B=R.useCallback(Z=>{const ge=Ll(Z);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),q=R.useCallback(Z=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:Z??void 0})},[t,O]),U=R.useCallback(Z=>{s.navigate({href:Z?`/projects/${encodeURIComponent(Z)}`:"/projects"})},[s]),Y=R.useCallback(Z=>{var ge;if(n)if(Z==="chat"){const je=l.current;s.navigate({href:C1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${Z==="skills"?"skills":`settings/${Z}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(Z=>{Vr(te.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[te]),W=R.useMemo(()=>Zp(),[n]),H=ct(W),ee=H.data??null,de=R.useCallback(Z=>{Vr(W.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[W]),re=R.useRef(void 0);re.current=ee==null?void 0:ee.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!H.data&&H.error?Bne():null].filter(Z=>Z!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(W4(n)),ce=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ce);Ct.current=ce;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ce.every(Z=>Z.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ce:ce.filter(Z=>Z.chatSessionId===u),[ce,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const Z=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>Z.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=Z=>{let ge=En.current.get(Z);return ge||(ge=new HEt,En.current.set(Z,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(Z=>{const ge=[...Z];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(Z=>{dr.current=Z,zi(Z)},[]),Pr=R.useCallback(Z=>{const ge=Et(Z);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in Z){const Me=Ms(je,en.current,Z);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(Z=>{const ge=Et(Z),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(Z)];vs.current=je,Rn(je),B(Z)},[B]),cs=R.useCallback((Z,ge,je)=>{const $e=Et(Z),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Pr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(Z));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(Z)];vs.current=tt,Rn(tt),O(Ll(Z,je))},[Pr,ls,Ls,O]),bs=R.useCallback(Z=>{const ge=dr.current;ge&&Et(ge)===Et(Z)&&Ls(null)},[Ls]);R.useEffect(()=>{let Z=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){Z=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),Z=!0;return}if(Z&&$e.key==="Enter"){$e.preventDefault(),Z=!1;const Lt=dr.current;Lt&&bs(Lt);return}Z=!1},je=()=>{Z=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((Z,ge)=>{const je=Et(Z),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(Z=>Z+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((Z,ge,je)=>{if(Rn(Z.tabHistory),vs.current=Z.tabHistory,Nr(Z.experimentsTabOpen),fn(Z.filesTabOpen),tn(Z.artifactsTabOpen),un(Z.expTabs),on(Z.fileTabs),lt(Me=>Me===Z.planTabs?Me:Z.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(Z.subagentTabs),On(Z.codeTabs),ls(Z.contentTabOrder),Ls(Z.previewTab),Jt(Z.filesView),ur(Z.filesToggled),Zt(Z.scope),Ke(Z.panelMax),ji(Z.treeViewport),Yn(M.current.activeSessionId===O0&&Z.fileTabs.some(Me=>Yu(Me,{path:S1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of Z.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Fr,workspace:oa}=K0t({projectId:ee&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(ee==null?void 0:ee.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const Z=Jl.current;(Z==null?void 0:Z.projectId)===n&&Z.taskId===u&&Z.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((Z,ge)=>{var at;if(!n)return;Z&&ge!=null&&ge.replace&&u===null&&(Fr(),W0t(n,Z));const je=cu(DO(n),Z??"new"),$e=je?je.active:Wc(n)?(at=T6(Z??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&Z&&u===null?M.current.pane:$e;s.navigate({href:C1(n,Z,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Fr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(Z=>Z+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:Z})=>{var ge;return((ge=Rd(Z.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(Z=>Z.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const Z=ob(i.href);!ee||!$n||!Z||(lb.queue({lastLocation:Z,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===Z?250:0),La.current=Z)},[i.href,ee,$n,oo,os,Ze]);const ec=(ee==null?void 0:ee.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async Z=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:Z}),de($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||ee!=null&&ee.tourCompleted||Ai()},[n,ec,Ai,ee==null?void 0:ee.tourCompleted]);const Mt=(L==null?void 0:L.find(Z=>Z.id===n))??null;R.useEffect(()=>{const Z=Q||ee===null?null:Mt==null?void 0:Mt.name;document.title=Z?`${Oo(Z)} — OpenResearch`:"OpenResearch"},[Q,ee,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(Z=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:Z})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((Z=!1)=>{Z&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},Z))},[O,xs]),Ri=()=>{I.refetch(),H.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!ee||lo.current)return;lo.current=!0,le.current=ee.preferredAgent;const Z=N6()??ee.workspace;Z&&(Cs(Z.railOpen),ks(Math.min(Z.panelWidth,T0())),_t(Z.experimentsView))},[ee]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(Z=>{const ge=++sc.current;de($e=>$e&&{...$e,preferredAgent:Z});const je=co.current.then(()=>r.mutateAsync({preferredAgent:Z})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const Z=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const Os=R.useCallback(Z=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(Z)).then(je=>{if(hr.current!==Z||Ut.current!==Z||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const Z=hr.current;Z&&(Ut.current=Z,vt.current.clear(),Dt.current.clear(),Os(Z))},onRun:Z=>{if(Z.projectId!==hr.current||Z.projectId!==Ut.current)return;const ge=vt.current.get(Z.id),je=Dt.current.has(Z.id);if(ge&&ge.updatedAt>Z.updatedAt||(vt.current.set(Z.id,Z),Dt.current.add(Z.id),Z.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(Z.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=Z.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(Z.id,Z)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((Z,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:Z,view:ge};un(at=>at.some(tt=>M2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((Z,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===Z||Me.id.startsWith(Z)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ce.map(Z=>{var ge;return[Z.id,((ge=Z.title)==null?void 0:ge.trim())||Z.slug||El()]})),[ce,G]),Zs=YR(zu),el=R.useMemo(()=>{const Z=new Map;for(const ge of Ie)Z.set(ge.id,Zs.get(ge.experimentId)??El());return Z},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(Z=>{const ge=tl.get(Z);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(Z=>{const ge=Zs.get(Z);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((Z,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===Z||$e.id.startsWith(Z));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(Z=>{const ge=nr.findIndex(je=>M2(je,Z));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[nr,yr,b]),uo=R.useCallback((Z,ge="preview")=>{Z.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,Z);Dr.current.fileTabs.some(at=>Yu(at,Z))||C.current.delete(Me),E.current.add(Me)}const $e=RO(Z);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,Z));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(Z,ge)},[cs]),fi=R.useCallback((Z,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(Z,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((Z,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(Z,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(Z=>uo({path:Z,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((Z,ge,je,$e,Me,at="preview")=>{const tt=fi(Z,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((Z,ge)=>{bs(Z),ge()},[bs]),of=R.useCallback(Z=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,Z));if(ge===-1)return;const je=n?Ms(n,u,Z):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(Z,{path:S1,source:"artifacts"})&&Yn(!1),yr(Z,Et(b)===Et(Z)))},[u,Mn,yr,n,b]),lf=R.useCallback(Z=>{Z.lineScrollRequest!==void 0&&m(Z.lineScrollRequest)},[]),x_=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:Z};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(Z=>{const ge=xt.findIndex(je=>je.promptId===Z.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,xt,b]),lc=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:Z,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(Z=>{const ge=ft.findIndex(je=>je.spawnPartId===Z.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let Z=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Rv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{Z&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=av(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{Z=!1,at()}},[ft]);const uc=R.useCallback((Z,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:Z,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:Z,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((Z,ge)=>{On(je=>je.map($e=>qf($e,Z)?{...$e,...ge}:$e)),ge.view&&O(Ll({...Z,...ge}))},[]),S_=R.useCallback(Z=>{const ge=xn.findIndex(je=>qf(je,Z));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(Z=>{Z==="experiments"?Nr(!1):Z==="files"?fn(!1):tn(!1),yr(Z,b===Z)},[yr,b]),ff=Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=Z.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Uv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(Z,ge)=>{F(je=>je?QR(je,Z):[Z]),s.navigate({href:`/projects/${encodeURIComponent(Z.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(Z=>Yu(Z,{path:S1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const Z=nl.data.messages.flatMap(je=>{const $e=Rv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=Z==null?void 0:Z.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(Z=>qf(Z,Ae))??null:null,Ue=new Map;for(const Z of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(Z),Z);const zn=ca?Et(ca):null,jn=di.filter(Z=>Z!==zn).map(Z=>Ue.get(Z)).filter(q0t),fr=Z=>ao!==null&&Et(ao)===Et(Z),Ln=Z=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,Z),label:Z.path.split("/").pop()||Z.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>of(Z)},`file:${z6(Z)}`),_r=Bs?ce.find(Z=>Z.id===Bs.id)??null:null,da=Oe?ce.find(Z=>Z.id===Oe.experimentId&&Z.branchName===Oe.branch)??null:null,_f=Z=>{var je,$e;if("path"in Z)return Ln(Z);if("id"in Z){const Me=ce.find(at=>at.id===Z.id);return f.jsx(Fc,{active:Bs!==null&&M2(Bs,Z),label:Me?Me.title||Me.slug:"…",icon:Z.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>Tu(Z)},Et(Z))}if("kind"in Z&&Z.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===Z.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>w_(Z)},Et(Z));if("kind"in Z)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===Z.spawnPartId,label:((je=uf[Z.spawnPartId])==null?void 0:je.label)??Z.label??Wne(),shimmer:(($e=uf[Z.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>cf(Z)},Et(Z));const ge=ce.find(Me=>Me.id===Z.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,Z),label:(ge==null?void 0:ge.slug)??Z.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>S_(Z)},Et(Z))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>U(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||ee===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>U(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(Z=>Z.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(ee==null?void 0:ee.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:ee.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:Z=>{F(ge=>ge?QR(ge,Z):[Z])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ce,runs:Ie,onOpenExperiment:(Z,ge)=>Is(Z,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(Z=>Z.id===u&&Z.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:C4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(fb,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(Z=>!Z),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Ur,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(Z=>Z.id===d&&Z.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(Z=>!Z),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ce,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ce.length>0?gne():void 0,experiments:br,onOpen:(Z,ge)=>{Is(Z.id,"overview",ge)},onOpenLogs:(Z,ge,je)=>{Is(Z,"terminal",je,ge)},onOpenCode:(Z,ge)=>{const je=ce.find($e=>$e.id===Z);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(Z,ge,je,$e)=>oc(Z,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const Z=Ms(n,u,Dn);C.current.delete(Z),E.current.add(Z)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:Z=>{N.current[Ms(n,u,Dn)]=Z,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(Z,ge,je,$e)=>hi(Dn,()=>oc(Z,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:Z=>{rr.current.set(Ms(n,u,Dn),Z),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(Z=>Z.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(Z,ge,je,$e,Me)=>hi(Qr,()=>oc(Z,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(Z,ge,je,$e,Me)=>hi(be,()=>Au(Z,be.sessionId,ge,je,$e,Me)),onOpenRun:(Z,ge)=>hi(be,()=>Oa(Z,ge)),runExperimentName:ac,onOpenExperiment:(Z,ge)=>hi(be,()=>ju(Z,ge)),experimentName:sf,onOpenSubagent:(Z,ge,je)=>hi(be,()=>lc(be.sessionId,Z,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:Z=>df(Oe,{view:Z}),onToggledChange:Z=>df(Oe,{toggled:Z}),onOpenFile:(Z,ge,je,$e)=>hi(Oe,()=>oc(Z,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:q,parentExperiment:ce.find(Z=>Z.id===_r.parentExperimentId)??null,onOpenView:(Z,ge,je)=>{hi(Bs,()=>Is(_r.id,Z,je,ge))},onOpenCode:(Z,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,Z,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(Z,ge)=>{Kr(!1),k_(Z,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const j5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=j5.useParams(),{pane:n}=j5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>cb}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>cb}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>cb}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=j5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=cb._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); diff --git a/ui/dist/index.html b/ui/dist/index.html index 2091d97c0..b8703ea63 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index 33a52b578..109d1641b 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -3001,6 +3001,8 @@ function GitTab({ const [defaultPromptOpen, setDefaultPromptOpen] = useState(false); const [defaultPromptSaving, setDefaultPromptSaving] = useState(false); const [defaultPromptError, setDefaultPromptError] = useState(null); + // The standing auto-topics default, captured when the sync prompt opens. + const [defaultPromptAutoTopics, setDefaultPromptAutoTopics] = useState(null); // Topic editor state. `null` means "not seeded yet"; once the project arrives it // holds the user's edits, so a background refetch cannot clobber typing. const [topicsAuto, setTopicsAuto] = useState(null); @@ -3008,12 +3010,19 @@ function GitTab({ const [topicsSaving, setTopicsSaving] = useState(false); const [topicsError, setTopicsError] = useState(null); const hasGithubRepository = Boolean(status?.github.owner && status.github.repo); + const topicsProjectId = useRef(null); + // Seed once per project: opening a different project on this tab must not leave + // the previous project's topics on screen, where saving would write them onto + // the new one. Re-seeding on every project object change would instead fight + // the user's typing, so key it on the project id. useEffect(() => { - if (!project || topicsAuto !== null) return; + if (!project || topicsProjectId.current === project.id) return; + topicsProjectId.current = project.id; setTopicsAuto(project.githubAutoTopicsEnabled); setTopicsCustom(project.githubTopics.join(", ")); - }, [project, topicsAuto]); + setTopicsError(null); + }, [project]); const load = async () => { await statusQuery.refetch({ cancelRefetch: false }); }; @@ -3042,6 +3051,9 @@ function GitTab({ void queryClient.fetchQuery(getProjectDefaultsQuery()) .then((defaults) => { if (!defaults.githubForNewProjects && !defaults.githubDefaultPromptSeen) { + // Remember the standing auto-topics default: this prompt only asks + // about syncing, so answering it must not rewrite the other setting. + setDefaultPromptAutoTopics(defaults.githubAutoTopicsForNewProjects); setDefaultPromptOpen(true); } }) @@ -3054,7 +3066,11 @@ function GitTab({ const finishDefaultPrompt = (enabled: boolean) => { setDefaultPromptSaving(true); setDefaultPromptError(null); - void setProjectDefaultsMutation.mutateAsync([enabled, enabled, true]) + void setProjectDefaultsMutation.mutateAsync([ + enabled, + defaultPromptAutoTopics ?? enabled, + true, + ]) .then(() => setDefaultPromptOpen(false)) .catch((err) => setDefaultPromptError(err instanceof Error ? err.message : String(err))) .finally(() => setDefaultPromptSaving(false)); From 2288c3b3e2159c3ee3243bc38f3845afb5258f23 Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 13:00:05 +0800 Subject: [PATCH 3/9] Remove the now-unused github_topics_enabled helper The publish guard used it to decide whether to sync; that guard now checks whether the computed topic set is empty, so nothing calls it. --- src/local/model.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/local/model.rs b/src/local/model.rs index 61e5b43e8..2f543462e 100644 --- a/src/local/model.rs +++ b/src/local/model.rs @@ -83,10 +83,6 @@ impl LocalProject { }) } - pub fn github_topics_enabled(&self) -> bool { - self.github_enabled() && self.github_auto_topics_enabled - } - /// Column order must match `store::PROJECT_COLS`. pub(crate) fn from_row(row: &rusqlite::Row<'_>) -> std::result::Result { let github_topics: String = row.get(7)?; From 7006034bb12c0ed844dae17b7e49ac8521b446dc Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 13:06:03 +0800 Subject: [PATCH 4/9] Label the topics controls and compare topic sets, not drafts - Wrap the new-project topics checkbox in a label so the visible text names the control and the whole row is clickable. - Give the extra-topics field an accessible name; it relied on its placeholder, which disappears once the user types. - Point the per-project topics switch at the repository-topics label instead of the new-project defaults one, which described the wrong thing. - Compare the parsed topic sets when deciding dirty state. Comparing raw strings treated "a,b" and "a, b" as an edit and sent a pointless PATCH. --- .../{index-D9ReCQbY.js => index-Dh0e4aL2.js} | 140 +++++++++--------- ui/dist/index.html | 2 +- ui/src/components/NewProjectForm.tsx | 5 +- ui/src/components/SettingsPage.tsx | 17 ++- 4 files changed, 85 insertions(+), 79 deletions(-) rename ui/dist/assets/{index-D9ReCQbY.js => index-Dh0e4aL2.js} (60%) diff --git a/ui/dist/assets/index-D9ReCQbY.js b/ui/dist/assets/index-Dh0e4aL2.js similarity index 60% rename from ui/dist/assets/index-D9ReCQbY.js rename to ui/dist/assets/index-Dh0e4aL2.js index 43d9ee92f..cbdf5206f 100644 --- a/ui/dist/assets/index-D9ReCQbY.js +++ b/ui/dist/assets/index-Dh0e4aL2.js @@ -1,4 +1,4 @@ -var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in e?sG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>iG(e,typeof n!="symbol"?n+"":n,t),n2=(e,n,t)=>n.has(e)||Z8("Cannot "+t);var ue=(e,n,t)=>(n2(e,n,"read from private field"),t?t.call(e):n.get(e)),st=(e,n,t)=>n.has(e)?Z8("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(n2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ot=(e,n,t)=>(n2(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return ue(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r2={exports:{}},s0={};/** +var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in e?sG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>iG(e,typeof n!="symbol"?n+"":n,t),r2=(e,n,t)=>n.has(e)||Z8("Cannot "+t);var de=(e,n,t)=>(r2(e,n,"read from private field"),t?t.call(e):n.get(e)),st=(e,n,t)=>n.has(e)?Z8("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(r2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ot=(e,n,t)=>(r2(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return de(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s2={exports:{}},s0={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var J8;function aG(){if(J8)return s0;J8=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var e9;function oG(){return e9||(e9=1,r2.exports=aG()),r2.exports}var f=oG(),s2={exports:{}},Xt={};/** + */var J8;function aG(){if(J8)return s0;J8=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var e9;function oG(){return e9||(e9=1,s2.exports=aG()),s2.exports}var f=oG(),i2={exports:{}},Xt={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,W,H){this.props=F,this.context=W,this.refs=v,this.updater=H||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,W){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,W,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,W,H){this.props=F,this.context=W,this.refs=v,this.updater=H||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,W,H){var ee=H.ref;return{$$typeof:e,type:F,key:W,ref:ee!==void 0?ee:null,props:H}}function O(F,W){return M(F.type,W,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var W={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(H){return W[H]})}var q=/\/+/g;function U(F,W){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):W.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(W){F.status==="pending"&&(F.status="fulfilled",F.value=W)},function(W){F.status==="pending"&&(F.status="rejected",F.reason=W)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function G(F,W,H,ee,de){var re=typeof F;(re==="undefined"||re==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,G(ne(F._payload),W,H,ee,de)}}if(ne)return de=de(F),ne=ee===""?"."+U(F,0):ee,E(de)?(H="",ne!=null&&(H=ne.replace(q,"$&/")+"/"),G(de,W,H,"",function(oe){return oe})):de!=null&&(B(de)&&(de=O(de,H+(de.key==null||F&&F.key===de.key?"":(""+de.key).replace(q,"$&/")+"/")+ne)),W.push(de)),1;ne=0;var Q=ee===""?".":ee+":";if(E(F))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,T5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,T5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return ue(this,Qc).setTimeout(e,n)}clearTimeout(e){ue(this,Qc).clearTimeout(e)}setInterval(e,n){return ue(this,Qc).setInterval(e,n)}clearInterval(e){ue(this,Qc).clearInterval(e)}},Qc=new WeakMap,T5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==A5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function A5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Xw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Xw(e)&&Xw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Zw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?R5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const M5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===M5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const L5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ue(this,Yc)||this.setEventListener(ue(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=ue(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){ue(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof ue(this,ud)=="boolean"?ue(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const O5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,Xc)||this.setEventListener(ue(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=ue(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=ue(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){ue(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return ue(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const q1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?q1.isOnline():!0}var U1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof U1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new U1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>O5.isFocused()&&(e.networkMode==="always"||q1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(L5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L5()?1/0:3e5))}clearGcTimeout(){ue(this,dd)!==void 0&&(ad.clearTimeout(ue(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,ue(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??ue(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ue(this,wh)}get promise(){var n;return(n=ue(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...ue(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,wa).remove(this)}setData(n,t){const r=Zw(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=ue(this,hs))==null?void 0:r.promise;return(s=ue(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ue(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===M5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=ue(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),ue(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(ue(this,hs)&&(ue(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ue(this,hs).cancel({revert:!0}):ue(this,hs).cancelRetry()),this.scheduleGc()),ue(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=ue(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(ue(this,hs))return ue(this,hs).continueRetry(),ue(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:ue(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ue(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=ue(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof U1&&E.revert&&this.setState({...ue(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=ue(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=ue(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof U1){if(E.silent)return ue(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=ue(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=ue(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{ue(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),ue(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,Jw,e4,t4,n4,r4,s4,i4,a4,nM,I5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,Sn).addObserver(this),u9(ue(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,r4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return o4(ue(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return o4(ue(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,s4).call(this),Ot(this,Un,i4).call(this),ue(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=ue(this,Sn);if(this.options=ue(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,ue(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,a4).call(this),ue(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&ue(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,Sn),observer:this});const s=this.hasListeners();s&&d9(ue(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||$r(this.options.staleTime,ue(this,Sn))!==$r(t.staleTime,ue(this,Sn)))&&Ot(this,Un,e4).call(this);const i=Ot(this,Un,t4).call(this);s&&(ue(this,Sn)!==r||$r(this.options.enabled,ue(this,Sn))!==$r(t.enabled,ue(this,Sn))||i!==ue(this,Zc))&&Ot(this,Un,n4).call(this,i)}getOptimisticResult(n){const t=ue(this,ni).getQueryCache().build(ue(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,ue(this,Sn).state)),r}getCurrentResult(){return ue(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){ue(this,Nh).add(n)}getCurrentQuery(){return ue(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=ue(this,ni).defaultQueryOptions(n),r=ue(this,ni).getQueryCache().build(ue(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=ue(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,ri)))}createResult(n,t){var N;const r=ue(this,Sn),s=this.options,i=ue(this,ri),a=ue(this,pd),o=ue(this,kh),l=n!==r?n.state:ue(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=ue(this,Eh))==null?void 0:N.state.data,ue(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=Zw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===ue(this,Dp))p=ue(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=Zw(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);ue(this,zl)&&(m=ue(this,zl),p=ue(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:B5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=ue(this,ri),t=this.createResult(ue(this,Sn),this.options);if(Fe(this,pd,ue(this,Sn).state),Fe(this,kh,this.options),ue(this,pd).data!==void 0&&Fe(this,Eh,ue(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,Nh).size)return!0;const o=new Set(a??ue(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(ue(this,ri)).some(l=>{const u=l;return ue(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(ue(this,ri))}),ue(this,ni).getQueryCache().notify({query:ue(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,r4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,a4).call(this);let t=ue(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},Jw=function(n){return!L5()&&$r(this.options.enabled,ue(this,Sn))!==!1&&uM(n)},e4=function(){Ot(this,Un,s4).call(this);const n=$r(this.options.staleTime,ue(this,Sn));if(ue(this,ri).isStale||!Ot(this,Un,Jw).call(this,n))return;const t=dM(ue(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{ue(this,ri).isStale||this.updateResult()},t))},t4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,Sn)):this.options.refetchInterval)??!1},n4=function(n){Ot(this,Un,i4).call(this),Fe(this,Zc,n),!(ue(this,Zc)===0||!Ot(this,Un,Jw).call(this,ue(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||O5.isFocused())&&Ot(this,Un,S0).call(this)},ue(this,Zc)))},r4=function(){Ot(this,Un,e4).call(this),Ot(this,Un,n4).call(this,Ot(this,Un,t4).call(this))},s4=function(){ue(this,md)!==void 0&&(ad.clearTimeout(ue(this,md)),Fe(this,md,void 0))},i4=function(){ue(this,gd)!==void 0&&(ad.clearInterval(ue(this,gd)),Fe(this,gd,void 0))},a4=function(){const n=ue(this,ni).getQueryCache().build(ue(this,ni),this.options);if(n===ue(this,Sn))return;const t=ue(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&o4(e,n,n.refetchOnMount)}function o4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&B5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&B5(e,t)}function B5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){ue(this,Eo).includes(n)||(ue(this,Eo).push(n),this.clearGcTimeout(),ue(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,ue(this,Eo).filter(t=>t!==n)),this.scheduleGc(),ue(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){ue(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():ue(this,qs).remove(this))}continue(){var n;return((n=ue(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:ue(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),ue(this,qs).config.onMutate&&await ue(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=ue(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=ue(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=ue(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=ue(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{ue(this,vd)===s&&Fe(this,vd,void 0),ue(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{ue(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),ue(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){ue(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);r?r.push(n):ue(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(ue(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=ue(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&ue(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=ue(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{ue(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),ue(this,jl).clear(),ue(this,qa).clear()})}getAll(){return Array.from(ue(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,l4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=ue(this,Tl).defaultMutationOptions(t),A0(this.options,r)||ue(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ue(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=ue(this,Us))==null?void 0:s.state.status)==="pending"&&ue(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&ue(this,Us)&&(ue(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=ue(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this,t)}getCurrentResult(){return ue(this,Jc)}reset(){var t;(t=ue(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,l4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=ue(this,Us))==null||s.removeObserver(this),Fe(this,Us,ue(this,Tl).getMutationCache().build(ue(this,Tl),this.options)),ue(this,Us).addObserver(this),ue(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=ue(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},l4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(ue(this,Al)&&this.hasListeners()){const d=ue(this,Jc).variables,p=ue(this,Jc).context,m={client:ue(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=ue(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=ue(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=ue(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=ue(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(ue(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,c4,u4,vM,d4,f4,h4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&ue(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,f4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,ue(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=ue(this,Fi),s=Ot(this,ms,d4).call(this,ue(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=ue(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,f4).call(this,d,p)})})),Ot(this,ms,h4).call(this)))})}getCurrentResult(){return ue(this,si)}getQueries(){return ue(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return ue(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,d4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,u4).call(this,a??s,t,i),()=>Ot(this,ms,c4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,c4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},u4=function(n,t,r){if(t){const s=ue(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(ue(this,si)!==ue(this,Bp)||i||t!==ue(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,ue(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,R5(ue(this,yd),t(n)))),ue(this,yd)}return n},vM=function(){var n;return!((n=ue(this,bd))!=null&&n.combine)||ue(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=ue(this,si)[r])==null?void 0:s.data)===void 0})},d4=function(n){const t=new Map;ue(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=ue(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new I5(ue(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},f4=function(n,t){const r=ue(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,ue(this,si).slice()),ue(this,si)[r]=t,Ot(this,ms,h4).call(this))},h4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=ue(this,yd),s=t?r:Ot(this,ms,u4).call(this,Ot(this,ms,c4).call(this,ue(this,si),ue(this,Pp)),(n=ue(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(ue(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??A5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){ue(this,zo).has(n.queryHash)||(ue(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=ue(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&ue(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return ue(this,zo).get(n)}getAll(){return[...ue(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,ue(this,nu)===1&&(Fe(this,Rh,O5.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onFocus())})),Fe(this,Mh,q1.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,ue(this,nu)===0&&((e=ue(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=ue(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return ue(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=ue(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return ue(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=ue(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return ue(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>ue(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=ue(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=ue(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=ue(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>ue(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(ue(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>ue(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=ue(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return q1.isOnline()?ue(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,zr)}getMutationCache(){return ue(this,eu)}getDefaultOptions(){return ue(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){ue(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...ue(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){ue(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...ue(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...ue(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=A5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===M5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,zr).clear(),ue(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?D5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||D5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>_4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&_4(b,S)){const w=new I5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),_4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,I5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&D5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Gv=0;const p4=new Set,HG=()=>Gv,_9=e=>(p4.add(e),()=>{p4.delete(e)}),za=()=>["workspace",Gv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Gv++,du.clear(),$5({queryKey:t}),p4.forEach(r=>r()),!0}const Fn=e=>e[1]===Gv;async function $5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Vr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var i2={exports:{}},i0={},a2={exports:{}},o2={};/** + */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,W){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,W,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,W,U){var Z=U.ref;return{$$typeof:e,type:F,key:W,ref:Z!==void 0?Z:null,props:U}}function O(F,W){return M(F.type,W,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var W={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(U){return W[U]})}var H=/\/+/g;function q(F,W){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):W.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(W){F.status==="pending"&&(F.status="fulfilled",F.value=W)},function(W){F.status==="pending"&&(F.status="rejected",F.reason=W)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function G(F,W,U,Z,ce){var re=typeof F;(re==="undefined"||re==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,G(ne(F._payload),W,U,Z,ce)}}if(ne)return ce=ce(F),ne=Z===""?"."+q(F,0):Z,E(ce)?(U="",ne!=null&&(U=ne.replace(H,"$&/")+"/"),G(ce,W,U,"",function(oe){return oe})):ce!=null&&(B(ce)&&(ce=O(ce,U+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+ne)),W.push(ce)),1;ne=0;var Q=Z===""?".":Z+":";if(E(F))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,T5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,T5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return de(this,Qc).setTimeout(e,n)}clearTimeout(e){de(this,Qc).clearTimeout(e)}setInterval(e,n){return de(this,Qc).setInterval(e,n)}clearInterval(e){de(this,Qc).clearInterval(e)}},Qc=new WeakMap,T5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==A5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function A5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Zw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Zw(e)&&Zw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Jw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?R5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const M5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===M5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const L5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){de(this,Yc)||this.setEventListener(de(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=de(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){de(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof de(this,ud)=="boolean"?de(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const O5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,Xc)||this.setEventListener(de(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=de(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){de(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return de(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const U1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?U1.isOnline():!0}var G1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof G1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new G1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>O5.isFocused()&&(e.networkMode==="always"||U1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(L5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L5()?1/0:3e5))}clearGcTimeout(){de(this,dd)!==void 0&&(ad.clearTimeout(de(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,de(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??de(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return de(this,wh)}get promise(){var n;return(n=de(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...de(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,wa).remove(this)}setData(n,t){const r=Jw(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=de(this,hs))==null?void 0:r.promise;return(s=de(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return de(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===M5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),de(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(de(this,hs)&&(de(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?de(this,hs).cancel({revert:!0}):de(this,hs).cancelRetry()),this.scheduleGc()),de(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=de(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(de(this,hs))return de(this,hs).continueRetry(),de(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:de(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:de(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=de(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof G1&&E.revert&&this.setState({...de(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=de(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=de(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof G1){if(E.silent)return de(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=de(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=de(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{de(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),de(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,e4,t4,n4,r4,s4,i4,a4,o4,nM,I5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(de(this,Sn).addObserver(this),u9(de(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,s4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return l4(de(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return l4(de(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,i4).call(this),Ot(this,Un,a4).call(this),de(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=de(this,Sn);if(this.options=de(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,de(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,o4).call(this),de(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&de(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:de(this,Sn),observer:this});const s=this.hasListeners();s&&d9(de(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||$r(this.options.staleTime,de(this,Sn))!==$r(t.staleTime,de(this,Sn)))&&Ot(this,Un,t4).call(this);const i=Ot(this,Un,n4).call(this);s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||i!==de(this,Zc))&&Ot(this,Un,r4).call(this,i)}getOptimisticResult(n){const t=de(this,ni).getQueryCache().build(de(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,de(this,Sn).state)),r}getCurrentResult(){return de(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){de(this,Nh).add(n)}getCurrentQuery(){return de(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=de(this,ni).defaultQueryOptions(n),r=de(this,ni).getQueryCache().build(de(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=de(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),de(this,ri)))}createResult(n,t){var N;const r=de(this,Sn),s=this.options,i=de(this,ri),a=de(this,pd),o=de(this,kh),l=n!==r?n.state:de(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=de(this,Eh))==null?void 0:N.state.data,de(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=Jw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===de(this,Dp))p=de(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=Jw(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);de(this,zl)&&(m=de(this,zl),p=de(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:B5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=de(this,ri),t=this.createResult(de(this,Sn),this.options);if(Fe(this,pd,de(this,Sn).state),Fe(this,kh,this.options),de(this,pd).data!==void 0&&Fe(this,Eh,de(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!de(this,Nh).size)return!0;const o=new Set(a??de(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(de(this,ri)).some(l=>{const u=l;return de(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(de(this,ri))}),de(this,ni).getQueryCache().notify({query:de(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,s4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,o4).call(this);let t=de(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},e4=function(n){return!L5()&&$r(this.options.enabled,de(this,Sn))!==!1&&uM(n)},t4=function(){Ot(this,Un,i4).call(this);const n=$r(this.options.staleTime,de(this,Sn));if(de(this,ri).isStale||!Ot(this,Un,e4).call(this,n))return;const t=dM(de(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{de(this,ri).isStale||this.updateResult()},t))},n4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(de(this,Sn)):this.options.refetchInterval)??!1},r4=function(n){Ot(this,Un,a4).call(this),Fe(this,Zc,n),!(de(this,Zc)===0||!Ot(this,Un,e4).call(this,de(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||O5.isFocused())&&Ot(this,Un,S0).call(this)},de(this,Zc)))},s4=function(){Ot(this,Un,t4).call(this),Ot(this,Un,r4).call(this,Ot(this,Un,n4).call(this))},i4=function(){de(this,md)!==void 0&&(ad.clearTimeout(de(this,md)),Fe(this,md,void 0))},a4=function(){de(this,gd)!==void 0&&(ad.clearInterval(de(this,gd)),Fe(this,gd,void 0))},o4=function(){const n=de(this,ni).getQueryCache().build(de(this,ni),this.options);if(n===de(this,Sn))return;const t=de(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&l4(e,n,n.refetchOnMount)}function l4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&B5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&B5(e,t)}function B5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){de(this,Eo).includes(n)||(de(this,Eo).push(n),this.clearGcTimeout(),de(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,de(this,Eo).filter(t=>t!==n)),this.scheduleGc(),de(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){de(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():de(this,qs).remove(this))}continue(){var n;return((n=de(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:de(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),de(this,qs).config.onMutate&&await de(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=de(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=de(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=de(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=de(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{de(this,vd)===s&&Fe(this,vd,void 0),de(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{de(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),de(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){de(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);r?r.push(n):de(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(de(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&de(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{de(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),de(this,jl).clear(),de(this,qa).clear()})}getAll(){return Array.from(de(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,c4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=de(this,Tl).defaultMutationOptions(t),A0(this.options,r)||de(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:de(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=de(this,Us))==null?void 0:s.state.status)==="pending"&&de(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&de(this,Us)&&(de(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=de(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,c4).call(this,t)}getCurrentResult(){return de(this,Jc)}reset(){var t;(t=de(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,c4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=de(this,Us))==null||s.removeObserver(this),Fe(this,Us,de(this,Tl).getMutationCache().build(de(this,Tl),this.options)),de(this,Us).addObserver(this),de(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=de(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},c4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(de(this,Al)&&this.hasListeners()){const d=de(this,Jc).variables,p=de(this,Jc).context,m={client:de(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=de(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=de(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=de(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=de(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(de(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,u4,d4,vM,f4,h4,_4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&de(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,h4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,de(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=de(this,Fi),s=Ot(this,ms,f4).call(this,de(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=de(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,h4).call(this,d,p)})})),Ot(this,ms,_4).call(this)))})}getCurrentResult(){return de(this,si)}getQueries(){return de(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return de(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,f4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,d4).call(this,a??s,t,i),()=>Ot(this,ms,u4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,u4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},d4=function(n,t,r){if(t){const s=de(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(de(this,si)!==de(this,Bp)||i||t!==de(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,de(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,R5(de(this,yd),t(n)))),de(this,yd)}return n},vM=function(){var n;return!((n=de(this,bd))!=null&&n.combine)||de(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=de(this,si)[r])==null?void 0:s.data)===void 0})},f4=function(n){const t=new Map;de(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=de(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new I5(de(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},h4=function(n,t){const r=de(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,de(this,si).slice()),de(this,si)[r]=t,Ot(this,ms,_4).call(this))},_4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=de(this,yd),s=t?r:Ot(this,ms,d4).call(this,Ot(this,ms,u4).call(this,de(this,si),de(this,Pp)),(n=de(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(de(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??A5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){de(this,zo).has(n.queryHash)||(de(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=de(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&de(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return de(this,zo).get(n)}getAll(){return[...de(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,de(this,nu)===1&&(Fe(this,Rh,O5.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onFocus())})),Fe(this,Mh,U1.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,de(this,nu)===0&&((e=de(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=de(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return de(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return de(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=de(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return de(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=de(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return de(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>de(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=de(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=de(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>de(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(de(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>de(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return U1.isOnline()?de(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,zr)}getMutationCache(){return de(this,eu)}getDefaultOptions(){return de(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){de(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...de(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){de(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...de(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...de(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=A5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===M5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...de(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){de(this,zr).clear(),de(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?D5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||D5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},p4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>p4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&p4(b,S)){const w=new I5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),p4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,I5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&D5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Wv=0;const m4=new Set,HG=()=>Wv,_9=e=>(m4.add(e),()=>{m4.delete(e)}),za=()=>["workspace",Wv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Wv++,du.clear(),$5({queryKey:t}),m4.forEach(r=>r()),!0}const Fn=e=>e[1]===Wv;async function $5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Vr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var a2={exports:{}},i0={},o2={exports:{}},l2={};/** * @license React * scheduler.production.js * @@ -22,7 +22,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var te=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(H,te))ees(de,H)?(G[I]=de,G[ee]=te,I=ee):(G[I]=H,G[W]=te,I=W);else if(ees(de,te))G[I]=de,G[ee]=te,I=ee;else break e}}return X}function s(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-G),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,U=q.port2;q.port1.onmessage=B,$=function(){U.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=te,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var te=p;p=X;try{return G.apply(this,arguments)}finally{p=te}}}})(o2)),o2}var m9;function GG(){return m9||(m9=1,a2.exports=UG()),a2.exports}var l2={exports:{}},Hs={};/** + */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var te=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(U,te))Zs(ce,U)?(G[I]=ce,G[Z]=te,I=Z):(G[I]=U,G[W]=te,I=W);else if(Zs(ce,te))G[I]=ce,G[Z]=te,I=Z;else break e}}return X}function s(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-G),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=B,$=function(){q.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=te,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var te=p;p=X;try{return G.apply(this,arguments)}finally{p=te}}}})(l2)),l2}var m9;function GG(){return m9||(m9=1,o2.exports=UG()),o2.exports}var c2={exports:{}},Hs={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var g9;function WG(){if(g9)return Hs;g9=1;var e=Vp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),l2.exports=WG(),l2.exports}/** + */var g9;function WG(){if(g9)return Hs;g9=1;var e=Vp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),c2.exports=WG(),c2.exports}/** * @license React * react-dom-client.production.js * @@ -38,15 +38,15 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var b9;function VG(){if(b9)return i0;b9=1;var e=GG(),n=Vp(),t=NM();function r(c){var h="https://react.dev/errors/"+c;if(1L||(c.current=I[L],I[L]=null,L--)}function H(c,h){L++,I[L]=c.current,c.current=h}var ee=F(null),de=F(null),re=F(null),ne=F(null);function Q(c,h){switch(H(re,h),H(de,c),H(ee,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?x8(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=x8(h),c=w8(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}W(ee),H(ee,c)}function le(){W(ee),W(de),W(re)}function oe(c){c.memoizedState!==null&&H(ne,c);var h=ee.current,g=w8(h,c.type);h!==g&&(H(de,c),H(ee,g))}function ce(c){de.current===c&&(W(ee),W(de)),ne.current===c&&(W(ne),J_._currentValue=te)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1L||(c.current=I[L],I[L]=null,L--)}function U(c,h){L++,I[L]=c.current,c.current=h}var Z=F(null),ce=F(null),re=F(null),ne=F(null);function Q(c,h){switch(U(re,h),U(ce,c),U(Z,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?x8(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=x8(h),c=w8(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}W(Z),U(Z,c)}function le(){W(Z),W(ce),W(re)}function oe(c){c.memoizedState!==null&&U(ne,c);var h=Z.current,g=w8(h,c.type);h!==g&&(U(ce,c),U(Z,g))}function ue(c){ce.current===c&&(W(Z),W(ce)),ne.current===c&&(W(ne),J_._currentValue=te)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1)":-1A||_e[k]!==Ce[A]){var De=` `+_e[k].replace(" at new "," at ");return c.displayName&&De.includes("")&&(De=De.replace("",c.displayName)),De}while(1<=k&&0<=A);break}}}finally{qe=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?ye(g):""}function Te(c,h){switch(c.tag){case 26:case 27:case 5:return ye(c.type);case 16:return ye("Lazy");case 13:return c.child!==h&&h!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ie(c.type,!1);case 11:return Ie(c.type.render,!1);case 1:return Ie(c.type,!0);case 31:return ye("Activity");default:return""}}function vt(c){try{var h="",g=null;do h+=Te(c,g),g=c,c=c.return;while(c);return h}catch(k){return` Error generating stack: `+k.message+` -`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Pr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=yy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=by(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function Ry(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function My(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Dy(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Ly=!1;function R_(){if(Ly){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Ly=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Ly=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,ex(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function Zy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,te,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function Jy(){return Ts(J_)}function Q7(){return qr().memoizedState}function Y7(){return qr().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:zy()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=gy(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=gy(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function ex(c,h,g,k){if(k={lane:2,revertLane:Rx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=gy(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Vy(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Yy,useDeferredValue:function(c,h){var g=ei();return Xy(g,c,h)},useTransition:function(){var c=Vy(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),_x(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=ky(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Ox(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(Hr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return H(Hr,Hr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=Hr.current,H(Hr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),Iy(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(wy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ce(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(Hr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),Iy(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(wy(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ce(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(Hr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),Iy(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function px(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function mx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function gx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Fr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(gx(c,h,g),c=c.sibling;c!==null;)gx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,vx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,$x=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Px={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Cx,Cx=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=sx(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function jx(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(xx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):wx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Tx=!1,sg=!1,Ax=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Tx||(Tx=!0,bU())}function V_(c,h){if(!Ax&&sg){Ax=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Ax=!1}}function vU(){c8()}function c8(){sg=Tx=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Pr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Pr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Pr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Pr(g.imageSizes)+'"]')):A+='[href="'+Pr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Pr(k)+'"][href="'+Pr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Vx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Kx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Pr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Pr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Pr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Vx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Kx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Vx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Qx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Qx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),i2.exports=VG(),i2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(G1(e)&&G1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function W1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Wv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Wv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=V1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=F5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Wv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),F5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=F5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Wv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&P5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:V1(1e3),matchCache:V1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function F5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function K1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return K1(e,t)===K1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function c2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function m4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=m4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=m4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=m4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function u2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=u2(s):Array.isArray(i)?i.push(u2(s)):t[r]=[i,u2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=g4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function g4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Q1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=H5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Q1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=H5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),q=!!v;q||(_=u),u=Q1(O,B),v=[$,B,(v==null?void 0:v[2])||M],q||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,q=!B&&!$||d;d=!1;const U=q?"GO":$?"BACK":"FORWARD",Y=q?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:U})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const q=$.enableBeforeUnload??!0;if(q===!0){O=!0;break}if(typeof q=="function"&&q()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Q1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=H5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function H5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Vv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=V1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=g4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Q1(i.href,{});i={...i,to:g4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,q]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!q||q.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(W1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Vv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&W1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function v4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=v4(e,"component");let r=v4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?v4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function q5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Kv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function U5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:V5(e,n,t,U5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=V5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function G5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=G5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=G5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function W5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?U5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],V5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Kv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,q;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const U=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=U&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(U){o.invalid=!0,Ml(e,o),m=R0(e,n,l,U,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const U=o._flight;o._flight=w,(q=G5(e,o,U))==null||q.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(U=>(E&&(B9(o,U,u),U[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),U)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},U=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,U,i)]).then(U=>j.then(Y=>(E&&!U&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),U)));if(r.push([t,j,M]),!y)return j.then(U=>$9(o,U));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(U=>(o.isFetching=!1,B9(O,U,!1),U));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(U=>$9(O,U))}async function b4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function V5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:U5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Kv?b4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await b4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Kv){const w=await b4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:q5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function y4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>y4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!q5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=q5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));W5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Vv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Vv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});W5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>y4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&y4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),W5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||P5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},K5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Qv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const x4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){x4[w4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,X1(e))}});let Eg=0,w4=0,Co,S4=0;function dV(e){try{++S4,e()}finally{--S4||YM()}}function X1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(S4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),X1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,X1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,X1(this)}};return n(),t}var d2={exports:{}},f2={},h2={exports:{}},_2={};/** +`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Pr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=xy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=yy(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function My(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dy(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Ly(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Oy=!1;function R_(){if(Oy){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Oy=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Oy=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,tx(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function Jy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,te,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function ex(){return Ts(J_)}function Q7(){return qr().memoizedState}function Y7(){return qr().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:jy()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=vy(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=vy(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function tx(c,h,g,k){if(k={lane:2,revertLane:Mx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=vy(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Ky(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Xy,useDeferredValue:function(c,h){var g=ei();return Zy(g,c,h)},useTransition:function(){var c=Ky(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),px(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=Cy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=Cy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Ix(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(Hr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return U(Hr,Hr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=Hr.current,U(Hr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),By(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(Sy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ue(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(Hr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),By(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(Sy(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ue(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(Hr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),By(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function mx(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function gx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function vx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Fr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(vx(c,h,g),c=c.sibling;c!==null;)vx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,bx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,Px=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Fx={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Ex,Ex=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=ix(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function Tx(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(wx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):Sx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Ax=!1,sg=!1,Rx=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Ax||(Ax=!0,bU())}function V_(c,h){if(!Rx&&sg){Rx=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Rx=!1}}function vU(){c8()}function c8(){sg=Ax=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Pr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Pr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Pr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Pr(g.imageSizes)+'"]')):A+='[href="'+Pr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Pr(k)+'"][href="'+Pr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Kx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Qx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Qx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Pr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Pr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Pr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Kx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Qx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Kx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Yx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Yx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),a2.exports=VG(),a2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(W1(e)&&W1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function V1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Vv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Vv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=K1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=F5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Vv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),F5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=F5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Vv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&P5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:K1(1e3),matchCache:K1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function F5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function Q1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return Q1(e,t)===Q1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function u2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function g4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=g4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=g4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=g4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function d2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=d2(s):Array.isArray(i)?i.push(d2(s)):t[r]=[i,d2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=v4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function v4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Y1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=H5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Y1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=H5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),H=!!v;H||(_=u),u=Y1(O,B),v=[$,B,(v==null?void 0:v[2])||M],H||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,H=!B&&!$||d;d=!1;const q=H?"GO":$?"BACK":"FORWARD",Y=H?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:q})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const H=$.enableBeforeUnload??!0;if(H===!0){O=!0;break}if(typeof H=="function"&&H()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Y1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=H5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function H5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Kv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=K1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=v4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Y1(i.href,{});i={...i,to:v4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,H]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!H||H.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(V1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Kv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&V1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function b4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=b4(e,"component");let r=b4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?b4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function q5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Qv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function U5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:V5(e,n,t,U5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=V5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function G5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=G5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=G5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function W5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?U5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],V5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Qv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,H;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const q=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=q&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(q){o.invalid=!0,Ml(e,o),m=R0(e,n,l,q,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const q=o._flight;o._flight=w,(H=G5(e,o,q))==null||H.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(q=>(E&&(B9(o,q,u),q[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),q)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},q=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,q,i)]).then(q=>j.then(Y=>(E&&!q&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),q)));if(r.push([t,j,M]),!y)return j.then(q=>$9(o,q));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(q=>(o.isFetching=!1,B9(O,q,!1),q));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(q=>$9(O,q))}async function y4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function V5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:U5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Qv?y4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await y4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Qv){const w=await y4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:q5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function x4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>x4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!q5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=q5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));W5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Kv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Kv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});W5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>x4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&x4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),W5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||P5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},K5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Yv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const w4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){w4[S4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,Z1(e))}});let Eg=0,S4=0,Co,k4=0;function dV(e){try{++k4,e()}finally{--k4||YM()}}function Z1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(k4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),Z1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,Z1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,Z1(this)}};return n(),t}var f2={exports:{}},h2={},_2={exports:{}},p2={};/** * @license React * use-sync-external-store-shim.production.js * @@ -54,7 +54,7 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var G9;function hV(){if(G9)return _2;G9=1;var e=Vp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return _2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,_2}var W9;function _V(){return W9||(W9=1,h2.exports=hV()),h2.exports}/** + */var G9;function hV(){if(G9)return p2;G9=1;var e=Vp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return p2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,p2}var W9;function _V(){return W9||(W9=1,_2.exports=hV()),_2.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -62,13 +62,13 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var V9;function pV(){if(V9)return f2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return f2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},f2}var K9;function mV(){return K9||(K9=1,d2.exports=pV()),d2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Q5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Qv),r=e.from??t,s=n.stores.getMatchStore(r),i=Q5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&P5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Yv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Y5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function p2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return W1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),W1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=K1(e.pathname,r),o=K1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:q,hash:U,state:Y,mask:G,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,W=VM(),H=p2(e.search),ee=p2(e.params),de=p2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,H,ee,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,de,t.basepath,W,we!==void 0)]},[de,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ce=oe?Bh(s,{})??SV:m2,pe=oe?m2:Bh(i,{})??m2,Se=[C,ce.className,pe.className].filter(Boolean).join(" "),ye=(y||ce.style||pe.style)&&{...y,...ce.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){g2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&g2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&g2(r)};return{...F,...ce,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var m2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,g2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Xv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Xv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Y5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Yv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Xv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(K5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function Zv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Zv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?K5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Qv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Zv(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Qv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:Zv(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Vv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=Zv(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Qv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(K5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Q5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Q5(e,n))}const Z1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))Z1.set(s,(Z1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?Z1.get(s):void 0,a=await t();if(!s||Z1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],X5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...X5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...X5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function Jv(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])$5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])Jv(r.id);$5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",Z5=["en","zh-CN","fa"],cD="orx:locale",J5=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=J5;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&J1.has(r)){const i=J1.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=J5;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&J1.has(l)){const u=J1.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Z5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&Z5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Z5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:J5}const J1=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,k4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,ev=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,v2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",b2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,y2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",tv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",C4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,e6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? + */var V9;function pV(){if(V9)return h2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return h2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},h2}var K9;function mV(){return K9||(K9=1,f2.exports=pV()),f2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Q5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Yv),r=e.from??t,s=n.stores.getMatchStore(r),i=Q5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&P5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Xv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Y5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function m2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return V1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),V1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=Q1(e.pathname,r),o=Q1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:H,hash:q,state:Y,mask:G,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,W=VM(),U=m2(e.search),Z=m2(e.params),ce=m2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,U,Z,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,ce,t.basepath,W,we!==void 0)]},[ce,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ue=oe?Bh(s,{})??SV:g2,pe=oe?g2:Bh(i,{})??g2,Se=[C,ue.className,pe.className].filter(Boolean).join(" "),ye=(y||ue.style||pe.style)&&{...y,...ue.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){v2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&v2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&v2(r)};return{...F,...ue,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var g2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,v2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Zv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Xv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Zv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Y5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Xv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Zv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(K5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function Jv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Jv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?K5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Yv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Jv(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Yv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:Jv(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Kv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=Jv(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Yv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(K5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Q5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Q5(e,n))}const J1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))J1.set(s,(J1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?J1.get(s):void 0,a=await t();if(!s||J1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],X5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...X5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...X5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function eb(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])$5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])eb(r.id);$5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",Z5=["en","zh-CN","fa"],cD="orx:locale",J5=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=J5;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&ev.has(r)){const i=ev.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=J5;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&ev.has(l)){const u=ev.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Z5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&Z5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Z5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:J5}const ev=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,C4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,tv=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,b2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",y2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,x2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",nv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",E4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,e6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? Its transcript will be permanently removed.`,Vie=e=>`删除“${e==null?void 0:e.title}”? 其对话记录将被永久移除。`,Kie=e=>`«${e==null?void 0:e.title}» حذف شود؟ -رونوشت آن برای همیشه حذف خواهد شد.`,Qie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Xie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Zie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Jie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xie(e):t==="fa"?Zie(e):Yie(e)}),eae=()=>"Could not exit Plan mode. Try again.",tae=()=>"无法退出计划模式。请重试。",nae=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",rae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Expand tool activity",iae=()=>"展开工具活动",aae=()=>"باز کردن فعالیت ابزارها",oae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=()=>"experiments",cae=()=>"实验",uae=()=>"آزمایش‌ها",dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cae():t==="fa"?uae():lae()}),fae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,hae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,_ae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,pae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,gae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,vae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,bae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=e=>`Message not sent: ${e==null?void 0:e.error}`,xae=e=>`消息未发送:${e==null?void 0:e.error}`,wae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,Sae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xae(e):t==="fa"?wae(e):yae(e)}),kae=()=>"Model unavailable",Cae=()=>"模型不可用",Eae=()=>"مدل در دسترس نیست",Nae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),zae=()=>"New session",jae=()=>"新会话",Tae=()=>"نشست جدید",hE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jae():t==="fa"?Tae():zae()}),Aae=()=>"No active sessions",Rae=()=>"没有活跃会话",Mae=()=>"نشست فعالی وجود ندارد",Dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No activity",Oae=()=>"无活动",Iae=()=>"بدون فعالیت",Bae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No archived sessions",Pae=()=>"没有已归档的会话",Fae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"No sessions yet",Uae=()=>"还没有会话",Gae=()=>"هنوز نشستی وجود ندارد",Wae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"1 annotation",Kae=()=>"1 条批注",Qae=()=>"۱ یادداشت",Yae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"Open sub-agent transcript",Zae=()=>"打开子智能体记录",Jae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",eoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),toe=()=>"About this demo",noe=()=>"关于此演示",roe=()=>"دربارهٔ این نسخهٔ نمایشی",_E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?noe():t==="fa"?roe():toe()}),soe=()=>"Accept and auto mode",ioe=()=>"接受并使用自动模式",aoe=()=>"پذیرش و حالت خودکار",ooe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Accept and bypass all",coe=()=>"接受并跳过所有审批",uoe=()=>"پذیرش و عبور از همهٔ تأییدها",doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"Active",hoe=()=>"活跃",_oe=()=>"فعال",poe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"All",goe=()=>"全部",voe=()=>"همه",boe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Allow",xoe=()=>"允许",woe=()=>"اجازه دادن",Soe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Approval required",Coe=()=>"需要批准",Eoe=()=>"نیازمند تأیید",Noe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Archived",joe=()=>"已归档",Toe=()=>"بایگانی‌شده",pE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Aoe=()=>"Ask about this",Roe=()=>"询问此内容",Moe=()=>"دربارهٔ این بپرسید",Doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Loe=()=>"Attach a PDF or image",Ooe=()=>"附加 PDF 或图片",Ioe=()=>"پیوست PDF یا تصویر",mE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),Boe=()=>"Bash",$oe=()=>"Bash",Poe=()=>"Bash",xD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$oe():t==="fa"?Poe():Boe()}),Foe=()=>"Browsed the web",Hoe=()=>"已浏览网页",qoe=()=>"وب مرور شد",gE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hoe():t==="fa"?qoe():Foe()}),Uoe=()=>"Built the project",Goe=()=>"已构建项目",Woe=()=>"پروژه ساخته شد",Voe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancel",Qoe=()=>"取消",Yoe=()=>"لغو",Xoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Cancelled an experiment run",Joe=()=>"已取消实验运行",ele=()=>"اجرای آزمایش لغو شد",tle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked code style",rle=()=>"已检查代码风格",sle=()=>"سبک کد بررسی شد",ile=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked compute options",ole=()=>"已检查算力选项",lle=()=>"گزینه‌های رایانشی بررسی شد",cle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=()=>"Checked experiment status",dle=()=>"已检查实验状态",fle=()=>"وضعیت آزمایش بررسی شد",vE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dle():t==="fa"?fle():ule()}),hle=()=>"Checked Git status",_le=()=>"已检查 Git 状态",ple=()=>"وضعیت Git بررسی شد",mle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked local times",vle=()=>"已查询当地时间",ble=()=>"زمان‌های محلی بررسی شد",yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked market data",wle=()=>"已查询市场数据",Sle=()=>"داده‌های بازار بررسی شد",kle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked sports data",Ele=()=>"已查询体育数据",Nle=()=>"داده‌های ورزشی بررسی شد",zle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked the weather",Tle=()=>"已查询天气",Ale=()=>"آب‌وهوا بررسی شد",Rle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Checked types",Dle=()=>"已检查类型",Lle=()=>"نوع‌ها بررسی شد",Ole=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ile=()=>"Clear annotations",Ble=()=>"清除批注",$le=()=>"پاک کردن یادداشت‌ها",bE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Customize",Fle=()=>"自定义",Hle=()=>"سفارشی‌سازی",qle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),Ule=()=>"Data sources",Gle=()=>"数据源",Wle=()=>"منابع داده",x2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gle():t==="fa"?Wle():Ule()}),Vle=()=>"Delegated a task to a new agent",Kle=()=>"已将任务委派给新智能体",Qle=()=>"وظیفه به عامل جدید واگذار شد",Yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Xle=()=>"Delete",Zle=()=>"删除",Jle=()=>"حذف",wD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zle():t==="fa"?Jle():Xle()}),ece=()=>"Deny",tce=()=>"拒绝",nce=()=>"رد کردن",rce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),sce=()=>"Edit and re-send",ice=()=>"编辑并重新发送",ace=()=>"ویرایش و ارسال دوباره",yE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ice():t==="fa"?ace():sce()}),oce=()=>"Edit message",lce=()=>"编辑消息",cce=()=>"ویرایش پیام",uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),dce=()=>"Edited a file",fce=()=>"已编辑文件",hce=()=>"فایل ویرایش شد",xE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fce():t==="fa"?hce():dce()}),_ce=()=>"Exit Bash mode",pce=()=>"退出 Bash 模式",mce=()=>"خروج از حالت Bash",wE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pce():t==="fa"?mce():_ce()}),gce=()=>"Exit Plan mode",vce=()=>"退出计划模式",bce=()=>"خروج از حالت طرح",SE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vce():t==="fa"?bce():gce()}),yce=()=>"Failed:",xce=()=>"失败:",wce=()=>"ناموفق:",t6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xce():t==="fa"?wce():yce()}),Sce=()=>"Filter sessions",kce=()=>"筛选会话",Cce=()=>"فیلتر نشست‌ها",kE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"is unavailable.",Nce=()=>"不可用。",zce=()=>"در دسترس نیست.",jce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Later queued messages will wait until this is retried or removed.",Ace=()=>"后续排队的消息会等待此消息重试或移除。",Rce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Mce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Dce=()=>"Listed files",Lce=()=>"已列出文件",Oce=()=>"فایل‌ها فهرست شد",CE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lce():t==="fa"?Oce():Dce()}),Ice=()=>"Listed project runs",Bce=()=>"已列出项目运行",$ce=()=>"اجراهای پروژه فهرست شد",Pce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Listed projects",Hce=()=>"已列出项目",qce=()=>"پروژه‌ها فهرست شد",Uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"Loading conversation…",Wce=()=>"正在加载对话…",Vce=()=>"در حال بارگیری گفتگو…",Kce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"New Chat",Yce=()=>"新对话",Xce=()=>"گفتگوی جدید",Zce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Jce=()=>"Next version",eue=()=>"下一版本",tue=()=>"نسخهٔ بعدی",EE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),nue=()=>"Open the session this agent spawned",rue=()=>"打开此智能体创建的会话",sue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",iue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Opened web pages",oue=()=>"已打开网页",lue=()=>"صفحه‌های وب باز شد",cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan",due=()=>"计划",fue=()=>"طرح",hue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan approved",pue=()=>"计划已批准",mue=()=>"طرح تأیید شد",gue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan rejected",bue=()=>"计划已拒绝",yue=()=>"طرح رد شد",xue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan resolved",Sue=()=>"计划已处理",kue=()=>"طرح تعیین تکلیف شد",Cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Plan revision requested",Nue=()=>"已请求修改计划",zue=()=>"درخواست بازنگری طرح ثبت شد",jue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),Tue=()=>"Previous version",Aue=()=>"上一版本",Rue=()=>"نسخهٔ قبلی",NE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aue():t==="fa"?Rue():Tue()}),Mue=()=>"Ran a command",Due=()=>"已运行命令",Lue=()=>"فرمان اجرا شد",Oue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Ran tests",Bue=()=>"已运行测试",$ue=()=>"آزمون‌ها اجرا شد",Pue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read a file",Hue=()=>"已读取文件",que=()=>"فایل خوانده شد",Uue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read Git history",Wue=()=>"已读取 Git 历史",Vue=()=>"تاریخچهٔ Git خوانده شد",Kue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Read project details",Yue=()=>"已读取项目详情",Xue=()=>"جزئیات پروژه خوانده شد",Zue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Reject",ede=()=>"拒绝",tde=()=>"رد کردن",nde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove",sde=()=>"移除",ide=()=>"حذف",ade=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove annotation",lde=()=>"移除批注",cde=()=>"حذف یادداشت",ude=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),dde=()=>"Remove file",fde=()=>"移除文件",hde=()=>"حذف فایل",zE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),_de=()=>"Remove image",pde=()=>"移除图片",mde=()=>"حذف تصویر",jE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),gde=()=>"Remove queued message",vde=()=>"移除排队消息",bde=()=>"حذف پیام صف",TE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vde():t==="fa"?bde():gde()}),yde=()=>"Rename",xde=()=>"重命名",wde=()=>"تغییر نام",SD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xde():t==="fa"?wde():yde()}),Sde=()=>"Reviewed code changes",kde=()=>"已审查代码更改",Cde=()=>"تغییرات کد بازبینی شد",Ede=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Nde=()=>"Run",zde=()=>"运行",jde=()=>"اجرا",AE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zde():t==="fa"?jde():Nde()}),Tde=()=>"Selected chat text",Ade=()=>"已选聊天文本",Rde=()=>"متن انتخاب‌شدهٔ گفتگو",Mde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Selected text:",Lde=()=>"已选文本:",Ode=()=>"متن انتخاب‌شده:",Ide=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Send",$de=()=>"发送",Pde=()=>"ارسال",E4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"Session options",Hde=()=>"会话选项",qde=()=>"گزینه‌های نشست",RE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hde():t==="fa"?qde():Fde()}),Ude=()=>"Session title",Gde=()=>"会话标题",Wde=()=>"عنوان نشست",Vde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Kde=()=>"Show sidebar",Qde=()=>"显示侧边栏",Yde=()=>"نمایش نوار کناری",ME=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qde():t==="fa"?Yde():Kde()}),Xde=()=>"Started an experiment run",Zde=()=>"已启动实验运行",Jde=()=>"اجرای آزمایش آغاز شد",efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Reading the project to suggest where to start…",nfe=()=>"正在阅读项目以建议从哪里开始…",rfe=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",sfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Starter prompts",afe=()=>"入门提示",ofe=()=>"پیشنهادهای شروع",lfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),cfe=()=>"Stop",ufe=()=>"停止",dfe=()=>"توقف",DE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ufe():t==="fa"?dfe():cfe()}),ffe=()=>"Submit",hfe=()=>"提交",_fe=()=>"ارسال",pfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Tool failed",gfe=()=>"工具失败",vfe=()=>"ابزار ناموفق بود",bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),yfe=()=>"Used tools",xfe=()=>"已使用工具",wfe=()=>"ابزارها استفاده شد",kD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xfe():t==="fa"?wfe():yfe()}),Sfe=()=>"View full plan",kfe=()=>"查看完整计划",Cfe=()=>"مشاهدهٔ طرح کامل",Efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waited for an experiment run",zfe=()=>"已等待实验运行",jfe=()=>"برای اجرای آزمایش صبر شد",Tfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"Waiting for your input…",Rfe=()=>"正在等待你的输入…",Mfe=()=>"منتظر ورودی شما…",Dfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"What should we research?",Ofe=()=>"我们应该研究什么?",Ife=()=>"چه چیزی را پژوهش کنیم؟",Bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"You, mid-task",Pfe=()=>"你(任务进行中)",Ffe=()=>"شما، هنگام انجام وظیفه",Hfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Pasted image",Ufe=()=>"粘贴的图片",Gfe=()=>"تصویر جای‌گذاری‌شده",Wfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Vfe=()=>"Plan",Kfe=()=>"计划",Qfe=()=>"طرح",CD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kfe():t==="fa"?Qfe():Vfe()}),Yfe=()=>"Plan mode — ready to proceed?",Xfe=()=>"计划模式 — 准备好继续了吗?",Zfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Jfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),ehe=()=>"Proposed plan",the=()=>"提议的计划",nhe=()=>"طرح پیشنهادی",LE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),rhe=()=>"Question",she=()=>"问题",ihe=()=>"پرسش",ahe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Queued",lhe=()=>"已排队",che=()=>"در صف",uhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),dhe=()=>"Recents",fhe=()=>"最近",hhe=()=>"اخیر",ED=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fhe():t==="fa"?hhe():dhe()}),_he=()=>"Re-check its setup.",phe=()=>"请重新检查其设置。",mhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",ghe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not recover this turn. Try again.",bhe=()=>"无法恢复本轮。请重试。",yhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=()=>"Could not remove the queued message. Try again.",She=()=>"无法移除排队消息。请重试。",khe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Che=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?She():t==="fa"?khe():whe()}),Ehe=e=>`Could not re-send: ${e==null?void 0:e.error}`,Nhe=e=>`无法重新发送:${e==null?void 0:e.error}`,zhe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,jhe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),The=()=>"Resolved",Ahe=()=>"已处理",Rhe=()=>"رسیدگی شد",Mhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"Could not retry the queued message. Try again.",Lhe=()=>"无法重试排队消息。请重试。",Ohe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Ihe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"run logs",$he=()=>"运行日志",Phe=()=>"گزارش‌های اجرا",Fhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Hhe=()=>"Scroll to bottom",qhe=()=>"滚动到底部",Uhe=()=>"رفتن به پایین گفتگو",OE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qhe():t==="fa"?Uhe():Hhe()}),Ghe=()=>"The selected harness is unavailable",Whe=()=>"所选智能体工具不可用",Vhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",w2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Whe():t==="fa"?Vhe():Ghe()}),Khe=()=>"Session limit reached",Qhe=()=>"已达到会话使用限额",Yhe=()=>"به سقف مصرف نشست رسیده‌اید",Xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"The chat session was not created",Jhe=()=>"未能创建聊天会话",e_e=()=>"نشست گفت‌وگو ایجاد نشد",t_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>"Show full conversation",r_e=()=>"显示完整对话",s_e=()=>"نمایش کامل گفتگو",i_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>" · Spawned by another agent",o_e=()=>" · 由另一个智能体创建",l_e=()=>" · ساخته‌شده به‌دست عامل دیگر",c_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=()=>"Starting…",d_e=()=>"正在启动…",f_e=()=>"در حال شروع…",h_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d_e():t==="fa"?f_e():u_e()}),__e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,p_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,m_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,g_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p_e(e):t==="fa"?m_e(e):__e(e)}),v_e=()=>"Could not stop the turn. Try again.",b_e=()=>"无法停止本轮。请重试。",y_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",x_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b_e():t==="fa"?y_e():v_e()}),w_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,S_e=e=>`无法切换分支:${e==null?void 0:e.error}`,k_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,C_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S_e(e):t==="fa"?k_e(e):w_e(e)}),E_e=()=>"The agent",N_e=()=>"智能体",z_e=()=>"عامل",j_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Thinking",A_e=()=>"正在思考",R_e=()=>"در حال فکر کردن",M_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),D_e=()=>"Could not toggle Plan mode. Try again.",L_e=()=>"无法切换计划模式。请重试。",O_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",IE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=()=>"This turn did not finish.",B_e=()=>"本轮未完成。",$_e=()=>"این نوبت کامل نشد.",BE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),P_e=()=>"Type a custom answer…",F_e=()=>"输入自定义回答…",H_e=()=>"پاسخ دلخواه را بنویسید…",q_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Unarchive",G_e=()=>"取消归档",W_e=()=>"خارج کردن از بایگانی",V_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),K_e=()=>"Untitled",Q_e=()=>"未命名",Y_e=()=>"بدون عنوان",Ng=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q_e():t==="fa"?Y_e():K_e()}),X_e=()=>"Could not update permissions. Try again.",Z_e=()=>"无法更新权限。请重试。",J_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",e0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=()=>"Work details",n0e=()=>"工作详情",r0e=()=>"جزئیات کار",s0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),i0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,a0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,o0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,l0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=e=>`Worked for ${e==null?void 0:e.duration}`,u0e=e=>`已工作 ${e==null?void 0:e.duration}`,d0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,f0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u0e(e):t==="fa"?d0e(e):c0e(e)}),h0e=()=>"Working…",_0e=()=>"正在工作…",p0e=()=>"در حال کار…",n6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_0e():t==="fa"?p0e():h0e()}),m0e=()=>"Close tab",g0e=()=>"关闭标签页",v0e=()=>"بستن زبانه",b0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),y0e=()=>"Changes",x0e=()=>"更改",w0e=()=>"تغییرات",ND=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x0e():t==="fa"?w0e():y0e()}),S0e=()=>"Code browser view",k0e=()=>"代码浏览器视图",C0e=()=>"نمای مرورگر کد",E0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Files",z0e=()=>"文件",j0e=()=>"فایل‌ها",T0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Refresh",R0e=()=>"刷新",M0e=()=>"تازه‌سازی",$E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"listing truncated",L0e=()=>"列表已截断",O0e=()=>"فهرست کوتاه شده است",I0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"No files.",$0e=()=>"没有文件。",P0e=()=>"فایلی وجود ندارد.",F0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Refresh failed:",q0e=()=>"刷新失败:",U0e=()=>"تازه‌سازی ناموفق بود:",G0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Cancelling…",V0e=()=>"正在取消…",K0e=()=>"در حال لغو…",Q0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Y0e=()=>"Checking…",X0e=()=>"正在检查…",Z0e=()=>"در حال بررسی…",Xi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X0e():t==="fa"?Z0e():Y0e()}),J0e=()=>"Copied",epe=()=>"已复制",tpe=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),npe=e=>`Failed to load: ${e==null?void 0:e.error}`,rpe=e=>`加载失败:${e==null?void 0:e.error}`,spe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,zD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?rpe(e):t==="fa"?spe(e):npe(e)}),ipe=()=>"Loading…",ape=()=>"正在加载…",ope=()=>"در حال بارگیری…",jD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),lpe=e=>`+ ${e==null?void 0:e.count} more`,cpe=e=>`另有 ${e==null?void 0:e.count} 项`,upe=e=>`${e==null?void 0:e.count}+ مورد دیگر`,dpe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cpe(e):t==="fa"?upe(e):lpe(e)}),fpe=()=>"Rendered view",hpe=()=>"渲染视图",_pe=()=>"نمای رندرشده",nv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hpe():t==="fa"?_pe():fpe()}),ppe=()=>"Save",mpe=()=>"保存",gpe=()=>"ذخیره",no=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mpe():t==="fa"?gpe():ppe()}),vpe=()=>"Saving…",bpe=()=>"正在保存…",ype=()=>"در حال ذخیره…",Ei=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bpe():t==="fa"?ype():vpe()}),xpe=()=>"Show less",wpe=()=>"收起",Spe=()=>"نمایش کمتر",TD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wpe():t==="fa"?Spe():xpe()}),kpe=()=>"Show more",Cpe=()=>"展开",Epe=()=>"نمایش بیشتر",Npe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),zpe=()=>"Stop",jpe=()=>"停止",Tpe=()=>"توقف",AD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Ape=()=>"Stopping…",Rpe=()=>"正在停止…",Mpe=()=>"در حال توقف…",Dpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Lpe=()=>"View source",Ope=()=>"查看源代码",Ipe=()=>"نمایش متن منبع",rh=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ope():t==="fa"?Ipe():Lpe()}),Bpe=()=>"Runs as a remote Hugging Face Job",$pe=()=>"作为远程 Hugging Face Job 运行",Ppe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs as a Job on your Kubernetes cluster",qpe=()=>"作为 Kubernetes 集群上的 Job 运行",Upe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs directly on this computer",Vpe=()=>"直接在此计算机上运行",Kpe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs in a remote Modal sandbox",Xpe=()=>"在远程 Modal 沙箱中运行",Zpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on an ephemeral OpenResearch box",tme=()=>"在临时 OpenResearch 主机上运行",nme=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs on the connected Ray cluster",ime=()=>"在已连接的 Ray 集群上运行",ame=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs as a scheduled job on your Slurm cluster",cme=()=>"作为 Slurm 集群上的调度作业运行",ume=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs on a host from your SSH config",hme=()=>"在 SSH 配置中的主机上运行",_me=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"Runs through Tinker’s remote compute",gme=()=>"通过 Tinker 远程算力运行",vme=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"HF Jobs",xme=()=>"HF Jobs",wme=()=>"HF Jobs",Sme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"Kubernetes",Cme=()=>"Kubernetes",Eme=()=>"Kubernetes",Nme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"This machine",jme=()=>"此计算机",Tme=()=>"این رایانه",RD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jme():t==="fa"?Tme():zme()}),Ame=()=>"Modal",Rme=()=>"Modal",Mme=()=>"Modal",Dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"OpenResearch",Ome=()=>"OpenResearch",Ime=()=>"OpenResearch",Bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Ray",Pme=()=>"Ray",Fme=()=>"Ray",Hme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"Slurm",Ume=()=>"Slurm",Gme=()=>"Slurm",Wme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"SSH",Kme=()=>"SSH",Qme=()=>"SSH",Yme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"Tinker",Zme=()=>"Tinker",Jme=()=>"Tinker",ege=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",nge=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",rge=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",sge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",age=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",oge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",lge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",uge=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",dge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",fge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"This computer must stay awake and online while Tinker runs.",_ge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",pge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",mge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window",vge=()=>"上下文窗口",bge=()=>"پنجرهٔ زمینه",yge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=()=>"Context window used",wge=()=>"已使用的上下文窗口",Sge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",kge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wge():t==="fa"?Sge():xge()}),Cge=e=>`${e==null?void 0:e.value} tokens`,Ege=e=>`${e==null?void 0:e.value} 个 token`,Nge=e=>`${e==null?void 0:e.value} توکن`,zge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Age=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Rge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tge(e):t==="fa"?Age(e):jge(e)}),Mge=()=>"No runs yet — ask the agent to launch one.",Dge=()=>"尚无运行——让智能体启动一个。",Lge=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Oge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Ige=()=>"Run",Bge=()=>"运行",$ge=()=>"اجرا",PE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bge():t==="fa"?$ge():Ige()}),Pge=()=>"Switch run",Fge=()=>"切换运行",Hge=()=>"تغییر اجرا",qge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fge():t==="fa"?Hge():Pge()}),Uge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Gge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Wge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Qge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Yge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Xge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}m`,Jge=e=>`${e==null?void 0:e.value} 分钟`,e1e=e=>`${e==null?void 0:e.value} دقیقه`,t1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=e=>`${e==null?void 0:e.value}s`,r1e=e=>`${e==null?void 0:e.value} 秒`,s1e=e=>`${e==null?void 0:e.value} ثانیه`,i1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):n1e(e)}),a1e=()=>"Code",o1e=()=>"代码",l1e=()=>"کد",c1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"created",d1e=()=>"创建于",f1e=()=>"ایجادشده",h1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"from",p1e=()=>"来自",m1e=()=>"از",g1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Logs",b1e=()=>"日志",y1e=()=>"گزارش‌ها",x1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Latest run",S1e=()=>"最新运行",k1e=()=>"آخرین اجرا",C1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Code",N1e=()=>"代码",z1e=()=>"کد",j1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"Commit",A1e=()=>"提交",R1e=()=>"کامیت",M1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"created",L1e=()=>"创建于",O1e=()=>"ایجادشده",I1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Description",$1e=()=>"说明",P1e=()=>"توضیحات",F1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"Duration",q1e=()=>"时长",U1e=()=>"مدت",G1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"exit",V1e=()=>"退出码",K1e=()=>"خروج",Q1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"from",X1e=()=>"来自",Z1e=()=>"از",J1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Logs",tve=()=>"日志",nve=()=>"گزارش‌ها",rve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run",ive=()=>"运行",ave=()=>"اجرا",ove=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Run history",cve=()=>"运行历史",uve=()=>"تاریخچهٔ اجرا",dve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Started",hve=()=>"开始时间",_ve=()=>"آغاز",pve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Runs",gve=()=>"运行",vve=()=>"اجراها",bve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",xve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",wve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",Sve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No runs yet",Cve=()=>"还没有运行",Eve=()=>"هنوز اجرایی وجود ندارد",Nve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"No experiments yet.",jve=()=>"还没有实验。",Tve=()=>"هنوز آزمایشی وجود ندارد.",Ave=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Not run yet",Mve=()=>"尚未运行",Dve=()=>"هنوز اجرا نشده",Lve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"1 run",Ive=()=>"1 次运行",Bve=()=>"۱ اجرا",$ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"Open logs",Fve=()=>"打开日志",Hve=()=>"باز کردن گزارش‌ها",qve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fve():t==="fa"?Hve():Pve()}),Uve=e=>`${e==null?void 0:e.count} runs`,Gve=e=>`${e==null?void 0:e.count} 次运行`,Wve=e=>`${e==null?void 0:e.count} اجرا`,Vve=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gve(e):t==="fa"?Wve(e):Uve(e)}),Kve=()=>"Stop requested",Qve=()=>"已请求停止",Yve=()=>"درخواست توقف ثبت شد",Xve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Stop run",Jve=()=>"停止运行",ebe=()=>"توقف اجرا",tbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Code",rbe=()=>"代码",sbe=()=>"کد",ibe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Experiments",obe=()=>"实验",lbe=()=>"آزمایش‌ها",cbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Logs",dbe=()=>"日志",fbe=()=>"گزارش‌ها",hbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Stop failed:",pbe=()=>"停止失败:",mbe=()=>"توقف ناموفق بود:",gbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),vbe=()=>"Clipboard access is unavailable.",bbe=()=>"无法访问剪贴板。",ybe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",MD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bbe():t==="fa"?ybe():vbe()}),xbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,wbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,Sbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,kbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):xbe(e)}),Cbe=()=>"Duplicate",Ebe=()=>"创建副本",Nbe=()=>"ایجاد نسخهٔ تکراری",zbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),jbe=e=>`File actions for ${e==null?void 0:e.path}`,Tbe=e=>`${e==null?void 0:e.path} 的文件操作`,Abe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Rbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tbe(e):t==="fa"?Abe(e):jbe(e)}),Mbe=()=>"Open",Dbe=()=>"打开",Lbe=()=>"باز کردن",Obe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Mbe()}),Ibe=e=>`Rename ${e==null?void 0:e.path}`,Bbe=e=>`重命名 ${e==null?void 0:e.path}`,$be=e=>`تغییر نام ${e==null?void 0:e.path}`,Pbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Hbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,qbe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Ube=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Hbe(e):t==="fa"?qbe(e):Fbe(e)}),Gbe=()=>"Binary file — no inline preview.",Wbe=()=>"二进制文件——无法内嵌预览。",Vbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Kbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Qbe=()=>"This file changed on disk. Your edits have not been overwritten.",Ybe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Xbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",FE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Qbe()}),Zbe=()=>"Compile failed",Jbe=()=>"编译失败",eye=()=>"کامپایل ناموفق بود",tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),nye=()=>"Compile PDF",rye=()=>"编译 PDF",sye=()=>"کامپایل PDF",HE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rye():t==="fa"?sye():nye()}),iye=()=>"Compiled, but the engine reported errors — check the output below.",aye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",oye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",lye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy command",uye=()=>"复制命令",dye=()=>"کپی فرمان",fye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Copy install command",_ye=()=>"复制安装命令",pye=()=>"کپی فرمان نصب",mye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"This file was deleted on disk. Your edits have not been discarded.",vye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",bye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",qE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vye():t==="fa"?bye():gye()}),yye=()=>"Discard my edits and reload",xye=()=>"放弃我的编辑并重新加载",wye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Sye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),kye=()=>"Discard unsaved changes and close this file?",Cye=()=>"要丢弃未保存的更改并关闭此文件吗?",Eye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",UE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cye():t==="fa"?Eye():kye()}),Nye=()=>"Dismiss",zye=()=>"关闭",jye=()=>"بستن",Tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss compile message",Rye=()=>"关闭编译消息",Mye=()=>"بستن پیام کامپایل",Dye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Dismiss Overleaf message",Oye=()=>"关闭 Overleaf 消息",Iye=()=>"بستن پیام Overleaf",Bye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),$ye=()=>"Download",Pye=()=>"下载",Fye=()=>"بارگیری",DD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pye():t==="fa"?Fye():$ye()}),Hye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,qye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Uye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Gye=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qye(e):t==="fa"?Uye(e):Hye(e)}),Wye=()=>"Failed to load file:",Vye=()=>"加载文件失败:",Kye=()=>"بارگیری فایل ناموفق بود:",GE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vye():t==="fa"?Kye():Wye()}),Qye=()=>"File truncated — showing the first 512 KB.",Yye=()=>"文件已截断——仅显示前 512 KB。",Xye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Zye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=()=>"The page below stops partway — the full file could not be loaded.",exe=()=>"下方页面在中途结束——无法加载完整文件。",txe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",nxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?exe():t==="fa"?txe():Jye()}),rxe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,sxe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ixe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,axe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sxe(e):t==="fa"?ixe(e):rxe(e)}),oxe=()=>"Loading…",lxe=()=>"正在加载…",cxe=()=>"در حال بارگیری…",LD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lxe():t==="fa"?cxe():oxe()}),uxe=()=>"File not found.",dxe=()=>"找不到文件。",fxe=()=>"فایل پیدا نشد.",hxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dxe():t==="fa"?fxe():uxe()}),_xe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pxe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mxe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pxe(e):t==="fa"?mxe(e):_xe(e)}),vxe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,bxe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,yxe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,xxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bxe(e):t==="fa"?yxe(e):vxe(e)}),wxe=()=>"File not found on disk.",Sxe=()=>"磁盘上找不到此文件。",kxe=()=>"فایل روی دیسک پیدا نشد.",Cxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Nxe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,zxe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,jxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nxe(e):t==="fa"?zxe(e):Exe(e)}),Txe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Axe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Rxe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Mxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Axe(e):t==="fa"?Rxe(e):Txe(e)}),Dxe=()=>"Open in default editor",Lxe=()=>"在默认编辑器中打开",Oxe=()=>"باز کردن در ویرایشگر پیش‌فرض",WE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Ixe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Bxe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",$xe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Pxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Fxe=()=>"Overwrite disk file",Hxe=()=>"覆盖磁盘文件",qxe=()=>"بازنویسی فایل روی دیسک",Uxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hxe():t==="fa"?qxe():Fxe()}),Gxe=()=>"Compiled PDF is out of date",Wxe=()=>"已编译的 PDF 不是最新版本",Vxe=()=>"PDF کامپایل‌شده به‌روز نیست",Kxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wxe():t==="fa"?Vxe():Gxe()}),Qxe=()=>"project clone",Yxe=()=>"项目克隆",Xxe=()=>"کلون پروژه",zg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yxe():t==="fa"?Xxe():Qxe()}),Zxe=()=>"Recompile PDF",Jxe=()=>"重新编译 PDF",e2e=()=>"کامپایل دوبارهٔ PDF",VE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jxe():t==="fa"?e2e():Zxe()}),t2e=()=>"Reload from disk",n2e=()=>"从磁盘重新加载",r2e=()=>"بارگذاری مجدد از دیسک",s2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Save failed",a2e=()=>"保存失败",o2e=()=>"ذخیره ناموفق بود",l2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Saving…",u2e=()=>"正在保存…",d2e=()=>"در حال ذخیره…",f2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Selected — press ⌘C",_2e=()=>"已选中 — 按 ⌘C 复制",p2e=()=>"انتخاب شد — برای کپی ⌘C را بزنید",m2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"session’s worktree",v2e=()=>"会话工作树",b2e=()=>"درخت کاری نشست",jg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v2e():t==="fa"?b2e():g2e()}),y2e=()=>"Show compiled PDF",x2e=()=>"显示已编译的 PDF",w2e=()=>"نمایش PDF کامپایل‌شده",KE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x2e():t==="fa"?w2e():y2e()}),S2e=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",k2e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",C2e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",E2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"This session's worktree isn't available — showing the project clone's copy.",z2e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",j2e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",T2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z2e():t==="fa"?j2e():N2e()}),A2e=()=>"Unsaved",R2e=()=>"未保存",M2e=()=>"ذخیره نشده",OD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R2e():t==="fa"?M2e():A2e()}),D2e=()=>"Unsaved — ⌘S to save",L2e=()=>"未保存 — 按 ⌘S 保存",O2e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",I2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L2e():t==="fa"?O2e():D2e()}),B2e=()=>"Update orx on the remote machine to edit this file safely.",$2e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",P2e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",F2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$2e():t==="fa"?P2e():B2e()}),H2e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",q2e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",U2e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",G2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q2e():t==="fa"?U2e():H2e()}),W2e=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",V2e=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",K2e=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Q2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V2e():t==="fa"?K2e():W2e()}),Y2e=()=>"Back to preview",X2e=()=>"返回预览",Z2e=()=>"بازگشت به پیش‌نمایش",J2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),ewe=e=>`${e==null?void 0:e.count} changed files`,twe=e=>`${e==null?void 0:e.count} 个已更改文件`,nwe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,ID=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?twe(e):t==="fa"?nwe(e):ewe(e)}),rwe=()=>"Changed files",swe=()=>"已更改文件",iwe=()=>"فایل‌های تغییرکرده",awe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Diff preview truncated",lwe=()=>"差异预览已截断",cwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),dwe=e=>`${e==null?void 0:e.count} files shown (partial)`,fwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,_we=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fwe(e):t==="fa"?hwe(e):dwe(e)}),pwe=()=>"No changes.",mwe=()=>"没有更改。",gwe=()=>"تغییری وجود ندارد.",vwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No complete file preview was available before the cutoff.",ywe=()=>"在截断位置之前没有完整的文件预览。",xwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",wwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"No textual diff for this file.",kwe=()=>"此文件没有文本差异。",Cwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Ewe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"1 changed file",zwe=()=>"1 个已更改文件",jwe=()=>"۱ فایل تغییرکرده",BD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zwe():t==="fa"?jwe():Nwe()}),Twe=()=>"1 file shown (partial)",Awe=()=>"显示 1 个文件(部分)",Rwe=()=>"۱ فایل نمایش داده شده (ناقص)",Mwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=()=>"Unable to parse this diff.",Lwe=()=>"无法解析此差异。",Owe=()=>"خواندن این تفاوت ممکن نبود.",Iwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lwe():t==="fa"?Owe():Dwe()}),Bwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$we=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Pwe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Fwe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$we(e):t==="fa"?Pwe(e):Bwe(e)}),Hwe=()=>"View full diff",qwe=()=>"查看完整差异",Uwe=()=>"نمایش تفاوت کامل",Gwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"Create a token ↗",Vwe=()=>"创建令牌 ↗",Kwe=()=>"ساخت توکن ↗",Qwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Ywe=()=>"All projects",Xwe=()=>"所有项目",Zwe=()=>"همهٔ پروژه‌ها",QE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xwe():t==="fa"?Zwe():Ywe()}),Jwe=()=>"Configure Repository",e4e=()=>"配置仓库",t4e=()=>"پیکربندی مخزن",n4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Create a new project",s4e=()=>"新建项目",i4e=()=>"ایجاد پروژهٔ جدید",a4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"Hide sidebar",l4e=()=>"隐藏侧边栏",c4e=()=>"پنهان کردن نوار کناری",YE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),u4e=()=>"Project",d4e=()=>"项目",f4e=()=>"پروژه",h4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d4e():t==="fa"?f4e():u4e()}),_4e=e=>`${e==null?void 0:e.count} cancelled`,p4e=e=>`${e==null?void 0:e.count} 次取消`,m4e=e=>`${e==null?void 0:e.count} لغوشده`,g4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} done`,b4e=e=>`${e==null?void 0:e.count} 次完成`,y4e=e=>`${e==null?void 0:e.count} تمام‌شده`,x4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} failed`,S4e=e=>`${e==null?void 0:e.count} 次失败`,k4e=e=>`${e==null?void 0:e.count} ناموفق`,C4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count} files`,N4e=e=>`${e==null?void 0:e.count} 个文件`,z4e=e=>`${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count}+ files`,A4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,R4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,M4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=e=>`${e==null?void 0:e.count} live`,L4e=e=>`${e==null?void 0:e.count} 次进行中`,O4e=e=>`${e==null?void 0:e.count} فعال`,I4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L4e(e):t==="fa"?O4e(e):D4e(e)}),B4e=()=>"1 file",$4e=()=>"1 个文件",P4e=()=>"۱ فایل",F4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=()=>"1 run",q4e=()=>"1 次运行",U4e=()=>"۱ اجرا",G4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q4e():t==="fa"?U4e():H4e()}),W4e=e=>`${e==null?void 0:e.count} runs`,V4e=e=>`${e==null?void 0:e.count} 次运行`,K4e=e=>`${e==null?void 0:e.count} اجرا`,Q4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V4e(e):t==="fa"?K4e(e):W4e(e)}),Y4e=()=>"No instances yet.",X4e=()=>"还没有实例。",Z4e=()=>"هنوز نمونه‌ای وجود ندارد.",J4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Nothing running right now.",t3e=()=>"当前没有运行中的实例。",n3e=()=>"اکنون چیزی در حال اجرا نیست.",r3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its history.",i3e=()=>"请选择一个项目以查看其历史记录。",a3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"Select a project to see its runs.",c3e=()=>"请选择一个项目以查看其运行。",u3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",d3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=()=>"View history",h3e=()=>"查看历史记录",_3e=()=>"مشاهدهٔ تاریخچه",p3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h3e():t==="fa"?_3e():f3e()}),m3e=e=>`View history (${e==null?void 0:e.count})`,g3e=e=>`查看历史记录(${e==null?void 0:e.count})`,v3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,b3e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?g3e(e):t==="fa"?v3e(e):m3e(e)}),y3e=()=>"The engine exited without producing a PDF or a log.",x3e=()=>"引擎已退出,但没有生成 PDF 或日志。",w3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",S3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Loading…",C3e=()=>"正在加载…",E3e=()=>"در حال بارگیری…",N3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),z3e=()=>"Add local model",j3e=()=>"添加本地模型",T3e=()=>"افزودن مدل محلی",$D=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?j3e():t==="fa"?T3e():z3e()}),A3e=()=>"Local server address",R3e=()=>"本地服务器地址",M3e=()=>"نشانی سرور محلی",D3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"Find models",O3e=()=>"查找模型",I3e=()=>"یافتن مدل‌ها",B3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),$3e=()=>"(OpenAI compatible)",P3e=()=>"(兼容 OpenAI)",F3e=()=>"(سازگار با OpenAI)",PD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P3e():t==="fa"?F3e():$3e()}),H3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",q3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",U3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",G3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Connected",V3e=()=>"已连接",K3e=()=>"متصل شد",Q3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Context window",X3e=()=>"上下文窗口",Z3e=()=>"پنجرهٔ زمینه",J3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",t5e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",n5e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",r5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),s5e=()=>"Custom Endpoint",i5e=()=>"自定义端点",a5e=()=>"نقطهٔ اتصال سفارشی",r6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),o5e=e=>`Disconnect ${e==null?void 0:e.name}`,l5e=e=>`断开 ${e==null?void 0:e.name}`,c5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,u5e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?l5e(e):t==="fa"?c5e(e):o5e(e)}),d5e=()=>"Get OpenCode",f5e=()=>"获取 OpenCode",h5e=()=>"دریافت OpenCode",_5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",m5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",g5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",v5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"API key (optional)",y5e=()=>"API 密钥(可选)",x5e=()=>"کلید API (اختیاری)",w5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Save model",k5e=()=>"保存模型",C5e=()=>"ذخیرهٔ مدل",E5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Model server",z5e=()=>"模型服务器",j5e=()=>"سرور مدل",XE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Local models",A5e=()=>"本地模型",R5e=()=>"مدل‌های محلی",ZE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A5e():t==="fa"?R5e():T5e()}),M5e=()=>"API token (optional)",D5e=()=>"API 令牌(可选)",L5e=()=>"توکن API (اختیاری)",O5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),I5e=()=>"Copy",B5e=()=>"复制",$5e=()=>"کپی",s6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B5e():t==="fa"?$5e():I5e()}),P5e=()=>"Copy code",F5e=()=>"复制代码",H5e=()=>"کپی کد",q5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),U5e=()=>"Download",G5e=()=>"下载",W5e=()=>"بارگیری",FD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G5e():t==="fa"?W5e():U5e()}),V5e=()=>"This browser can’t preview this media format.",K5e=()=>"此浏览器无法预览该媒体格式。",Q5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Y5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>"Add Local Model",Z5e=()=>"添加本地模型",J5e=()=>"افزودن مدل محلی",e6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),t6e=()=>" · CLI configuration",n6e=()=>" · CLI 配置",r6e=()=>" · پیکربندی CLI",HD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),s6e=()=>"· Default",i6e=()=>"· 默认",a6e=()=>"· پیش‌فرض",qD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i6e():t==="fa"?a6e():s6e()}),o6e=()=>"Default model",l6e=()=>"默认模型",c6e=()=>"مدل پیش‌فرض",JE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l6e():t==="fa"?c6e():o6e()}),u6e=()=>"Detecting harnesses…",d6e=()=>"正在检测智能体工具…",f6e=()=>"در حال شناسایی ابزارهای عامل…",h6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Effort",p6e=()=>"推理强度",m6e=()=>"میزان استدلال",g6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Fast speed ·",b6e=()=>"快速 ·",y6e=()=>"سرعت بالا ·",x6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),w6e=()=>"Mode",S6e=()=>"模式",k6e=()=>"حالت",eN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),C6e=()=>"Model",E6e=()=>"模型",N6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E6e():t==="fa"?N6e():C6e()}),z6e=e=>`${e==null?void 0:e.count} more — search to find`,j6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,T6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,A6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?j6e(e):t==="fa"?T6e(e):z6e(e)}),R6e=()=>"Not available",M6e=()=>"不可用",D6e=()=>"در دسترس نیست",L6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),O6e=()=>"Search models…",I6e=()=>"搜索模型…",B6e=()=>"جست‌وجوی مدل‌ها…",UD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Sessions keep their harness. Start a new chat to switch.",P6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",F6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",H6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),q6e=()=>"Speed",U6e=()=>"速度",G6e=()=>"سرعت",tN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?U6e():t==="fa"?G6e():q6e()}),W6e=()=>"Unavailable",V6e=()=>"不可用",K6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V6e():t==="fa"?K6e():W6e()}),Q6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Y6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,X6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Z6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Y6e(e):t==="fa"?X6e(e):Q6e(e)}),J6e=()=>"Variant",eSe=()=>"变体",tSe=()=>"گونه",nSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced",sSe=()=>"高级",iSe=()=>"پیشرفته",aSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · Connect GitHub",lSe=()=>"高级 · 连接 GitHub",cSe=()=>"پیشرفته · اتصال GitHub",uSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Advanced · GitHub sync on",fSe=()=>"高级 · GitHub 同步已开启",hSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",_Se=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",mSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",gSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",vSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mSe():t==="fa"?gSe():pSe()}),bSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,ySe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,xSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,wSe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ySe(e):t==="fa"?xSe(e):bSe(e)}),SSe=()=>"Choose an existing project folder",kSe=()=>"选择现有项目文件夹",CSe=()=>"انتخاب پوشهٔ موجود پروژه",nN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kSe():t==="fa"?CSe():SSe()}),ESe=()=>"Choosing…",NSe=()=>"正在选择…",zSe=()=>"در حال انتخاب…",jSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone destination",ASe=()=>"克隆位置",RSe=()=>"مقصد کلون",MSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Clone paper project",LSe=()=>"克隆论文项目",OSe=()=>"کلون پروژهٔ مقاله",ISe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),BSe=()=>"Create project",$Se=()=>"创建项目",PSe=()=>"ایجاد پروژه",rN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Creating…",HSe=()=>"正在创建…",qSe=()=>"در حال ایجاد…",USe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),GSe=()=>"Choose a different destination. This path is a file, not a folder.",WSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",VSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",S2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WSe():t==="fa"?VSe():GSe()}),KSe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",QSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",YSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",sN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QSe():t==="fa"?YSe():KSe()}),XSe=()=>"Auto-apply repository topics",ZSe=()=>"自动添加仓库 topic",JSe=()=>"اعمال خودکار موضوع‌های مخزن",eke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.",nke=()=>"自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",rke=()=>"موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",ske=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Blank project",ake=()=>"空白项目",oke=()=>"پروژهٔ خالی",lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Cancel",uke=()=>"取消",dke=()=>"لغو",fke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Change",_ke=()=>"更改",pke=()=>"تغییر",mke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Change selected paper",vke=()=>"更改所选论文",bke=()=>"تغییر مقالهٔ انتخاب‌شده",yke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vke():t==="fa"?bke():gke()}),xke=()=>"Check out a Git branch before using this folder.",wke=()=>"使用此文件夹前,请先检出一个 Git 分支。",Ske=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",kke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wke():t==="fa"?Ske():xke()}),Cke=()=>"Checking project location.",Eke=()=>"正在检查项目位置。",Nke=()=>"در حال بررسی محل پروژه.",iN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),zke=()=>"Existing folder",jke=()=>"现有文件夹",Tke=()=>"پوشهٔ موجود",Ake=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"Experiment branches will be pushed to the remote GitHub repository.",Mke=()=>"实验分支将推送到远程 GitHub 仓库。",Dke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Oke=()=>"Extra topics (comma-separated), e.g. llm, benchmark",Ike=()=>"附加 topic(逗号分隔),例如 llm, benchmark",Bke=()=>"موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark",GD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),$ke=()=>"From a paper",Pke=()=>"从论文创建",Fke=()=>"از یک مقاله",Hke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Uke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Gke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Wke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"my-research",Kke=()=>"my-research",Qke=()=>"my-research",aN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Yke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Xke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Zke=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Jke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xke():t==="fa"?Zke():Yke()}),e7e=()=>"No public repository found on alphaXiv",t7e=()=>"在 alphaXiv 上未找到公开仓库",n7e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",r7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),s7e=()=>"OpenResearch will start a blank project with this paper's PDF.",i7e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",a7e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",o7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i7e():t==="fa"?a7e():s7e()}),l7e=()=>"Paper",c7e=()=>"论文",u7e=()=>"مقاله",d7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c7e():t==="fa"?u7e():l7e()}),f7e=()=>"Project location",h7e=()=>"项目位置",_7e=()=>"محل پروژه",k2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h7e():t==="fa"?_7e():f7e()}),p7e=()=>"Project name",m7e=()=>"项目名称",g7e=()=>"نام پروژه",oN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),v7e=()=>"Search for a paper by arXiv ID, URL, or title",b7e=()=>"按 arXiv ID、网址或标题搜索论文",y7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",x7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b7e():t==="fa"?y7e():v7e()}),w7e=()=>"Sync experiments to GitHub",S7e=()=>"将实验同步到 GitHub",k7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",C7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"That folder no longer exists. Choose it again.",N7e=()=>"该文件夹已不存在。请重新选择。",z7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",j7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),T7e=()=>"The selected folder contains an invalid Git repository.",A7e=()=>"所选文件夹包含无效的 Git 仓库。",R7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",M7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A7e():t==="fa"?R7e():T7e()}),D7e=()=>"The selected path is not a folder.",L7e=()=>"所选路径不是文件夹。",O7e=()=>"مسیر انتخاب‌شده پوشه نیست.",I7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L7e():t==="fa"?O7e():D7e()}),B7e=e=>`Checking ${e==null?void 0:e.repository}.`,$7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,P7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,F7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$7e(e):t==="fa"?P7e(e):B7e(e)}),H7e=e=>`Creates ${e==null?void 0:e.repository}.`,q7e=e=>`将创建 ${e==null?void 0:e.repository}。`,U7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,G7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?q7e(e):t==="fa"?U7e(e):H7e(e)}),W7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,V7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,K7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Q7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V7e(e):t==="fa"?K7e(e):W7e(e)}),Y7e=()=>"Project location is required.",X7e=()=>"必须填写项目位置。",Z7e=()=>"محل پروژه الزامی است.",lN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),J7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",eCe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",tCe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",cN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eCe():t==="fa"?tCe():J7e()}),nCe=()=>"A linked public code repository is cloned without credentials.",rCe=()=>"关联的公开代码仓库无需凭据即可克隆。",sCe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",iCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,oCe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,lCe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,cCe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oCe(e):t==="fa"?lCe(e):aCe(e)}),uCe=()=>"Searching alphaXiv…",dCe=()=>"正在搜索 alphaXiv…",fCe=()=>"در حال جست‌وجوی alphaXiv…",hCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Use folder",pCe=()=>"使用文件夹",mCe=()=>"استفاده از پوشه",gCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Can’t reach OpenResearch. This page is no longer live.",bCe=()=>"无法连接 OpenResearch。此页面已不再实时同步。",yCe=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",N4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"A workspace for your research agents",wCe=()=>"面向研究智能体的工作空间",SCe=()=>"فضای کاری برای عامل‌های پژوهشی شما",kCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Add papers that represent your research interests, including papers by other authors.",ECe=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",NCe=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",zCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"API key",TCe=()=>"API 密钥",ACe=()=>"کلید API",i6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),RCe=()=>"AI/ML",MCe=()=>"人工智能与机器学习",DCe=()=>"هوش مصنوعی و یادگیری ماشین",LCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MCe():t==="fa"?DCe():RCe()}),OCe=()=>"Biology",ICe=()=>"生物学",BCe=()=>"زیست‌شناسی",$Ce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),PCe=()=>"Other",FCe=()=>"其他",HCe=()=>"سایر",qCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FCe():t==="fa"?HCe():PCe()}),UCe=()=>"Physics",GCe=()=>"物理学",WCe=()=>"فیزیک",VCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GCe():t==="fa"?WCe():UCe()}),KCe=()=>"Back",QCe=()=>"返回",YCe=()=>"بازگشت",uN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QCe():t==="fa"?YCe():KCe()}),XCe=()=>"Check failed",ZCe=()=>"检查失败",JCe=()=>"بررسی ناموفق بود",e8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZCe():t==="fa"?JCe():XCe()}),t8e=()=>"Checking",n8e=()=>"正在检查",r8e=()=>"در حال بررسی",s8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"Checking Git…",a8e=()=>"正在检查 Git…",o8e=()=>"در حال بررسی Git…",l8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Choose a coding agent",u8e=()=>"选择编程智能体",d8e=()=>"یک عامل کدنویسی انتخاب کنید",f8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Choose a coding agent to continue.",_8e=()=>"选择一个编程智能体以继续。",p8e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",m8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Choose at least one research area to continue.",v8e=()=>"请至少选择一个研究领域后再继续。",b8e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",y8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Choose one or more.",w8e=()=>"请选择一项或多项。",S8e=()=>"یک یا چند مورد را انتخاب کنید.",k8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Choose your preferred coding agent",E8e=()=>"请选择首选编程智能体",N8e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",z8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Consolidate your research",T8e=()=>"集中管理研究",A8e=()=>"پژوهش خود را یکپارچه کنید",R8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Continue",D8e=()=>"继续",L8e=()=>"ادامه",dN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Describe your research area to continue.",I8e=()=>"请描述你的研究领域后再继续。",B8e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",$8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",F8e=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",H8e=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",q8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G8e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",W8e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",V8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Everything stays local",Q8e=()=>"一切都保留在本地",Y8e=()=>"همه‌چیز محلی می‌ماند",X8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Get started",J8e=()=>"开始使用",e9e=()=>"شروع",t9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J8e():t==="fa"?e9e():Z8e()}),n9e=()=>"Git is required for local experiments. Install Git, then re-check.",r9e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",s9e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",i9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Ground your agents",o9e=()=>"为智能体提供可靠依据",l9e=()=>"عامل‌هایتان را به منابع متصل کنید",c9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),u9e=()=>"Install broken",d9e=()=>"安装损坏",f9e=()=>"نصب خراب است",h9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d9e():t==="fa"?f9e():u9e()}),_9e=()=>"Install Git to continue",p9e=()=>"请安装 Git 后再继续",m9e=()=>"برای ادامه Git را نصب کنید",g9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p9e():t==="fa"?m9e():_9e()}),v9e=()=>"Local Git",b9e=()=>"本地 Git",y9e=()=>"Git محلی",x9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b9e():t==="fa"?y9e():v9e()}),w9e=()=>", and ",S9e=()=>" 和 ",k9e=()=>" و ",C9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Compatible with",N9e=()=>"兼容",z9e=()=>"سازگار با",j9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),T9e=()=>"Use your own local models",A9e=()=>"使用你自己的本地模型",R9e=()=>"از مدل‌های محلی خود استفاده کنید",M9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),D9e=()=>"Not detected",L9e=()=>"未检测到",O9e=()=>"شناسایی نشد",fN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),I9e=()=>"Not found",B9e=()=>"未找到",$9e=()=>"پیدا نشد",WD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Not signed in",F9e=()=>"未登录",H9e=()=>"وارد نشده",q9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),U9e=()=>"OpenResearch uses a coding agent already installed on this machine.",G9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",W9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",V9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G9e():t==="fa"?W9e():U9e()}),K9e=()=>"Other research area",Q9e=()=>"其他研究领域",Y9e=()=>"حوزهٔ پژوهشی دیگر",X9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q9e():t==="fa"?Y9e():K9e()}),Z9e=()=>"Re-check",J9e=()=>"重新检查",eEe=()=>"بررسی دوباره",VD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J9e():t==="fa"?eEe():Z9e()}),tEe=()=>"Ready",nEe=()=>"已就绪",rEe=()=>"آماده",a6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Re-check Git before continuing",iEe=()=>"请重新检查 Git 后再继续",aEe=()=>"پیش از ادامه Git را دوباره بررسی کنید",oEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Representative papers",cEe=()=>"代表性论文",uEe=()=>"مقاله‌های شاخص",dEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Research background",hEe=()=>"研究背景",_Ee=()=>"پیشینهٔ پژوهشی",pEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",vEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",hN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Search alphaXiv by title to link a paper…",yEe=()=>"按标题搜索 alphaXiv 以关联论文…",xEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Searching alphaXiv…",kEe=()=>"正在搜索 alphaXiv…",CEe=()=>"در حال جست‌وجوی alphaXiv…",EEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Selected",zEe=()=>"已选择",jEe=()=>"انتخاب‌شده",TEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Local model unavailable",REe=()=>"本地模型不可用",MEe=()=>"مدل محلی در دسترس نیست",KD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),DEe=()=>"Setting things up…",LEe=()=>"正在设置…",OEe=()=>"در حال راه‌اندازی…",IEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LEe():t==="fa"?OEe():DEe()}),BEe=()=>"Connect a local model or sign in to a coding agent to continue",$Ee=()=>"连接本地模型或登录编码智能体以继续",PEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",FEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ee():t==="fa"?PEe():BEe()}),HEe=()=>"Connect a local model or sign in to an agent to continue.",qEe=()=>"连接本地模型或登录一个智能体以继续。",UEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",GEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qEe():t==="fa"?UEe():HEe()}),WEe=()=>"Signed in",VEe=()=>"已登录",KEe=()=>"وارد شده",QEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VEe():t==="fa"?KEe():WEe()}),YEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",XEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",ZEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",JEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XEe():t==="fa"?ZEe():YEe()}),eNe=()=>"· Step 1 of 2",tNe=()=>"· 第 1 步,共 2 步",nNe=()=>"· مرحلهٔ ۱ از ۲",rNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tNe():t==="fa"?nNe():eNe()}),sNe=()=>"· Step 2 of 2",iNe=()=>"· 第 2 步,共 2 步",aNe=()=>"· مرحلهٔ ۲ از ۲",oNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Tell us about your research",cNe=()=>"介绍一下你的研究",uNe=()=>"از پژوهش خود بگویید",dNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),fNe=()=>"Tell us your other research area",hNe=()=>"告诉我们你的其他研究领域",_Ne=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",pNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hNe():t==="fa"?_Ne():fNe()}),mNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",gNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",vNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",bNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gNe():t==="fa"?vNe():mNe()}),yNe=()=>"Unable to verify",xNe=()=>"无法验证",wNe=()=>"تأیید ممکن نیست",SNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xNe():t==="fa"?wNe():yNe()}),kNe=()=>"Update required",CNe=()=>"需要更新",ENe=()=>"نیازمند به‌روزرسانی",NNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Waiting for the Git check",jNe=()=>"正在等待 Git 检查",TNe=()=>"در انتظار بررسی Git",ANe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jNe():t==="fa"?TNe():zNe()}),RNe=()=>"Waiting for the local tool checks",MNe=()=>"正在等待本地工具检查",DNe=()=>"در انتظار بررسی ابزارهای محلی",LNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MNe():t==="fa"?DNe():RNe()}),ONe=()=>"What areas are you interested in?",INe=()=>"你对哪些领域感兴趣?",BNe=()=>"به چه حوزه‌هایی علاقه دارید؟",$Ne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),PNe=()=>"Your code, data, and experiment history stay on your machine.",FNe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",HNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",qNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FNe():t==="fa"?HNe():PNe()}),UNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",GNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",WNe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",VNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GNe():t==="fa"?WNe():UNe()}),KNe=()=>"Add cookie",QNe=()=>"添加 cookie",YNe=()=>"افزودن کوکی",XNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Changed here and on Overleaf — choose which copy to keep",JNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",eze=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",tze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"Create a token ↗",rze=()=>"创建令牌 ↗",sze=()=>"ساخت توکن ↗",ize=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),aze=()=>"Overleaf Git token",oze=()=>"Overleaf Git 令牌",lze=()=>"توکن Git در Overleaf",_N=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oze():t==="fa"?lze():aze()}),cze=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",uze=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",dze=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",fze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Import from browser",_ze=()=>"从浏览器导入",pze=()=>"وارد کردن از مرورگر",mze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"In step with Overleaf",vze=()=>"已与 Overleaf 同步",bze=()=>"با Overleaf همگام است",QD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),yze=()=>"The last sync did not finish.",xze=()=>"上次同步未完成。",wze=()=>"آخرین همگام‌سازی کامل نشد.",Sze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xze():t==="fa"?wze():yze()}),kze=()=>"Link and sync",Cze=()=>"关联并同步",Eze=()=>"پیوند و همگام‌سازی",Nze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"Connecting to Overleaf…",jze=()=>"正在连接 Overleaf…",Tze=()=>"در حال اتصال به Overleaf…",Aze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Edits are live on Overleaf",Mze=()=>"编辑已在 Overleaf 实时同步",Dze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Lze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mze():t==="fa"?Dze():Rze()}),Oze=()=>"Retry",Ize=()=>"重试",Bze=()=>"تلاش دوباره",$ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Live sync stopped.",Fze=()=>"实时同步已停止。",Hze=()=>"همگام‌سازی زنده متوقف شد.",qze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Live sync starts once the paper is in step with Overleaf.",Gze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Wze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Vze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Kze=()=>"My projects ↗",Qze=()=>"我的项目 ↗",Yze=()=>"پروژه‌های من ↗",pN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qze():t==="fa"?Yze():Kze()}),Xze=()=>"Nothing could be synced.",Zze=()=>"没有内容可以同步。",Jze=()=>"هیچ موردی قابل همگام‌سازی نبود.",eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open Overleaf ↗",nje=()=>"打开 Overleaf ↗",rje=()=>"باز کردن Overleaf ↗",sje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Cancel",aje=()=>"取消",oje=()=>"لغو",YD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",cje=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",uje=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",dje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Keep this copy",hje=()=>"保留此副本",_je=()=>"نگه داشتن این نسخه",pje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Open in Overleaf",gje=()=>"在 Overleaf 中打开",vje=()=>"باز کردن در Overleaf",bje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),yje=()=>"Replace the Overleaf token",xje=()=>"替换 Overleaf 令牌",wje=()=>"جایگزینی توکن Overleaf",mN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xje():t==="fa"?wje():yje()}),Sje=()=>"Sync files",kje=()=>"同步文件",Cje=()=>"همگام‌سازی فایل‌ها",Eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Unlink",zje=()=>"取消关联",jje=()=>"قطع پیوند",Tje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=()=>"Upload a copy as a new project ↗",Rje=()=>"上传副本作为新项目 ↗",Mje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",XD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rje():t==="fa"?Mje():Aje()}),Dje=()=>"Use Overleaf's",Lje=()=>"使用 Overleaf 的副本",Oje=()=>"استفاده از نسخهٔ Overleaf",Ije=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"This paper stays in step with Overleaf.",$je=()=>"此论文将与 Overleaf 保持同步。",Pje=()=>"این مقاله با Overleaf همگام می‌ماند.",Fje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$je():t==="fa"?Pje():Bje()}),Hje=()=>"Paste it instead",qje=()=>"改为粘贴",Uje=()=>"به‌جایش بچسبانید",Gje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qje():t==="fa"?Uje():Hje()}),Wje=e=>`Pulled ${e==null?void 0:e.paths}.`,Vje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Kje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Qje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vje(e):t==="fa"?Kje(e):Wje(e)}),Yje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Xje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Zje=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Jje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),eTe=e=>`Pushed ${e==null?void 0:e.paths}.`,tTe=e=>`已推送 ${e==null?void 0:e.paths}。`,nTe=e=>`${e==null?void 0:e.paths} ارسال شد.`,rTe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tTe(e):t==="fa"?nTe(e):eTe(e)}),sTe=()=>"Add a fresh Overleaf session cookie to start following again.",iTe=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",aTe=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",oTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Save the file first",cTe=()=>"请先保存文件",uTe=()=>"ابتدا فایل را ذخیره کنید",dTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),fTe=()=>"Save this file to sync it with Overleaf",hTe=()=>"保存此文件以与 Overleaf 同步",_Te=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",ZD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),pTe=()=>"Save token",mTe=()=>"保存令牌",gTe=()=>"ذخیرهٔ توکن",vTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),bTe=()=>"Send this paper to Overleaf",yTe=()=>"将此论文发送到 Overleaf",xTe=()=>"ارسال مقاله به Overleaf",wTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yTe():t==="fa"?xTe():bTe()}),STe=()=>"Overleaf session cookie",kTe=()=>"Overleaf 会话 cookie",CTe=()=>"کوکی نشست Overleaf",z4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kTe():t==="fa"?CTe():STe()}),ETe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",NTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",zTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",jTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=()=>"Overleaf sync failed",ATe=()=>"Overleaf 同步失败",RTe=()=>"همگام‌سازی با Overleaf ناموفق بود",j4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ATe():t==="fa"?RTe():TTe()}),MTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",DTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",LTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",OTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Syncing with Overleaf…",BTe=()=>"正在与 Overleaf 同步…",$Te=()=>"در حال همگام‌سازی با Overleaf…",JD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),PTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",FTe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",HTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",qTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FTe():t==="fa"?HTe():PTe()}),UTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",GTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",WTe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",VTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GTe():t==="fa"?WTe():UTe()}),KTe=()=>"Toggle Plan mode for this chat",QTe=()=>"切换此聊天的计划模式",YTe=()=>"تغییر حالت طرح این گفت‌وگو",XTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QTe():t==="fa"?YTe():KTe()}),ZTe=()=>"Accept and auto mode",JTe=()=>"接受并使用自动模式",eAe=()=>"پذیرش و حالت خودکار",tAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JTe():t==="fa"?eAe():ZTe()}),nAe=()=>"Accept and bypass all",rAe=()=>"接受并跳过所有审批",sAe=()=>"پذیرش و عبور از همهٔ تأییدها",iAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rAe():t==="fa"?sAe():nAe()}),aAe=()=>"Accept plan",oAe=()=>"接受计划",lAe=()=>"پذیرش طرح",cAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oAe():t==="fa"?lAe():aAe()}),uAe=e=>`${e==null?void 0:e.agent} proposed a plan`,dAe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,fAe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,hAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dAe(e):t==="fa"?fAe(e):uAe(e)}),_Ae=e=>`${e==null?void 0:e.agent} is ready to proceed`,pAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,mAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,gAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pAe(e):t==="fa"?mAe(e):_Ae(e)}),vAe=()=>"Back",bAe=()=>"返回",yAe=()=>"بازگشت",xAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bAe():t==="fa"?yAe():vAe()}),wAe=()=>"More approval options",SAe=()=>"更多批准选项",kAe=()=>"گزینه‌های تأیید بیشتر",CAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Open plan",NAe=()=>"打开计划",zAe=()=>"باز کردن طرح",jAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),TAe=()=>"Reject",AAe=()=>"拒绝",RAe=()=>"رد کردن",MAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),DAe=()=>"Revise",LAe=()=>"修改",OAe=()=>"بازنگری",IAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LAe():t==="fa"?OAe():DAe()}),BAe=()=>"Revise…",$Ae=()=>"修改…",PAe=()=>"بازنگری…",FAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ae():t==="fa"?PAe():BAe()}),HAe=()=>"What should change? (optional)",qAe=()=>"需要更改什么?(可选)",UAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",GAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qAe():t==="fa"?UAe():HAe()}),WAe=e=>`${e==null?void 0:e.count} active`,VAe=e=>`${e==null?void 0:e.count} 个活跃`,KAe=e=>`${e==null?void 0:e.count} فعال`,QAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?VAe(e):t==="fa"?KAe(e):WAe(e)}),YAe=e=>`${e==null?void 0:e.count} total agents`,XAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,ZAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,JAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?XAe(e):t==="fa"?ZAe(e):YAe(e)}),eRe=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,tRe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,nRe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,rRe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tRe(e):t==="fa"?nRe(e):eRe(e)}),sRe=()=>"Agents",iRe=()=>"智能体",aRe=()=>"عامل‌ها",gN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),oRe=()=>"arXiv paper ID:",lRe=()=>"arXiv 论文 ID:",cRe=()=>"شناسهٔ مقالهٔ arXiv:",uRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Cancel",fRe=()=>"取消",hRe=()=>"لغو",_Re=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),pRe=()=>"Created",mRe=()=>"创建时间",gRe=()=>"ایجادشده",vRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mRe():t==="fa"?gRe():pRe()}),bRe=()=>"Delete project?",yRe=()=>"删除项目?",xRe=()=>"پروژه حذف شود؟",wRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"Delete project",kRe=()=>"删除项目",CRe=()=>"حذف پروژه",ERe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"Deleting…",zRe=()=>"正在删除…",jRe=()=>"در حال حذف…",TRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),ARe=()=>"Experiments",RRe=()=>"实验",MRe=()=>"آزمایش‌ها",vN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RRe():t==="fa"?MRe():ARe()}),DRe=()=>"The local folder and linked GitHub repository are kept.",LRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",ORe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",IRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"The local folder is kept.",$Re=()=>"本地文件夹会保留。",PRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",FRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"New project",qRe=()=>"新建项目",URe=()=>"پروژهٔ جدید",eL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"No projects yet — create one to get started.",WRe=()=>"尚无项目——新建一个即可开始。",VRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",KRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Project",YRe=()=>"项目",XRe=()=>"پروژه",ZRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),JRe=()=>"Projects",eMe=()=>"项目",tMe=()=>"پروژه‌ها",nMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eMe():t==="fa"?tMe():JRe()}),rMe=()=>"Repository",sMe=()=>"仓库",iMe=()=>"مخزن",bN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),aMe=()=>"Idle",oMe=()=>"空闲",lMe=()=>"بیکار",cMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Local",dMe=()=>"本地",fMe=()=>"محلی",o6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dMe():t==="fa"?fMe():uMe()}),hMe=()=>"1 total agent",_Me=()=>"共 1 个智能体",pMe=()=>"در مجموع ۱ عامل",mMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=e=>`${e==null?void 0:e.count} running`,vMe=e=>`${e==null?void 0:e.count} 个运行中`,bMe=e=>`${e==null?void 0:e.count} در حال اجرا`,yMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vMe(e):t==="fa"?bMe(e):gMe(e)}),xMe=e=>`${e==null?void 0:e.count} total`,wMe=e=>`共 ${e==null?void 0:e.count} 个`,SMe=e=>`در مجموع ${e==null?void 0:e.count}`,yN=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wMe(e):t==="fa"?SMe(e):xMe(e)}),kMe=()=>"Installing the compatible binary. This may take a few minutes.",CMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",EMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",NMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),zMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,jMe=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,TMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,AMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jMe(e):t==="fa"?TMe(e):zMe(e)}),RMe=()=>"Check again",MMe=()=>"再次检查",DMe=()=>"بررسی دوباره",xN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MMe():t==="fa"?DMe():RMe()}),LMe=()=>"Closing…",OMe=()=>"正在关闭…",IMe=()=>"در حال بستن…",BMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OMe():t==="fa"?IMe():LMe()}),$Me=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,PMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,FMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,HMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PMe(e):t==="fa"?FMe(e):$Me(e)}),qMe=()=>"Preparing your remote workspace…",UMe=()=>"正在准备远程工作区…",GMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",WMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UMe():t==="fa"?GMe():qMe()}),VMe=e=>`Connecting to ${e==null?void 0:e.host}`,KMe=e=>`正在连接到 ${e==null?void 0:e.host}`,QMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,YMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KMe(e):t==="fa"?QMe(e):VMe(e)}),XMe=()=>"Close remote host picker",ZMe=()=>"关闭远程主机选择器",JMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",eDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZMe():t==="fa"?JMe():XMe()}),tDe=()=>"Choose a configured SSH host.",nDe=()=>"选择已配置的 SSH 主机。",rDe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",sDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nDe():t==="fa"?rDe():tDe()}),iDe=()=>"Connect to remote",aDe=()=>"连接到远程主机",oDe=()=>"اتصال به میزبان راه‌دور",tL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aDe():t==="fa"?oDe():iDe()}),lDe=()=>"Disconnect",cDe=()=>"断开连接",uDe=()=>"قطع اتصال",T4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Your remote work is still running. Reconnect when you’re ready.",fDe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",hDe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",_De=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`Disconnected from ${e==null?void 0:e.host}`,mDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,gDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,nL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),vDe=e=>`Could not connect to ${e==null?void 0:e.host}`,bDe=e=>`无法连接到 ${e==null?void 0:e.host}`,yDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,xDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bDe(e):t==="fa"?yDe(e):vDe(e)}),wDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",SDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",kDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",CDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SDe():t==="fa"?kDe():wDe()}),EDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",NDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",zDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",jDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),TDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ADe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,RDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,MDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ADe(e):t==="fa"?RDe(e):TDe(e)}),DDe=()=>"OpenResearch binary",LDe=()=>"OpenResearch 二进制文件",ODe=()=>"فایل اجرایی OpenResearch",IDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LDe():t==="fa"?ODe():DDe()}),BDe=()=>"OpenResearch Database",$De=()=>"OpenResearch 数据库",PDe=()=>"پایگاه دادهٔ OpenResearch",FDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",qDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",UDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",GDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qDe():t==="fa"?UDe():HDe()}),WDe=()=>"Install OpenResearch?",VDe=()=>"安装 OpenResearch?",KDe=()=>"OpenResearch نصب شود؟",QDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VDe():t==="fa"?KDe():WDe()}),YDe=()=>"Installing…",XDe=()=>"正在安装…",ZDe=()=>"در حال نصب…",JDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),eLe=()=>"No matching SSH hosts",tLe=()=>"没有匹配的 SSH 主机",nLe=()=>"میزبان SSH منطبقی پیدا نشد",rLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iLe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aLe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=()=>"Open remote",cLe=()=>"打开远程工作区",uLe=()=>"باز کردن راه‌دور",dLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),fLe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",hLe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",_Le=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",pLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",gLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",vLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",bLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gLe():t==="fa"?vLe():mLe()}),yLe=()=>"Preparing remote workspace…",xLe=()=>"正在准备远程工作区…",wLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",SLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),kLe=()=>"Reconnect",CLe=()=>"重新连接",ELe=()=>"اتصال دوباره",wN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),NLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",zLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",jLe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",TLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zLe():t==="fa"?jLe():NLe()}),ALe=e=>`Reconnecting to ${e==null?void 0:e.host}`,RLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,MLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,DLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RLe(e):t==="fa"?MLe(e):ALe(e)}),LLe=()=>"Search SSH hosts",OLe=()=>"搜索 SSH 主机",ILe=()=>"جستجوی میزبان‌های SSH",SN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),BLe=e=>`SSH: ${e==null?void 0:e.host}`,$Le=e=>`SSH:${e==null?void 0:e.host}`,PLe=e=>`SSH: ${e==null?void 0:e.host}`,C2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),FLe=()=>"Start a new OpenResearch host",HLe=()=>"启动新的 OpenResearch 主机",qLe=()=>"راه‌اندازی میزبان جدید OpenResearch",ULe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HLe():t==="fa"?qLe():FLe()}),GLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,WLe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,VLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,KLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WLe(e):t==="fa"?VLe(e):GLe(e)}),QLe=()=>"Stop OpenResearch",YLe=()=>"停止 OpenResearch",XLe=()=>"توقف OpenResearch",ZLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,eOe=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,tOe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,nOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eOe(e):t==="fa"?tOe(e):JLe(e)}),rOe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,sOe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,iOe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,aOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sOe(e):t==="fa"?iOe(e):rOe(e)}),oOe=()=>"Stop OpenResearch on host",lOe=()=>"停止主机上的 OpenResearch",cOe=()=>"توقف OpenResearch روی میزبان",rL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>"This will also:",dOe=()=>"这还将:",fOe=()=>"این کار همچنین:",hOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"End 1 pending approval.",pOe=()=>"结束 1 个待审批请求。",mOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",gOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),vOe=()=>"Leave 1 submitted experiment running.",bOe=()=>"让 1 个已提交实验继续运行。",yOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bOe():t==="fa"?yOe():vOe()}),wOe=()=>"Disconnect 1 other client.",SOe=()=>"断开 1 个其他客户端。",kOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",COe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Keep 1 queued message saved.",NOe=()=>"保留 1 条排队消息。",zOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",jOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),TOe=()=>"Interrupt 1 active agent turn.",AOe=()=>"中断 1 个活动代理任务。",ROe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",MOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AOe():t==="fa"?ROe():TOe()}),DOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,LOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,OOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,IOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LOe(e):t==="fa"?OOe(e):DOe(e)}),BOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,$Oe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,POe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,FOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,qOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,UOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,GOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qOe(e):t==="fa"?UOe(e):HOe(e)}),WOe=()=>"Stopping host…",VOe=()=>"正在停止主机…",KOe=()=>"در حال توقف میزبان…",QOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Update",XOe=()=>"更新",ZOe=()=>"به‌روزرسانی",kN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,eIe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,tIe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,nIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eIe(e):t==="fa"?tIe(e):JOe(e)}),rIe=()=>"Update OpenResearch?",sIe=()=>"更新 OpenResearch?",iIe=()=>"OpenResearch به‌روزرسانی شود؟",aIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Updating…",lIe=()=>"正在更新…",cIe=()=>"در حال به‌روزرسانی…",uIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),dIe=()=>"Disable syncing",fIe=()=>"关闭同步",hIe=()=>"غیرفعال کردن همگام‌سازی",_Ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fIe():t==="fa"?hIe():dIe()}),pIe=()=>"Enable GitHub syncing",mIe=()=>"启用 GitHub 同步",gIe=()=>"فعال‌سازی همگام‌سازی GitHub",vIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mIe():t==="fa"?gIe():pIe()}),bIe=()=>"Enabling…",yIe=()=>"正在启用…",xIe=()=>"در حال فعال‌سازی…",wIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yIe():t==="fa"?xIe():bIe()}),SIe=()=>"Updating…",kIe=()=>"正在更新…",CIe=()=>"در حال به‌روزرسانی…",EIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,zIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,jIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,TIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zIe(e):t==="fa"?jIe(e):NIe(e)}),AIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,RIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,MIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,DIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RIe(e):t==="fa"?MIe(e):AIe(e)}),LIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,OIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,IIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,BIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OIe(e):t==="fa"?IIe(e):LIe(e)}),$Ie=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,PIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,FIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,HIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PIe(e):t==="fa"?FIe(e):$Ie(e)}),qIe=()=>"CLI is retrying…",UIe=()=>"CLI 正在重试…",GIe=()=>"CLI در حال تلاش دوباره است…",WIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UIe():t==="fa"?GIe():qIe()}),VIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,KIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,QIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,YIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KIe(e):t==="fa"?QIe(e):VIe(e)}),XIe=()=>"Sending again…",ZIe=()=>"正在重新发送…",JIe=()=>"در حال ارسال دوباره…",eBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,nBe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,rBe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,sBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Retrying…",aBe=()=>"正在重试…",oBe=()=>"در حال تلاش دوباره…",sL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),lBe=()=>"Default speed",cBe=()=>"默认速度",uBe=()=>"سرعت پیش‌فرض",dBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cBe():t==="fa"?uBe():lBe()}),fBe=()=>"Standard",hBe=()=>"标准",_Be=()=>"استاندارد",pBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hBe():t==="fa"?_Be():fBe()}),mBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,gBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,vBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,bBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gBe(e):t==="fa"?vBe(e):mBe(e)}),yBe=()=>"Appearance",xBe=()=>"外观",wBe=()=>"ظاهر",SBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check",CBe=()=>"检查",EBe=()=>"بررسی",NBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"Check again",jBe=()=>"再次检查",TBe=()=>"بررسی دوباره",Qp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),ABe=()=>"Check for updates",RBe=()=>"检查更新",MBe=()=>"بررسی به‌روزرسانی",DBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RBe():t==="fa"?MBe():ABe()}),LBe=()=>"Check now",OBe=()=>"立即检查",IBe=()=>"اکنون بررسی کن",BBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Check setup",PBe=()=>"检查设置",FBe=()=>"بررسی راه‌اندازی",HBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PBe():t==="fa"?FBe():$Be()}),qBe=()=>"orx checks a few times a day on its own.",UBe=()=>"orx 每天会自动检查几次。",GBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",WBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UBe():t==="fa"?GBe():qBe()}),VBe=()=>"Choose a flavor",KBe=()=>"选择配置",QBe=()=>"انتخاب پیکربندی",YBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KBe():t==="fa"?QBe():VBe()}),XBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,ZBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,JBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZBe(e):t==="fa"?JBe(e):XBe(e)}),t$e=()=>"clean",n$e=()=>"无更改",r$e=()=>"بدون تغییر",s$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>`Already linked at ${e==null?void 0:e.link}.`,a$e=e=>`已链接到 ${e==null?void 0:e.link}。`,o$e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=e=>`Linked ${e==null?void 0:e.link}.`,u$e=e=>`已链接 ${e==null?void 0:e.link}。`,d$e=e=>`${e==null?void 0:e.link} پیوند شد.`,f$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u$e(e):t==="fa"?d$e(e):c$e(e)}),h$e=()=>"Connect",_$e=()=>"连接",p$e=()=>"اتصال",l6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_$e():t==="fa"?p$e():h$e()}),m$e=()=>"Connected via GitHub CLI",g$e=()=>"已通过 GitHub CLI 连接",v$e=()=>"از طریق GitHub CLI متصل است",iL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g$e():t==="fa"?v$e():m$e()}),b$e=()=>"Connecting…",y$e=()=>"正在连接…",x$e=()=>"در حال اتصال…",aL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y$e():t==="fa"?x$e():b$e()}),w$e=e=>`CPU cores: ${e==null?void 0:e.count}`,S$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,k$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,C$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S$e(e):t==="fa"?k$e(e):w$e(e)}),E$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",N$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",z$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",j$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"the current project",A$e=()=>"当前项目",R$e=()=>"پروژهٔ فعلی",M$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),D$e=e=>`${e==null?void 0:e.value} (custom)`,L$e=e=>`${e==null?void 0:e.value}(自定义)`,O$e=e=>`${e==null?void 0:e.value} (سفارشی)`,I$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L$e(e):t==="fa"?O$e(e):D$e(e)}),B$e=()=>"detached",$$e=()=>"分离头指针",P$e=()=>"جدا از شاخه",c6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Disconnected",H$e=()=>"已断开连接",q$e=()=>"قطع اتصال",oL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),U$e=()=>"Environment tab",G$e=()=>"环境标签页",W$e=()=>"زبانهٔ محیط",V$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G$e():t==="fa"?W$e():U$e()}),K$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Y$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,X$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Q$e(e):t==="fa"?Y$e(e):K$e(e)}),Z$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",J$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",ePe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",tPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J$e():t==="fa"?ePe():Z$e()}),nPe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",rPe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",sPe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",iPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",oPe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",lPe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",cPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=e=>`GPU × ${e==null?void 0:e.count}`,dPe=e=>`${e==null?void 0:e.count} 个 GPU`,fPe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,hPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dPe(e):t==="fa"?fPe(e):uPe(e)}),_Pe=()=>"has changes",pPe=()=>"有更改",mPe=()=>"دارای تغییر",gPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),vPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,bPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,yPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,xPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bPe(e):t==="fa"?yPe(e):vPe(e)}),wPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",SPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",kPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",CPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"Install",NPe=()=>"安装",zPe=()=>"نصب",jPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),TPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,APe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,RPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,MPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?APe(e):t==="fa"?RPe(e):TPe(e)}),DPe=e=>`Install the ${e==null?void 0:e.command} command`,LPe=e=>`安装 ${e==null?void 0:e.command} 命令`,OPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,IPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LPe(e):t==="fa"?OPe(e):DPe(e)}),BPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",$Pe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",PPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",FPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Pe():t==="fa"?PPe():BPe()}),HPe=()=>"Install the new release now instead of waiting for the background update.",qPe=()=>"立即安装新版本,无需等待后台更新。",UPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qPe():t==="fa"?UPe():HPe()}),WPe=()=>"Discard your unsaved Kubernetes changes?",VPe=()=>"要放弃未保存的 Kubernetes 更改吗?",KPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",QPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VPe():t==="fa"?KPe():WPe()}),YPe=()=>"Key from",XPe=()=>"密钥来自",ZPe=()=>"کلید از",JPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XPe():t==="fa"?ZPe():YPe()}),eFe=()=>"Use current kubectl context",tFe=()=>"使用当前 kubectl 上下文",nFe=()=>"استفاده از کانتکست فعلی kubectl",rFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=e=>`Use current context (${e==null?void 0:e.context})`,iFe=e=>`使用当前上下文(${e==null?void 0:e.context})`,aFe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,oFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iFe(e):t==="fa"?aFe(e):sFe(e)}),lFe=()=>"Language",cFe=()=>"语言",uFe=()=>"زبان",dFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),fFe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,hFe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,_Fe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,pFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hFe(e):t==="fa"?_Fe(e):fFe(e)}),mFe=()=>"Make default",gFe=()=>"设为默认值",vFe=()=>"پیش‌فرض شود",bFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gFe():t==="fa"?vFe():mFe()}),yFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",xFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",wFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",SFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xFe():t==="fa"?wFe():yFe()}),kFe=()=>"Replace token ID",CFe=()=>"替换令牌 ID",EFe=()=>"جایگزینی شناسهٔ توکن",NFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Replace token secret",jFe=()=>"替换令牌密钥",TFe=()=>"جایگزینی رمز توکن",AFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jFe():t==="fa"?TFe():zFe()}),RFe=()=>"How to get a Modal token",MFe=()=>"如何获取 Modal 令牌",DFe=()=>"روش دریافت توکن Modal",LFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MFe():t==="fa"?DFe():RFe()}),OFe=()=>"Token ID",IFe=()=>"令牌 ID",BFe=()=>"شناسهٔ توکن",$Fe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Token secret",FFe=()=>"令牌密钥",HFe=()=>"رمز توکن",qFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FFe():t==="fa"?HFe():PFe()}),UFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,GFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,WFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,lL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?GFe(e):t==="fa"?WFe(e):UFe(e)}),VFe=e=>`Needs ${e==null?void 0:e.tool}`,KFe=e=>`需要 ${e==null?void 0:e.tool}`,QFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,YFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KFe(e):t==="fa"?QFe(e):VFe(e)}),XFe=()=>"Needs tools",ZFe=()=>"缺少工具",JFe=()=>"به ابزارها نیاز دارد",eHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZFe():t==="fa"?JFe():XFe()}),tHe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,nHe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,rHe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,sHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nHe(e):t==="fa"?rHe(e):tHe(e)}),iHe=()=>"New runs use SSH; choose a host when launching.",aHe=()=>"新运行将使用 SSH;启动时请选择主机。",oHe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"New token",uHe=()=>"新令牌",dHe=()=>"توکن جدید",fHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"No default flavor",_He=()=>"不设默认配置",pHe=()=>"بدون پیکربندی پیش‌فرض",mHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"none",vHe=()=>"无",bHe=()=>"هیچ‌کدام",u6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vHe():t==="fa"?bHe():gHe()}),yHe=()=>"Not connected",xHe=()=>"未连接",wHe=()=>"متصل نیست",cL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"not found on PATH",kHe=()=>"在 PATH 中未找到",CHe=()=>"در PATH پیدا نشد",EHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,zHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,jHe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,THe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"not initialized",RHe=()=>"尚未初始化",MHe=()=>"راه‌اندازی نشده",DHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Not set",OHe=()=>"未设置",IHe=()=>"تنظیم نشده",A4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"OAuth (subscription login)",$He=()=>"OAuth(订阅登录)",PHe=()=>"OAuth (ورود با اشتراک)",FHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,qHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,UHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,GHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):HHe(e)}),WHe=()=>"Setting up…",VHe=()=>"正在设置…",KHe=()=>"در حال راه‌اندازی…",QHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Account",XHe=()=>"账户",ZHe=()=>"حساب",d6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Add one with",eqe=()=>"使用以下命令添加:",tqe=()=>"یکی با این فرمان اضافه کنید:",nqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Add variable",sqe=()=>"添加变量",iqe=()=>"افزودن متغیر",aqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"Agent models",lqe=()=>"智能体模型",cqe=()=>"مدل‌های عامل",uqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),dqe=()=>"Anonymous usage analytics",fqe=()=>"匿名使用情况分析",hqe=()=>"تحلیل ناشناس استفاده",CN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fqe():t==="fa"?hqe():dqe()}),_qe=()=>"Auth",pqe=()=>"身份验证",mqe=()=>"احراز هویت",gqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),vqe=()=>"Authentication",bqe=()=>"身份验证",yqe=()=>"احراز هویت",uL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bqe():t==="fa"?yqe():vqe()}),xqe=()=>"Auto-apply GitHub topics for new projects",wqe=()=>"为新项目自动添加 GitHub topic",Sqe=()=>"اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید",R4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wqe():t==="fa"?Sqe():xqe()}),kqe=()=>"Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.",Cqe=()=>"为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",Eqe=()=>"مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",dL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cqe():t==="fa"?Eqe():kqe()}),Nqe=()=>"Back to Compute",zqe=()=>"返回算力设置",jqe=()=>"بازگشت به رایانش",fL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zqe():t==="fa"?jqe():Nqe()}),Tqe=()=>"Backend",Aqe=()=>"后端",Rqe=()=>"بک‌اند",Mqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aqe():t==="fa"?Rqe():Tqe()}),Dqe=()=>"Baseline",Lqe=()=>"基线",Oqe=()=>"خط مبنا",Iqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"Binary",$qe=()=>"可执行文件",Pqe=()=>"فایل اجرایی",Fqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Cancel",qqe=()=>"取消",Uqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qqe():t==="fa"?Uqe():Hqe()}),Gqe=()=>"Cancel new variable",Wqe=()=>"取消新变量",Vqe=()=>"لغو متغیر جدید",Kqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wqe():t==="fa"?Vqe():Gqe()}),Qqe=()=>"Checking compute targets…",Yqe=()=>"正在检查算力目标…",Xqe=()=>"در حال بررسی مقصدهای رایانشی…",Zqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Qqe()}),Jqe=()=>"Checking kubectl…",eUe=()=>"正在检查 kubectl…",tUe=()=>"در حال بررسی kubectl…",nUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eUe():t==="fa"?tUe():Jqe()}),rUe=()=>"Checking Modal…",sUe=()=>"正在检查 Modal…",iUe=()=>"در حال بررسی Modal…",aUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Choose a preset flavor",lUe=()=>"选择预设规格",cUe=()=>"یک پیکربندی آماده انتخاب کنید",EN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),uUe=()=>"cluster default",dUe=()=>"集群默认值",fUe=()=>"پیش‌فرض خوشه",NN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dUe():t==="fa"?fUe():uUe()}),hUe=()=>"cluster default (e.g. 4h, 30m)",_Ue=()=>"集群默认值(例如 4h、30m)",pUe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",mUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ue():t==="fa"?pUe():hUe()}),gUe=()=>"Cluster unreachable",vUe=()=>"无法连接集群",bUe=()=>"خوشه در دسترس نیست",yUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vUe():t==="fa"?bUe():gUe()}),xUe=()=>"Compute",wUe=()=>"算力",SUe=()=>"رایانش",hL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wUe():t==="fa"?SUe():xUe()}),kUe=()=>"Connect compute backends and choose where new runs execute.",CUe=()=>"连接算力后端,并选择新运行的执行位置。",EUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",NUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"Connected",jUe=()=>"已连接",TUe=()=>"متصل",AUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jUe():t==="fa"?TUe():zUe()}),RUe=()=>"Context",MUe=()=>"上下文",DUe=()=>"زمینه",LUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MUe():t==="fa"?DUe():RUe()}),OUe=()=>"Current",IUe=()=>"当前",BUe=()=>"فعلی",$Ue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),PUe=()=>"Currently off:",FUe=()=>"当前已关闭:",HUe=()=>"اکنون خاموش است:",qUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FUe():t==="fa"?HUe():PUe()}),UUe=()=>"Custom flavor",GUe=()=>"自定义规格",WUe=()=>"پیکربندی سفارشی",VUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GUe():t==="fa"?WUe():UUe()}),KUe=()=>"Custom flavor…",QUe=()=>"自定义规格…",YUe=()=>"پیکربندی سفارشی…",XUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QUe():t==="fa"?YUe():KUe()}),ZUe=()=>"Data directory",JUe=()=>"数据目录",eGe=()=>"پوشهٔ داده",tGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JUe():t==="fa"?eGe():ZUe()}),nGe=()=>"default",rGe=()=>"默认",sGe=()=>"پیش‌فرض",iGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rGe():t==="fa"?sGe():nGe()}),aGe=()=>"Default",oGe=()=>"默认",lGe=()=>"پیش‌فرض",_L=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oGe():t==="fa"?lGe():aGe()}),cGe=()=>"Default destination",uGe=()=>"默认目标",dGe=()=>"مقصد پیش‌فرض",fGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uGe():t==="fa"?dGe():cGe()}),hGe=()=>"Detecting hardware…",_Ge=()=>"正在检测硬件…",pGe=()=>"در حال شناسایی سخت‌افزار…",mGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Detecting harnesses…",vGe=()=>"正在检测智能体工具…",bGe=()=>"در حال شناسایی ابزارهای عامل…",yGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",wGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",SGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",kGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Effective URL",EGe=()=>"实际使用的网址",NGe=()=>"نشانی مؤثر",zGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Enable GitHub syncing for new projects",TGe=()=>"为新项目启用 GitHub 同步",AGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",zN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),RGe=()=>"Environment",MGe=()=>"环境",DGe=()=>"محیط",pL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MGe():t==="fa"?DGe():RGe()}),LGe=()=>"Failed",OGe=()=>"失败",IGe=()=>"ناموفق",f6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OGe():t==="fa"?IGe():LGe()}),BGe=()=>"General",$Ge=()=>"常规",PGe=()=>"عمومی",FGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ge():t==="fa"?PGe():BGe()}),HGe=()=>"GitHub publishing",qGe=()=>"GitHub 发布",UGe=()=>"انتشار در GitHub",GGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qGe():t==="fa"?UGe():HGe()}),WGe=()=>"Git token",VGe=()=>"Git 令牌",KGe=()=>"توکن Git",QGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VGe():t==="fa"?KGe():WGe()}),YGe=()=>"Harnesses",XGe=()=>"智能体工具",ZGe=()=>"ابزارهای عامل",JGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XGe():t==="fa"?ZGe():YGe()}),eWe=()=>"hf_…",tWe=()=>"hf_…",nWe=()=>"hf_…",rWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",iWe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",aWe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",oWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"Initialize Git",cWe=()=>"初始化 Git",uWe=()=>"راه‌اندازی Git",dWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),fWe=()=>"Install",hWe=()=>"安装",_We=()=>"نصب",mL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hWe():t==="fa"?_We():fWe()}),pWe=()=>"Install broken",mWe=()=>"安装损坏",gWe=()=>"نصب خراب است",vWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mWe():t==="fa"?gWe():pWe()}),bWe=()=>"Install GitHub CLI",yWe=()=>"安装 GitHub CLI",xWe=()=>"نصب GitHub CLI",wWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yWe():t==="fa"?xWe():bWe()}),SWe=()=>"Install updates automatically",kWe=()=>"自动安装更新",CWe=()=>"نصب خودکار به‌روزرسانی‌ها",jN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),EWe=()=>"Instance history",NWe=()=>"实例历史",zWe=()=>"تاریخچهٔ نمونه‌ها",jWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NWe():t==="fa"?zWe():EWe()}),TWe=()=>"Invalid Token",AWe=()=>"令牌无效",RWe=()=>"توکن نامعتبر",MWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AWe():t==="fa"?RWe():TWe()}),DWe=()=>"Jobs / Dashboard URL",LWe=()=>"Jobs / 控制台网址",OWe=()=>"نشانی Jobs / داشبورد",IWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"kubectl not found",$We=()=>"未找到 kubectl",PWe=()=>"kubectl پیدا نشد",FWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$We():t==="fa"?PWe():BWe()}),HWe=()=>"Latest",qWe=()=>"最新版本",UWe=()=>"جدیدترین",GWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qWe():t==="fa"?UWe():HWe()}),WWe=()=>"Loading…",VWe=()=>"正在加载…",KWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VWe():t==="fa"?KWe():WWe()}),QWe=()=>"Loading Ray settings…",YWe=()=>"正在加载 Ray 设置…",XWe=()=>"در حال بارگیری تنظیمات Ray…",ZWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YWe():t==="fa"?XWe():QWe()}),JWe=()=>"Loading slurm settings…",eVe=()=>"正在加载 Slurm 设置…",tVe=()=>"در حال بارگیری تنظیمات Slurm…",nVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eVe():t==="fa"?tVe():JWe()}),rVe=()=>"Loading status…",sVe=()=>"正在加载状态…",iVe=()=>"در حال بارگیری وضعیت…",aVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sVe():t==="fa"?iVe():rVe()}),oVe=()=>"Local only",lVe=()=>"仅本地",cVe=()=>"فقط محلی",uVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lVe():t==="fa"?cVe():oVe()}),dVe=()=>"Local repository",fVe=()=>"本地仓库",hVe=()=>"مخزن محلی",_Ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fVe():t==="fa"?hVe():dVe()}),pVe=()=>"Login node",mVe=()=>"登录节点",gVe=()=>"گرهٔ ورود",vVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mVe():t==="fa"?gVe():pVe()}),bVe=()=>"Make GitHub syncing the default?",yVe=()=>"将 GitHub 同步设为默认值?",xVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",wVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yVe():t==="fa"?xVe():bVe()}),SVe=()=>"Missing bash/tar",kVe=()=>"缺少 bash/tar",CVe=()=>"bash/tar موجود نیست",EVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kVe():t==="fa"?CVe():SVe()}),NVe=()=>"More compute options",zVe=()=>"更多算力选项",jVe=()=>"گزینه‌های رایانشی بیشتر",TVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zVe():t==="fa"?jVe():NVe()}),AVe=()=>"Move failed:",RVe=()=>"移动失败:",MVe=()=>"انتقال ناموفق بود:",DVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RVe():t==="fa"?MVe():AVe()}),LVe=()=>"Moved. orx is now using the new location.",OVe=()=>"已移动。orx 现在使用新位置。",IVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",BVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OVe():t==="fa"?IVe():LVe()}),$Ve=()=>"Namespace",PVe=()=>"命名空间",FVe=()=>"فضای نام",HVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PVe():t==="fa"?FVe():$Ve()}),qVe=()=>"New location",UVe=()=>"新位置",GVe=()=>"محل جدید",WVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UVe():t==="fa"?GVe():qVe()}),VVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",KVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",QVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",YVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KVe():t==="fa"?QVe():VVe()}),XVe=()=>"New variable key",ZVe=()=>"新变量键名",JVe=()=>"کلید متغیر جدید",eKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZVe():t==="fa"?JVe():XVe()}),tKe=()=>"New variable value",nKe=()=>"新变量值",rKe=()=>"مقدار متغیر جدید",sKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nKe():t==="fa"?rKe():tKe()}),iKe=()=>"No code, prompts, file contents, or account identifiers are sent.",aKe=()=>"不会发送代码、提示词、文件内容或账户标识符。",oKe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",lKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aKe():t==="fa"?oKe():iKe()}),cKe=()=>"No hosts found in ~/.ssh/config.",uKe=()=>"在 ~/.ssh/config 中未找到主机。",dKe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",fKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uKe():t==="fa"?dKe():cKe()}),hKe=()=>"No job-create permission",_Ke=()=>"没有创建 Job 的权限",pKe=()=>"مجوز ساخت Job وجود ندارد",mKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ke():t==="fa"?pKe():hKe()}),gKe=()=>"No Write Permissions",vKe=()=>"无写入权限",bKe=()=>"بدون مجوز نوشتن",yKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vKe():t==="fa"?bKe():gKe()}),xKe=()=>"No key on this computer to register — load a registered key with",wKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",SKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",kKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wKe():t==="fa"?SKe():xKe()}),CKe=()=>"No key on this computer yet — create one with",EKe=()=>"此计算机上还没有密钥——使用以下命令创建:",NKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",zKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EKe():t==="fa"?NKe():CKe()}),jKe=()=>"No Slurm CLI",TKe=()=>"无 Slurm CLI",AKe=()=>"بدون CLI اسلورم",RKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TKe():t==="fa"?AKe():jKe()}),MKe=()=>"None registered",DKe=()=>"未注册任何密钥",LKe=()=>"هیچ‌کدام ثبت نشده",OKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DKe():t==="fa"?LKe():MKe()}),IKe=()=>"Not checked",BKe=()=>"未检查",$Ke=()=>"بررسی نشده",gL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BKe():t==="fa"?$Ke():IKe()}),PKe=()=>"Not configured",FKe=()=>"未配置",HKe=()=>"پیکربندی نشده",eb=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FKe():t==="fa"?HKe():PKe()}),qKe=()=>"Not installed",UKe=()=>"未安装",GKe=()=>"نصب نیست",WKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UKe():t==="fa"?GKe():qKe()}),VKe=()=>"Not now",KKe=()=>"暂不",QKe=()=>"اکنون نه",YKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KKe():t==="fa"?QKe():VKe()}),XKe=()=>"Not on this computer",ZKe=()=>"不在此计算机上",JKe=()=>"روی این رایانه نیست",eQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZKe():t==="fa"?JKe():XKe()}),tQe=()=>"Not set (pass --host per launch)",nQe=()=>"未设置(每次启动时传入 --host)",rQe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",sQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Not signed in",aQe=()=>"未登录",oQe=()=>"وارد نشده",vL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),lQe=()=>"On this computer",cQe=()=>"在此计算机上",uQe=()=>"روی این رایانه",dQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cQe():t==="fa"?uQe():lQe()}),fQe=()=>"Open a project to inspect its repository and GitHub publication state.",hQe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",_Qe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",pQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hQe():t==="fa"?_Qe():fQe()}),mQe=()=>"Open job page",gQe=()=>"打开作业页面",vQe=()=>"باز کردن صفحهٔ کار",TN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gQe():t==="fa"?vQe():mQe()}),bQe=()=>"Open on GitHub",yQe=()=>"在 GitHub 上打开",xQe=()=>"باز کردن در GitHub",AN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yQe():t==="fa"?xQe():bQe()}),wQe=()=>", or create one with",SQe=()=>",或使用以下命令创建:",kQe=()=>"، یا با این فرمان یکی بسازید:",CQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SQe():t==="fa"?kQe():wQe()}),EQe=()=>"Org",NQe=()=>"组织",zQe=()=>"سازمان",jQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"Orgs",AQe=()=>"组织",RQe=()=>"سازمان‌ها",MQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),DQe=()=>"orx can't update this install",LQe=()=>"orx 无法更新此安装",OQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",IQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LQe():t==="fa"?OQe():DQe()}),BQe=()=>"Overleaf",$Qe=()=>"Overleaf",PQe=()=>"Overleaf",bL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),FQe=()=>"Overleaf Git authentication token",HQe=()=>"Overleaf Git 身份验证令牌",qQe=()=>"توکن احراز هویت Git در Overleaf",UQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HQe():t==="fa"?qQe():FQe()}),GQe=()=>"Overridden by env",WQe=()=>"已被环境变量覆盖",VQe=()=>"بازنویسی‌شده توسط محیط",KQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WQe():t==="fa"?VQe():GQe()}),QQe=()=>"Partition",YQe=()=>"分区",XQe=()=>"پارتیشن",ZQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YQe():t==="fa"?XQe():QQe()}),JQe=()=>"Path",eYe=()=>"路径",tYe=()=>"مسیر",nYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eYe():t==="fa"?tYe():JQe()}),rYe=()=>"Plan",sYe=()=>"方案",iYe=()=>"سطح اشتراک",aYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sYe():t==="fa"?iYe():rYe()}),oYe=()=>"Project",lYe=()=>"项目",cYe=()=>"پروژه",uYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lYe():t==="fa"?cYe():oYe()}),dYe=()=>"Ray version",fYe=()=>"Ray 版本",hYe=()=>"نسخهٔ Ray",_Ye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),pYe=()=>"Reachable",mYe=()=>"可访问",gYe=()=>"در دسترس",vYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mYe():t==="fa"?gYe():pYe()}),bYe=()=>"Reading ~/.ssh/config…",yYe=()=>"正在读取 ~/.ssh/config…",xYe=()=>"در حال خواندن ‎~/.ssh/config…",yL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yYe():t==="fa"?xYe():bYe()}),wYe=()=>"Ready",SYe=()=>"就绪",kYe=()=>"آماده",Yp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),CYe=()=>"Ready to move",EYe=()=>"可以移动",NYe=()=>"آمادهٔ انتقال",zYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EYe():t==="fa"?NYe():CYe()}),jYe=()=>"Configured",TYe=()=>"已配置",AYe=()=>"پیکربندی‌شده",h6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),RYe=()=>"Refresh",MYe=()=>"刷新",DYe=()=>"تازه‌سازی",Xp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MYe():t==="fa"?DYe():RYe()}),LYe=()=>"Remotes",OYe=()=>"远程仓库",IYe=()=>"مخزن‌های دوردست",BYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OYe():t==="fa"?IYe():LYe()}),$Ye=()=>"Repository",PYe=()=>"仓库",FYe=()=>"مخزن",HYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PYe():t==="fa"?FYe():$Ye()}),qYe=()=>"Repository topics",UYe=()=>"仓库 topic",GYe=()=>"موضوع‌های مخزن",RN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UYe():t==="fa"?GYe():qYe()}),WYe=()=>"Restart to finish updating",VYe=()=>"重新启动以完成更新",KYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",QYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VYe():t==="fa"?KYe():WYe()}),YYe=()=>"Running instances",XYe=()=>"正在运行的实例",ZYe=()=>"نمونه‌های در حال اجرا",JYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),eXe=()=>"Runtime",tXe=()=>"运行时间",nXe=()=>"زمان اجرا",rXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>". Save it under that key if it's meant for HF Jobs.",iXe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",aXe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",oXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>"Session cookie",cXe=()=>"会话 cookie",uXe=()=>"کوکی نشست",dXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),fXe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",hXe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",_Xe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",pXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hXe():t==="fa"?_Xe():fXe()}),mXe=()=>"Settings",gXe=()=>"设置",vXe=()=>"تنظیمات",_6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gXe():t==="fa"?vXe():mXe()}),bXe=()=>"Signed in",yXe=()=>"已登录",xXe=()=>"وارد شده",wXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yXe():t==="fa"?xXe():bXe()}),SXe=()=>"Source",kXe=()=>"来源",CXe=()=>"منبع",xL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kXe():t==="fa"?CXe():SXe()}),EXe=()=>"SSH Key",NXe=()=>"SSH 密钥",zXe=()=>"کلید SSH",jXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NXe():t==="fa"?zXe():EXe()}),TXe=()=>"Started",AXe=()=>"开始时间",RXe=()=>"آغاز",MXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),DXe=()=>"State",LXe=()=>"状态",OXe=()=>"وضعیت",IXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LXe():t==="fa"?OXe():DXe()}),BXe=()=>"Status",$Xe=()=>"状态",PXe=()=>"وضعیت",l_=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),FXe=()=>"Storage",HXe=()=>"存储",qXe=()=>"ذخیره‌سازی",UXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HXe():t==="fa"?qXe():FXe()}),GXe=()=>"Sync",WXe=()=>"同步",VXe=()=>"همگام‌سازی",KXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"Syncing off",YXe=()=>"同步已关闭",XXe=()=>"همگام‌سازی خاموش",ZXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Test connection",eZe=()=>"测试连接",tZe=()=>"آزمایش اتصال",nZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Testing…",sZe=()=>"正在测试…",iZe=()=>"در حال آزمایش…",aZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),oZe=()=>", then add it with",lZe=()=>",然后使用以下命令添加:",cZe=()=>"، سپس با این فرمان اضافه‌اش کنید:",uZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lZe():t==="fa"?cZe():oZe()}),dZe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",fZe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",hZe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",_Ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fZe():t==="fa"?hZe():dZe()}),pZe=()=>"This saved destination is not configured. Set it up below or choose another backend.",mZe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",gZe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",vZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mZe():t==="fa"?gZe():pZe()}),bZe=()=>"This value looks like a Hugging Face token — compute runs only read it from",yZe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",xZe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",wZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yZe():t==="fa"?xZe():bZe()}),SZe=()=>"Time limit",kZe=()=>"时间限制",CZe=()=>"محدودیت زمانی",EZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Unable to verify",zZe=()=>"无法验证",jZe=()=>"تأیید ممکن نیست",M4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),TZe=()=>"Unknown",AZe=()=>"未知",RZe=()=>"نامشخص",wL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AZe():t==="fa"?RZe():TZe()}),MZe=()=>"Update required",DZe=()=>"需要更新",LZe=()=>"نیازمند به‌روزرسانی",OZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DZe():t==="fa"?LZe():MZe()}),IZe=()=>"Updates",BZe=()=>"更新",$Ze=()=>"به‌روزرسانی‌ها",MN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BZe():t==="fa"?$Ze():IZe()}),PZe=()=>"Usage analytics",FZe=()=>"使用情况分析",HZe=()=>"تحلیل استفاده",qZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FZe():t==="fa"?HZe():PZe()}),UZe=()=>"value",GZe=()=>"值",WZe=()=>"مقدار",SL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GZe():t==="fa"?WZe():UZe()}),VZe=()=>"Variables available to runs and the research agent (API keys, tokens).",KZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",QZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",YZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZe():t==="fa"?QZe():VZe()}),XZe=()=>"Version",ZZe=()=>"版本",JZe=()=>"نسخه",kL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZe():t==="fa"?JZe():XZe()}),eJe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",tJe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",nJe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",rJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tJe():t==="fa"?nJe():eJe()}),sJe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",iJe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",aJe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",oJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iJe():t==="fa"?aJe():sJe()}),lJe=()=>"Pick a login node first",cJe=()=>"请先选择登录节点",uJe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",dJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cJe():t==="fa"?uJe():lJe()}),fJe=()=>"Providers",hJe=()=>"提供商",_Je=()=>"ارائه‌دهندگان",pJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hJe():t==="fa"?_Je():fJe()}),mJe=()=>"Reconnect",gJe=()=>"重新连接",vJe=()=>"اتصال دوباره",CL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gJe():t==="fa"?vJe():mJe()}),bJe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yJe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,xJe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,wJe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yJe(e):t==="fa"?xJe(e):bJe(e)}),SJe=()=>"Reinstall with the orx installer to get automatic updates.",kJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",CJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",EJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kJe():t==="fa"?CJe():SJe()}),NJe=()=>"Re-link",zJe=()=>"重新链接",jJe=()=>"پیوند دوباره",TJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zJe():t==="fa"?jJe():NJe()}),AJe=()=>"Remove cookie",RJe=()=>"移除 cookie",MJe=()=>"حذف کوکی",DJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RJe():t==="fa"?MJe():AJe()}),LJe=()=>"Remove token",OJe=()=>"移除令牌",IJe=()=>"حذف توکن",BJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OJe():t==="fa"?IJe():LJe()}),$Je=()=>"Removing…",PJe=()=>"正在移除…",FJe=()=>"در حال حذف…",DN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PJe():t==="fa"?FJe():$Je()}),HJe=()=>"Replace anyway",qJe=()=>"仍要替换",UJe=()=>"به‌هرحال جایگزین کن",GJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qJe():t==="fa"?UJe():HJe()}),WJe=()=>"Replace key",VJe=()=>"替换密钥",KJe=()=>"جایگزینی کلید",QJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJe():t==="fa"?KJe():WJe()}),YJe=()=>"Replace token",XJe=()=>"替换令牌",ZJe=()=>"جایگزینی توکن",JJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XJe():t==="fa"?ZJe():YJe()}),eet=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,tet=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,net=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,ret=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tet(e):t==="fa"?net(e):eet(e)}),set=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,iet=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,aet=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,oet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iet(e):t==="fa"?aet(e):set(e)}),cet=()=>"Run `gh auth login` in your terminal.",uet=()=>"请在终端中运行 `gh auth login`。",det=()=>"در پایانه `gh auth login` را اجرا کنید.",fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uet():t==="fa"?det():cet()}),het=()=>"Saved",_et=()=>"已保存",pet=()=>"ذخیره شده",LN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_et():t==="fa"?pet():het()}),met=()=>"Set up",get=()=>"设置",vet=()=>"راه‌اندازی",bet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?get():t==="fa"?vet():met()}),yet=()=>"Set up SSH key",xet=()=>"设置 SSH 密钥",wet=()=>"راه‌اندازی کلید SSH",ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"Sign in",Eet=()=>"登录",Net=()=>"ورود",EL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),zet=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,jet=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Tet=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,NL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jet(e):t==="fa"?Tet(e):zet(e)}),Aet=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Ret=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Met=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Det=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ret():t==="fa"?Met():Aet()}),Let=()=>"The terminal disconnected before setup completed. Try again.",Oet=()=>"设置完成前终端连接已断开。请重试。",Iet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",ON=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oet():t==="fa"?Iet():Let()}),Bet=()=>"Dark",$et=()=>"深色",Pet=()=>"تیره",Fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$et():t==="fa"?Pet():Bet()}),Het=()=>"Theme",qet=()=>"主题",Uet=()=>"پوسته",IN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qet():t==="fa"?Uet():Het()}),Get=()=>"Light",Wet=()=>"浅色",Vet=()=>"روشن",Ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wet():t==="fa"?Vet():Get()}),Qet=()=>"System",Yet=()=>"系统",Xet=()=>"سیستم",Zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=()=>"Set up billing in the Tinker console",ett=()=>"在 Tinker 控制台设置账单",ttt=()=>"تنظیم پرداخت در کنسول Tinker",ntt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ett():t==="fa"?ttt():Jet()}),rtt=()=>"Billing setup required",stt=()=>"需要设置账单",itt=()=>"تنظیم پرداخت لازم است",att=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",ltt=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",ctt=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",utt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"Invalid Key",ftt=()=>"密钥无效",htt=()=>"کلید نامعتبر",_tt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Token from",mtt=()=>"令牌来自",gtt=()=>"توکن از",vtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),btt=()=>"Update now",ytt=()=>"立即更新",xtt=()=>"اکنون به‌روزرسانی کن",wtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ytt():t==="fa"?xtt():btt()}),Stt=e=>`Update to ${e==null?void 0:e.version}`,ktt=e=>`更新到 ${e==null?void 0:e.version}`,Ctt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Ett=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ktt(e):t==="fa"?Ctt(e):Stt(e)}),Ntt=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",ztt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",jtt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Ttt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ztt():t==="fa"?jtt():Ntt()}),Att=()=>"Updating default destination…",Rtt=()=>"正在更新默认运行位置…",Mtt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Dtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rtt():t==="fa"?Mtt():Att()}),Ltt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",Ott=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Itt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Btt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ott():t==="fa"?Itt():Ltt()}),$tt=()=>"Validating…",Ptt=()=>"正在验证…",Ftt=()=>"در حال اعتبارسنجی…",zL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ptt():t==="fa"?Ftt():$tt()}),Htt=()=>"View settings",qtt=()=>"查看设置",Utt=()=>"مشاهدهٔ تنظیمات",Gtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qtt():t==="fa"?Utt():Htt()}),Wtt=()=>"Skill",Vtt=()=>"技能",Ktt=()=>"مهارت",Qtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vtt():t==="fa"?Ktt():Wtt()}),Ytt=()=>"Loading skill…",Xtt=()=>"正在加载技能…",Ztt=()=>"در حال بارگیری مهارت…",Jtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xtt():t==="fa"?Ztt():Ytt()}),ent=()=>"Personal",tnt=()=>"个人",nnt=()=>"شخصی",rnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Alternatively, tell your agent to save a reusable skill for you.",int=()=>"或者,请你的智能体为你保存可重复使用的技能。",ant=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",ont=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,cnt=e=>`删除技能“${e==null?void 0:e.name}”?`,unt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,dnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cnt(e):t==="fa"?unt(e):lnt(e)}),fnt=e=>`Delete skill ${e==null?void 0:e.name}`,hnt=e=>`删除技能 ${e==null?void 0:e.name}`,_nt=e=>`حذف مهارت ${e==null?void 0:e.name}`,pnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hnt(e):t==="fa"?_nt(e):fnt(e)}),mnt=e=>`Delete the “${e==null?void 0:e.name}” template?`,gnt=e=>`删除模板“${e==null?void 0:e.name}”?`,vnt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,bnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gnt(e):t==="fa"?vnt(e):mnt(e)}),ynt=e=>`Delete template ${e==null?void 0:e.name}`,xnt=e=>`删除模板 ${e==null?void 0:e.name}`,wnt=e=>`حذف قالب ${e==null?void 0:e.name}`,Snt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xnt(e):t==="fa"?wnt(e):ynt(e)}),knt=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",Cnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Ent=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Nnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cnt():t==="fa"?Ent():knt()}),znt=()=>"Drop a SKILL.md or .zip here, or click to choose",jnt=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Tnt=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Ant=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jnt():t==="fa"?Tnt():znt()}),Rnt=()=>"Drop a .tex or .zip here, or click to choose",Mnt=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Dnt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Lnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mnt():t==="fa"?Dnt():Rnt()}),Ont=()=>"File too large (max 20 MB).",Int=()=>"文件过大(最大 20 MB)。",Bnt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",jL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Int():t==="fa"?Bnt():Ont()}),$nt=()=>" + 1 file",Pnt=()=>" + 1 个文件",Fnt=()=>" + ۱ فایل",Hnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pnt():t==="fa"?Fnt():$nt()}),qnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Unt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Gnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Wnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Remove from OpenResearch",Knt=()=>"从 OpenResearch 移除",Qnt=()=>"حذف از OpenResearch",Ynt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,Znt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,Jnt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,ert=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Znt(e):t==="fa"?Jnt(e):Xnt(e)}),trt=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,nrt=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,rrt=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,srt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nrt(e):t==="fa"?rrt(e):trt(e)}),irt=e=>` + ${e==null?void 0:e.count} files`,art=e=>` + ${e==null?void 0:e.count} 个文件`,ort=e=>` + ${e==null?void 0:e.count} فایل`,lrt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?art(e):t==="fa"?ort(e):irt(e)}),crt=()=>"Could not load skills:",urt=()=>"无法加载技能:",drt=()=>"بارگیری مهارت‌ها ممکن نشد:",frt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?urt():t==="fa"?drt():crt()}),hrt=()=>"Could not load templates:",_rt=()=>"无法加载模板:",prt=()=>"بارگیری قالب‌ها ممکن نشد:",mrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"Customize",vrt=()=>"自定义",brt=()=>"سفارشی‌سازی",yrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"Delete skill",wrt=()=>"删除技能",Srt=()=>"حذف مهارت",krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Delete template",Ert=()=>"删除模板",Nrt=()=>"حذف قالب",zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"LaTeX templates",Trt=()=>"LaTeX 模板",Art=()=>"قالب‌های LaTeX",Rrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"Loading skills…",Drt=()=>"正在加载技能…",Lrt=()=>"در حال بارگیری مهارت‌ها…",Ort=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Loading templates…",Brt=()=>"正在加载模板…",$rt=()=>"در حال بارگیری قالب‌ها…",Prt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"No skills yet.",Hrt=()=>"尚无技能。",qrt=()=>"هنوز مهارتی وجود ندارد.",Urt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"No templates yet.",Wrt=()=>"尚无模板。",Vrt=()=>"هنوز قالبی وجود ندارد.",Krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"Skills",Yrt=()=>"技能",Xrt=()=>"مهارت‌ها",Zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Uploading…",est=()=>"正在上传…",tst=()=>"در حال بارگذاری…",nst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",sst=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",ist=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ast=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"Upload a SKILL.md file or a .zip of a skill folder.",lst=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",cst=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",ust=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Upload a .tex file or a .zip of a template folder.",fst=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",hst=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",_st=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),pst=()=>"Close SSH config",mst=()=>"关闭 SSH 配置",gst=()=>"بستن پیکربندی SSH",vst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mst():t==="fa"?gst():pst()}),bst=()=>"Discard your unsaved SSH config changes?",yst=()=>"要放弃未保存的 SSH 配置更改吗?",xst=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",wst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yst():t==="fa"?xst():bst()}),Sst=()=>"Loading SSH config…",kst=()=>"正在加载 SSH 配置…",Cst=()=>"در حال بارگیری پیکربندی SSH…",Est=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kst():t==="fa"?Cst():Sst()}),Nst=()=>"SSH config saved",zst=()=>"SSH 配置已保存",jst=()=>"پیکربندی SSH ذخیره شد",Tst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zst():t==="fa"?jst():Nst()}),Ast=()=>"SSH config",Rst=()=>"SSH 配置",Mst=()=>"پیکربندی SSH",Dst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rst():t==="fa"?Mst():Ast()}),Lst=()=>"Configure SSH hosts…",Ost=()=>"配置 SSH 主机…",Ist=()=>"پیکربندی میزبان‌های SSH…",TL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ost():t==="fa"?Ist():Lst()}),Bst=()=>"Cancelled",$st=()=>"已取消",Pst=()=>"لغوشده",Fst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$st():t==="fa"?Pst():Bst()}),Hst=()=>"Cancelling",qst=()=>"正在取消",Ust=()=>"در حال لغو",Gst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Done",Vst=()=>"已完成",Kst=()=>"انجام‌شده",Qst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Editing",Xst=()=>"正在编辑",Zst=()=>"در حال ویرایش",Jst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=()=>"Failed",tit=()=>"失败",nit=()=>"ناموفق",rit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tit():t==="fa"?nit():eit()}),sit=()=>"Idle",iit=()=>"空闲",ait=()=>"بی‌کار",oit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iit():t==="fa"?ait():sit()}),lit=()=>"Running",cit=()=>"运行中",uit=()=>"در حال اجرا",dit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Starting",hit=()=>"正在启动",_it=()=>"در حال آغاز",pit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Copying…",git=()=>"正在复制…",vit=()=>"در حال کپی…",bit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>"Finalizing…",xit=()=>"正在完成…",wit=()=>"در حال نهایی‌سازی…",Sit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=e=>`${e==null?void 0:e.size} free at target`,Cit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,Eit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,Nit=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Cit(e):t==="fa"?Eit(e):kit(e)}),zit=e=>`Move all orx data to: +رونوشت آن برای همیشه حذف خواهد شد.`,Qie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Xie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Zie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Jie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xie(e):t==="fa"?Zie(e):Yie(e)}),eae=()=>"Could not exit Plan mode. Try again.",tae=()=>"无法退出计划模式。请重试。",nae=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",rae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Expand tool activity",iae=()=>"展开工具活动",aae=()=>"باز کردن فعالیت ابزارها",oae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=()=>"experiments",cae=()=>"实验",uae=()=>"آزمایش‌ها",dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cae():t==="fa"?uae():lae()}),fae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,hae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,_ae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,pae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,gae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,vae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,bae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=e=>`Message not sent: ${e==null?void 0:e.error}`,xae=e=>`消息未发送:${e==null?void 0:e.error}`,wae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,Sae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xae(e):t==="fa"?wae(e):yae(e)}),kae=()=>"Model unavailable",Cae=()=>"模型不可用",Eae=()=>"مدل در دسترس نیست",Nae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),zae=()=>"New session",jae=()=>"新会话",Tae=()=>"نشست جدید",hE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jae():t==="fa"?Tae():zae()}),Aae=()=>"No active sessions",Rae=()=>"没有活跃会话",Mae=()=>"نشست فعالی وجود ندارد",Dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No activity",Oae=()=>"无活动",Iae=()=>"بدون فعالیت",Bae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No archived sessions",Pae=()=>"没有已归档的会话",Fae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"No sessions yet",Uae=()=>"还没有会话",Gae=()=>"هنوز نشستی وجود ندارد",Wae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"1 annotation",Kae=()=>"1 条批注",Qae=()=>"۱ یادداشت",Yae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"Open sub-agent transcript",Zae=()=>"打开子智能体记录",Jae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",eoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),toe=()=>"About this demo",noe=()=>"关于此演示",roe=()=>"دربارهٔ این نسخهٔ نمایشی",_E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?noe():t==="fa"?roe():toe()}),soe=()=>"Accept and auto mode",ioe=()=>"接受并使用自动模式",aoe=()=>"پذیرش و حالت خودکار",ooe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Accept and bypass all",coe=()=>"接受并跳过所有审批",uoe=()=>"پذیرش و عبور از همهٔ تأییدها",doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"Active",hoe=()=>"活跃",_oe=()=>"فعال",poe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"All",goe=()=>"全部",voe=()=>"همه",boe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Allow",xoe=()=>"允许",woe=()=>"اجازه دادن",Soe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Approval required",Coe=()=>"需要批准",Eoe=()=>"نیازمند تأیید",Noe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Archived",joe=()=>"已归档",Toe=()=>"بایگانی‌شده",pE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Aoe=()=>"Ask about this",Roe=()=>"询问此内容",Moe=()=>"دربارهٔ این بپرسید",Doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Loe=()=>"Attach a PDF or image",Ooe=()=>"附加 PDF 或图片",Ioe=()=>"پیوست PDF یا تصویر",mE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),Boe=()=>"Bash",$oe=()=>"Bash",Poe=()=>"Bash",xD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$oe():t==="fa"?Poe():Boe()}),Foe=()=>"Browsed the web",Hoe=()=>"已浏览网页",qoe=()=>"وب مرور شد",gE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hoe():t==="fa"?qoe():Foe()}),Uoe=()=>"Built the project",Goe=()=>"已构建项目",Woe=()=>"پروژه ساخته شد",Voe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancel",Qoe=()=>"取消",Yoe=()=>"لغو",Xoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Cancelled an experiment run",Joe=()=>"已取消实验运行",ele=()=>"اجرای آزمایش لغو شد",tle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked code style",rle=()=>"已检查代码风格",sle=()=>"سبک کد بررسی شد",ile=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked compute options",ole=()=>"已检查算力选项",lle=()=>"گزینه‌های رایانشی بررسی شد",cle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=()=>"Checked experiment status",dle=()=>"已检查实验状态",fle=()=>"وضعیت آزمایش بررسی شد",vE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dle():t==="fa"?fle():ule()}),hle=()=>"Checked Git status",_le=()=>"已检查 Git 状态",ple=()=>"وضعیت Git بررسی شد",mle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked local times",vle=()=>"已查询当地时间",ble=()=>"زمان‌های محلی بررسی شد",yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked market data",wle=()=>"已查询市场数据",Sle=()=>"داده‌های بازار بررسی شد",kle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked sports data",Ele=()=>"已查询体育数据",Nle=()=>"داده‌های ورزشی بررسی شد",zle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked the weather",Tle=()=>"已查询天气",Ale=()=>"آب‌وهوا بررسی شد",Rle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Checked types",Dle=()=>"已检查类型",Lle=()=>"نوع‌ها بررسی شد",Ole=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ile=()=>"Clear annotations",Ble=()=>"清除批注",$le=()=>"پاک کردن یادداشت‌ها",bE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Customize",Fle=()=>"自定义",Hle=()=>"سفارشی‌سازی",qle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),Ule=()=>"Data sources",Gle=()=>"数据源",Wle=()=>"منابع داده",w2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gle():t==="fa"?Wle():Ule()}),Vle=()=>"Delegated a task to a new agent",Kle=()=>"已将任务委派给新智能体",Qle=()=>"وظیفه به عامل جدید واگذار شد",Yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Xle=()=>"Delete",Zle=()=>"删除",Jle=()=>"حذف",wD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zle():t==="fa"?Jle():Xle()}),ece=()=>"Deny",tce=()=>"拒绝",nce=()=>"رد کردن",rce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),sce=()=>"Edit and re-send",ice=()=>"编辑并重新发送",ace=()=>"ویرایش و ارسال دوباره",yE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ice():t==="fa"?ace():sce()}),oce=()=>"Edit message",lce=()=>"编辑消息",cce=()=>"ویرایش پیام",uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),dce=()=>"Edited a file",fce=()=>"已编辑文件",hce=()=>"فایل ویرایش شد",xE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fce():t==="fa"?hce():dce()}),_ce=()=>"Exit Bash mode",pce=()=>"退出 Bash 模式",mce=()=>"خروج از حالت Bash",wE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pce():t==="fa"?mce():_ce()}),gce=()=>"Exit Plan mode",vce=()=>"退出计划模式",bce=()=>"خروج از حالت طرح",SE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vce():t==="fa"?bce():gce()}),yce=()=>"Failed:",xce=()=>"失败:",wce=()=>"ناموفق:",t6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xce():t==="fa"?wce():yce()}),Sce=()=>"Filter sessions",kce=()=>"筛选会话",Cce=()=>"فیلتر نشست‌ها",kE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"is unavailable.",Nce=()=>"不可用。",zce=()=>"در دسترس نیست.",jce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Later queued messages will wait until this is retried or removed.",Ace=()=>"后续排队的消息会等待此消息重试或移除。",Rce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Mce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Dce=()=>"Listed files",Lce=()=>"已列出文件",Oce=()=>"فایل‌ها فهرست شد",CE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lce():t==="fa"?Oce():Dce()}),Ice=()=>"Listed project runs",Bce=()=>"已列出项目运行",$ce=()=>"اجراهای پروژه فهرست شد",Pce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Listed projects",Hce=()=>"已列出项目",qce=()=>"پروژه‌ها فهرست شد",Uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"Loading conversation…",Wce=()=>"正在加载对话…",Vce=()=>"در حال بارگیری گفتگو…",Kce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"New Chat",Yce=()=>"新对话",Xce=()=>"گفتگوی جدید",Zce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Jce=()=>"Next version",eue=()=>"下一版本",tue=()=>"نسخهٔ بعدی",EE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),nue=()=>"Open the session this agent spawned",rue=()=>"打开此智能体创建的会话",sue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",iue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Opened web pages",oue=()=>"已打开网页",lue=()=>"صفحه‌های وب باز شد",cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan",due=()=>"计划",fue=()=>"طرح",hue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan approved",pue=()=>"计划已批准",mue=()=>"طرح تأیید شد",gue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan rejected",bue=()=>"计划已拒绝",yue=()=>"طرح رد شد",xue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan resolved",Sue=()=>"计划已处理",kue=()=>"طرح تعیین تکلیف شد",Cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Plan revision requested",Nue=()=>"已请求修改计划",zue=()=>"درخواست بازنگری طرح ثبت شد",jue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),Tue=()=>"Previous version",Aue=()=>"上一版本",Rue=()=>"نسخهٔ قبلی",NE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aue():t==="fa"?Rue():Tue()}),Mue=()=>"Ran a command",Due=()=>"已运行命令",Lue=()=>"فرمان اجرا شد",Oue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Ran tests",Bue=()=>"已运行测试",$ue=()=>"آزمون‌ها اجرا شد",Pue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read a file",Hue=()=>"已读取文件",que=()=>"فایل خوانده شد",Uue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read Git history",Wue=()=>"已读取 Git 历史",Vue=()=>"تاریخچهٔ Git خوانده شد",Kue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Read project details",Yue=()=>"已读取项目详情",Xue=()=>"جزئیات پروژه خوانده شد",Zue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Reject",ede=()=>"拒绝",tde=()=>"رد کردن",nde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove",sde=()=>"移除",ide=()=>"حذف",ade=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove annotation",lde=()=>"移除批注",cde=()=>"حذف یادداشت",ude=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),dde=()=>"Remove file",fde=()=>"移除文件",hde=()=>"حذف فایل",zE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),_de=()=>"Remove image",pde=()=>"移除图片",mde=()=>"حذف تصویر",jE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),gde=()=>"Remove queued message",vde=()=>"移除排队消息",bde=()=>"حذف پیام صف",TE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vde():t==="fa"?bde():gde()}),yde=()=>"Rename",xde=()=>"重命名",wde=()=>"تغییر نام",SD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xde():t==="fa"?wde():yde()}),Sde=()=>"Reviewed code changes",kde=()=>"已审查代码更改",Cde=()=>"تغییرات کد بازبینی شد",Ede=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Nde=()=>"Run",zde=()=>"运行",jde=()=>"اجرا",AE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zde():t==="fa"?jde():Nde()}),Tde=()=>"Selected chat text",Ade=()=>"已选聊天文本",Rde=()=>"متن انتخاب‌شدهٔ گفتگو",Mde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Selected text:",Lde=()=>"已选文本:",Ode=()=>"متن انتخاب‌شده:",Ide=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Send",$de=()=>"发送",Pde=()=>"ارسال",N4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"Session options",Hde=()=>"会话选项",qde=()=>"گزینه‌های نشست",RE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hde():t==="fa"?qde():Fde()}),Ude=()=>"Session title",Gde=()=>"会话标题",Wde=()=>"عنوان نشست",Vde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Kde=()=>"Show sidebar",Qde=()=>"显示侧边栏",Yde=()=>"نمایش نوار کناری",ME=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qde():t==="fa"?Yde():Kde()}),Xde=()=>"Started an experiment run",Zde=()=>"已启动实验运行",Jde=()=>"اجرای آزمایش آغاز شد",efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Reading the project to suggest where to start…",nfe=()=>"正在阅读项目以建议从哪里开始…",rfe=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",sfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Starter prompts",afe=()=>"入门提示",ofe=()=>"پیشنهادهای شروع",lfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),cfe=()=>"Stop",ufe=()=>"停止",dfe=()=>"توقف",DE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ufe():t==="fa"?dfe():cfe()}),ffe=()=>"Submit",hfe=()=>"提交",_fe=()=>"ارسال",pfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Tool failed",gfe=()=>"工具失败",vfe=()=>"ابزار ناموفق بود",bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),yfe=()=>"Used tools",xfe=()=>"已使用工具",wfe=()=>"ابزارها استفاده شد",kD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xfe():t==="fa"?wfe():yfe()}),Sfe=()=>"View full plan",kfe=()=>"查看完整计划",Cfe=()=>"مشاهدهٔ طرح کامل",Efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waited for an experiment run",zfe=()=>"已等待实验运行",jfe=()=>"برای اجرای آزمایش صبر شد",Tfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"Waiting for your input…",Rfe=()=>"正在等待你的输入…",Mfe=()=>"منتظر ورودی شما…",Dfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"What should we research?",Ofe=()=>"我们应该研究什么?",Ife=()=>"چه چیزی را پژوهش کنیم؟",Bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"You, mid-task",Pfe=()=>"你(任务进行中)",Ffe=()=>"شما، هنگام انجام وظیفه",Hfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Pasted image",Ufe=()=>"粘贴的图片",Gfe=()=>"تصویر جای‌گذاری‌شده",Wfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Vfe=()=>"Plan",Kfe=()=>"计划",Qfe=()=>"طرح",CD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kfe():t==="fa"?Qfe():Vfe()}),Yfe=()=>"Plan mode — ready to proceed?",Xfe=()=>"计划模式 — 准备好继续了吗?",Zfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Jfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),ehe=()=>"Proposed plan",the=()=>"提议的计划",nhe=()=>"طرح پیشنهادی",LE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),rhe=()=>"Question",she=()=>"问题",ihe=()=>"پرسش",ahe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Queued",lhe=()=>"已排队",che=()=>"در صف",uhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),dhe=()=>"Recents",fhe=()=>"最近",hhe=()=>"اخیر",ED=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fhe():t==="fa"?hhe():dhe()}),_he=()=>"Re-check its setup.",phe=()=>"请重新检查其设置。",mhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",ghe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not recover this turn. Try again.",bhe=()=>"无法恢复本轮。请重试。",yhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=()=>"Could not remove the queued message. Try again.",She=()=>"无法移除排队消息。请重试。",khe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Che=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?She():t==="fa"?khe():whe()}),Ehe=e=>`Could not re-send: ${e==null?void 0:e.error}`,Nhe=e=>`无法重新发送:${e==null?void 0:e.error}`,zhe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,jhe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),The=()=>"Resolved",Ahe=()=>"已处理",Rhe=()=>"رسیدگی شد",Mhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"Could not retry the queued message. Try again.",Lhe=()=>"无法重试排队消息。请重试。",Ohe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Ihe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"run logs",$he=()=>"运行日志",Phe=()=>"گزارش‌های اجرا",Fhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Hhe=()=>"Scroll to bottom",qhe=()=>"滚动到底部",Uhe=()=>"رفتن به پایین گفتگو",OE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qhe():t==="fa"?Uhe():Hhe()}),Ghe=()=>"The selected harness is unavailable",Whe=()=>"所选智能体工具不可用",Vhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",S2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Whe():t==="fa"?Vhe():Ghe()}),Khe=()=>"Session limit reached",Qhe=()=>"已达到会话使用限额",Yhe=()=>"به سقف مصرف نشست رسیده‌اید",Xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"The chat session was not created",Jhe=()=>"未能创建聊天会话",e_e=()=>"نشست گفت‌وگو ایجاد نشد",t_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>"Show full conversation",r_e=()=>"显示完整对话",s_e=()=>"نمایش کامل گفتگو",i_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>" · Spawned by another agent",o_e=()=>" · 由另一个智能体创建",l_e=()=>" · ساخته‌شده به‌دست عامل دیگر",c_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=()=>"Starting…",d_e=()=>"正在启动…",f_e=()=>"در حال شروع…",h_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d_e():t==="fa"?f_e():u_e()}),__e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,p_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,m_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,g_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p_e(e):t==="fa"?m_e(e):__e(e)}),v_e=()=>"Could not stop the turn. Try again.",b_e=()=>"无法停止本轮。请重试。",y_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",x_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b_e():t==="fa"?y_e():v_e()}),w_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,S_e=e=>`无法切换分支:${e==null?void 0:e.error}`,k_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,C_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S_e(e):t==="fa"?k_e(e):w_e(e)}),E_e=()=>"The agent",N_e=()=>"智能体",z_e=()=>"عامل",j_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Thinking",A_e=()=>"正在思考",R_e=()=>"در حال فکر کردن",M_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),D_e=()=>"Could not toggle Plan mode. Try again.",L_e=()=>"无法切换计划模式。请重试。",O_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",IE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=()=>"This turn did not finish.",B_e=()=>"本轮未完成。",$_e=()=>"این نوبت کامل نشد.",BE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),P_e=()=>"Type a custom answer…",F_e=()=>"输入自定义回答…",H_e=()=>"پاسخ دلخواه را بنویسید…",q_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Unarchive",G_e=()=>"取消归档",W_e=()=>"خارج کردن از بایگانی",V_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),K_e=()=>"Untitled",Q_e=()=>"未命名",Y_e=()=>"بدون عنوان",Ng=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q_e():t==="fa"?Y_e():K_e()}),X_e=()=>"Could not update permissions. Try again.",Z_e=()=>"无法更新权限。请重试。",J_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",e0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=()=>"Work details",n0e=()=>"工作详情",r0e=()=>"جزئیات کار",s0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),i0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,a0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,o0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,l0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=e=>`Worked for ${e==null?void 0:e.duration}`,u0e=e=>`已工作 ${e==null?void 0:e.duration}`,d0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,f0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u0e(e):t==="fa"?d0e(e):c0e(e)}),h0e=()=>"Working…",_0e=()=>"正在工作…",p0e=()=>"در حال کار…",n6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_0e():t==="fa"?p0e():h0e()}),m0e=()=>"Close tab",g0e=()=>"关闭标签页",v0e=()=>"بستن زبانه",b0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),y0e=()=>"Changes",x0e=()=>"更改",w0e=()=>"تغییرات",ND=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x0e():t==="fa"?w0e():y0e()}),S0e=()=>"Code browser view",k0e=()=>"代码浏览器视图",C0e=()=>"نمای مرورگر کد",E0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Files",z0e=()=>"文件",j0e=()=>"فایل‌ها",T0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Refresh",R0e=()=>"刷新",M0e=()=>"تازه‌سازی",$E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"listing truncated",L0e=()=>"列表已截断",O0e=()=>"فهرست کوتاه شده است",I0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"No files.",$0e=()=>"没有文件。",P0e=()=>"فایلی وجود ندارد.",F0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Refresh failed:",q0e=()=>"刷新失败:",U0e=()=>"تازه‌سازی ناموفق بود:",G0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Cancelling…",V0e=()=>"正在取消…",K0e=()=>"در حال لغو…",Q0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Y0e=()=>"Checking…",X0e=()=>"正在检查…",Z0e=()=>"در حال بررسی…",Xi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X0e():t==="fa"?Z0e():Y0e()}),J0e=()=>"Copied",epe=()=>"已复制",tpe=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),npe=e=>`Failed to load: ${e==null?void 0:e.error}`,rpe=e=>`加载失败:${e==null?void 0:e.error}`,spe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,zD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?rpe(e):t==="fa"?spe(e):npe(e)}),ipe=()=>"Loading…",ape=()=>"正在加载…",ope=()=>"در حال بارگیری…",jD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),lpe=e=>`+ ${e==null?void 0:e.count} more`,cpe=e=>`另有 ${e==null?void 0:e.count} 项`,upe=e=>`${e==null?void 0:e.count}+ مورد دیگر`,dpe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cpe(e):t==="fa"?upe(e):lpe(e)}),fpe=()=>"Rendered view",hpe=()=>"渲染视图",_pe=()=>"نمای رندرشده",rv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hpe():t==="fa"?_pe():fpe()}),ppe=()=>"Save",mpe=()=>"保存",gpe=()=>"ذخیره",no=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mpe():t==="fa"?gpe():ppe()}),vpe=()=>"Saving…",bpe=()=>"正在保存…",ype=()=>"در حال ذخیره…",Ei=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bpe():t==="fa"?ype():vpe()}),xpe=()=>"Show less",wpe=()=>"收起",Spe=()=>"نمایش کمتر",TD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wpe():t==="fa"?Spe():xpe()}),kpe=()=>"Show more",Cpe=()=>"展开",Epe=()=>"نمایش بیشتر",Npe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),zpe=()=>"Stop",jpe=()=>"停止",Tpe=()=>"توقف",AD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Ape=()=>"Stopping…",Rpe=()=>"正在停止…",Mpe=()=>"در حال توقف…",Dpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Lpe=()=>"View source",Ope=()=>"查看源代码",Ipe=()=>"نمایش متن منبع",rh=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ope():t==="fa"?Ipe():Lpe()}),Bpe=()=>"Runs as a remote Hugging Face Job",$pe=()=>"作为远程 Hugging Face Job 运行",Ppe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs as a Job on your Kubernetes cluster",qpe=()=>"作为 Kubernetes 集群上的 Job 运行",Upe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs directly on this computer",Vpe=()=>"直接在此计算机上运行",Kpe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs in a remote Modal sandbox",Xpe=()=>"在远程 Modal 沙箱中运行",Zpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on an ephemeral OpenResearch box",tme=()=>"在临时 OpenResearch 主机上运行",nme=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs on the connected Ray cluster",ime=()=>"在已连接的 Ray 集群上运行",ame=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs as a scheduled job on your Slurm cluster",cme=()=>"作为 Slurm 集群上的调度作业运行",ume=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs on a host from your SSH config",hme=()=>"在 SSH 配置中的主机上运行",_me=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"Runs through Tinker’s remote compute",gme=()=>"通过 Tinker 远程算力运行",vme=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"HF Jobs",xme=()=>"HF Jobs",wme=()=>"HF Jobs",Sme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"Kubernetes",Cme=()=>"Kubernetes",Eme=()=>"Kubernetes",Nme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"This machine",jme=()=>"此计算机",Tme=()=>"این رایانه",RD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jme():t==="fa"?Tme():zme()}),Ame=()=>"Modal",Rme=()=>"Modal",Mme=()=>"Modal",Dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"OpenResearch",Ome=()=>"OpenResearch",Ime=()=>"OpenResearch",Bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Ray",Pme=()=>"Ray",Fme=()=>"Ray",Hme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"Slurm",Ume=()=>"Slurm",Gme=()=>"Slurm",Wme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"SSH",Kme=()=>"SSH",Qme=()=>"SSH",Yme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"Tinker",Zme=()=>"Tinker",Jme=()=>"Tinker",ege=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",nge=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",rge=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",sge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",age=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",oge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",lge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",uge=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",dge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",fge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"This computer must stay awake and online while Tinker runs.",_ge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",pge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",mge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window",vge=()=>"上下文窗口",bge=()=>"پنجرهٔ زمینه",yge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=()=>"Context window used",wge=()=>"已使用的上下文窗口",Sge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",kge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wge():t==="fa"?Sge():xge()}),Cge=e=>`${e==null?void 0:e.value} tokens`,Ege=e=>`${e==null?void 0:e.value} 个 token`,Nge=e=>`${e==null?void 0:e.value} توکن`,zge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Age=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Rge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tge(e):t==="fa"?Age(e):jge(e)}),Mge=()=>"No runs yet — ask the agent to launch one.",Dge=()=>"尚无运行——让智能体启动一个。",Lge=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Oge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Ige=()=>"Run",Bge=()=>"运行",$ge=()=>"اجرا",PE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bge():t==="fa"?$ge():Ige()}),Pge=()=>"Switch run",Fge=()=>"切换运行",Hge=()=>"تغییر اجرا",qge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fge():t==="fa"?Hge():Pge()}),Uge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Gge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Wge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Qge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Yge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Xge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}m`,Jge=e=>`${e==null?void 0:e.value} 分钟`,e1e=e=>`${e==null?void 0:e.value} دقیقه`,t1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=e=>`${e==null?void 0:e.value}s`,r1e=e=>`${e==null?void 0:e.value} 秒`,s1e=e=>`${e==null?void 0:e.value} ثانیه`,i1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):n1e(e)}),a1e=()=>"Code",o1e=()=>"代码",l1e=()=>"کد",c1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"created",d1e=()=>"创建于",f1e=()=>"ایجادشده",h1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"from",p1e=()=>"来自",m1e=()=>"از",g1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Logs",b1e=()=>"日志",y1e=()=>"گزارش‌ها",x1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Latest run",S1e=()=>"最新运行",k1e=()=>"آخرین اجرا",C1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Code",N1e=()=>"代码",z1e=()=>"کد",j1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"Commit",A1e=()=>"提交",R1e=()=>"کامیت",M1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"created",L1e=()=>"创建于",O1e=()=>"ایجادشده",I1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Description",$1e=()=>"说明",P1e=()=>"توضیحات",F1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"Duration",q1e=()=>"时长",U1e=()=>"مدت",G1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"exit",V1e=()=>"退出码",K1e=()=>"خروج",Q1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"from",X1e=()=>"来自",Z1e=()=>"از",J1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Logs",tve=()=>"日志",nve=()=>"گزارش‌ها",rve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run",ive=()=>"运行",ave=()=>"اجرا",ove=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Run history",cve=()=>"运行历史",uve=()=>"تاریخچهٔ اجرا",dve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Started",hve=()=>"开始时间",_ve=()=>"آغاز",pve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Runs",gve=()=>"运行",vve=()=>"اجراها",bve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",xve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",wve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",Sve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No runs yet",Cve=()=>"还没有运行",Eve=()=>"هنوز اجرایی وجود ندارد",Nve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"No experiments yet.",jve=()=>"还没有实验。",Tve=()=>"هنوز آزمایشی وجود ندارد.",Ave=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Not run yet",Mve=()=>"尚未运行",Dve=()=>"هنوز اجرا نشده",Lve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"1 run",Ive=()=>"1 次运行",Bve=()=>"۱ اجرا",$ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"Open logs",Fve=()=>"打开日志",Hve=()=>"باز کردن گزارش‌ها",qve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fve():t==="fa"?Hve():Pve()}),Uve=e=>`${e==null?void 0:e.count} runs`,Gve=e=>`${e==null?void 0:e.count} 次运行`,Wve=e=>`${e==null?void 0:e.count} اجرا`,Vve=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gve(e):t==="fa"?Wve(e):Uve(e)}),Kve=()=>"Stop requested",Qve=()=>"已请求停止",Yve=()=>"درخواست توقف ثبت شد",Xve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Stop run",Jve=()=>"停止运行",ebe=()=>"توقف اجرا",tbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Code",rbe=()=>"代码",sbe=()=>"کد",ibe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Experiments",obe=()=>"实验",lbe=()=>"آزمایش‌ها",cbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Logs",dbe=()=>"日志",fbe=()=>"گزارش‌ها",hbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Stop failed:",pbe=()=>"停止失败:",mbe=()=>"توقف ناموفق بود:",gbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),vbe=()=>"Clipboard access is unavailable.",bbe=()=>"无法访问剪贴板。",ybe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",MD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bbe():t==="fa"?ybe():vbe()}),xbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,wbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,Sbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,kbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):xbe(e)}),Cbe=()=>"Duplicate",Ebe=()=>"创建副本",Nbe=()=>"ایجاد نسخهٔ تکراری",zbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),jbe=e=>`File actions for ${e==null?void 0:e.path}`,Tbe=e=>`${e==null?void 0:e.path} 的文件操作`,Abe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Rbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tbe(e):t==="fa"?Abe(e):jbe(e)}),Mbe=()=>"Open",Dbe=()=>"打开",Lbe=()=>"باز کردن",Obe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Mbe()}),Ibe=e=>`Rename ${e==null?void 0:e.path}`,Bbe=e=>`重命名 ${e==null?void 0:e.path}`,$be=e=>`تغییر نام ${e==null?void 0:e.path}`,Pbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Hbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,qbe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Ube=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Hbe(e):t==="fa"?qbe(e):Fbe(e)}),Gbe=()=>"Binary file — no inline preview.",Wbe=()=>"二进制文件——无法内嵌预览。",Vbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Kbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Qbe=()=>"This file changed on disk. Your edits have not been overwritten.",Ybe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Xbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",FE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Qbe()}),Zbe=()=>"Compile failed",Jbe=()=>"编译失败",eye=()=>"کامپایل ناموفق بود",tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),nye=()=>"Compile PDF",rye=()=>"编译 PDF",sye=()=>"کامپایل PDF",HE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rye():t==="fa"?sye():nye()}),iye=()=>"Compiled, but the engine reported errors — check the output below.",aye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",oye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",lye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy command",uye=()=>"复制命令",dye=()=>"کپی فرمان",fye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Copy install command",_ye=()=>"复制安装命令",pye=()=>"کپی فرمان نصب",mye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"This file was deleted on disk. Your edits have not been discarded.",vye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",bye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",qE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vye():t==="fa"?bye():gye()}),yye=()=>"Discard my edits and reload",xye=()=>"放弃我的编辑并重新加载",wye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Sye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),kye=()=>"Discard unsaved changes and close this file?",Cye=()=>"要丢弃未保存的更改并关闭此文件吗?",Eye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",UE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cye():t==="fa"?Eye():kye()}),Nye=()=>"Dismiss",zye=()=>"关闭",jye=()=>"بستن",Tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss compile message",Rye=()=>"关闭编译消息",Mye=()=>"بستن پیام کامپایل",Dye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Dismiss Overleaf message",Oye=()=>"关闭 Overleaf 消息",Iye=()=>"بستن پیام Overleaf",Bye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),$ye=()=>"Download",Pye=()=>"下载",Fye=()=>"بارگیری",DD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pye():t==="fa"?Fye():$ye()}),Hye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,qye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Uye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Gye=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qye(e):t==="fa"?Uye(e):Hye(e)}),Wye=()=>"Failed to load file:",Vye=()=>"加载文件失败:",Kye=()=>"بارگیری فایل ناموفق بود:",GE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vye():t==="fa"?Kye():Wye()}),Qye=()=>"File truncated — showing the first 512 KB.",Yye=()=>"文件已截断——仅显示前 512 KB。",Xye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Zye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=()=>"The page below stops partway — the full file could not be loaded.",exe=()=>"下方页面在中途结束——无法加载完整文件。",txe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",nxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?exe():t==="fa"?txe():Jye()}),rxe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,sxe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ixe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,axe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sxe(e):t==="fa"?ixe(e):rxe(e)}),oxe=()=>"Loading…",lxe=()=>"正在加载…",cxe=()=>"در حال بارگیری…",LD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lxe():t==="fa"?cxe():oxe()}),uxe=()=>"File not found.",dxe=()=>"找不到文件。",fxe=()=>"فایل پیدا نشد.",hxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dxe():t==="fa"?fxe():uxe()}),_xe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pxe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mxe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pxe(e):t==="fa"?mxe(e):_xe(e)}),vxe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,bxe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,yxe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,xxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bxe(e):t==="fa"?yxe(e):vxe(e)}),wxe=()=>"File not found on disk.",Sxe=()=>"磁盘上找不到此文件。",kxe=()=>"فایل روی دیسک پیدا نشد.",Cxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Nxe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,zxe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,jxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nxe(e):t==="fa"?zxe(e):Exe(e)}),Txe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Axe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Rxe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Mxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Axe(e):t==="fa"?Rxe(e):Txe(e)}),Dxe=()=>"Open in default editor",Lxe=()=>"在默认编辑器中打开",Oxe=()=>"باز کردن در ویرایشگر پیش‌فرض",WE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Ixe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Bxe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",$xe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Pxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Fxe=()=>"Overwrite disk file",Hxe=()=>"覆盖磁盘文件",qxe=()=>"بازنویسی فایل روی دیسک",Uxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hxe():t==="fa"?qxe():Fxe()}),Gxe=()=>"Compiled PDF is out of date",Wxe=()=>"已编译的 PDF 不是最新版本",Vxe=()=>"PDF کامپایل‌شده به‌روز نیست",Kxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wxe():t==="fa"?Vxe():Gxe()}),Qxe=()=>"project clone",Yxe=()=>"项目克隆",Xxe=()=>"کلون پروژه",zg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yxe():t==="fa"?Xxe():Qxe()}),Zxe=()=>"Recompile PDF",Jxe=()=>"重新编译 PDF",e2e=()=>"کامپایل دوبارهٔ PDF",VE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jxe():t==="fa"?e2e():Zxe()}),t2e=()=>"Reload from disk",n2e=()=>"从磁盘重新加载",r2e=()=>"بارگذاری مجدد از دیسک",s2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Save failed",a2e=()=>"保存失败",o2e=()=>"ذخیره ناموفق بود",l2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Saving…",u2e=()=>"正在保存…",d2e=()=>"در حال ذخیره…",f2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Selected — press ⌘C",_2e=()=>"已选中 — 按 ⌘C 复制",p2e=()=>"انتخاب شد — برای کپی ⌘C را بزنید",m2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"session’s worktree",v2e=()=>"会话工作树",b2e=()=>"درخت کاری نشست",jg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v2e():t==="fa"?b2e():g2e()}),y2e=()=>"Show compiled PDF",x2e=()=>"显示已编译的 PDF",w2e=()=>"نمایش PDF کامپایل‌شده",KE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x2e():t==="fa"?w2e():y2e()}),S2e=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",k2e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",C2e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",E2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"This session's worktree isn't available — showing the project clone's copy.",z2e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",j2e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",T2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z2e():t==="fa"?j2e():N2e()}),A2e=()=>"Unsaved",R2e=()=>"未保存",M2e=()=>"ذخیره نشده",OD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R2e():t==="fa"?M2e():A2e()}),D2e=()=>"Unsaved — ⌘S to save",L2e=()=>"未保存 — 按 ⌘S 保存",O2e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",I2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L2e():t==="fa"?O2e():D2e()}),B2e=()=>"Update orx on the remote machine to edit this file safely.",$2e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",P2e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",F2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$2e():t==="fa"?P2e():B2e()}),H2e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",q2e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",U2e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",G2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q2e():t==="fa"?U2e():H2e()}),W2e=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",V2e=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",K2e=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Q2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V2e():t==="fa"?K2e():W2e()}),Y2e=()=>"Back to preview",X2e=()=>"返回预览",Z2e=()=>"بازگشت به پیش‌نمایش",J2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),ewe=e=>`${e==null?void 0:e.count} changed files`,twe=e=>`${e==null?void 0:e.count} 个已更改文件`,nwe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,ID=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?twe(e):t==="fa"?nwe(e):ewe(e)}),rwe=()=>"Changed files",swe=()=>"已更改文件",iwe=()=>"فایل‌های تغییرکرده",awe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Diff preview truncated",lwe=()=>"差异预览已截断",cwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),dwe=e=>`${e==null?void 0:e.count} files shown (partial)`,fwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,_we=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fwe(e):t==="fa"?hwe(e):dwe(e)}),pwe=()=>"No changes.",mwe=()=>"没有更改。",gwe=()=>"تغییری وجود ندارد.",vwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No complete file preview was available before the cutoff.",ywe=()=>"在截断位置之前没有完整的文件预览。",xwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",wwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"No textual diff for this file.",kwe=()=>"此文件没有文本差异。",Cwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Ewe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"1 changed file",zwe=()=>"1 个已更改文件",jwe=()=>"۱ فایل تغییرکرده",BD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zwe():t==="fa"?jwe():Nwe()}),Twe=()=>"1 file shown (partial)",Awe=()=>"显示 1 个文件(部分)",Rwe=()=>"۱ فایل نمایش داده شده (ناقص)",Mwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=()=>"Unable to parse this diff.",Lwe=()=>"无法解析此差异。",Owe=()=>"خواندن این تفاوت ممکن نبود.",Iwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lwe():t==="fa"?Owe():Dwe()}),Bwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$we=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Pwe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Fwe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$we(e):t==="fa"?Pwe(e):Bwe(e)}),Hwe=()=>"View full diff",qwe=()=>"查看完整差异",Uwe=()=>"نمایش تفاوت کامل",Gwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"Create a token ↗",Vwe=()=>"创建令牌 ↗",Kwe=()=>"ساخت توکن ↗",Qwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Ywe=()=>"All projects",Xwe=()=>"所有项目",Zwe=()=>"همهٔ پروژه‌ها",QE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xwe():t==="fa"?Zwe():Ywe()}),Jwe=()=>"Configure Repository",e4e=()=>"配置仓库",t4e=()=>"پیکربندی مخزن",n4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Create a new project",s4e=()=>"新建项目",i4e=()=>"ایجاد پروژهٔ جدید",a4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"Hide sidebar",l4e=()=>"隐藏侧边栏",c4e=()=>"پنهان کردن نوار کناری",YE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),u4e=()=>"Project",d4e=()=>"项目",f4e=()=>"پروژه",h4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d4e():t==="fa"?f4e():u4e()}),_4e=e=>`${e==null?void 0:e.count} cancelled`,p4e=e=>`${e==null?void 0:e.count} 次取消`,m4e=e=>`${e==null?void 0:e.count} لغوشده`,g4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} done`,b4e=e=>`${e==null?void 0:e.count} 次完成`,y4e=e=>`${e==null?void 0:e.count} تمام‌شده`,x4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} failed`,S4e=e=>`${e==null?void 0:e.count} 次失败`,k4e=e=>`${e==null?void 0:e.count} ناموفق`,C4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count} files`,N4e=e=>`${e==null?void 0:e.count} 个文件`,z4e=e=>`${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count}+ files`,A4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,R4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,M4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=e=>`${e==null?void 0:e.count} live`,L4e=e=>`${e==null?void 0:e.count} 次进行中`,O4e=e=>`${e==null?void 0:e.count} فعال`,I4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L4e(e):t==="fa"?O4e(e):D4e(e)}),B4e=()=>"1 file",$4e=()=>"1 个文件",P4e=()=>"۱ فایل",F4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=()=>"1 run",q4e=()=>"1 次运行",U4e=()=>"۱ اجرا",G4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q4e():t==="fa"?U4e():H4e()}),W4e=e=>`${e==null?void 0:e.count} runs`,V4e=e=>`${e==null?void 0:e.count} 次运行`,K4e=e=>`${e==null?void 0:e.count} اجرا`,Q4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V4e(e):t==="fa"?K4e(e):W4e(e)}),Y4e=()=>"No instances yet.",X4e=()=>"还没有实例。",Z4e=()=>"هنوز نمونه‌ای وجود ندارد.",J4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Nothing running right now.",t3e=()=>"当前没有运行中的实例。",n3e=()=>"اکنون چیزی در حال اجرا نیست.",r3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its history.",i3e=()=>"请选择一个项目以查看其历史记录。",a3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"Select a project to see its runs.",c3e=()=>"请选择一个项目以查看其运行。",u3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",d3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=()=>"View history",h3e=()=>"查看历史记录",_3e=()=>"مشاهدهٔ تاریخچه",p3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h3e():t==="fa"?_3e():f3e()}),m3e=e=>`View history (${e==null?void 0:e.count})`,g3e=e=>`查看历史记录(${e==null?void 0:e.count})`,v3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,b3e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?g3e(e):t==="fa"?v3e(e):m3e(e)}),y3e=()=>"The engine exited without producing a PDF or a log.",x3e=()=>"引擎已退出,但没有生成 PDF 或日志。",w3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",S3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Loading…",C3e=()=>"正在加载…",E3e=()=>"در حال بارگیری…",N3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),z3e=()=>"Add local model",j3e=()=>"添加本地模型",T3e=()=>"افزودن مدل محلی",$D=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?j3e():t==="fa"?T3e():z3e()}),A3e=()=>"Local server address",R3e=()=>"本地服务器地址",M3e=()=>"نشانی سرور محلی",D3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"Find models",O3e=()=>"查找模型",I3e=()=>"یافتن مدل‌ها",B3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),$3e=()=>"(OpenAI compatible)",P3e=()=>"(兼容 OpenAI)",F3e=()=>"(سازگار با OpenAI)",PD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P3e():t==="fa"?F3e():$3e()}),H3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",q3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",U3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",G3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Connected",V3e=()=>"已连接",K3e=()=>"متصل شد",Q3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Context window",X3e=()=>"上下文窗口",Z3e=()=>"پنجرهٔ زمینه",J3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",t5e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",n5e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",r5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),s5e=()=>"Custom Endpoint",i5e=()=>"自定义端点",a5e=()=>"نقطهٔ اتصال سفارشی",r6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),o5e=e=>`Disconnect ${e==null?void 0:e.name}`,l5e=e=>`断开 ${e==null?void 0:e.name}`,c5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,u5e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?l5e(e):t==="fa"?c5e(e):o5e(e)}),d5e=()=>"Get OpenCode",f5e=()=>"获取 OpenCode",h5e=()=>"دریافت OpenCode",_5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",m5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",g5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",v5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"API key (optional)",y5e=()=>"API 密钥(可选)",x5e=()=>"کلید API (اختیاری)",w5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Save model",k5e=()=>"保存模型",C5e=()=>"ذخیرهٔ مدل",E5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Model server",z5e=()=>"模型服务器",j5e=()=>"سرور مدل",XE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Local models",A5e=()=>"本地模型",R5e=()=>"مدل‌های محلی",ZE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A5e():t==="fa"?R5e():T5e()}),M5e=()=>"API token (optional)",D5e=()=>"API 令牌(可选)",L5e=()=>"توکن API (اختیاری)",O5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),I5e=()=>"Copy",B5e=()=>"复制",$5e=()=>"کپی",s6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B5e():t==="fa"?$5e():I5e()}),P5e=()=>"Copy code",F5e=()=>"复制代码",H5e=()=>"کپی کد",q5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),U5e=()=>"Download",G5e=()=>"下载",W5e=()=>"بارگیری",FD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G5e():t==="fa"?W5e():U5e()}),V5e=()=>"This browser can’t preview this media format.",K5e=()=>"此浏览器无法预览该媒体格式。",Q5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Y5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>"Add Local Model",Z5e=()=>"添加本地模型",J5e=()=>"افزودن مدل محلی",e6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),t6e=()=>" · CLI configuration",n6e=()=>" · CLI 配置",r6e=()=>" · پیکربندی CLI",HD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),s6e=()=>"· Default",i6e=()=>"· 默认",a6e=()=>"· پیش‌فرض",qD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i6e():t==="fa"?a6e():s6e()}),o6e=()=>"Default model",l6e=()=>"默认模型",c6e=()=>"مدل پیش‌فرض",JE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l6e():t==="fa"?c6e():o6e()}),u6e=()=>"Detecting harnesses…",d6e=()=>"正在检测智能体工具…",f6e=()=>"در حال شناسایی ابزارهای عامل…",h6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Effort",p6e=()=>"推理强度",m6e=()=>"میزان استدلال",g6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Fast speed ·",b6e=()=>"快速 ·",y6e=()=>"سرعت بالا ·",x6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),w6e=()=>"Mode",S6e=()=>"模式",k6e=()=>"حالت",eN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),C6e=()=>"Model",E6e=()=>"模型",N6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E6e():t==="fa"?N6e():C6e()}),z6e=e=>`${e==null?void 0:e.count} more — search to find`,j6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,T6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,A6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?j6e(e):t==="fa"?T6e(e):z6e(e)}),R6e=()=>"Not available",M6e=()=>"不可用",D6e=()=>"در دسترس نیست",L6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),O6e=()=>"Search models…",I6e=()=>"搜索模型…",B6e=()=>"جست‌وجوی مدل‌ها…",UD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Sessions keep their harness. Start a new chat to switch.",P6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",F6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",H6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),q6e=()=>"Speed",U6e=()=>"速度",G6e=()=>"سرعت",tN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?U6e():t==="fa"?G6e():q6e()}),W6e=()=>"Unavailable",V6e=()=>"不可用",K6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V6e():t==="fa"?K6e():W6e()}),Q6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Y6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,X6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Z6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Y6e(e):t==="fa"?X6e(e):Q6e(e)}),J6e=()=>"Variant",eSe=()=>"变体",tSe=()=>"گونه",nSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced",sSe=()=>"高级",iSe=()=>"پیشرفته",aSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · Connect GitHub",lSe=()=>"高级 · 连接 GitHub",cSe=()=>"پیشرفته · اتصال GitHub",uSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Advanced · GitHub sync on",fSe=()=>"高级 · GitHub 同步已开启",hSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",_Se=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",mSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",gSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",vSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mSe():t==="fa"?gSe():pSe()}),bSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,ySe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,xSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,wSe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ySe(e):t==="fa"?xSe(e):bSe(e)}),SSe=()=>"Choose an existing project folder",kSe=()=>"选择现有项目文件夹",CSe=()=>"انتخاب پوشهٔ موجود پروژه",nN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kSe():t==="fa"?CSe():SSe()}),ESe=()=>"Choosing…",NSe=()=>"正在选择…",zSe=()=>"در حال انتخاب…",jSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone destination",ASe=()=>"克隆位置",RSe=()=>"مقصد کلون",MSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Clone paper project",LSe=()=>"克隆论文项目",OSe=()=>"کلون پروژهٔ مقاله",ISe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),BSe=()=>"Create project",$Se=()=>"创建项目",PSe=()=>"ایجاد پروژه",rN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Creating…",HSe=()=>"正在创建…",qSe=()=>"در حال ایجاد…",USe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),GSe=()=>"Choose a different destination. This path is a file, not a folder.",WSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",VSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",k2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WSe():t==="fa"?VSe():GSe()}),KSe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",QSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",YSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",sN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QSe():t==="fa"?YSe():KSe()}),XSe=()=>"Auto-apply repository topics",ZSe=()=>"自动添加仓库 topic",JSe=()=>"اعمال خودکار موضوع‌های مخزن",eke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.",nke=()=>"自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",rke=()=>"موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",ske=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Blank project",ake=()=>"空白项目",oke=()=>"پروژهٔ خالی",lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Cancel",uke=()=>"取消",dke=()=>"لغو",fke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Change",_ke=()=>"更改",pke=()=>"تغییر",mke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Change selected paper",vke=()=>"更改所选论文",bke=()=>"تغییر مقالهٔ انتخاب‌شده",yke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vke():t==="fa"?bke():gke()}),xke=()=>"Check out a Git branch before using this folder.",wke=()=>"使用此文件夹前,请先检出一个 Git 分支。",Ske=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",kke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wke():t==="fa"?Ske():xke()}),Cke=()=>"Checking project location.",Eke=()=>"正在检查项目位置。",Nke=()=>"در حال بررسی محل پروژه.",iN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),zke=()=>"Existing folder",jke=()=>"现有文件夹",Tke=()=>"پوشهٔ موجود",Ake=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"Experiment branches will be pushed to the remote GitHub repository.",Mke=()=>"实验分支将推送到远程 GitHub 仓库。",Dke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Oke=()=>"Extra topics (comma-separated), e.g. llm, benchmark",Ike=()=>"附加 topic(逗号分隔),例如 llm, benchmark",Bke=()=>"موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark",GD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),$ke=()=>"From a paper",Pke=()=>"从论文创建",Fke=()=>"از یک مقاله",Hke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Uke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Gke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Wke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"my-research",Kke=()=>"my-research",Qke=()=>"my-research",aN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Yke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Xke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Zke=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Jke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xke():t==="fa"?Zke():Yke()}),e7e=()=>"No public repository found on alphaXiv",t7e=()=>"在 alphaXiv 上未找到公开仓库",n7e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",r7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),s7e=()=>"OpenResearch will start a blank project with this paper's PDF.",i7e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",a7e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",o7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i7e():t==="fa"?a7e():s7e()}),l7e=()=>"Paper",c7e=()=>"论文",u7e=()=>"مقاله",d7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c7e():t==="fa"?u7e():l7e()}),f7e=()=>"Project location",h7e=()=>"项目位置",_7e=()=>"محل پروژه",C2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h7e():t==="fa"?_7e():f7e()}),p7e=()=>"Project name",m7e=()=>"项目名称",g7e=()=>"نام پروژه",oN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),v7e=()=>"Search for a paper by arXiv ID, URL, or title",b7e=()=>"按 arXiv ID、网址或标题搜索论文",y7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",x7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b7e():t==="fa"?y7e():v7e()}),w7e=()=>"Sync experiments to GitHub",S7e=()=>"将实验同步到 GitHub",k7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",C7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"That folder no longer exists. Choose it again.",N7e=()=>"该文件夹已不存在。请重新选择。",z7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",j7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),T7e=()=>"The selected folder contains an invalid Git repository.",A7e=()=>"所选文件夹包含无效的 Git 仓库。",R7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",M7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A7e():t==="fa"?R7e():T7e()}),D7e=()=>"The selected path is not a folder.",L7e=()=>"所选路径不是文件夹。",O7e=()=>"مسیر انتخاب‌شده پوشه نیست.",I7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L7e():t==="fa"?O7e():D7e()}),B7e=e=>`Checking ${e==null?void 0:e.repository}.`,$7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,P7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,F7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$7e(e):t==="fa"?P7e(e):B7e(e)}),H7e=e=>`Creates ${e==null?void 0:e.repository}.`,q7e=e=>`将创建 ${e==null?void 0:e.repository}。`,U7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,G7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?q7e(e):t==="fa"?U7e(e):H7e(e)}),W7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,V7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,K7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Q7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V7e(e):t==="fa"?K7e(e):W7e(e)}),Y7e=()=>"Project location is required.",X7e=()=>"必须填写项目位置。",Z7e=()=>"محل پروژه الزامی است.",lN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),J7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",eCe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",tCe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",cN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eCe():t==="fa"?tCe():J7e()}),nCe=()=>"A linked public code repository is cloned without credentials.",rCe=()=>"关联的公开代码仓库无需凭据即可克隆。",sCe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",iCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,oCe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,lCe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,cCe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oCe(e):t==="fa"?lCe(e):aCe(e)}),uCe=()=>"Searching alphaXiv…",dCe=()=>"正在搜索 alphaXiv…",fCe=()=>"در حال جست‌وجوی alphaXiv…",hCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Use folder",pCe=()=>"使用文件夹",mCe=()=>"استفاده از پوشه",gCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Can’t reach OpenResearch. This page is no longer live.",bCe=()=>"无法连接 OpenResearch。此页面已不再实时同步。",yCe=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",z4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"A workspace for your research agents",wCe=()=>"面向研究智能体的工作空间",SCe=()=>"فضای کاری برای عامل‌های پژوهشی شما",kCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Add papers that represent your research interests, including papers by other authors.",ECe=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",NCe=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",zCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"API key",TCe=()=>"API 密钥",ACe=()=>"کلید API",i6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),RCe=()=>"AI/ML",MCe=()=>"人工智能与机器学习",DCe=()=>"هوش مصنوعی و یادگیری ماشین",LCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MCe():t==="fa"?DCe():RCe()}),OCe=()=>"Biology",ICe=()=>"生物学",BCe=()=>"زیست‌شناسی",$Ce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),PCe=()=>"Other",FCe=()=>"其他",HCe=()=>"سایر",qCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FCe():t==="fa"?HCe():PCe()}),UCe=()=>"Physics",GCe=()=>"物理学",WCe=()=>"فیزیک",VCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GCe():t==="fa"?WCe():UCe()}),KCe=()=>"Back",QCe=()=>"返回",YCe=()=>"بازگشت",uN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QCe():t==="fa"?YCe():KCe()}),XCe=()=>"Check failed",ZCe=()=>"检查失败",JCe=()=>"بررسی ناموفق بود",e8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZCe():t==="fa"?JCe():XCe()}),t8e=()=>"Checking",n8e=()=>"正在检查",r8e=()=>"در حال بررسی",s8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"Checking Git…",a8e=()=>"正在检查 Git…",o8e=()=>"در حال بررسی Git…",l8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Choose a coding agent",u8e=()=>"选择编程智能体",d8e=()=>"یک عامل کدنویسی انتخاب کنید",f8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Choose a coding agent to continue.",_8e=()=>"选择一个编程智能体以继续。",p8e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",m8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Choose at least one research area to continue.",v8e=()=>"请至少选择一个研究领域后再继续。",b8e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",y8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Choose one or more.",w8e=()=>"请选择一项或多项。",S8e=()=>"یک یا چند مورد را انتخاب کنید.",k8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Choose your preferred coding agent",E8e=()=>"请选择首选编程智能体",N8e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",z8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Consolidate your research",T8e=()=>"集中管理研究",A8e=()=>"پژوهش خود را یکپارچه کنید",R8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Continue",D8e=()=>"继续",L8e=()=>"ادامه",dN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Describe your research area to continue.",I8e=()=>"请描述你的研究领域后再继续。",B8e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",$8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",F8e=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",H8e=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",q8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G8e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",W8e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",V8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Everything stays local",Q8e=()=>"一切都保留在本地",Y8e=()=>"همه‌چیز محلی می‌ماند",X8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Get started",J8e=()=>"开始使用",e9e=()=>"شروع",t9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J8e():t==="fa"?e9e():Z8e()}),n9e=()=>"Git is required for local experiments. Install Git, then re-check.",r9e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",s9e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",i9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Ground your agents",o9e=()=>"为智能体提供可靠依据",l9e=()=>"عامل‌هایتان را به منابع متصل کنید",c9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),u9e=()=>"Install broken",d9e=()=>"安装损坏",f9e=()=>"نصب خراب است",h9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d9e():t==="fa"?f9e():u9e()}),_9e=()=>"Install Git to continue",p9e=()=>"请安装 Git 后再继续",m9e=()=>"برای ادامه Git را نصب کنید",g9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p9e():t==="fa"?m9e():_9e()}),v9e=()=>"Local Git",b9e=()=>"本地 Git",y9e=()=>"Git محلی",x9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b9e():t==="fa"?y9e():v9e()}),w9e=()=>", and ",S9e=()=>" 和 ",k9e=()=>" و ",C9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Compatible with",N9e=()=>"兼容",z9e=()=>"سازگار با",j9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),T9e=()=>"Use your own local models",A9e=()=>"使用你自己的本地模型",R9e=()=>"از مدل‌های محلی خود استفاده کنید",M9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),D9e=()=>"Not detected",L9e=()=>"未检测到",O9e=()=>"شناسایی نشد",fN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),I9e=()=>"Not found",B9e=()=>"未找到",$9e=()=>"پیدا نشد",WD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Not signed in",F9e=()=>"未登录",H9e=()=>"وارد نشده",q9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),U9e=()=>"OpenResearch uses a coding agent already installed on this machine.",G9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",W9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",V9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G9e():t==="fa"?W9e():U9e()}),K9e=()=>"Other research area",Q9e=()=>"其他研究领域",Y9e=()=>"حوزهٔ پژوهشی دیگر",X9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q9e():t==="fa"?Y9e():K9e()}),Z9e=()=>"Re-check",J9e=()=>"重新检查",eEe=()=>"بررسی دوباره",VD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J9e():t==="fa"?eEe():Z9e()}),tEe=()=>"Ready",nEe=()=>"已就绪",rEe=()=>"آماده",a6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Re-check Git before continuing",iEe=()=>"请重新检查 Git 后再继续",aEe=()=>"پیش از ادامه Git را دوباره بررسی کنید",oEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Representative papers",cEe=()=>"代表性论文",uEe=()=>"مقاله‌های شاخص",dEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Research background",hEe=()=>"研究背景",_Ee=()=>"پیشینهٔ پژوهشی",pEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",vEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",hN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Search alphaXiv by title to link a paper…",yEe=()=>"按标题搜索 alphaXiv 以关联论文…",xEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Searching alphaXiv…",kEe=()=>"正在搜索 alphaXiv…",CEe=()=>"در حال جست‌وجوی alphaXiv…",EEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Selected",zEe=()=>"已选择",jEe=()=>"انتخاب‌شده",TEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Local model unavailable",REe=()=>"本地模型不可用",MEe=()=>"مدل محلی در دسترس نیست",KD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),DEe=()=>"Setting things up…",LEe=()=>"正在设置…",OEe=()=>"در حال راه‌اندازی…",IEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LEe():t==="fa"?OEe():DEe()}),BEe=()=>"Connect a local model or sign in to a coding agent to continue",$Ee=()=>"连接本地模型或登录编码智能体以继续",PEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",FEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ee():t==="fa"?PEe():BEe()}),HEe=()=>"Connect a local model or sign in to an agent to continue.",qEe=()=>"连接本地模型或登录一个智能体以继续。",UEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",GEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qEe():t==="fa"?UEe():HEe()}),WEe=()=>"Signed in",VEe=()=>"已登录",KEe=()=>"وارد شده",QEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VEe():t==="fa"?KEe():WEe()}),YEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",XEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",ZEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",JEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XEe():t==="fa"?ZEe():YEe()}),eNe=()=>"· Step 1 of 2",tNe=()=>"· 第 1 步,共 2 步",nNe=()=>"· مرحلهٔ ۱ از ۲",rNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tNe():t==="fa"?nNe():eNe()}),sNe=()=>"· Step 2 of 2",iNe=()=>"· 第 2 步,共 2 步",aNe=()=>"· مرحلهٔ ۲ از ۲",oNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Tell us about your research",cNe=()=>"介绍一下你的研究",uNe=()=>"از پژوهش خود بگویید",dNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),fNe=()=>"Tell us your other research area",hNe=()=>"告诉我们你的其他研究领域",_Ne=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",pNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hNe():t==="fa"?_Ne():fNe()}),mNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",gNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",vNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",bNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gNe():t==="fa"?vNe():mNe()}),yNe=()=>"Unable to verify",xNe=()=>"无法验证",wNe=()=>"تأیید ممکن نیست",SNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xNe():t==="fa"?wNe():yNe()}),kNe=()=>"Update required",CNe=()=>"需要更新",ENe=()=>"نیازمند به‌روزرسانی",NNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Waiting for the Git check",jNe=()=>"正在等待 Git 检查",TNe=()=>"در انتظار بررسی Git",ANe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jNe():t==="fa"?TNe():zNe()}),RNe=()=>"Waiting for the local tool checks",MNe=()=>"正在等待本地工具检查",DNe=()=>"در انتظار بررسی ابزارهای محلی",LNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MNe():t==="fa"?DNe():RNe()}),ONe=()=>"What areas are you interested in?",INe=()=>"你对哪些领域感兴趣?",BNe=()=>"به چه حوزه‌هایی علاقه دارید؟",$Ne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),PNe=()=>"Your code, data, and experiment history stay on your machine.",FNe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",HNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",qNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FNe():t==="fa"?HNe():PNe()}),UNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",GNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",WNe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",VNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GNe():t==="fa"?WNe():UNe()}),KNe=()=>"Add cookie",QNe=()=>"添加 cookie",YNe=()=>"افزودن کوکی",XNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Changed here and on Overleaf — choose which copy to keep",JNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",eze=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",tze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"Create a token ↗",rze=()=>"创建令牌 ↗",sze=()=>"ساخت توکن ↗",ize=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),aze=()=>"Overleaf Git token",oze=()=>"Overleaf Git 令牌",lze=()=>"توکن Git در Overleaf",_N=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oze():t==="fa"?lze():aze()}),cze=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",uze=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",dze=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",fze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Import from browser",_ze=()=>"从浏览器导入",pze=()=>"وارد کردن از مرورگر",mze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"In step with Overleaf",vze=()=>"已与 Overleaf 同步",bze=()=>"با Overleaf همگام است",QD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),yze=()=>"The last sync did not finish.",xze=()=>"上次同步未完成。",wze=()=>"آخرین همگام‌سازی کامل نشد.",Sze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xze():t==="fa"?wze():yze()}),kze=()=>"Link and sync",Cze=()=>"关联并同步",Eze=()=>"پیوند و همگام‌سازی",Nze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"Connecting to Overleaf…",jze=()=>"正在连接 Overleaf…",Tze=()=>"در حال اتصال به Overleaf…",Aze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Edits are live on Overleaf",Mze=()=>"编辑已在 Overleaf 实时同步",Dze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Lze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mze():t==="fa"?Dze():Rze()}),Oze=()=>"Retry",Ize=()=>"重试",Bze=()=>"تلاش دوباره",$ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Live sync stopped.",Fze=()=>"实时同步已停止。",Hze=()=>"همگام‌سازی زنده متوقف شد.",qze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Live sync starts once the paper is in step with Overleaf.",Gze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Wze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Vze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Kze=()=>"My projects ↗",Qze=()=>"我的项目 ↗",Yze=()=>"پروژه‌های من ↗",pN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qze():t==="fa"?Yze():Kze()}),Xze=()=>"Nothing could be synced.",Zze=()=>"没有内容可以同步。",Jze=()=>"هیچ موردی قابل همگام‌سازی نبود.",eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open Overleaf ↗",nje=()=>"打开 Overleaf ↗",rje=()=>"باز کردن Overleaf ↗",sje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Cancel",aje=()=>"取消",oje=()=>"لغو",YD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",cje=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",uje=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",dje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Keep this copy",hje=()=>"保留此副本",_je=()=>"نگه داشتن این نسخه",pje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Open in Overleaf",gje=()=>"在 Overleaf 中打开",vje=()=>"باز کردن در Overleaf",bje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),yje=()=>"Replace the Overleaf token",xje=()=>"替换 Overleaf 令牌",wje=()=>"جایگزینی توکن Overleaf",mN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xje():t==="fa"?wje():yje()}),Sje=()=>"Sync files",kje=()=>"同步文件",Cje=()=>"همگام‌سازی فایل‌ها",Eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Unlink",zje=()=>"取消关联",jje=()=>"قطع پیوند",Tje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=()=>"Upload a copy as a new project ↗",Rje=()=>"上传副本作为新项目 ↗",Mje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",XD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rje():t==="fa"?Mje():Aje()}),Dje=()=>"Use Overleaf's",Lje=()=>"使用 Overleaf 的副本",Oje=()=>"استفاده از نسخهٔ Overleaf",Ije=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"This paper stays in step with Overleaf.",$je=()=>"此论文将与 Overleaf 保持同步。",Pje=()=>"این مقاله با Overleaf همگام می‌ماند.",Fje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$je():t==="fa"?Pje():Bje()}),Hje=()=>"Paste it instead",qje=()=>"改为粘贴",Uje=()=>"به‌جایش بچسبانید",Gje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qje():t==="fa"?Uje():Hje()}),Wje=e=>`Pulled ${e==null?void 0:e.paths}.`,Vje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Kje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Qje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vje(e):t==="fa"?Kje(e):Wje(e)}),Yje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Xje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Zje=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Jje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),eTe=e=>`Pushed ${e==null?void 0:e.paths}.`,tTe=e=>`已推送 ${e==null?void 0:e.paths}。`,nTe=e=>`${e==null?void 0:e.paths} ارسال شد.`,rTe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tTe(e):t==="fa"?nTe(e):eTe(e)}),sTe=()=>"Add a fresh Overleaf session cookie to start following again.",iTe=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",aTe=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",oTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Save the file first",cTe=()=>"请先保存文件",uTe=()=>"ابتدا فایل را ذخیره کنید",dTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),fTe=()=>"Save this file to sync it with Overleaf",hTe=()=>"保存此文件以与 Overleaf 同步",_Te=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",ZD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),pTe=()=>"Save token",mTe=()=>"保存令牌",gTe=()=>"ذخیرهٔ توکن",vTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),bTe=()=>"Send this paper to Overleaf",yTe=()=>"将此论文发送到 Overleaf",xTe=()=>"ارسال مقاله به Overleaf",wTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yTe():t==="fa"?xTe():bTe()}),STe=()=>"Overleaf session cookie",kTe=()=>"Overleaf 会话 cookie",CTe=()=>"کوکی نشست Overleaf",j4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kTe():t==="fa"?CTe():STe()}),ETe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",NTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",zTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",jTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=()=>"Overleaf sync failed",ATe=()=>"Overleaf 同步失败",RTe=()=>"همگام‌سازی با Overleaf ناموفق بود",T4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ATe():t==="fa"?RTe():TTe()}),MTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",DTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",LTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",OTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Syncing with Overleaf…",BTe=()=>"正在与 Overleaf 同步…",$Te=()=>"در حال همگام‌سازی با Overleaf…",JD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),PTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",FTe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",HTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",qTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FTe():t==="fa"?HTe():PTe()}),UTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",GTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",WTe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",VTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GTe():t==="fa"?WTe():UTe()}),KTe=()=>"Toggle Plan mode for this chat",QTe=()=>"切换此聊天的计划模式",YTe=()=>"تغییر حالت طرح این گفت‌وگو",XTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QTe():t==="fa"?YTe():KTe()}),ZTe=()=>"Accept and auto mode",JTe=()=>"接受并使用自动模式",eAe=()=>"پذیرش و حالت خودکار",tAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JTe():t==="fa"?eAe():ZTe()}),nAe=()=>"Accept and bypass all",rAe=()=>"接受并跳过所有审批",sAe=()=>"پذیرش و عبور از همهٔ تأییدها",iAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rAe():t==="fa"?sAe():nAe()}),aAe=()=>"Accept plan",oAe=()=>"接受计划",lAe=()=>"پذیرش طرح",cAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oAe():t==="fa"?lAe():aAe()}),uAe=e=>`${e==null?void 0:e.agent} proposed a plan`,dAe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,fAe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,hAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dAe(e):t==="fa"?fAe(e):uAe(e)}),_Ae=e=>`${e==null?void 0:e.agent} is ready to proceed`,pAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,mAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,gAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pAe(e):t==="fa"?mAe(e):_Ae(e)}),vAe=()=>"Back",bAe=()=>"返回",yAe=()=>"بازگشت",xAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bAe():t==="fa"?yAe():vAe()}),wAe=()=>"More approval options",SAe=()=>"更多批准选项",kAe=()=>"گزینه‌های تأیید بیشتر",CAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Open plan",NAe=()=>"打开计划",zAe=()=>"باز کردن طرح",jAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),TAe=()=>"Reject",AAe=()=>"拒绝",RAe=()=>"رد کردن",MAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),DAe=()=>"Revise",LAe=()=>"修改",OAe=()=>"بازنگری",IAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LAe():t==="fa"?OAe():DAe()}),BAe=()=>"Revise…",$Ae=()=>"修改…",PAe=()=>"بازنگری…",FAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ae():t==="fa"?PAe():BAe()}),HAe=()=>"What should change? (optional)",qAe=()=>"需要更改什么?(可选)",UAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",GAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qAe():t==="fa"?UAe():HAe()}),WAe=e=>`${e==null?void 0:e.count} active`,VAe=e=>`${e==null?void 0:e.count} 个活跃`,KAe=e=>`${e==null?void 0:e.count} فعال`,QAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?VAe(e):t==="fa"?KAe(e):WAe(e)}),YAe=e=>`${e==null?void 0:e.count} total agents`,XAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,ZAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,JAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?XAe(e):t==="fa"?ZAe(e):YAe(e)}),eRe=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,tRe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,nRe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,rRe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tRe(e):t==="fa"?nRe(e):eRe(e)}),sRe=()=>"Agents",iRe=()=>"智能体",aRe=()=>"عامل‌ها",gN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),oRe=()=>"arXiv paper ID:",lRe=()=>"arXiv 论文 ID:",cRe=()=>"شناسهٔ مقالهٔ arXiv:",uRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Cancel",fRe=()=>"取消",hRe=()=>"لغو",_Re=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),pRe=()=>"Created",mRe=()=>"创建时间",gRe=()=>"ایجادشده",vRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mRe():t==="fa"?gRe():pRe()}),bRe=()=>"Delete project?",yRe=()=>"删除项目?",xRe=()=>"پروژه حذف شود؟",wRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"Delete project",kRe=()=>"删除项目",CRe=()=>"حذف پروژه",ERe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"Deleting…",zRe=()=>"正在删除…",jRe=()=>"در حال حذف…",TRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),ARe=()=>"Experiments",RRe=()=>"实验",MRe=()=>"آزمایش‌ها",vN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RRe():t==="fa"?MRe():ARe()}),DRe=()=>"The local folder and linked GitHub repository are kept.",LRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",ORe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",IRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"The local folder is kept.",$Re=()=>"本地文件夹会保留。",PRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",FRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"New project",qRe=()=>"新建项目",URe=()=>"پروژهٔ جدید",eL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"No projects yet — create one to get started.",WRe=()=>"尚无项目——新建一个即可开始。",VRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",KRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Project",YRe=()=>"项目",XRe=()=>"پروژه",ZRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),JRe=()=>"Projects",eMe=()=>"项目",tMe=()=>"پروژه‌ها",nMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eMe():t==="fa"?tMe():JRe()}),rMe=()=>"Repository",sMe=()=>"仓库",iMe=()=>"مخزن",bN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),aMe=()=>"Idle",oMe=()=>"空闲",lMe=()=>"بیکار",cMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Local",dMe=()=>"本地",fMe=()=>"محلی",o6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dMe():t==="fa"?fMe():uMe()}),hMe=()=>"1 total agent",_Me=()=>"共 1 个智能体",pMe=()=>"در مجموع ۱ عامل",mMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=e=>`${e==null?void 0:e.count} running`,vMe=e=>`${e==null?void 0:e.count} 个运行中`,bMe=e=>`${e==null?void 0:e.count} در حال اجرا`,yMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vMe(e):t==="fa"?bMe(e):gMe(e)}),xMe=e=>`${e==null?void 0:e.count} total`,wMe=e=>`共 ${e==null?void 0:e.count} 个`,SMe=e=>`در مجموع ${e==null?void 0:e.count}`,yN=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wMe(e):t==="fa"?SMe(e):xMe(e)}),kMe=()=>"Installing the compatible binary. This may take a few minutes.",CMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",EMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",NMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),zMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,jMe=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,TMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,AMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jMe(e):t==="fa"?TMe(e):zMe(e)}),RMe=()=>"Check again",MMe=()=>"再次检查",DMe=()=>"بررسی دوباره",xN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MMe():t==="fa"?DMe():RMe()}),LMe=()=>"Closing…",OMe=()=>"正在关闭…",IMe=()=>"در حال بستن…",BMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OMe():t==="fa"?IMe():LMe()}),$Me=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,PMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,FMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,HMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PMe(e):t==="fa"?FMe(e):$Me(e)}),qMe=()=>"Preparing your remote workspace…",UMe=()=>"正在准备远程工作区…",GMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",WMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UMe():t==="fa"?GMe():qMe()}),VMe=e=>`Connecting to ${e==null?void 0:e.host}`,KMe=e=>`正在连接到 ${e==null?void 0:e.host}`,QMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,YMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KMe(e):t==="fa"?QMe(e):VMe(e)}),XMe=()=>"Close remote host picker",ZMe=()=>"关闭远程主机选择器",JMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",eDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZMe():t==="fa"?JMe():XMe()}),tDe=()=>"Choose a configured SSH host.",nDe=()=>"选择已配置的 SSH 主机。",rDe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",sDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nDe():t==="fa"?rDe():tDe()}),iDe=()=>"Connect to remote",aDe=()=>"连接到远程主机",oDe=()=>"اتصال به میزبان راه‌دور",tL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aDe():t==="fa"?oDe():iDe()}),lDe=()=>"Disconnect",cDe=()=>"断开连接",uDe=()=>"قطع اتصال",A4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Your remote work is still running. Reconnect when you’re ready.",fDe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",hDe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",_De=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`Disconnected from ${e==null?void 0:e.host}`,mDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,gDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,nL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),vDe=e=>`Could not connect to ${e==null?void 0:e.host}`,bDe=e=>`无法连接到 ${e==null?void 0:e.host}`,yDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,xDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bDe(e):t==="fa"?yDe(e):vDe(e)}),wDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",SDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",kDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",CDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SDe():t==="fa"?kDe():wDe()}),EDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",NDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",zDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",jDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),TDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ADe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,RDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,MDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ADe(e):t==="fa"?RDe(e):TDe(e)}),DDe=()=>"OpenResearch binary",LDe=()=>"OpenResearch 二进制文件",ODe=()=>"فایل اجرایی OpenResearch",IDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LDe():t==="fa"?ODe():DDe()}),BDe=()=>"OpenResearch Database",$De=()=>"OpenResearch 数据库",PDe=()=>"پایگاه دادهٔ OpenResearch",FDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",qDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",UDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",GDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qDe():t==="fa"?UDe():HDe()}),WDe=()=>"Install OpenResearch?",VDe=()=>"安装 OpenResearch?",KDe=()=>"OpenResearch نصب شود؟",QDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VDe():t==="fa"?KDe():WDe()}),YDe=()=>"Installing…",XDe=()=>"正在安装…",ZDe=()=>"در حال نصب…",JDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),eLe=()=>"No matching SSH hosts",tLe=()=>"没有匹配的 SSH 主机",nLe=()=>"میزبان SSH منطبقی پیدا نشد",rLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iLe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aLe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=()=>"Open remote",cLe=()=>"打开远程工作区",uLe=()=>"باز کردن راه‌دور",dLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),fLe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",hLe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",_Le=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",pLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",gLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",vLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",bLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gLe():t==="fa"?vLe():mLe()}),yLe=()=>"Preparing remote workspace…",xLe=()=>"正在准备远程工作区…",wLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",SLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),kLe=()=>"Reconnect",CLe=()=>"重新连接",ELe=()=>"اتصال دوباره",wN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),NLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",zLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",jLe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",TLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zLe():t==="fa"?jLe():NLe()}),ALe=e=>`Reconnecting to ${e==null?void 0:e.host}`,RLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,MLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,DLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RLe(e):t==="fa"?MLe(e):ALe(e)}),LLe=()=>"Search SSH hosts",OLe=()=>"搜索 SSH 主机",ILe=()=>"جستجوی میزبان‌های SSH",SN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),BLe=e=>`SSH: ${e==null?void 0:e.host}`,$Le=e=>`SSH:${e==null?void 0:e.host}`,PLe=e=>`SSH: ${e==null?void 0:e.host}`,E2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),FLe=()=>"Start a new OpenResearch host",HLe=()=>"启动新的 OpenResearch 主机",qLe=()=>"راه‌اندازی میزبان جدید OpenResearch",ULe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HLe():t==="fa"?qLe():FLe()}),GLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,WLe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,VLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,KLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WLe(e):t==="fa"?VLe(e):GLe(e)}),QLe=()=>"Stop OpenResearch",YLe=()=>"停止 OpenResearch",XLe=()=>"توقف OpenResearch",ZLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,eOe=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,tOe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,nOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eOe(e):t==="fa"?tOe(e):JLe(e)}),rOe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,sOe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,iOe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,aOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sOe(e):t==="fa"?iOe(e):rOe(e)}),oOe=()=>"Stop OpenResearch on host",lOe=()=>"停止主机上的 OpenResearch",cOe=()=>"توقف OpenResearch روی میزبان",rL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>"This will also:",dOe=()=>"这还将:",fOe=()=>"این کار همچنین:",hOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"End 1 pending approval.",pOe=()=>"结束 1 个待审批请求。",mOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",gOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),vOe=()=>"Leave 1 submitted experiment running.",bOe=()=>"让 1 个已提交实验继续运行。",yOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bOe():t==="fa"?yOe():vOe()}),wOe=()=>"Disconnect 1 other client.",SOe=()=>"断开 1 个其他客户端。",kOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",COe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Keep 1 queued message saved.",NOe=()=>"保留 1 条排队消息。",zOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",jOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),TOe=()=>"Interrupt 1 active agent turn.",AOe=()=>"中断 1 个活动代理任务。",ROe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",MOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AOe():t==="fa"?ROe():TOe()}),DOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,LOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,OOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,IOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LOe(e):t==="fa"?OOe(e):DOe(e)}),BOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,$Oe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,POe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,FOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,qOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,UOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,GOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qOe(e):t==="fa"?UOe(e):HOe(e)}),WOe=()=>"Stopping host…",VOe=()=>"正在停止主机…",KOe=()=>"در حال توقف میزبان…",QOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Update",XOe=()=>"更新",ZOe=()=>"به‌روزرسانی",kN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,eIe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,tIe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,nIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eIe(e):t==="fa"?tIe(e):JOe(e)}),rIe=()=>"Update OpenResearch?",sIe=()=>"更新 OpenResearch?",iIe=()=>"OpenResearch به‌روزرسانی شود؟",aIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Updating…",lIe=()=>"正在更新…",cIe=()=>"در حال به‌روزرسانی…",uIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),dIe=()=>"Disable syncing",fIe=()=>"关闭同步",hIe=()=>"غیرفعال کردن همگام‌سازی",_Ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fIe():t==="fa"?hIe():dIe()}),pIe=()=>"Enable GitHub syncing",mIe=()=>"启用 GitHub 同步",gIe=()=>"فعال‌سازی همگام‌سازی GitHub",vIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mIe():t==="fa"?gIe():pIe()}),bIe=()=>"Enabling…",yIe=()=>"正在启用…",xIe=()=>"در حال فعال‌سازی…",wIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yIe():t==="fa"?xIe():bIe()}),SIe=()=>"Updating…",kIe=()=>"正在更新…",CIe=()=>"در حال به‌روزرسانی…",EIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,zIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,jIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,TIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zIe(e):t==="fa"?jIe(e):NIe(e)}),AIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,RIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,MIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,DIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RIe(e):t==="fa"?MIe(e):AIe(e)}),LIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,OIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,IIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,BIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OIe(e):t==="fa"?IIe(e):LIe(e)}),$Ie=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,PIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,FIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,HIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PIe(e):t==="fa"?FIe(e):$Ie(e)}),qIe=()=>"CLI is retrying…",UIe=()=>"CLI 正在重试…",GIe=()=>"CLI در حال تلاش دوباره است…",WIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UIe():t==="fa"?GIe():qIe()}),VIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,KIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,QIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,YIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KIe(e):t==="fa"?QIe(e):VIe(e)}),XIe=()=>"Sending again…",ZIe=()=>"正在重新发送…",JIe=()=>"در حال ارسال دوباره…",eBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,nBe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,rBe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,sBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Retrying…",aBe=()=>"正在重试…",oBe=()=>"در حال تلاش دوباره…",sL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),lBe=()=>"Default speed",cBe=()=>"默认速度",uBe=()=>"سرعت پیش‌فرض",dBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cBe():t==="fa"?uBe():lBe()}),fBe=()=>"Standard",hBe=()=>"标准",_Be=()=>"استاندارد",pBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hBe():t==="fa"?_Be():fBe()}),mBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,gBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,vBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,bBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gBe(e):t==="fa"?vBe(e):mBe(e)}),yBe=()=>"Appearance",xBe=()=>"外观",wBe=()=>"ظاهر",SBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check",CBe=()=>"检查",EBe=()=>"بررسی",NBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"Check again",jBe=()=>"再次检查",TBe=()=>"بررسی دوباره",Qp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),ABe=()=>"Check for updates",RBe=()=>"检查更新",MBe=()=>"بررسی به‌روزرسانی",DBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RBe():t==="fa"?MBe():ABe()}),LBe=()=>"Check now",OBe=()=>"立即检查",IBe=()=>"اکنون بررسی کن",BBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Check setup",PBe=()=>"检查设置",FBe=()=>"بررسی راه‌اندازی",HBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PBe():t==="fa"?FBe():$Be()}),qBe=()=>"orx checks a few times a day on its own.",UBe=()=>"orx 每天会自动检查几次。",GBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",WBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UBe():t==="fa"?GBe():qBe()}),VBe=()=>"Choose a flavor",KBe=()=>"选择配置",QBe=()=>"انتخاب پیکربندی",YBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KBe():t==="fa"?QBe():VBe()}),XBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,ZBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,JBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZBe(e):t==="fa"?JBe(e):XBe(e)}),t$e=()=>"clean",n$e=()=>"无更改",r$e=()=>"بدون تغییر",s$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>`Already linked at ${e==null?void 0:e.link}.`,a$e=e=>`已链接到 ${e==null?void 0:e.link}。`,o$e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=e=>`Linked ${e==null?void 0:e.link}.`,u$e=e=>`已链接 ${e==null?void 0:e.link}。`,d$e=e=>`${e==null?void 0:e.link} پیوند شد.`,f$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u$e(e):t==="fa"?d$e(e):c$e(e)}),h$e=()=>"Connect",_$e=()=>"连接",p$e=()=>"اتصال",l6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_$e():t==="fa"?p$e():h$e()}),m$e=()=>"Connected via GitHub CLI",g$e=()=>"已通过 GitHub CLI 连接",v$e=()=>"از طریق GitHub CLI متصل است",iL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g$e():t==="fa"?v$e():m$e()}),b$e=()=>"Connecting…",y$e=()=>"正在连接…",x$e=()=>"در حال اتصال…",aL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y$e():t==="fa"?x$e():b$e()}),w$e=e=>`CPU cores: ${e==null?void 0:e.count}`,S$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,k$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,C$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S$e(e):t==="fa"?k$e(e):w$e(e)}),E$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",N$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",z$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",j$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"the current project",A$e=()=>"当前项目",R$e=()=>"پروژهٔ فعلی",M$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),D$e=e=>`${e==null?void 0:e.value} (custom)`,L$e=e=>`${e==null?void 0:e.value}(自定义)`,O$e=e=>`${e==null?void 0:e.value} (سفارشی)`,I$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L$e(e):t==="fa"?O$e(e):D$e(e)}),B$e=()=>"detached",$$e=()=>"分离头指针",P$e=()=>"جدا از شاخه",c6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Disconnected",H$e=()=>"已断开连接",q$e=()=>"قطع اتصال",oL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),U$e=()=>"Environment tab",G$e=()=>"环境标签页",W$e=()=>"زبانهٔ محیط",V$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G$e():t==="fa"?W$e():U$e()}),K$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Y$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,X$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Q$e(e):t==="fa"?Y$e(e):K$e(e)}),Z$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",J$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",ePe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",tPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J$e():t==="fa"?ePe():Z$e()}),nPe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",rPe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",sPe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",iPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",oPe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",lPe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",cPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=e=>`GPU × ${e==null?void 0:e.count}`,dPe=e=>`${e==null?void 0:e.count} 个 GPU`,fPe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,hPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dPe(e):t==="fa"?fPe(e):uPe(e)}),_Pe=()=>"has changes",pPe=()=>"有更改",mPe=()=>"دارای تغییر",gPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),vPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,bPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,yPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,xPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bPe(e):t==="fa"?yPe(e):vPe(e)}),wPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",SPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",kPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",CPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"Install",NPe=()=>"安装",zPe=()=>"نصب",jPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),TPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,APe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,RPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,MPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?APe(e):t==="fa"?RPe(e):TPe(e)}),DPe=e=>`Install the ${e==null?void 0:e.command} command`,LPe=e=>`安装 ${e==null?void 0:e.command} 命令`,OPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,IPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LPe(e):t==="fa"?OPe(e):DPe(e)}),BPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",$Pe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",PPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",FPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Pe():t==="fa"?PPe():BPe()}),HPe=()=>"Install the new release now instead of waiting for the background update.",qPe=()=>"立即安装新版本,无需等待后台更新。",UPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qPe():t==="fa"?UPe():HPe()}),WPe=()=>"Discard your unsaved Kubernetes changes?",VPe=()=>"要放弃未保存的 Kubernetes 更改吗?",KPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",QPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VPe():t==="fa"?KPe():WPe()}),YPe=()=>"Key from",XPe=()=>"密钥来自",ZPe=()=>"کلید از",JPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XPe():t==="fa"?ZPe():YPe()}),eFe=()=>"Use current kubectl context",tFe=()=>"使用当前 kubectl 上下文",nFe=()=>"استفاده از کانتکست فعلی kubectl",rFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=e=>`Use current context (${e==null?void 0:e.context})`,iFe=e=>`使用当前上下文(${e==null?void 0:e.context})`,aFe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,oFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iFe(e):t==="fa"?aFe(e):sFe(e)}),lFe=()=>"Language",cFe=()=>"语言",uFe=()=>"زبان",dFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),fFe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,hFe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,_Fe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,pFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hFe(e):t==="fa"?_Fe(e):fFe(e)}),mFe=()=>"Make default",gFe=()=>"设为默认值",vFe=()=>"پیش‌فرض شود",bFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gFe():t==="fa"?vFe():mFe()}),yFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",xFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",wFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",SFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xFe():t==="fa"?wFe():yFe()}),kFe=()=>"Replace token ID",CFe=()=>"替换令牌 ID",EFe=()=>"جایگزینی شناسهٔ توکن",NFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Replace token secret",jFe=()=>"替换令牌密钥",TFe=()=>"جایگزینی رمز توکن",AFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jFe():t==="fa"?TFe():zFe()}),RFe=()=>"How to get a Modal token",MFe=()=>"如何获取 Modal 令牌",DFe=()=>"روش دریافت توکن Modal",LFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MFe():t==="fa"?DFe():RFe()}),OFe=()=>"Token ID",IFe=()=>"令牌 ID",BFe=()=>"شناسهٔ توکن",$Fe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Token secret",FFe=()=>"令牌密钥",HFe=()=>"رمز توکن",qFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FFe():t==="fa"?HFe():PFe()}),UFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,GFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,WFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,lL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?GFe(e):t==="fa"?WFe(e):UFe(e)}),VFe=e=>`Needs ${e==null?void 0:e.tool}`,KFe=e=>`需要 ${e==null?void 0:e.tool}`,QFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,YFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KFe(e):t==="fa"?QFe(e):VFe(e)}),XFe=()=>"Needs tools",ZFe=()=>"缺少工具",JFe=()=>"به ابزارها نیاز دارد",eHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZFe():t==="fa"?JFe():XFe()}),tHe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,nHe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,rHe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,sHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nHe(e):t==="fa"?rHe(e):tHe(e)}),iHe=()=>"New runs use SSH; choose a host when launching.",aHe=()=>"新运行将使用 SSH;启动时请选择主机。",oHe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"New token",uHe=()=>"新令牌",dHe=()=>"توکن جدید",fHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"No default flavor",_He=()=>"不设默认配置",pHe=()=>"بدون پیکربندی پیش‌فرض",mHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"none",vHe=()=>"无",bHe=()=>"هیچ‌کدام",u6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vHe():t==="fa"?bHe():gHe()}),yHe=()=>"Not connected",xHe=()=>"未连接",wHe=()=>"متصل نیست",cL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"not found on PATH",kHe=()=>"在 PATH 中未找到",CHe=()=>"در PATH پیدا نشد",EHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,zHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,jHe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,THe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"not initialized",RHe=()=>"尚未初始化",MHe=()=>"راه‌اندازی نشده",DHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Not set",OHe=()=>"未设置",IHe=()=>"تنظیم نشده",R4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"OAuth (subscription login)",$He=()=>"OAuth(订阅登录)",PHe=()=>"OAuth (ورود با اشتراک)",FHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,qHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,UHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,GHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):HHe(e)}),WHe=()=>"Setting up…",VHe=()=>"正在设置…",KHe=()=>"در حال راه‌اندازی…",QHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Account",XHe=()=>"账户",ZHe=()=>"حساب",d6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Add one with",eqe=()=>"使用以下命令添加:",tqe=()=>"یکی با این فرمان اضافه کنید:",nqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Add variable",sqe=()=>"添加变量",iqe=()=>"افزودن متغیر",aqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"Agent models",lqe=()=>"智能体模型",cqe=()=>"مدل‌های عامل",uqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),dqe=()=>"Anonymous usage analytics",fqe=()=>"匿名使用情况分析",hqe=()=>"تحلیل ناشناس استفاده",CN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fqe():t==="fa"?hqe():dqe()}),_qe=()=>"Auth",pqe=()=>"身份验证",mqe=()=>"احراز هویت",gqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),vqe=()=>"Authentication",bqe=()=>"身份验证",yqe=()=>"احراز هویت",uL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bqe():t==="fa"?yqe():vqe()}),xqe=()=>"Auto-apply GitHub topics for new projects",wqe=()=>"为新项目自动添加 GitHub topic",Sqe=()=>"اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید",EN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wqe():t==="fa"?Sqe():xqe()}),kqe=()=>"Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.",Cqe=()=>"为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",Eqe=()=>"مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",dL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cqe():t==="fa"?Eqe():kqe()}),Nqe=()=>"Back to Compute",zqe=()=>"返回算力设置",jqe=()=>"بازگشت به رایانش",fL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zqe():t==="fa"?jqe():Nqe()}),Tqe=()=>"Backend",Aqe=()=>"后端",Rqe=()=>"بک‌اند",Mqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aqe():t==="fa"?Rqe():Tqe()}),Dqe=()=>"Baseline",Lqe=()=>"基线",Oqe=()=>"خط مبنا",Iqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"Binary",$qe=()=>"可执行文件",Pqe=()=>"فایل اجرایی",Fqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Cancel",qqe=()=>"取消",Uqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qqe():t==="fa"?Uqe():Hqe()}),Gqe=()=>"Cancel new variable",Wqe=()=>"取消新变量",Vqe=()=>"لغو متغیر جدید",Kqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wqe():t==="fa"?Vqe():Gqe()}),Qqe=()=>"Checking compute targets…",Yqe=()=>"正在检查算力目标…",Xqe=()=>"در حال بررسی مقصدهای رایانشی…",Zqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Qqe()}),Jqe=()=>"Checking kubectl…",eUe=()=>"正在检查 kubectl…",tUe=()=>"در حال بررسی kubectl…",nUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eUe():t==="fa"?tUe():Jqe()}),rUe=()=>"Checking Modal…",sUe=()=>"正在检查 Modal…",iUe=()=>"در حال بررسی Modal…",aUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Choose a preset flavor",lUe=()=>"选择预设规格",cUe=()=>"یک پیکربندی آماده انتخاب کنید",NN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),uUe=()=>"cluster default",dUe=()=>"集群默认值",fUe=()=>"پیش‌فرض خوشه",zN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dUe():t==="fa"?fUe():uUe()}),hUe=()=>"cluster default (e.g. 4h, 30m)",_Ue=()=>"集群默认值(例如 4h、30m)",pUe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",mUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ue():t==="fa"?pUe():hUe()}),gUe=()=>"Cluster unreachable",vUe=()=>"无法连接集群",bUe=()=>"خوشه در دسترس نیست",yUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vUe():t==="fa"?bUe():gUe()}),xUe=()=>"Compute",wUe=()=>"算力",SUe=()=>"رایانش",hL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wUe():t==="fa"?SUe():xUe()}),kUe=()=>"Connect compute backends and choose where new runs execute.",CUe=()=>"连接算力后端,并选择新运行的执行位置。",EUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",NUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"Connected",jUe=()=>"已连接",TUe=()=>"متصل",AUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jUe():t==="fa"?TUe():zUe()}),RUe=()=>"Context",MUe=()=>"上下文",DUe=()=>"زمینه",LUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MUe():t==="fa"?DUe():RUe()}),OUe=()=>"Current",IUe=()=>"当前",BUe=()=>"فعلی",$Ue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),PUe=()=>"Currently off:",FUe=()=>"当前已关闭:",HUe=()=>"اکنون خاموش است:",qUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FUe():t==="fa"?HUe():PUe()}),UUe=()=>"Custom flavor",GUe=()=>"自定义规格",WUe=()=>"پیکربندی سفارشی",VUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GUe():t==="fa"?WUe():UUe()}),KUe=()=>"Custom flavor…",QUe=()=>"自定义规格…",YUe=()=>"پیکربندی سفارشی…",XUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QUe():t==="fa"?YUe():KUe()}),ZUe=()=>"Data directory",JUe=()=>"数据目录",eGe=()=>"پوشهٔ داده",tGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JUe():t==="fa"?eGe():ZUe()}),nGe=()=>"default",rGe=()=>"默认",sGe=()=>"پیش‌فرض",iGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rGe():t==="fa"?sGe():nGe()}),aGe=()=>"Default",oGe=()=>"默认",lGe=()=>"پیش‌فرض",_L=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oGe():t==="fa"?lGe():aGe()}),cGe=()=>"Default destination",uGe=()=>"默认目标",dGe=()=>"مقصد پیش‌فرض",fGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uGe():t==="fa"?dGe():cGe()}),hGe=()=>"Detecting hardware…",_Ge=()=>"正在检测硬件…",pGe=()=>"در حال شناسایی سخت‌افزار…",mGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Detecting harnesses…",vGe=()=>"正在检测智能体工具…",bGe=()=>"در حال شناسایی ابزارهای عامل…",yGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",wGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",SGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",kGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Effective URL",EGe=()=>"实际使用的网址",NGe=()=>"نشانی مؤثر",zGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Enable GitHub syncing for new projects",TGe=()=>"为新项目启用 GitHub 同步",AGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",jN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),RGe=()=>"Environment",MGe=()=>"环境",DGe=()=>"محیط",pL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MGe():t==="fa"?DGe():RGe()}),LGe=()=>"Failed",OGe=()=>"失败",IGe=()=>"ناموفق",f6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OGe():t==="fa"?IGe():LGe()}),BGe=()=>"General",$Ge=()=>"常规",PGe=()=>"عمومی",FGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ge():t==="fa"?PGe():BGe()}),HGe=()=>"GitHub publishing",qGe=()=>"GitHub 发布",UGe=()=>"انتشار در GitHub",GGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qGe():t==="fa"?UGe():HGe()}),WGe=()=>"Git token",VGe=()=>"Git 令牌",KGe=()=>"توکن Git",QGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VGe():t==="fa"?KGe():WGe()}),YGe=()=>"Harnesses",XGe=()=>"智能体工具",ZGe=()=>"ابزارهای عامل",JGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XGe():t==="fa"?ZGe():YGe()}),eWe=()=>"hf_…",tWe=()=>"hf_…",nWe=()=>"hf_…",rWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",iWe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",aWe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",oWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"Initialize Git",cWe=()=>"初始化 Git",uWe=()=>"راه‌اندازی Git",dWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),fWe=()=>"Install",hWe=()=>"安装",_We=()=>"نصب",mL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hWe():t==="fa"?_We():fWe()}),pWe=()=>"Install broken",mWe=()=>"安装损坏",gWe=()=>"نصب خراب است",vWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mWe():t==="fa"?gWe():pWe()}),bWe=()=>"Install GitHub CLI",yWe=()=>"安装 GitHub CLI",xWe=()=>"نصب GitHub CLI",wWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yWe():t==="fa"?xWe():bWe()}),SWe=()=>"Install updates automatically",kWe=()=>"自动安装更新",CWe=()=>"نصب خودکار به‌روزرسانی‌ها",TN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),EWe=()=>"Instance history",NWe=()=>"实例历史",zWe=()=>"تاریخچهٔ نمونه‌ها",jWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NWe():t==="fa"?zWe():EWe()}),TWe=()=>"Invalid Token",AWe=()=>"令牌无效",RWe=()=>"توکن نامعتبر",MWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AWe():t==="fa"?RWe():TWe()}),DWe=()=>"Jobs / Dashboard URL",LWe=()=>"Jobs / 控制台网址",OWe=()=>"نشانی Jobs / داشبورد",IWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"kubectl not found",$We=()=>"未找到 kubectl",PWe=()=>"kubectl پیدا نشد",FWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$We():t==="fa"?PWe():BWe()}),HWe=()=>"Latest",qWe=()=>"最新版本",UWe=()=>"جدیدترین",GWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qWe():t==="fa"?UWe():HWe()}),WWe=()=>"Loading…",VWe=()=>"正在加载…",KWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VWe():t==="fa"?KWe():WWe()}),QWe=()=>"Loading Ray settings…",YWe=()=>"正在加载 Ray 设置…",XWe=()=>"در حال بارگیری تنظیمات Ray…",ZWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YWe():t==="fa"?XWe():QWe()}),JWe=()=>"Loading slurm settings…",eVe=()=>"正在加载 Slurm 设置…",tVe=()=>"در حال بارگیری تنظیمات Slurm…",nVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eVe():t==="fa"?tVe():JWe()}),rVe=()=>"Loading status…",sVe=()=>"正在加载状态…",iVe=()=>"در حال بارگیری وضعیت…",aVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sVe():t==="fa"?iVe():rVe()}),oVe=()=>"Local only",lVe=()=>"仅本地",cVe=()=>"فقط محلی",uVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lVe():t==="fa"?cVe():oVe()}),dVe=()=>"Local repository",fVe=()=>"本地仓库",hVe=()=>"مخزن محلی",_Ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fVe():t==="fa"?hVe():dVe()}),pVe=()=>"Login node",mVe=()=>"登录节点",gVe=()=>"گرهٔ ورود",vVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mVe():t==="fa"?gVe():pVe()}),bVe=()=>"Make GitHub syncing the default?",yVe=()=>"将 GitHub 同步设为默认值?",xVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",wVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yVe():t==="fa"?xVe():bVe()}),SVe=()=>"Missing bash/tar",kVe=()=>"缺少 bash/tar",CVe=()=>"bash/tar موجود نیست",EVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kVe():t==="fa"?CVe():SVe()}),NVe=()=>"More compute options",zVe=()=>"更多算力选项",jVe=()=>"گزینه‌های رایانشی بیشتر",TVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zVe():t==="fa"?jVe():NVe()}),AVe=()=>"Move failed:",RVe=()=>"移动失败:",MVe=()=>"انتقال ناموفق بود:",DVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RVe():t==="fa"?MVe():AVe()}),LVe=()=>"Moved. orx is now using the new location.",OVe=()=>"已移动。orx 现在使用新位置。",IVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",BVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OVe():t==="fa"?IVe():LVe()}),$Ve=()=>"Namespace",PVe=()=>"命名空间",FVe=()=>"فضای نام",HVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PVe():t==="fa"?FVe():$Ve()}),qVe=()=>"New location",UVe=()=>"新位置",GVe=()=>"محل جدید",WVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UVe():t==="fa"?GVe():qVe()}),VVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",KVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",QVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",YVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KVe():t==="fa"?QVe():VVe()}),XVe=()=>"New variable key",ZVe=()=>"新变量键名",JVe=()=>"کلید متغیر جدید",eKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZVe():t==="fa"?JVe():XVe()}),tKe=()=>"New variable value",nKe=()=>"新变量值",rKe=()=>"مقدار متغیر جدید",sKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nKe():t==="fa"?rKe():tKe()}),iKe=()=>"No code, prompts, file contents, or account identifiers are sent.",aKe=()=>"不会发送代码、提示词、文件内容或账户标识符。",oKe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",lKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aKe():t==="fa"?oKe():iKe()}),cKe=()=>"No hosts found in ~/.ssh/config.",uKe=()=>"在 ~/.ssh/config 中未找到主机。",dKe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",fKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uKe():t==="fa"?dKe():cKe()}),hKe=()=>"No job-create permission",_Ke=()=>"没有创建 Job 的权限",pKe=()=>"مجوز ساخت Job وجود ندارد",mKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ke():t==="fa"?pKe():hKe()}),gKe=()=>"No Write Permissions",vKe=()=>"无写入权限",bKe=()=>"بدون مجوز نوشتن",yKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vKe():t==="fa"?bKe():gKe()}),xKe=()=>"No key on this computer to register — load a registered key with",wKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",SKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",kKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wKe():t==="fa"?SKe():xKe()}),CKe=()=>"No key on this computer yet — create one with",EKe=()=>"此计算机上还没有密钥——使用以下命令创建:",NKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",zKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EKe():t==="fa"?NKe():CKe()}),jKe=()=>"No Slurm CLI",TKe=()=>"无 Slurm CLI",AKe=()=>"بدون CLI اسلورم",RKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TKe():t==="fa"?AKe():jKe()}),MKe=()=>"None registered",DKe=()=>"未注册任何密钥",LKe=()=>"هیچ‌کدام ثبت نشده",OKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DKe():t==="fa"?LKe():MKe()}),IKe=()=>"Not checked",BKe=()=>"未检查",$Ke=()=>"بررسی نشده",gL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BKe():t==="fa"?$Ke():IKe()}),PKe=()=>"Not configured",FKe=()=>"未配置",HKe=()=>"پیکربندی نشده",tb=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FKe():t==="fa"?HKe():PKe()}),qKe=()=>"Not installed",UKe=()=>"未安装",GKe=()=>"نصب نیست",WKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UKe():t==="fa"?GKe():qKe()}),VKe=()=>"Not now",KKe=()=>"暂不",QKe=()=>"اکنون نه",YKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KKe():t==="fa"?QKe():VKe()}),XKe=()=>"Not on this computer",ZKe=()=>"不在此计算机上",JKe=()=>"روی این رایانه نیست",eQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZKe():t==="fa"?JKe():XKe()}),tQe=()=>"Not set (pass --host per launch)",nQe=()=>"未设置(每次启动时传入 --host)",rQe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",sQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Not signed in",aQe=()=>"未登录",oQe=()=>"وارد نشده",vL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),lQe=()=>"On this computer",cQe=()=>"在此计算机上",uQe=()=>"روی این رایانه",dQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cQe():t==="fa"?uQe():lQe()}),fQe=()=>"Open a project to inspect its repository and GitHub publication state.",hQe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",_Qe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",pQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hQe():t==="fa"?_Qe():fQe()}),mQe=()=>"Open job page",gQe=()=>"打开作业页面",vQe=()=>"باز کردن صفحهٔ کار",AN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gQe():t==="fa"?vQe():mQe()}),bQe=()=>"Open on GitHub",yQe=()=>"在 GitHub 上打开",xQe=()=>"باز کردن در GitHub",RN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yQe():t==="fa"?xQe():bQe()}),wQe=()=>", or create one with",SQe=()=>",或使用以下命令创建:",kQe=()=>"، یا با این فرمان یکی بسازید:",CQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SQe():t==="fa"?kQe():wQe()}),EQe=()=>"Org",NQe=()=>"组织",zQe=()=>"سازمان",jQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"Orgs",AQe=()=>"组织",RQe=()=>"سازمان‌ها",MQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),DQe=()=>"orx can't update this install",LQe=()=>"orx 无法更新此安装",OQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",IQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LQe():t==="fa"?OQe():DQe()}),BQe=()=>"Overleaf",$Qe=()=>"Overleaf",PQe=()=>"Overleaf",bL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),FQe=()=>"Overleaf Git authentication token",HQe=()=>"Overleaf Git 身份验证令牌",qQe=()=>"توکن احراز هویت Git در Overleaf",UQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HQe():t==="fa"?qQe():FQe()}),GQe=()=>"Overridden by env",WQe=()=>"已被环境变量覆盖",VQe=()=>"بازنویسی‌شده توسط محیط",KQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WQe():t==="fa"?VQe():GQe()}),QQe=()=>"Partition",YQe=()=>"分区",XQe=()=>"پارتیشن",ZQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YQe():t==="fa"?XQe():QQe()}),JQe=()=>"Path",eYe=()=>"路径",tYe=()=>"مسیر",nYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eYe():t==="fa"?tYe():JQe()}),rYe=()=>"Plan",sYe=()=>"方案",iYe=()=>"سطح اشتراک",aYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sYe():t==="fa"?iYe():rYe()}),oYe=()=>"Project",lYe=()=>"项目",cYe=()=>"پروژه",uYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lYe():t==="fa"?cYe():oYe()}),dYe=()=>"Ray version",fYe=()=>"Ray 版本",hYe=()=>"نسخهٔ Ray",_Ye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),pYe=()=>"Reachable",mYe=()=>"可访问",gYe=()=>"در دسترس",vYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mYe():t==="fa"?gYe():pYe()}),bYe=()=>"Reading ~/.ssh/config…",yYe=()=>"正在读取 ~/.ssh/config…",xYe=()=>"در حال خواندن ‎~/.ssh/config…",yL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yYe():t==="fa"?xYe():bYe()}),wYe=()=>"Ready",SYe=()=>"就绪",kYe=()=>"آماده",Yp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),CYe=()=>"Ready to move",EYe=()=>"可以移动",NYe=()=>"آمادهٔ انتقال",zYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EYe():t==="fa"?NYe():CYe()}),jYe=()=>"Configured",TYe=()=>"已配置",AYe=()=>"پیکربندی‌شده",h6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),RYe=()=>"Refresh",MYe=()=>"刷新",DYe=()=>"تازه‌سازی",Xp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MYe():t==="fa"?DYe():RYe()}),LYe=()=>"Remotes",OYe=()=>"远程仓库",IYe=()=>"مخزن‌های دوردست",BYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OYe():t==="fa"?IYe():LYe()}),$Ye=()=>"Repository",PYe=()=>"仓库",FYe=()=>"مخزن",HYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PYe():t==="fa"?FYe():$Ye()}),qYe=()=>"Repository topics",UYe=()=>"仓库 topic",GYe=()=>"موضوع‌های مخزن",S1=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UYe():t==="fa"?GYe():qYe()}),WYe=()=>"Restart to finish updating",VYe=()=>"重新启动以完成更新",KYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",QYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VYe():t==="fa"?KYe():WYe()}),YYe=()=>"Running instances",XYe=()=>"正在运行的实例",ZYe=()=>"نمونه‌های در حال اجرا",JYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),eXe=()=>"Runtime",tXe=()=>"运行时间",nXe=()=>"زمان اجرا",rXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>". Save it under that key if it's meant for HF Jobs.",iXe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",aXe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",oXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>"Session cookie",cXe=()=>"会话 cookie",uXe=()=>"کوکی نشست",dXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),fXe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",hXe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",_Xe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",pXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hXe():t==="fa"?_Xe():fXe()}),mXe=()=>"Settings",gXe=()=>"设置",vXe=()=>"تنظیمات",_6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gXe():t==="fa"?vXe():mXe()}),bXe=()=>"Signed in",yXe=()=>"已登录",xXe=()=>"وارد شده",wXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yXe():t==="fa"?xXe():bXe()}),SXe=()=>"Source",kXe=()=>"来源",CXe=()=>"منبع",xL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kXe():t==="fa"?CXe():SXe()}),EXe=()=>"SSH Key",NXe=()=>"SSH 密钥",zXe=()=>"کلید SSH",jXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NXe():t==="fa"?zXe():EXe()}),TXe=()=>"Started",AXe=()=>"开始时间",RXe=()=>"آغاز",MXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),DXe=()=>"State",LXe=()=>"状态",OXe=()=>"وضعیت",IXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LXe():t==="fa"?OXe():DXe()}),BXe=()=>"Status",$Xe=()=>"状态",PXe=()=>"وضعیت",l_=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),FXe=()=>"Storage",HXe=()=>"存储",qXe=()=>"ذخیره‌سازی",UXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HXe():t==="fa"?qXe():FXe()}),GXe=()=>"Sync",WXe=()=>"同步",VXe=()=>"همگام‌سازی",KXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"Syncing off",YXe=()=>"同步已关闭",XXe=()=>"همگام‌سازی خاموش",ZXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Test connection",eZe=()=>"测试连接",tZe=()=>"آزمایش اتصال",nZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Testing…",sZe=()=>"正在测试…",iZe=()=>"در حال آزمایش…",aZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),oZe=()=>", then add it with",lZe=()=>",然后使用以下命令添加:",cZe=()=>"، سپس با این فرمان اضافه‌اش کنید:",uZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lZe():t==="fa"?cZe():oZe()}),dZe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",fZe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",hZe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",_Ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fZe():t==="fa"?hZe():dZe()}),pZe=()=>"This saved destination is not configured. Set it up below or choose another backend.",mZe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",gZe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",vZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mZe():t==="fa"?gZe():pZe()}),bZe=()=>"This value looks like a Hugging Face token — compute runs only read it from",yZe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",xZe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",wZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yZe():t==="fa"?xZe():bZe()}),SZe=()=>"Time limit",kZe=()=>"时间限制",CZe=()=>"محدودیت زمانی",EZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Unable to verify",zZe=()=>"无法验证",jZe=()=>"تأیید ممکن نیست",M4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),TZe=()=>"Unknown",AZe=()=>"未知",RZe=()=>"نامشخص",wL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AZe():t==="fa"?RZe():TZe()}),MZe=()=>"Update required",DZe=()=>"需要更新",LZe=()=>"نیازمند به‌روزرسانی",OZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DZe():t==="fa"?LZe():MZe()}),IZe=()=>"Updates",BZe=()=>"更新",$Ze=()=>"به‌روزرسانی‌ها",MN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BZe():t==="fa"?$Ze():IZe()}),PZe=()=>"Usage analytics",FZe=()=>"使用情况分析",HZe=()=>"تحلیل استفاده",qZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FZe():t==="fa"?HZe():PZe()}),UZe=()=>"value",GZe=()=>"值",WZe=()=>"مقدار",SL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GZe():t==="fa"?WZe():UZe()}),VZe=()=>"Variables available to runs and the research agent (API keys, tokens).",KZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",QZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",YZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZe():t==="fa"?QZe():VZe()}),XZe=()=>"Version",ZZe=()=>"版本",JZe=()=>"نسخه",kL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZe():t==="fa"?JZe():XZe()}),eJe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",tJe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",nJe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",rJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tJe():t==="fa"?nJe():eJe()}),sJe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",iJe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",aJe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",oJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iJe():t==="fa"?aJe():sJe()}),lJe=()=>"Pick a login node first",cJe=()=>"请先选择登录节点",uJe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",dJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cJe():t==="fa"?uJe():lJe()}),fJe=()=>"Providers",hJe=()=>"提供商",_Je=()=>"ارائه‌دهندگان",pJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hJe():t==="fa"?_Je():fJe()}),mJe=()=>"Reconnect",gJe=()=>"重新连接",vJe=()=>"اتصال دوباره",CL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gJe():t==="fa"?vJe():mJe()}),bJe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yJe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,xJe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,wJe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yJe(e):t==="fa"?xJe(e):bJe(e)}),SJe=()=>"Reinstall with the orx installer to get automatic updates.",kJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",CJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",EJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kJe():t==="fa"?CJe():SJe()}),NJe=()=>"Re-link",zJe=()=>"重新链接",jJe=()=>"پیوند دوباره",TJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zJe():t==="fa"?jJe():NJe()}),AJe=()=>"Remove cookie",RJe=()=>"移除 cookie",MJe=()=>"حذف کوکی",DJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RJe():t==="fa"?MJe():AJe()}),LJe=()=>"Remove token",OJe=()=>"移除令牌",IJe=()=>"حذف توکن",BJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OJe():t==="fa"?IJe():LJe()}),$Je=()=>"Removing…",PJe=()=>"正在移除…",FJe=()=>"در حال حذف…",DN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PJe():t==="fa"?FJe():$Je()}),HJe=()=>"Replace anyway",qJe=()=>"仍要替换",UJe=()=>"به‌هرحال جایگزین کن",GJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qJe():t==="fa"?UJe():HJe()}),WJe=()=>"Replace key",VJe=()=>"替换密钥",KJe=()=>"جایگزینی کلید",QJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJe():t==="fa"?KJe():WJe()}),YJe=()=>"Replace token",XJe=()=>"替换令牌",ZJe=()=>"جایگزینی توکن",JJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XJe():t==="fa"?ZJe():YJe()}),eet=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,tet=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,net=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,ret=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tet(e):t==="fa"?net(e):eet(e)}),set=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,iet=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,aet=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,oet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iet(e):t==="fa"?aet(e):set(e)}),cet=()=>"Run `gh auth login` in your terminal.",uet=()=>"请在终端中运行 `gh auth login`。",det=()=>"در پایانه `gh auth login` را اجرا کنید.",fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uet():t==="fa"?det():cet()}),het=()=>"Saved",_et=()=>"已保存",pet=()=>"ذخیره شده",LN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_et():t==="fa"?pet():het()}),met=()=>"Set up",get=()=>"设置",vet=()=>"راه‌اندازی",bet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?get():t==="fa"?vet():met()}),yet=()=>"Set up SSH key",xet=()=>"设置 SSH 密钥",wet=()=>"راه‌اندازی کلید SSH",ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"Sign in",Eet=()=>"登录",Net=()=>"ورود",EL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),zet=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,jet=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Tet=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,NL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jet(e):t==="fa"?Tet(e):zet(e)}),Aet=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Ret=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Met=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Det=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ret():t==="fa"?Met():Aet()}),Let=()=>"The terminal disconnected before setup completed. Try again.",Oet=()=>"设置完成前终端连接已断开。请重试。",Iet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",ON=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oet():t==="fa"?Iet():Let()}),Bet=()=>"Dark",$et=()=>"深色",Pet=()=>"تیره",Fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$et():t==="fa"?Pet():Bet()}),Het=()=>"Theme",qet=()=>"主题",Uet=()=>"پوسته",IN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qet():t==="fa"?Uet():Het()}),Get=()=>"Light",Wet=()=>"浅色",Vet=()=>"روشن",Ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wet():t==="fa"?Vet():Get()}),Qet=()=>"System",Yet=()=>"系统",Xet=()=>"سیستم",Zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=()=>"Set up billing in the Tinker console",ett=()=>"在 Tinker 控制台设置账单",ttt=()=>"تنظیم پرداخت در کنسول Tinker",ntt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ett():t==="fa"?ttt():Jet()}),rtt=()=>"Billing setup required",stt=()=>"需要设置账单",itt=()=>"تنظیم پرداخت لازم است",att=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",ltt=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",ctt=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",utt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"Invalid Key",ftt=()=>"密钥无效",htt=()=>"کلید نامعتبر",_tt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Token from",mtt=()=>"令牌来自",gtt=()=>"توکن از",vtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),btt=()=>"Update now",ytt=()=>"立即更新",xtt=()=>"اکنون به‌روزرسانی کن",wtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ytt():t==="fa"?xtt():btt()}),Stt=e=>`Update to ${e==null?void 0:e.version}`,ktt=e=>`更新到 ${e==null?void 0:e.version}`,Ctt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Ett=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ktt(e):t==="fa"?Ctt(e):Stt(e)}),Ntt=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",ztt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",jtt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Ttt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ztt():t==="fa"?jtt():Ntt()}),Att=()=>"Updating default destination…",Rtt=()=>"正在更新默认运行位置…",Mtt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Dtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rtt():t==="fa"?Mtt():Att()}),Ltt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",Ott=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Itt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Btt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ott():t==="fa"?Itt():Ltt()}),$tt=()=>"Validating…",Ptt=()=>"正在验证…",Ftt=()=>"در حال اعتبارسنجی…",zL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ptt():t==="fa"?Ftt():$tt()}),Htt=()=>"View settings",qtt=()=>"查看设置",Utt=()=>"مشاهدهٔ تنظیمات",Gtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qtt():t==="fa"?Utt():Htt()}),Wtt=()=>"Skill",Vtt=()=>"技能",Ktt=()=>"مهارت",Qtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vtt():t==="fa"?Ktt():Wtt()}),Ytt=()=>"Loading skill…",Xtt=()=>"正在加载技能…",Ztt=()=>"در حال بارگیری مهارت…",Jtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xtt():t==="fa"?Ztt():Ytt()}),ent=()=>"Personal",tnt=()=>"个人",nnt=()=>"شخصی",rnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Alternatively, tell your agent to save a reusable skill for you.",int=()=>"或者,请你的智能体为你保存可重复使用的技能。",ant=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",ont=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,cnt=e=>`删除技能“${e==null?void 0:e.name}”?`,unt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,dnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cnt(e):t==="fa"?unt(e):lnt(e)}),fnt=e=>`Delete skill ${e==null?void 0:e.name}`,hnt=e=>`删除技能 ${e==null?void 0:e.name}`,_nt=e=>`حذف مهارت ${e==null?void 0:e.name}`,pnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hnt(e):t==="fa"?_nt(e):fnt(e)}),mnt=e=>`Delete the “${e==null?void 0:e.name}” template?`,gnt=e=>`删除模板“${e==null?void 0:e.name}”?`,vnt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,bnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gnt(e):t==="fa"?vnt(e):mnt(e)}),ynt=e=>`Delete template ${e==null?void 0:e.name}`,xnt=e=>`删除模板 ${e==null?void 0:e.name}`,wnt=e=>`حذف قالب ${e==null?void 0:e.name}`,Snt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xnt(e):t==="fa"?wnt(e):ynt(e)}),knt=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",Cnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Ent=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Nnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cnt():t==="fa"?Ent():knt()}),znt=()=>"Drop a SKILL.md or .zip here, or click to choose",jnt=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Tnt=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Ant=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jnt():t==="fa"?Tnt():znt()}),Rnt=()=>"Drop a .tex or .zip here, or click to choose",Mnt=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Dnt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Lnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mnt():t==="fa"?Dnt():Rnt()}),Ont=()=>"File too large (max 20 MB).",Int=()=>"文件过大(最大 20 MB)。",Bnt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",jL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Int():t==="fa"?Bnt():Ont()}),$nt=()=>" + 1 file",Pnt=()=>" + 1 个文件",Fnt=()=>" + ۱ فایل",Hnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pnt():t==="fa"?Fnt():$nt()}),qnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Unt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Gnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Wnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Remove from OpenResearch",Knt=()=>"从 OpenResearch 移除",Qnt=()=>"حذف از OpenResearch",Ynt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,Znt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,Jnt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,ert=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Znt(e):t==="fa"?Jnt(e):Xnt(e)}),trt=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,nrt=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,rrt=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,srt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nrt(e):t==="fa"?rrt(e):trt(e)}),irt=e=>` + ${e==null?void 0:e.count} files`,art=e=>` + ${e==null?void 0:e.count} 个文件`,ort=e=>` + ${e==null?void 0:e.count} فایل`,lrt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?art(e):t==="fa"?ort(e):irt(e)}),crt=()=>"Could not load skills:",urt=()=>"无法加载技能:",drt=()=>"بارگیری مهارت‌ها ممکن نشد:",frt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?urt():t==="fa"?drt():crt()}),hrt=()=>"Could not load templates:",_rt=()=>"无法加载模板:",prt=()=>"بارگیری قالب‌ها ممکن نشد:",mrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"Customize",vrt=()=>"自定义",brt=()=>"سفارشی‌سازی",yrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"Delete skill",wrt=()=>"删除技能",Srt=()=>"حذف مهارت",krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Delete template",Ert=()=>"删除模板",Nrt=()=>"حذف قالب",zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"LaTeX templates",Trt=()=>"LaTeX 模板",Art=()=>"قالب‌های LaTeX",Rrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"Loading skills…",Drt=()=>"正在加载技能…",Lrt=()=>"در حال بارگیری مهارت‌ها…",Ort=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Loading templates…",Brt=()=>"正在加载模板…",$rt=()=>"در حال بارگیری قالب‌ها…",Prt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"No skills yet.",Hrt=()=>"尚无技能。",qrt=()=>"هنوز مهارتی وجود ندارد.",Urt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"No templates yet.",Wrt=()=>"尚无模板。",Vrt=()=>"هنوز قالبی وجود ندارد.",Krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"Skills",Yrt=()=>"技能",Xrt=()=>"مهارت‌ها",Zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Uploading…",est=()=>"正在上传…",tst=()=>"در حال بارگذاری…",nst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",sst=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",ist=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ast=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"Upload a SKILL.md file or a .zip of a skill folder.",lst=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",cst=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",ust=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Upload a .tex file or a .zip of a template folder.",fst=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",hst=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",_st=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),pst=()=>"Close SSH config",mst=()=>"关闭 SSH 配置",gst=()=>"بستن پیکربندی SSH",vst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mst():t==="fa"?gst():pst()}),bst=()=>"Discard your unsaved SSH config changes?",yst=()=>"要放弃未保存的 SSH 配置更改吗?",xst=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",wst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yst():t==="fa"?xst():bst()}),Sst=()=>"Loading SSH config…",kst=()=>"正在加载 SSH 配置…",Cst=()=>"در حال بارگیری پیکربندی SSH…",Est=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kst():t==="fa"?Cst():Sst()}),Nst=()=>"SSH config saved",zst=()=>"SSH 配置已保存",jst=()=>"پیکربندی SSH ذخیره شد",Tst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zst():t==="fa"?jst():Nst()}),Ast=()=>"SSH config",Rst=()=>"SSH 配置",Mst=()=>"پیکربندی SSH",Dst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rst():t==="fa"?Mst():Ast()}),Lst=()=>"Configure SSH hosts…",Ost=()=>"配置 SSH 主机…",Ist=()=>"پیکربندی میزبان‌های SSH…",TL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ost():t==="fa"?Ist():Lst()}),Bst=()=>"Cancelled",$st=()=>"已取消",Pst=()=>"لغوشده",Fst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$st():t==="fa"?Pst():Bst()}),Hst=()=>"Cancelling",qst=()=>"正在取消",Ust=()=>"در حال لغو",Gst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Done",Vst=()=>"已完成",Kst=()=>"انجام‌شده",Qst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Editing",Xst=()=>"正在编辑",Zst=()=>"در حال ویرایش",Jst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=()=>"Failed",tit=()=>"失败",nit=()=>"ناموفق",rit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tit():t==="fa"?nit():eit()}),sit=()=>"Idle",iit=()=>"空闲",ait=()=>"بی‌کار",oit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iit():t==="fa"?ait():sit()}),lit=()=>"Running",cit=()=>"运行中",uit=()=>"در حال اجرا",dit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Starting",hit=()=>"正在启动",_it=()=>"در حال آغاز",pit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Copying…",git=()=>"正在复制…",vit=()=>"در حال کپی…",bit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>"Finalizing…",xit=()=>"正在完成…",wit=()=>"در حال نهایی‌سازی…",Sit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=e=>`${e==null?void 0:e.size} free at target`,Cit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,Eit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,Nit=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Cit(e):t==="fa"?Eit(e):kit(e)}),zit=e=>`Move all orx data to: ${e==null?void 0:e.path} The store is copied to the new location and activated there. Active runs or chats will block the move.`,jit=e=>`将所有 orx 数据移动到: @@ -77,15 +77,15 @@ ${e==null?void 0:e.path} 存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,Tit=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ ${e==null?void 0:e.path} -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",E2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),N2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",p6="chat_demo_nanochat_figures_v1",m6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[p6]:"figures",[m6]:"literature"},S1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class D4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new D4(s,a,i.exists)}}catch(i){if(i instanceof D4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),tb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??O4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?r6():n,r=O4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const rv="default";function nb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===rv)?rv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const L4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:L4,label:pBe(),description:dBe()},...t]:[]}function sv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?L4:t!=null&&s.some(a=>a.id===t)?t:L4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=nb(e,n);return r.length===0?rv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function O4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(Jv(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),iv=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),v6=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function rb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const k1=new Map;function kht(e,n){let t=k1.get(e);return t||(t=new Set,k1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&k1.delete(e)}}function Cht(e){var n;(n=k1.get(e.runId))==null||n.forEach(t=>t(e))}const I4=new Set;function av(e){return I4.add(e),()=>{I4.delete(e)}}function bl(e){I4.forEach(n=>n(e))}const B4=new Set;function Eht(e){return B4.add(e),()=>{B4.delete(e)}}function yl(){B4.forEach(e=>e())}const $4=new Set;function Nht(e){return $4.add(e),()=>{$4.delete(e)}}function WN(e){$4.forEach(n=>n(e))}const P4=new Set;function tO(e){return P4.add(e),()=>{P4.delete(e)}}function z2(e){P4.forEach(n=>n(e))}const F4=new Set;function zht(e){return F4.add(e),()=>{F4.delete(e)}}function VN(e){F4.forEach(n=>n(e))}const H4=new Set;function jht(e){return H4.add(e),()=>{H4.delete(e)}}function Tht(e){H4.forEach(n=>n(e))}let q4=!0;const U4=new Set;function Aht(e){return U4.add(e),()=>{U4.delete(e)}}function KN(){return q4}function QN(e){e!==q4&&(q4=e,U4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&z2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&z2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&z2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const ov=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return ov.add(t),()=>{ov.delete(t)}},[])}const YN={onRun:e=>ov.forEach(n=>n.onRun(e)),onReconnect:()=>ov.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),G4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),W4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,W4(n.projectId).queryKey,n.id),nt.setQueryData(W4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(X5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=av(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?Jv(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&rb(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,iv().queryKey),nt.setQueryData(iv().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const V4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of V4)n()}}function Pht(e){return V4.add(e),()=>V4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const K4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of K4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return K4.add(e),()=>K4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),lv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(lv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(lv):e.slice(n).join(lv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(lv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Q4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Q4)?(p=d.slice(0,-1),m=!0):d.startsWith(Q4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Q4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),j2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],q=()=>["auto","min","max","fr",pt,ht],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],F=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],ee=()=>[j2,c0,Qu],de=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,j2,iz,sz],oe=()=>["","none",x,pt,ht],ce=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",j2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Y4(e,s,"postfixLookupClassGroups"),Y4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)Y4(e,n,t)},Y4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function sb({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ib({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:q,gap:U,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,W]=Je.useState(null),[H,ee]=Je.useState(!1),[de,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ce,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=q.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(q)},[e.swipeDirections,q]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*U+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{ee(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!H)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[H,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":H,"data-promise":!!d.promise,"data-swiped":ce,"data-removed":de,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&H),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${de?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(ee=>ee.toasterId===r):T.filter(ee=>!ee.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(ee=>ee.position).map(ee=>ee.position)))),[M,i]),[B,$]=Je.useState([]),[q,U]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),W=Je.useRef(!1),H=Je.useCallback(ee=>{j(de=>{var re;return(re=de.find(ne=>ne.id===ee.id))!=null&&re.delete||wi.dismiss(ee.id),de.filter(({id:ne})=>ne!==ee.id)})},[]);return Je.useEffect(()=>wi.subscribe(ee=>{if(ee.dismiss){requestAnimationFrame(()=>{j(de=>de.map(re=>re.id===ee.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(de=>{const re=de.findIndex(ne=>ne.id===ee.id);return re!==-1?[...de.slice(0,re),{...de[re],...ee},...de.slice(re+1)]:[ee,...de]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:de})=>{te(de?"dark":"light")})}catch{ee.addListener(({matches:re})=>{try{te(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&U(!1)},[T]),Je.useEffect(()=>{const ee=de=>{var re;if(a.length>0&&a.every(le=>de[le]||de.code===le)){var Q;U(!0),(Q=I.current)==null||Q.focus()}de.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((ee,de)=>{var re;const[ne,Q]=ee.split("-");return M.length?Je.createElement("ol",{key:ee,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{Y||U(!1)},onDragEnd:()=>U(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&de===0||le.position===ee).map((le,oe)=>{var ce,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ce=b==null?void 0:b.duration)!=null?ce:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:ee,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:H,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:q,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ab(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),ab(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var T2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(T2)),T2.exports}var N0t=E0t(),A2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(A2)),A2.exports}var j0t=z0t(),R2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",N2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),z2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",p6="chat_demo_nanochat_figures_v1",m6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[p6]:"figures",[m6]:"literature"},k1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class D4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new D4(s,a,i.exists)}}catch(i){if(i instanceof D4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),nb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??O4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?r6():n,r=O4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const sv="default";function rb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===sv)?sv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const L4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:L4,label:pBe(),description:dBe()},...t]:[]}function iv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?L4:t!=null&&s.some(a=>a.id===t)?t:L4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=rb(e,n);return r.length===0?sv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function O4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(eb(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),av=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),v6=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function sb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const C1=new Map;function kht(e,n){let t=C1.get(e);return t||(t=new Set,C1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&C1.delete(e)}}function Cht(e){var n;(n=C1.get(e.runId))==null||n.forEach(t=>t(e))}const I4=new Set;function ov(e){return I4.add(e),()=>{I4.delete(e)}}function bl(e){I4.forEach(n=>n(e))}const B4=new Set;function Eht(e){return B4.add(e),()=>{B4.delete(e)}}function yl(){B4.forEach(e=>e())}const $4=new Set;function Nht(e){return $4.add(e),()=>{$4.delete(e)}}function WN(e){$4.forEach(n=>n(e))}const P4=new Set;function tO(e){return P4.add(e),()=>{P4.delete(e)}}function j2(e){P4.forEach(n=>n(e))}const F4=new Set;function zht(e){return F4.add(e),()=>{F4.delete(e)}}function VN(e){F4.forEach(n=>n(e))}const H4=new Set;function jht(e){return H4.add(e),()=>{H4.delete(e)}}function Tht(e){H4.forEach(n=>n(e))}let q4=!0;const U4=new Set;function Aht(e){return U4.add(e),()=>{U4.delete(e)}}function KN(){return q4}function QN(e){e!==q4&&(q4=e,U4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&j2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&j2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&j2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const lv=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return lv.add(t),()=>{lv.delete(t)}},[])}const YN={onRun:e=>lv.forEach(n=>n.onRun(e)),onReconnect:()=>lv.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),G4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),W4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,W4(n.projectId).queryKey,n.id),nt.setQueryData(W4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(X5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=ov(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?eb(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&sb(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,av().queryKey),nt.setQueryData(av().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const V4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of V4)n()}}function Pht(e){return V4.add(e),()=>V4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const K4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of K4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return K4.add(e),()=>K4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),cv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(cv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(cv):e.slice(n).join(cv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(cv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Q4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Q4)?(p=d.slice(0,-1),m=!0):d.startsWith(Q4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Q4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),T2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],H=()=>["auto","min","max","fr",pt,ht],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],F=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],Z=()=>[T2,c0,Qu],ce=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,T2,iz,sz],oe=()=>["","none",x,pt,ht],ue=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",T2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Y4(e,s,"postfixLookupClassGroups"),Y4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)Y4(e,n,t)},Y4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function ib({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ab({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:H,gap:q,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,W]=Je.useState(null),[U,Z]=Je.useState(!1),[ce,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ue,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=H.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(H)},[e.swipeDirections,H]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*q+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{Z(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!U)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ue,"data-removed":ce,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&U),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${ce?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(Z=>Z.toasterId===r):T.filter(Z=>!Z.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(Z=>Z.position).map(Z=>Z.position)))),[M,i]),[B,$]=Je.useState([]),[H,q]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),W=Je.useRef(!1),U=Je.useCallback(Z=>{j(ce=>{var re;return(re=ce.find(ne=>ne.id===Z.id))!=null&&re.delete||wi.dismiss(Z.id),ce.filter(({id:ne})=>ne!==Z.id)})},[]);return Je.useEffect(()=>wi.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{j(ce=>ce.map(re=>re.id===Z.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(ce=>{const re=ce.findIndex(ne=>ne.id===Z.id);return re!==-1?[...ce.slice(0,re),{...ce[re],...Z},...ce.slice(re+1)]:[Z,...ce]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:ce})=>{te(ce?"dark":"light")})}catch{Z.addListener(({matches:re})=>{try{te(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&q(!1)},[T]),Je.useEffect(()=>{const Z=ce=>{var re;if(a.length>0&&a.every(le=>ce[le]||ce.code===le)){var Q;q(!0),(Q=I.current)==null||Q.focus()}ce.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((Z,ce)=>{var re;const[ne,Q]=Z.split("-");return M.length?Je.createElement("ol",{key:Z,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Y||q(!1)},onDragEnd:()=>q(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&ce===0||le.position===Z).map((le,oe)=>{var ue,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ue=b==null?void 0:b.duration)!=null?ue:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:Z,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:H,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ob(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),ob(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var A2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(A2)),A2.exports}var N0t=E0t(),R2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(R2)),R2.exports}var j0t=z0t(),M2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let q=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get($);if(!U)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++q,Y=0),{row:q,column:Y}},T=N(y),j=N(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var O,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=j;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let O=0;Oy?y.activate(U,Y,$):x(0,Y),hover:(U,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,U,Y,$)},leave:(U,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,U,Y,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let H=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const q=this._rowColumns.get($);if(!q)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++H,Y=0),{row:H,column:Y}},T=N(y),j=N(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var O,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=j;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let O=0;Oy?y.activate(q,Y,$):x(0,Y),hover:(q,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,q,Y,$)},leave:(q,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,q,Y,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? -WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=l(3614),_=l(3656),d=l(3551),p=l(9042),m=l(3730),x=l(1680),S=l(3107),v=l(5744),b=l(2950),w=l(1296),y=l(428),C=l(4269),E=l(5114),N=l(8934),T=l(3230),j=l(9312),M=l(4725),O=l(6731),B=l(8055),$=l(8969),q=l(8460),U=l(844),Y=l(6114),G=l(8437),X=l(2584),te=l(7399),I=l(5941),L=l(9074),F=l(2585),W=l(5435),H=l(4567),ee=l(779);class de extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ne={}){super(ne),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new q.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new q.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new q.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new q.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new q.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new q.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new q.EventEmitter),this._onBlur=this.register(new q.EventEmitter),this._onA11yCharEmitter=this.register(new q.EventEmitter),this._onA11yTabEmitter=this.register(new q.EventEmitter),this._onWillOpen=this.register(new q.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((Q,le)=>this.refresh(Q,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((Q=>this._reportWindowsOptions(Q)))),this.register(this._inputHandler.onColor((Q=>this._handleColorEvent(Q)))),this.register((0,q.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,q.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((Q=>this._afterResize(Q.cols,Q.rows)))),this.register((0,U.toDisposable)((()=>{var Q,le;this._customKeyEventHandler=void 0,(le=(Q=this.element)==null?void 0:Q.parentNode)==null||le.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const Q of ne){let le,oe="";switch(Q.index){case 256:le="foreground",oe="10";break;case 257:le="background",oe="11";break;case 258:le="cursor",oe="12";break;default:le="ansi",oe="4;"+Q.index}switch(Q.type){case 0:const ce=B.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[Q.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${oe};${(0,I.toRgbString)(ce)}${X.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((pe=>pe.ansi[Q.index]=B.channels.toColor(...Q.color)));else{const pe=le;this._themeService.modifyColors((Se=>Se[pe]=B.channels.toColor(...Q.color)))}break;case 2:this._themeService.restoreColor(Q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ne=this.buffer.ybase+this.buffer.y,Q=this.buffer.lines.get(ne);if(!Q)return;const le=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ce=Q.getWidth(le),pe=this._renderService.dimensions.css.cell.width*ce,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,ye=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ye+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(Q=>{this.hasSelection()&&(0,u.copyHandler)(Q,this._selectionService)})));const ne=Q=>(0,u.handlePasteEvent)(Q,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,_.addDisposableDomListener)(this.element,"paste",ne)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(Q=>{Q.button===2&&(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(Q=>{(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(Q=>{Q.button===1&&(0,u.moveTextAreaUnderMouseCursor)(Q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var le;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((le=this.element)==null?void 0:le.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ne.appendChild(this.element);const Q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,Q=this.element;function le(pe){const Se=ne._mouseService.getMouseReportCoords(pe,ne.screenElement);if(!Se)return!1;let ye,qe;switch(pe.overrideType||pe.type){case"mousemove":qe=32,pe.buttons===void 0?(ye=3,pe.button!==void 0&&(ye=pe.button<3?pe.button:3)):ye=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":qe=0,ye=pe.button<3?pe.button:3;break;case"mousedown":qe=1,ye=pe.button<3?pe.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(pe)===!1||ne.viewport.getLinesScrolled(pe)===0)return!1;qe=pe.deltaY<0?0:1,ye=4;break;default:return!1}return!(qe===void 0||ye===void 0||ye>4)&&ne.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:ye,action:qe,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:pe=>(le(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(le(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&le(pe)},mousemove:pe=>{pe.buttons||le(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?oe.mousemove||(Q.addEventListener("mousemove",ce.mousemove),oe.mousemove=ce.mousemove):(Q.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(Q.addEventListener("wheel",ce.wheel,{passive:!1}),oe.wheel=ce.wheel):(Q.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(Q,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return le(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,_.addDisposableDomListener)(Q,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(pe);if(Se===0)return;const ye=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let qe="";for(let Ie=0;Ie{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(Q,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(ne,Q){var le;(le=this._renderService)==null||le.refreshRows(ne,Q)}updateCursorStyle(ne){var Q;(Q=this._selectionService)!=null&&Q.shouldColumnSelect(ne)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ne,Q,le=0){var oe;le===1?(super.scrollLines(ne,Q,le),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(ne)}paste(ne){(0,u.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const Q=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),Q}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,Q,le){this._selectionService.setSelection(ne,Q,le)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,Q){var le;(le=this._selectionService)==null||le.selectLines(ne,Q)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const Q=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!Q&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;Q||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,te.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),le.type===3||le.type===2){const oe=this.rows-1;return this.scrollLines(le.type===2?-oe:oe),this.cancel(ne,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(le.cancel&&this.cancel(ne,!0),!le.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==X.C0.ETX&&le.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,Q){const le=ne.isMac&&!this.options.macOptionIsMeta&&Q.altKey&&!Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.altKey&&Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.getModifierState("AltGraph");return Q.type==="keypress"?le:le&&(!Q.keyCode||Q.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(Q){return Q.keyCode===16||Q.keyCode===17||Q.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let Q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)Q=ne.charCode;else if(ne.which===null||ne.which===void 0)Q=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;Q=ne.which}return!(!Q||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(Q=String.fromCharCode(Q),this._onKey.fire({key:Q,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(Q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const Q=ne.data;return this.coreService.triggerDataEvent(Q,!0),this.cancel(ne),!0}return!1}resize(ne,Q){ne!==this.cols||Q!==this.rows?super.resize(ne,Q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,Q){var le,oe;(le=this._charSizeService)==null||le.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var ne;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Q=1;Q{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,u=1e3){this._renderCallback=l,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=d-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u)}}},1680:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),p=l(4725),m=l(8460),x=l(844),S=l(2585);let v=o.Viewport=class extends x.Disposable{constructor(b,w,y,C,E,N,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=E,this._renderService=N,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=$),C=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let w=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(b,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const w=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(b,w))}};o.Viewport=v=u([_(2,S.IBufferService),_(3,S.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],v)},3107:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),p=l(844),m=l(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(S,v,b,w,y){super(),this._screenElement=S,this._bufferService=v,this._coreBrowserService=b,this._decorationService=w,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),v.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=S.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(S,v),v}_refreshStyle(S){const v=S.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let b=this._decorationElements.get(S);b||(b=this._createElement(S),S.element=b,this._decorationElements.set(S,b),this._container.appendChild(b),S.onDispose((()=>{this._decorationElements.delete(S),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(b)}}_refreshXPosition(S,v=S.element){if(!v)return;const b=S.options.x??0;(S.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var v;(v=this._decorationElements.get(S))==null||v.remove(),this._decorationElements.delete(S),S.dispose()}};o.BufferDecorationRenderer=x=u([_(1,m.IBufferService),_(2,d.ICoreBrowserService),_(3,m.IDecorationService),_(4,d.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const u of this._zones)if(u.color===l.options.overviewRulerOptions.color&&u.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,l.marker.line))return;if(this._lineAdjacentToZone(u,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(u,l.marker.line)}if(this._zonePoolIndex=l.startBufferLine&&u<=l.endBufferLine}_lineAdjacentToZone(l,u,_){return u>=l.startBufferLine-this._linePadding[_||"full"]&&u<=l.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(l,u){l.startBufferLine=Math.min(l.startBufferLine,u),l.endBufferLine=Math.max(l.endBufferLine,u)}}},5744:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),p=l(4725),m=l(844),x=l(2585),S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let w=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,E,N,T,j,M){var B;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=E,this._decorationService=N,this._renderService=T,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=w=u([_(2,x.IBufferService),_(3,x.IDecorationService),_(4,p.IRenderService),_(5,x.IOptionsService),_(6,p.ICoreBrowserService)],w)},2950:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),p=l(2585),m=l(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,v,b,w,y,C){this._textarea=S,this._compositionView=v,this._bufferService=b,this._optionsService=w,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(S,"");this._dataAlreadySent=b,v.length>S.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,d.IRenderService)],x)},9806:(a,o)=>{function l(u,_,d){const p=d.getBoundingClientRect(),m=u.getComputedStyle(d),x=parseInt(m.getPropertyValue("padding-left")),S=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-x,_.clientY-p.top-S]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(u,_,d,p,m,x,S,v,b){if(!x)return;const w=l(u,_,d);return w?(w[0]=Math.ceil((w[0]+(b?S/2:0))/S),w[1]=Math.ceil(w[1]/v),w[0]=Math.min(Math.max(w[0],1),p+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),m),w):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=l(2584);function _(v,b,w,y){const C=v-d(v,w),E=b-d(b,w),N=Math.abs(C-E)-(function(T,j,M){let O=0;const B=T-d(T,M),$=j-d(j,M);for(let q=0;q=0&&vb?"A":"B"}function m(v,b,w,y,C,E){let N=v,T=b,j="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>E.cols-1?(j+=E.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(j+=E.buffer.translateBufferLineToString(T,!1,0,v+1),N=E.cols-1,v=N,T--);return j+E.buffer.translateBufferLineToString(T,!1,v,N)}function x(v,b){const w=b?"O":"[";return u.C0.ESC+w+v}function S(v,b){v=Math.floor(v);let w="";for(let y=0;y0?B-d(B,$):M;const Y=B,G=(function(X,te,I,L,F,W){let H;return H=_(I,L,F,W).length>0?L-d(L,F):te,X=I&&Hv?"D":"C",S(Math.abs(C-v),x(N,y));N=E>b?"D":"C";const T=Math.abs(E-b);return S((function(j,M){return M.cols-j})(E>b?v:C,w)+(T-1)*w.cols+1+((E>b?C:v)-1),x(N,y))}},1296:function(a,o,l){var u=this&&this.__decorate||function(q,U,Y,G){var X,te=arguments.length,I=te<3?U:G===null?G=Object.getOwnPropertyDescriptor(U,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(q,U,Y,G);else for(var L=q.length-1;L>=0;L--)(X=q[L])&&(I=(te<3?X(I):te>3?X(U,Y,I):X(U,Y))||I);return te>3&&I&&Object.defineProperty(U,Y,I),I},_=this&&this.__param||function(q,U){return function(Y,G){U(Y,G,q)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),p=l(2550),m=l(2223),x=l(6171),S=l(6052),v=l(4725),b=l(8055),w=l(8460),y=l(844),C=l(2585),E="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",j="xterm-bg-",M="xterm-focus",O="xterm-selection";let B=1,$=o.DomRenderer=class extends y.Disposable{constructor(q,U,Y,G,X,te,I,L,F,W,H,ee,de){super(),this._terminal=q,this._document=U,this._element=Y,this._screenElement=G,this._viewportElement=X,this._helperContainer=te,this._linkifier2=I,this._charSizeService=F,this._optionsService=W,this._bufferService=H,this._coreBrowserService=ee,this._themeService=de,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((re=>this._injectCss(re)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((re=>this._handleLinkHover(re)))),this.register(this._linkifier2.onHideLinkUnderline((re=>this._handleLinkLeave(re)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const q=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*q,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*q),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/q),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/q),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(q){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${N} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(q.foreground,.5).css};}`,U+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;U+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${G} { 50% { box-shadow: none; }}`,U+=`@keyframes ${X} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,U+=`${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[te,I]of q.ansi.entries())U+=`${this._terminalSelector} .${T}${te} { color: ${I.css}; }${this._terminalSelector} .${T}${te}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${j}${te} { background-color: ${I.css}; }`;U+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(q.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${j}${m.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const q=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${q}px`,this._rowFactory.defaultSpacing=q}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(q,U){for(let Y=this._rowElements.length;Y<=U;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,U){this._refreshRowElements(q,U),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(q,U,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,U,Y),this.renderRows(0,this._bufferService.rows-1),!q||!U)return;this._selectionRenderModel.update(this._terminal,q,U,Y);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(Y){const F=q[0]>U[0];L.appendChild(this._createSelectionElement(te,F?U[0]:q[0],F?q[0]:U[0],I-te+1))}else{const F=G===te?q[0]:0,W=te===X?U[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(te,F,W));const H=I-te-1;if(L.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,H)),te!==I){const ee=X===I?U[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,ee))}}this._selectionContainer.appendChild(L)}_createSelectionElement(q,U,Y,G=1){const X=this._document.createElement("div"),te=U*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(Y-U);return te+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-te),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=q*this.dimensions.css.cell.height+"px",X.style.left=`${te}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const q of this._rowElements)q.replaceChildren()}renderRows(q,U){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=q;F<=U;F++){const W=F+Y.ydisp,H=this._rowElements[F],ee=Y.lines.get(W);if(!H||!ee)break;H.replaceChildren(...this._rowFactory.createRow(ee,W,W===G,I,L,X,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!0)}_handleLinkLeave(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!1)}_setCellUnderline(q,U,Y,G,X,te){Y<0&&(q=0),G<0&&(U=0);const I=this._bufferService.rows-1;Y=Math.max(Math.min(Y,I),0),G=Math.max(Math.min(G,I),0),X=Math.min(X,this._bufferService.cols);const L=this._bufferService.buffer,F=L.ybase+L.y,W=Math.min(L.x,X-1),H=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=Y;re<=G;++re){const ne=re+L.ydisp,Q=this._rowElements[re],le=L.lines.get(ne);if(!Q||!le)break;Q.replaceChildren(...this._rowFactory.createRow(le,ne,ne===F,ee,de,W,H,this.dimensions.css.cell.width,this._widthCache,te?re===Y?q:0:-1,te?(re===G?U:X)-1:-1))}}};o.DomRenderer=$=u([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],$)},3787:function(a,o,l){var u=this&&this.__decorate||function(N,T,j,M){var O,B=arguments.length,$=B<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,T,j,M);else for(var q=N.length-1;q>=0;q--)(O=N[q])&&($=(B<3?O($):B>3?O(T,j,$):O(T,j))||$);return B>3&&$&&Object.defineProperty(T,j,$),$},_=this&&this.__param||function(N,T){return function(j,M){T(j,M,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),p=l(643),m=l(511),x=l(2585),S=l(8055),v=l(4725),b=l(4269),w=l(6171),y=l(3734);let C=o.DomRendererRowFactory=class{constructor(N,T,j,M,O,B,$){this._document=N,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=M,this._coreService=O,this._decorationService=B,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,j){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=j}createRow(N,T,j,M,O,B,$,q,U,Y,G){const X=[],te=this._characterJoinerService.getJoinedCharacters(T),I=this._themeService.colors;let L,F=N.getNoBgTrimmedLength();j&&F0&&Se===te[0][0]){qe=!0;const We=te.shift();Te=new b.JoinedCellData(this._workCell,N.translateToString(!0,We[0],We[1]),We[1]-We[0]),Ie=We[1]-1,ye=Te.getWidth()}const vt=this._isCellInSelection(Se,T),Dt=j&&Se===B,Ut=pe&&Se>=Y&&Se<=G;let Ft=!1;this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{Ft=!0}));let mt=Te.getChars()||p.WHITESPACE_CELL_CHAR;if(mt===" "&&(Te.isUnderline()||Te.isOverline())&&(mt=" "),oe=ye*q-U.get(mt,Te.isBold(),Te.isItalic()),L){if(W&&(vt&&le||!vt&&!le&&Te.bg===ee)&&(vt&&le&&I.selectionForeground||Te.fg===de)&&Te.extended.ext===re&&Ut===ne&&oe===Q&&!Dt&&!qe&&!Ft){Te.isInvisible()?H+=p.WHITESPACE_CELL_CHAR:H+=mt,W++;continue}W&&(L.textContent=H),L=this._document.createElement("span"),W=0,H=""}else L=this._document.createElement("span");if(ee=Te.bg,de=Te.fg,re=Te.extended.ext,ne=Ut,Q=oe,le=vt,qe&&B>=Se&&B<=Ie&&(B=Se),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ce.push("xterm-cursor-blink"),ce.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(Te.isBold()&&ce.push("xterm-bold"),Te.isItalic()&&ce.push("xterm-italic"),Te.isDim()&&ce.push("xterm-dim"),H=Te.isInvisible()?p.WHITESPACE_CELL_CHAR:Te.getChars()||p.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(ce.push(`xterm-underline-${Te.extended.underlineStyle}`),H===" "&&(H=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let We=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&We<8&&(We+=8),L.style.textDecorationColor=I.ansi[We].css}Te.isOverline()&&(ce.push("xterm-overline"),H===" "&&(H=" ")),Te.isStrikethrough()&&ce.push("xterm-strikethrough"),Ut&&(L.style.textDecoration="underline");let rt=Te.getFgColor(),ut=Te.getFgColorMode(),Ct=Te.getBgColor(),we=Te.getBgColorMode();const Re=!!Te.isInverse();if(Re){const We=rt;rt=Ct,Ct=We;const Gt=ut;ut=we,we=Gt}let Ze,_t,wt,Zt=!1;switch(this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{We.options.layer!=="top"&&Zt||(We.backgroundColorRGB&&(we=50331648,Ct=We.backgroundColorRGB.rgba>>8&16777215,Ze=We.backgroundColorRGB),We.foregroundColorRGB&&(ut=50331648,rt=We.foregroundColorRGB.rgba>>8&16777215,_t=We.foregroundColorRGB),Zt=We.options.layer==="top")})),!Zt&&vt&&(Ze=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ct=Ze.rgba>>8&16777215,we=50331648,Zt=!0,I.selectionForeground&&(ut=50331648,rt=I.selectionForeground.rgba>>8&16777215,_t=I.selectionForeground)),Zt&&ce.push("xterm-decoration-top"),we){case 16777216:case 33554432:wt=I.ansi[Ct],ce.push(`xterm-bg-${Ct}`);break;case 50331648:wt=S.channels.toColor(Ct>>16,Ct>>8&255,255&Ct),this._addStyle(L,`background-color:#${E((Ct>>>0).toString(16),"0",6)}`);break;default:Re?(wt=I.foreground,ce.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):wt=I.background}switch(Ze||Te.isDim()&&(Ze=S.color.multiplyOpacity(wt,.5)),ut){case 16777216:case 33554432:Te.isBold()&&rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(rt+=8),this._applyMinimumContrast(L,wt,I.ansi[rt],Te,Ze,void 0)||ce.push(`xterm-fg-${rt}`);break;case 50331648:const We=S.channels.toColor(rt>>16&255,rt>>8&255,255&rt);this._applyMinimumContrast(L,wt,We,Te,Ze,_t)||this._addStyle(L,`color:#${E(rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,wt,I.foreground,Te,Ze,_t)||Re&&ce.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ce.length&&(L.className=ce.join(" "),ce.length=0),Dt||qe||Ft?L.textContent=H:W++,oe!==this.defaultSpacing&&(L.style.letterSpacing=`${oe}px`),X.push(L),Se=Ie}return L&&W&&(L.textContent=H),X}_applyMinimumContrast(N,T,j,M,O,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let q;if(O||B||(q=$.getColor(T.rgba,j.rgba)),q===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);q=S.color.ensureContrastRatio(O||T,B||j,U),$.setColor((O||T).rgba,(B||j).rgba,q??null)}return!!q&&(this._addStyle(N,`color:${q.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?N>=j[0]&&T>=j[1]&&N=j[1]&&N>=M[0]&&T<=M[1]:T>j[1]&&T=j[0]&&N=j[0])}};function E(N,T,j){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=l.createElement("span");_.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=l.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,d,p,m],this._container.appendChild(_),this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(m),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,u,_,d){l===this._font&&u===this._fontSize&&_===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=u,this._weight=_,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,u,_){let d=0;if(!u&&!_&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const x=this._measure(l,0);return x>0&&(this._flat[d]=x),x}let p=l;u&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),_&&(x|=2),m=this._measure(l,x),m>0&&this._holey.set(p,m)}return m}_measure(l,u){const _=this._measureElements[u];return _.textContent=l.repeat(32),_.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(_){return 57508<=_&&_<=57558}function u(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=u,o.allowRescaling=function(_,d,p,m){return d===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!u(_)&&!l(_)&&!(function(x){return 57344<=x&&x<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return l(_)||(function(d){return 9472<=d&&d<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,d,p=0){return(_-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,d,p,m=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const x=_.buffers.active.ydisp,S=d[1]-x,v=p[1]-x,b=Math.max(S,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=S,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=d[0],this.endCol=p[0])}isCellSelected(_,d,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,u=this.selectionEnd;return!(!l||!u)&&(l[1]>u[1]||l[1]===u[1]&&l[0]>u[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),p=l(8460),m=l(844);let x=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=u([_(2,d.IOptionsService)],x);class S extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class v extends S{constructor(y,C,E){super(),this._document=y,this._parentElement=C,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),p=l(643),m=l(511),x=l(2585);class S extends d.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=S;let v=o.CharacterJoinerService=class CO{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const $=this._getJoinedRanges(E,j,T,y,N);for(let q=0;q<$.length;q++)C.push($[q])}N=B,j=T,M=this._workCell.fg,O=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const B=this._getJoinedRanges(E,j,T,y,N);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=l(844),_=l(8460),d=l(3656);class p extends u.Disposable{constructor(S,v,b){super(),this._textarea=S,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=l(844);class _ extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=_},8934:function(a,o,l){var u=this&&this.__decorate||function(x,S,v,b){var w,y=arguments.length,C=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,S,v,b);else for(var E=x.length-1;E>=0;E--)(w=x[E])&&(C=(y<3?w(C):y>3?w(S,v,C):w(S,v))||C);return y>3&&C&&Object.defineProperty(S,v,C),C},_=this&&this.__param||function(x,S){return function(v,b){S(v,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),p=l(9806);let m=o.MouseService=class{constructor(x,S){this._renderService=x,this._charSizeService=S}getCoords(x,S,v,b,w){return(0,p.getCoords)(window,x,S,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(x,S){const v=(0,p.getCoordsRelativeToElement)(window,x,S);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([_(0,d.IRenderService),_(1,d.ICharSizeService)],m)},3230:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),p=l(4725),m=l(8460),x=l(844),S=l(7226),v=l(2585);let b=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,E,N,T,j,M){super(),this._rowCount=w,this._charSizeService=E,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((O,B)=>this._renderRows(O,B)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((O=>this._registerIntersectionObserver(O,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,x.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var E;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(E=this._renderer.value)==null||E.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};o.RenderService=b=u([_(2,v.IOptionsService),_(3,p.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],b)},9312:function(a,o,l){var u=this&&this.__decorate||function(j,M,O,B){var $,q=arguments.length,U=q<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,O):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(j,M,O,B);else for(var Y=j.length-1;Y>=0;Y--)($=j[Y])&&(U=(q<3?$(U):q>3?$(M,O,U):$(M,O))||U);return q>3&&U&&Object.defineProperty(M,O,U),U},_=this&&this.__param||function(j,M){return function(O,B){M(O,B,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),p=l(9504),m=l(456),x=l(4725),S=l(8460),v=l(844),b=l(6114),w=l(4841),y=l(511),C=l(2585),E=" ",N=new RegExp(E,"g");let T=o.SelectionService=class extends v.Disposable{constructor(j,M,O,B,$,q,U,Y,G){super(),this._element=j,this._screenElement=M,this._linkifier=O,this._bufferService=B,this._coreService=$,this._mouseService=q,this._optionsService=U,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const O=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const $=j[0]$.replace(N," "))).join(b.isWindows?`\r +WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,u){this._renderCallback=l,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=l(3614),_=l(3656),d=l(3551),p=l(9042),m=l(3730),x=l(1680),S=l(3107),v=l(5744),b=l(2950),w=l(1296),y=l(428),C=l(4269),E=l(5114),N=l(8934),T=l(3230),j=l(9312),M=l(4725),O=l(6731),B=l(8055),$=l(8969),H=l(8460),q=l(844),Y=l(6114),G=l(8437),X=l(2584),te=l(7399),I=l(5941),L=l(9074),F=l(2585),W=l(5435),U=l(4567),Z=l(779);class ce extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(ne={}){super(ne),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new q.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((Q,le)=>this.refresh(Q,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((Q=>this._reportWindowsOptions(Q)))),this.register(this._inputHandler.onColor((Q=>this._handleColorEvent(Q)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((Q=>this._afterResize(Q.cols,Q.rows)))),this.register((0,q.toDisposable)((()=>{var Q,le;this._customKeyEventHandler=void 0,(le=(Q=this.element)==null?void 0:Q.parentNode)==null||le.removeChild(this.element)})))}_handleColorEvent(ne){if(this._themeService)for(const Q of ne){let le,oe="";switch(Q.index){case 256:le="foreground",oe="10";break;case 257:le="background",oe="11";break;case 258:le="cursor",oe="12";break;default:le="ansi",oe="4;"+Q.index}switch(Q.type){case 0:const ue=B.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[Q.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${oe};${(0,I.toRgbString)(ue)}${X.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((pe=>pe.ansi[Q.index]=B.channels.toColor(...Q.color)));else{const pe=le;this._themeService.modifyColors((Se=>Se[pe]=B.channels.toColor(...Q.color)))}break;case 2:this._themeService.restoreColor(Q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ne){ne?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ne){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var ne;return(ne=this.textarea)==null?void 0:ne.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ne=this.buffer.ybase+this.buffer.y,Q=this.buffer.lines.get(ne);if(!Q)return;const le=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ue=Q.getWidth(le),pe=this._renderService.dimensions.css.cell.width*ue,Se=this.buffer.y*this._renderService.dimensions.css.cell.height,ye=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ye+"px",this.textarea.style.top=Se+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(Q=>{this.hasSelection()&&(0,u.copyHandler)(Q,this._selectionService)})));const ne=Q=>(0,u.handlePasteEvent)(Q,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",ne)),this.register((0,_.addDisposableDomListener)(this.element,"paste",ne)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(Q=>{Q.button===2&&(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(Q=>{(0,u.rightClickHandler)(Q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(Q=>{Q.button===1&&(0,u.moveTextAreaUnderMouseCursor)(Q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(ne=>this._keyUp(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(ne=>this._keyDown(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(ne=>this._keyPress(ne)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(ne=>this._compositionHelper.compositionupdate(ne)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(ne=>this._inputEvent(ne)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ne){var le;if(!ne)throw new Error("Terminal requires a parent element.");if(ne.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((le=this.element)==null?void 0:le.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ne.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),ne.appendChild(this.element);const Q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,ne.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(j.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(w.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ne=this,Q=this.element;function le(pe){const Se=ne._mouseService.getMouseReportCoords(pe,ne.screenElement);if(!Se)return!1;let ye,qe;switch(pe.overrideType||pe.type){case"mousemove":qe=32,pe.buttons===void 0?(ye=3,pe.button!==void 0&&(ye=pe.button<3?pe.button:3)):ye=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":qe=0,ye=pe.button<3?pe.button:3;break;case"mousedown":qe=1,ye=pe.button<3?pe.button:3;break;case"wheel":if(ne._customWheelEventHandler&&ne._customWheelEventHandler(pe)===!1||ne.viewport.getLinesScrolled(pe)===0)return!1;qe=pe.deltaY<0?0:1,ye=4;break;default:return!1}return!(qe===void 0||ye===void 0||ye>4)&&ne.coreMouseService.triggerMouseEvent({col:Se.col,row:Se.row,x:Se.x,y:Se.y,button:ye,action:qe,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ue={mouseup:pe=>(le(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(le(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&le(pe)},mousemove:pe=>{pe.buttons||le(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?oe.mousemove||(Q.addEventListener("mousemove",ue.mousemove),oe.mousemove=ue.mousemove):(Q.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(Q.addEventListener("wheel",ue.wheel,{passive:!1}),oe.wheel=ue.wheel):(Q.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ue.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ue.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(Q,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return le(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,_.addDisposableDomListener)(Q,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Se=this.viewport.getLinesScrolled(pe);if(Se===0)return;const ye=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let qe="";for(let Ie=0;Ie{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(Q,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(ne,Q){var le;(le=this._renderService)==null||le.refreshRows(ne,Q)}updateCursorStyle(ne){var Q;(Q=this._selectionService)!=null&&Q.shouldColumnSelect(ne)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(ne,Q,le=0){var oe;le===1?(super.scrollLines(ne,Q,le),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(ne)}paste(ne){(0,u.paste)(ne,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ne){this._customKeyEventHandler=ne}attachCustomWheelEventHandler(ne){this._customWheelEventHandler=ne}registerLinkProvider(ne){return this._linkProviderService.registerLinkProvider(ne)}registerCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const Q=this._characterJoinerService.register(ne);return this.refresh(0,this.rows-1),Q}deregisterCharacterJoiner(ne){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ne)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ne){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ne)}registerDecoration(ne){return this._decorationService.registerDecoration(ne)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ne,Q,le){this._selectionService.setSelection(ne,Q,le)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var ne;(ne=this._selectionService)==null||ne.clearSelection()}selectAll(){var ne;(ne=this._selectionService)==null||ne.selectAll()}selectLines(ne,Q){var le;(le=this._selectionService)==null||le.selectLines(ne,Q)}_keyDown(ne){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;const Q=this.browser.isMac&&this.options.macOptionIsMeta&&ne.altKey;if(!Q&&!this._compositionHelper.keydown(ne))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;Q||ne.key!=="Dead"&&ne.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,te.evaluateKeyboardEvent)(ne,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ne),le.type===3||le.type===2){const oe=this.rows-1;return this.scrollLines(le.type===2?-oe:oe),this.cancel(ne,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ne)||(le.cancel&&this.cancel(ne,!0),!le.key||!!(ne.key&&!ne.ctrlKey&&!ne.altKey&&!ne.metaKey&&ne.key.length===1&&ne.key.charCodeAt(0)>=65&&ne.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==X.C0.ETX&&le.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||ne.altKey||ne.ctrlKey?this.cancel(ne,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ne,Q){const le=ne.isMac&&!this.options.macOptionIsMeta&&Q.altKey&&!Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.altKey&&Q.ctrlKey&&!Q.metaKey||ne.isWindows&&Q.getModifierState("AltGraph");return Q.type==="keypress"?le:le&&(!Q.keyCode||Q.keyCode>47)}_keyUp(ne){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1||((function(Q){return Q.keyCode===16||Q.keyCode===17||Q.keyCode===18})(ne)||this.focus(),this.updateCursorStyle(ne),this._keyPressHandled=!1)}_keyPress(ne){let Q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ne)===!1)return!1;if(this.cancel(ne),ne.charCode)Q=ne.charCode;else if(ne.which===null||ne.which===void 0)Q=ne.keyCode;else{if(ne.which===0||ne.charCode===0)return!1;Q=ne.which}return!(!Q||(ne.altKey||ne.ctrlKey||ne.metaKey)&&!this._isThirdLevelShift(this.browser,ne)||(Q=String.fromCharCode(Q),this._onKey.fire({key:Q,domEvent:ne}),this._showCursor(),this.coreService.triggerDataEvent(Q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ne){if(ne.data&&ne.inputType==="insertText"&&(!ne.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const Q=ne.data;return this.coreService.triggerDataEvent(Q,!0),this.cancel(ne),!0}return!1}resize(ne,Q){ne!==this.cols||Q!==this.rows?super.resize(ne,Q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ne,Q){var le,oe;(le=this._charSizeService)==null||le.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var ne;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Q=1;Q{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,u=1e3){this._renderCallback=l,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,u,_){this._rowCount=_,l=l!==void 0?l:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=d-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,u)}}},1680:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),p=l(4725),m=l(8460),x=l(844),S=l(2585);let v=o.Viewport=class extends x.Disposable{constructor(b,w,y,C,E,N,T,j){super(),this._viewportElement=b,this._scrollArea=w,this._bufferService=y,this._optionsService=C,this._charSizeService=E,this._renderService=N,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(j.colors),this.register(j.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const w=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==w&&(this._lastRecordedBufferHeight=w,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const w=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:w,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,w){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&y0&&(y=$),C=""}}return{bufferElements:E,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let w=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(w/=this._currentRowHeight+0,this._wheelPartialScroll+=w,w=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(w*=this._bufferService.rows),w}_applyScrollModifier(b,w){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&w.altKey||y==="ctrl"&&w.ctrlKey||y==="shift"&&w.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const w=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,w!==0&&(this._viewportElement.scrollTop+=w,this._bubbleScroll(b,w))}};o.Viewport=v=u([_(2,S.IBufferService),_(3,S.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],v)},3107:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),p=l(844),m=l(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(S,v,b,w,y){super(),this._screenElement=S,this._bufferService=v,this._coreBrowserService=b,this._decorationService=w,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var w;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((w=S==null?void 0:S.options)==null?void 0:w.layer)==="top"),v.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=S.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(S,v),v}_refreshStyle(S){const v=S.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let b=this._decorationElements.get(S);b||(b=this._createElement(S),S.element=b,this._decorationElements.set(S,b),this._container.appendChild(b),S.onDispose((()=>{this._decorationElements.delete(S),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(b)}}_refreshXPosition(S,v=S.element){if(!v)return;const b=S.options.x??0;(S.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var v;(v=this._decorationElements.get(S))==null||v.remove(),this._decorationElements.delete(S),S.dispose()}};o.BufferDecorationRenderer=x=u([_(1,m.IBufferService),_(2,d.ICoreBrowserService),_(3,m.IDecorationService),_(4,d.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const u of this._zones)if(u.color===l.options.overviewRulerOptions.color&&u.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,l.marker.line))return;if(this._lineAdjacentToZone(u,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(u,l.marker.line)}if(this._zonePoolIndex=l.startBufferLine&&u<=l.endBufferLine}_lineAdjacentToZone(l,u,_){return u>=l.startBufferLine-this._linePadding[_||"full"]&&u<=l.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(l,u){l.startBufferLine=Math.min(l.startBufferLine,u),l.endBufferLine=Math.max(l.endBufferLine,u)}}},5744:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),p=l(4725),m=l(844),x=l(2585),S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let w=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,E,N,T,j,M){var B;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=E,this._decorationService=N,this._renderService=T,this._optionsService=j,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(B=this._viewportElement.parentElement)==null||B.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var $;($=this._canvas)==null||$.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=w=u([_(2,x.IBufferService),_(3,x.IDecorationService),_(4,p.IRenderService),_(5,x.IOptionsService),_(6,p.ICoreBrowserService)],w)},2950:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),p=l(2585),m=l(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,v,b,w,y,C){this._textarea=S,this._compositionView=v,this._bufferService=b,this._optionsService=w,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(S,"");this._dataAlreadySent=b,v.length>S.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,d.IRenderService)],x)},9806:(a,o)=>{function l(u,_,d){const p=d.getBoundingClientRect(),m=u.getComputedStyle(d),x=parseInt(m.getPropertyValue("padding-left")),S=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-x,_.clientY-p.top-S]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(u,_,d,p,m,x,S,v,b){if(!x)return;const w=l(u,_,d);return w?(w[0]=Math.ceil((w[0]+(b?S/2:0))/S),w[1]=Math.ceil(w[1]/v),w[0]=Math.min(Math.max(w[0],1),p+(b?1:0)),w[1]=Math.min(Math.max(w[1],1),m),w):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=l(2584);function _(v,b,w,y){const C=v-d(v,w),E=b-d(b,w),N=Math.abs(C-E)-(function(T,j,M){let O=0;const B=T-d(T,M),$=j-d(j,M);for(let H=0;H=0&&vb?"A":"B"}function m(v,b,w,y,C,E){let N=v,T=b,j="";for(;N!==w||T!==y;)N+=C?1:-1,C&&N>E.cols-1?(j+=E.buffer.translateBufferLineToString(T,!1,v,N),N=0,v=0,T++):!C&&N<0&&(j+=E.buffer.translateBufferLineToString(T,!1,0,v+1),N=E.cols-1,v=N,T--);return j+E.buffer.translateBufferLineToString(T,!1,v,N)}function x(v,b){const w=b?"O":"[";return u.C0.ESC+w+v}function S(v,b){v=Math.floor(v);let w="";for(let y=0;y0?B-d(B,$):M;const Y=B,G=(function(X,te,I,L,F,W){let U;return U=_(I,L,F,W).length>0?L-d(L,F):te,X=I&&Uv?"D":"C",S(Math.abs(C-v),x(N,y));N=E>b?"D":"C";const T=Math.abs(E-b);return S((function(j,M){return M.cols-j})(E>b?v:C,w)+(T-1)*w.cols+1+((E>b?C:v)-1),x(N,y))}},1296:function(a,o,l){var u=this&&this.__decorate||function(H,q,Y,G){var X,te=arguments.length,I=te<3?q:G===null?G=Object.getOwnPropertyDescriptor(q,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(H,q,Y,G);else for(var L=H.length-1;L>=0;L--)(X=H[L])&&(I=(te<3?X(I):te>3?X(q,Y,I):X(q,Y))||I);return te>3&&I&&Object.defineProperty(q,Y,I),I},_=this&&this.__param||function(H,q){return function(Y,G){q(Y,G,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),p=l(2550),m=l(2223),x=l(6171),S=l(6052),v=l(4725),b=l(8055),w=l(8460),y=l(844),C=l(2585),E="xterm-dom-renderer-owner-",N="xterm-rows",T="xterm-fg-",j="xterm-bg-",M="xterm-focus",O="xterm-selection";let B=1,$=o.DomRenderer=class extends y.Disposable{constructor(H,q,Y,G,X,te,I,L,F,W,U,Z,ce){super(),this._terminal=H,this._document=q,this._element=Y,this._screenElement=G,this._viewportElement=X,this._helperContainer=te,this._linkifier2=I,this._charSizeService=F,this._optionsService=W,this._bufferService=U,this._coreBrowserService=Z,this._themeService=ce,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new w.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((re=>this._injectCss(re)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((re=>this._handleLinkHover(re)))),this.register(this._linkifier2.onHideLinkUnderline((re=>this._handleLinkLeave(re)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const q=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let q=`${this._terminalSelector} .${N} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;q+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(H.foreground,.5).css};}`,q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;q+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,q+=`@keyframes ${X} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,q+=`${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,q+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[te,I]of H.ansi.entries())q+=`${this._terminalSelector} .${T}${te} { color: ${I.css}; }${this._terminalSelector} .${T}${te}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${j}${te} { background-color: ${I.css}; }`;q+=`${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(H.background).css}; }${this._terminalSelector} .${T}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${j}${m.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=q}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,q){for(let Y=this._rowElements.length;Y<=q;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,q){this._refreshRowElements(H,q),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,q,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,q,Y),this.renderRows(0,this._bufferService.rows-1),!H||!q)return;this._selectionRenderModel.update(this._terminal,H,q,Y);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(Y){const F=H[0]>q[0];L.appendChild(this._createSelectionElement(te,F?q[0]:H[0],F?H[0]:q[0],I-te+1))}else{const F=G===te?H[0]:0,W=te===X?q[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(te,F,W));const U=I-te-1;if(L.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,U)),te!==I){const Z=X===I?q[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,Z))}}this._selectionContainer.appendChild(L)}_createSelectionElement(H,q,Y,G=1){const X=this._document.createElement("div"),te=q*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(Y-q);return te+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-te),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=H*this.dimensions.css.cell.height+"px",X.style.left=`${te}px`,X.style.width=`${I}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,q){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=H;F<=q;F++){const W=F+Y.ydisp,U=this._rowElements[F],Z=Y.lines.get(W);if(!U||!Z)break;U.replaceChildren(...this._rowFactory.createRow(Z,W,W===G,I,L,X,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,q,Y,G,X,te){Y<0&&(H=0),G<0&&(q=0);const I=this._bufferService.rows-1;Y=Math.max(Math.min(Y,I),0),G=Math.max(Math.min(G,I),0),X=Math.min(X,this._bufferService.cols);const L=this._bufferService.buffer,F=L.ybase+L.y,W=Math.min(L.x,X-1),U=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let re=Y;re<=G;++re){const ne=re+L.ydisp,Q=this._rowElements[re],le=L.lines.get(ne);if(!Q||!le)break;Q.replaceChildren(...this._rowFactory.createRow(le,ne,ne===F,Z,ce,W,U,this.dimensions.css.cell.width,this._widthCache,te?re===Y?H:0:-1,te?(re===G?q:X)-1:-1))}}};o.DomRenderer=$=u([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],$)},3787:function(a,o,l){var u=this&&this.__decorate||function(N,T,j,M){var O,B=arguments.length,$=B<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,j):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,T,j,M);else for(var H=N.length-1;H>=0;H--)(O=N[H])&&($=(B<3?O($):B>3?O(T,j,$):O(T,j))||$);return B>3&&$&&Object.defineProperty(T,j,$),$},_=this&&this.__param||function(N,T){return function(j,M){T(j,M,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),p=l(643),m=l(511),x=l(2585),S=l(8055),v=l(4725),b=l(4269),w=l(6171),y=l(3734);let C=o.DomRendererRowFactory=class{constructor(N,T,j,M,O,B,$){this._document=N,this._characterJoinerService=T,this._optionsService=j,this._coreBrowserService=M,this._coreService=O,this._decorationService=B,this._themeService=$,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,T,j){this._selectionStart=N,this._selectionEnd=T,this._columnSelectMode=j}createRow(N,T,j,M,O,B,$,H,q,Y,G){const X=[],te=this._characterJoinerService.getJoinedCharacters(T),I=this._themeService.colors;let L,F=N.getNoBgTrimmedLength();j&&F0&&Se===te[0][0]){qe=!0;const We=te.shift();Te=new b.JoinedCellData(this._workCell,N.translateToString(!0,We[0],We[1]),We[1]-We[0]),Ie=We[1]-1,ye=Te.getWidth()}const vt=this._isCellInSelection(Se,T),Dt=j&&Se===B,Ut=pe&&Se>=Y&&Se<=G;let Ft=!1;this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{Ft=!0}));let mt=Te.getChars()||p.WHITESPACE_CELL_CHAR;if(mt===" "&&(Te.isUnderline()||Te.isOverline())&&(mt=" "),oe=ye*H-q.get(mt,Te.isBold(),Te.isItalic()),L){if(W&&(vt&&le||!vt&&!le&&Te.bg===Z)&&(vt&&le&&I.selectionForeground||Te.fg===ce)&&Te.extended.ext===re&&Ut===ne&&oe===Q&&!Dt&&!qe&&!Ft){Te.isInvisible()?U+=p.WHITESPACE_CELL_CHAR:U+=mt,W++;continue}W&&(L.textContent=U),L=this._document.createElement("span"),W=0,U=""}else L=this._document.createElement("span");if(Z=Te.bg,ce=Te.fg,re=Te.extended.ext,ne=Ut,Q=oe,le=vt,qe&&B>=Se&&B<=Ie&&(B=Se),!this._coreService.isCursorHidden&&Dt&&this._coreService.isCursorInitialized){if(ue.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ue.push("xterm-cursor-blink"),ue.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":ue.push("xterm-cursor-outline");break;case"block":ue.push("xterm-cursor-block");break;case"bar":ue.push("xterm-cursor-bar");break;case"underline":ue.push("xterm-cursor-underline")}}if(Te.isBold()&&ue.push("xterm-bold"),Te.isItalic()&&ue.push("xterm-italic"),Te.isDim()&&ue.push("xterm-dim"),U=Te.isInvisible()?p.WHITESPACE_CELL_CHAR:Te.getChars()||p.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(ue.push(`xterm-underline-${Te.extended.underlineStyle}`),U===" "&&(U=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let We=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&We<8&&(We+=8),L.style.textDecorationColor=I.ansi[We].css}Te.isOverline()&&(ue.push("xterm-overline"),U===" "&&(U=" ")),Te.isStrikethrough()&&ue.push("xterm-strikethrough"),Ut&&(L.style.textDecoration="underline");let rt=Te.getFgColor(),ut=Te.getFgColorMode(),Ct=Te.getBgColor(),we=Te.getBgColorMode();const Re=!!Te.isInverse();if(Re){const We=rt;rt=Ct,Ct=We;const Gt=ut;ut=we,we=Gt}let Ze,_t,wt,Zt=!1;switch(this._decorationService.forEachDecorationAtCell(Se,T,void 0,(We=>{We.options.layer!=="top"&&Zt||(We.backgroundColorRGB&&(we=50331648,Ct=We.backgroundColorRGB.rgba>>8&16777215,Ze=We.backgroundColorRGB),We.foregroundColorRGB&&(ut=50331648,rt=We.foregroundColorRGB.rgba>>8&16777215,_t=We.foregroundColorRGB),Zt=We.options.layer==="top")})),!Zt&&vt&&(Ze=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ct=Ze.rgba>>8&16777215,we=50331648,Zt=!0,I.selectionForeground&&(ut=50331648,rt=I.selectionForeground.rgba>>8&16777215,_t=I.selectionForeground)),Zt&&ue.push("xterm-decoration-top"),we){case 16777216:case 33554432:wt=I.ansi[Ct],ue.push(`xterm-bg-${Ct}`);break;case 50331648:wt=S.channels.toColor(Ct>>16,Ct>>8&255,255&Ct),this._addStyle(L,`background-color:#${E((Ct>>>0).toString(16),"0",6)}`);break;default:Re?(wt=I.foreground,ue.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):wt=I.background}switch(Ze||Te.isDim()&&(Ze=S.color.multiplyOpacity(wt,.5)),ut){case 16777216:case 33554432:Te.isBold()&&rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(rt+=8),this._applyMinimumContrast(L,wt,I.ansi[rt],Te,Ze,void 0)||ue.push(`xterm-fg-${rt}`);break;case 50331648:const We=S.channels.toColor(rt>>16&255,rt>>8&255,255&rt);this._applyMinimumContrast(L,wt,We,Te,Ze,_t)||this._addStyle(L,`color:#${E(rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,wt,I.foreground,Te,Ze,_t)||Re&&ue.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ue.length&&(L.className=ue.join(" "),ue.length=0),Dt||qe||Ft?L.textContent=U:W++,oe!==this.defaultSpacing&&(L.style.letterSpacing=`${oe}px`),X.push(L),Se=Ie}return L&&W&&(L.textContent=U),X}_applyMinimumContrast(N,T,j,M,O,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const $=this._getContrastCache(M);let H;if(O||B||(H=$.getColor(T.rgba,j.rgba)),H===void 0){const q=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);H=S.color.ensureContrastRatio(O||T,B||j,q),$.setColor((O||T).rgba,(B||j).rgba,H??null)}return!!H&&(this._addStyle(N,`color:${H.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,T){N.setAttribute("style",`${N.getAttribute("style")||""}${T};`)}_isCellInSelection(N,T){const j=this._selectionStart,M=this._selectionEnd;return!(!j||!M)&&(this._columnSelectMode?j[0]<=M[0]?N>=j[0]&&T>=j[1]&&N=j[1]&&N>=M[0]&&T<=M[1]:T>j[1]&&T=j[0]&&N=j[0])}};function E(N,T,j){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=l.createElement("span");_.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=l.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,d,p,m],this._container.appendChild(_),this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(m),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,u,_,d){l===this._font&&u===this._fontSize&&_===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=u,this._weight=_,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,u,_){let d=0;if(!u&&!_&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const x=this._measure(l,0);return x>0&&(this._flat[d]=x),x}let p=l;u&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),_&&(x|=2),m=this._measure(l,x),m>0&&this._holey.set(p,m)}return m}_measure(l,u){const _=this._measureElements[u];return _.textContent=l.repeat(32),_.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(_){return 57508<=_&&_<=57558}function u(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=u,o.allowRescaling=function(_,d,p,m){return d===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!u(_)&&!l(_)&&!(function(x){return 57344<=x&&x<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return l(_)||(function(d){return 9472<=d&&d<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,d,p=0){return(_-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,d,p,m=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const x=_.buffers.active.ydisp,S=d[1]-x,v=p[1]-x,b=Math.max(S,0),w=Math.min(v,_.rows-1);b>=_.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=S,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=w,this.startCol=d[0],this.endCol=p[0])}isCellSelected(_,d,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,u=this.selectionEnd;return!(!l||!u)&&(l[1]>u[1]||l[1]===u[1]&&l[0]>u[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),p=l(8460),m=l(844);let x=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(w,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const w=this._measureStrategy.measure();w.width===this.width&&w.height===this.height||(this.width=w.width,this.height=w.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=u([_(2,d.IOptionsService)],x);class S extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class v extends S{constructor(y,C,E){super(),this._document=y,this._parentElement=C,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends S{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),p=l(643),m=l(511),x=l(2585);class S extends d.AttributeData{constructor(w,y,C){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(w){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=S;let v=o.CharacterJoinerService=class CO{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(w){const y={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(y),y.id}deregister(w){for(let y=0;y1){const $=this._getJoinedRanges(E,j,T,y,N);for(let H=0;H<$.length;H++)C.push($[H])}N=B,j=T,M=this._workCell.fg,O=this._workCell.bg}T+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const B=this._getJoinedRanges(E,j,T,y,N);for(let $=0;${Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=l(844),_=l(8460),d=l(3656);class p extends u.Disposable{constructor(S,v,b){super(),this._textarea=S,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((w=>this._screenDprMonitor.setWindow(w)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=l(844);class _ extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=_},8934:function(a,o,l){var u=this&&this.__decorate||function(x,S,v,b){var w,y=arguments.length,C=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,S,v,b);else for(var E=x.length-1;E>=0;E--)(w=x[E])&&(C=(y<3?w(C):y>3?w(S,v,C):w(S,v))||C);return y>3&&C&&Object.defineProperty(S,v,C),C},_=this&&this.__param||function(x,S){return function(v,b){S(v,b,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),p=l(9806);let m=o.MouseService=class{constructor(x,S){this._renderService=x,this._charSizeService=S}getCoords(x,S,v,b,w){return(0,p.getCoords)(window,x,S,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(x,S){const v=(0,p.getCoordsRelativeToElement)(window,x,S);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=m=u([_(0,d.IRenderService),_(1,d.ICharSizeService)],m)},3230:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),p=l(4725),m=l(8460),x=l(844),S=l(7226),v=l(2585);let b=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,y,C,E,N,T,j,M){super(),this._rowCount=w,this._charSizeService=E,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((O,B)=>this._renderRows(O,B)),j),this.register(this._renderDebouncer),this.register(j.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(j.window,y),this.register(j.onWindowChange((O=>this._registerIntersectionObserver(O,y))))}_registerIntersectionObserver(w,y){if("IntersectionObserver"in w){const C=new w.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,x.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(w){this._isPaused=w.isIntersecting===void 0?w.intersectionRatio===0:!w.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(w,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,y,this._rowCount))}_renderRows(w,y){this._renderer.value&&(w=Math.min(w,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(w,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:w,end:y}),this._onRender.fire({start:w,end:y}),this._isNextRenderRedrawOnly=!0)}resize(w,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(w){this._renderer.value=w,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(w){return this._renderDebouncer.addRefreshCallback(w)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var w,y;this._renderer.value&&((y=(w=this._renderer.value).clearTextureAtlas)==null||y.call(w),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(w,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(w,y)})):this._renderer.value.handleResize(w,y),this._fullRefresh())}handleCharSizeChanged(){var w;(w=this._renderer.value)==null||w.handleCharSizeChanged()}handleBlur(){var w;(w=this._renderer.value)==null||w.handleBlur()}handleFocus(){var w;(w=this._renderer.value)==null||w.handleFocus()}handleSelectionChanged(w,y,C){var E;this._selectionState.start=w,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(E=this._renderer.value)==null||E.handleSelectionChanged(w,y,C)}handleCursorMove(){var w;(w=this._renderer.value)==null||w.handleCursorMove()}clear(){var w;(w=this._renderer.value)==null||w.clear()}};o.RenderService=b=u([_(2,v.IOptionsService),_(3,p.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],b)},9312:function(a,o,l){var u=this&&this.__decorate||function(j,M,O,B){var $,H=arguments.length,q=H<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,O):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(j,M,O,B);else for(var Y=j.length-1;Y>=0;Y--)($=j[Y])&&(q=(H<3?$(q):H>3?$(M,O,q):$(M,O))||q);return H>3&&q&&Object.defineProperty(M,O,q),q},_=this&&this.__param||function(j,M){return function(O,B){M(O,B,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),p=l(9504),m=l(456),x=l(4725),S=l(8460),v=l(844),b=l(6114),w=l(4841),y=l(511),C=l(2585),E=" ",N=new RegExp(E,"g");let T=o.SelectionService=class extends v.Disposable{constructor(j,M,O,B,$,H,q,Y,G){super(),this._element=j,this._screenElement=M,this._linkifier=O,this._bufferService=B,this._coreService=$,this._mouseService=H,this._optionsService=q,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!j||!M||j[0]===M[0]&&j[1]===M[1])}get selectionText(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!j||!M)return"";const O=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(j[0]===M[0])return"";const $=j[0]$.replace(N," "))).join(b.isWindows?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(j){const M=this._getMouseBufferCoords(j),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(j,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([j,M],O,B)}_areCoordsInSelection(j,M,O){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,q;const O=(q=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:q.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(j);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);O?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,O)}_fireOnSelectionChange(j,M,O){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let O=M;for(let B=0;M>=B;B++){const $=j.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(j,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,O=!0,B=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,q=$.lines.get(j[1]);if(!q)return;const U=$.translateBufferLineToString(j[1],!1);let Y=this._convertViewportColToCharacterIndex(q,j[0]),G=Y;const X=j[0]-Y;let te=0,I=0,L=0,F=0;if(U.charAt(Y)===" "){for(;Y>0&&U.charAt(Y-1)===" ";)Y--;for(;G1&&(F+=re-1,G+=re-1);ee>0&&Y>0&&!this._isCharWordSeparator(q.loadCell(ee-1,this._workCell));){q.loadCell(ee-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,ee--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,ee--}for(;de1&&(F+=ne-1,G+=ne-1),G++,de++}}G++;let W=Y+X-te+L,H=Math.min(this._bufferService.cols,G-Y+te+I-L-F);if(M||U.slice(Y,G).trim()!==""){if(O&&W===0&&q.getCodePoint(0)!==32){const ee=$.lines.get(j[1]-1);if(ee&&q.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(de){const re=this._bufferService.cols-de.start;W-=re,H+=re}}}if(B&&W+H===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const ee=$.lines.get(j[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const de=this._getWordAt([0,j[1]+1],!1,!1,!0);de&&(H+=de.length)}}return{start:W,length:H}}}_selectWordAt(j,M){const O=this._getWordAt(j,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[O.start,j[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let O=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,j,M,O){var B,$=arguments.length,q=$<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(T,j,M,O);else for(var U=T.length-1;U>=0;U--)(B=T[U])&&(q=($<3?B(q):$>3?B(j,M,q):B(j,M))||q);return $>3&&q&&Object.defineProperty(j,M,q),q},_=this&&this.__param||function(T,j){return function(M,O){j(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=j[M/36%6|0],B=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((j-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const j=v.ensureContrastRatio(E.rgba,N.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const j=E/255,M=N/255,O=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,q=T>>16&255,U=T>>8&255,Y=w(S.relativeLuminance2($,q,U),S.relativeLuminance2(M,O,B));for(;Y0||q>0||U>0);)$-=Math.max(0,Math.ceil(.1*$)),q-=Math.max(0,Math.ceil(.1*q)),U-=Math.max(0,Math.ceil(.1*U)),Y=w(S.relativeLuminance2($,q,U),S.relativeLuminance2(M,O,B));return($<<24|q<<16|U<<8|255)>>>0}function E(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,q=T>>16&255,U=T>>8&255,Y=w(S.relativeLuminance2($,q,U),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,q=N>>8&255;return l=B+Math.round((j-B)*d),u=$+Math.round((M-$)*d),_=q+Math.round((O-q)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,j){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(Uw(M,S.relativeLuminance(Y>>8))?q:Y}return q}const B=E(N,T,j),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(q>>8))?B:q}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,q)=>this._inputHandler.parse($,q)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,q){this._bufferService.scrollLines(B,$,q)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(te,I,L,F){var W,H=arguments.length,ee=H<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(te,I,L,F);else for(var de=te.length-1;de>=0;de--)(W=te[de])&&(ee=(H<3?W(ee):H>3?W(I,L,ee):W(I,L))||ee);return H>3&&ee&&Object.defineProperty(I,L,ee),ee},_=this&&this.__param||function(te,I){return function(L,F){I(L,F,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),j=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var q;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(o.WindowsOptionsReportType=q={}));let U=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,F,W,H,ee,de,re,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=F,this._logService=W,this._optionsService=H,this._oscLinkService=ee,this._coreMouseService=de,this._unicodeService=re,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:oe})})),this._parser.setDcsHandlerFallback(((Q,le,oe)=>{le==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:oe})})),this._parser.setPrintHandler(((Q,le,oe)=>this.print(Q,le,oe))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,F,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=W}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let F,W=this._activeBuffer.x,H=this._activeBuffer.y,ee=0;const de=this._parseStack.paused;if(de){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;W=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(ee=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=ee;Q0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ce=this._parser.precedingJoinState;for(let pe=L;pere){if(ne){const Ie=oe;let Te=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(Ie,Te,0,qe,!1);Te=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(oe.insertCells(this._activeBuffer.x,H-qe,this._activeBuffer.getNullCell(le)),oe.getWidth(re-1)===2&&oe.setCellFromCodepoint(re-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,H,le),H>0)for(;--H;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ce,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new j.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,F,W=!1,H=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);ee.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),H),W&&(ee.isWrapped=!1)}_resetBufferLine(I,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),F.isWrapped=!1)}eraseInDisplay(I,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=re;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ce=I.params[0];return pe=ce,Se=L?ce===2?4:ce===4?oe(ee.modes.insertMode):ce===12?3:ce===20?oe(le.convertEol):0:ce===1?oe(F.applicationCursorKeys):ce===3?le.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ce===6?oe(F.origin):ce===7?oe(F.wraparound):ce===8?3:ce===9?oe(W==="X10"):ce===12?oe(le.cursorBlink):ce===25?oe(!ee.isCursorHidden):ce===45?oe(F.reverseWraparound):ce===66?oe(F.applicationKeypad):ce===67?4:ce===1e3?oe(W==="VT200"):ce===1002?oe(W==="DRAG"):ce===1003?oe(W==="ANY"):ce===1004?oe(F.sendFocus):ce===1005?4:ce===1006?oe(H==="SGR"):ce===1015?4:ce===1016?oe(H==="SGR_PIXELS"):ce===1048?1:ce===47||ce===1047||ce===1049?oe(ne===Q):ce===2004?oe(F.bracketedPasteMode):0,ee.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,F,W,H){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([F,W,H])):L===5&&(I&=-50331904,I|=33554432|255&F),I}_extractColor(I,L,F){const W=[0,0,-1,0,0,0];let H=0,ee=0;do{if(W[ee+H]=I.params[L+ee],I.hasSubParams(L+ee)){const de=I.getSubParams(L+ee);let re=0;do W[1]===5&&(H=1),W[ee+re+1+H]=de[re];while(++re=2||W[1]===2&&ee+H>=5)break;W[1]&&(H=1)}while(++ee+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let F;const W=this._curAttrData;for(let H=0;H=30&&F<=37?(W.fg&=-50331904,W.fg|=16777216|F-30):F>=40&&F<=47?(W.bg&=-50331904,W.bg|=16777216|F-40):F>=90&&F<=97?(W.fg&=-50331904,W.fg|=16777224|F-90):F>=100&&F<=107?(W.bg&=-50331904,W.bg|=16777224|F-100):F===0?this._processSGR0(W):F===1?W.fg|=134217728:F===3?W.bg|=67108864:F===4?(W.fg|=268435456,this._processUnderline(I.hasSubParams(H)?I.getSubParams(H)[0]:1,W)):F===5?W.fg|=536870912:F===7?W.fg|=67108864:F===8?W.fg|=1073741824:F===9?W.fg|=2147483648:F===2?W.bg|=134217728:F===21?this._processUnderline(2,W):F===22?(W.fg&=-134217729,W.bg&=-134217729):F===23?W.bg&=-67108865:F===24?(W.fg&=-268435457,this._processUnderline(0,W)):F===25?W.fg&=-536870913:F===27?W.fg&=-67108865:F===28?W.fg&=-1073741825:F===29?W.fg&=2147483647:F===39?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?H+=this._extractColor(I,H,W):F===53?W.bg|=1073741824:F===55?W.bg&=-1073741825:F===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):F===100?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${F}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(I){const L=I.params[0]||1;let F;return(I.length<2||(F=I.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(q.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(q.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],F=I.split(";");for(;F.length>1;){const W=F.shift(),H=F.shift();if(/^\d+$/.exec(W)){const ee=parseInt(W);if(X(ee))if(H==="?")L.push({type:0,index:ee});else{const de=(0,M.parseColor)(H);de&&L.push({type:1,index:ee,color:de})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=I.split(":");let W;const H=F.findIndex((ee=>ee.startsWith("id=")));return H!==-1&&(W=F[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const F=I.split(";");for(let W=0;W=this._specialColors.length);++W,++L)if(F[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const H=(0,M.parseColor)(F[W]);H&&this._onColor.fire([{type:1,index:this._specialColors[L],color:H}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],F=I.split(";");for(let W=0;W=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${H}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let G=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(U=te,te=I,I=U),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(te){return 0<=te&&te<256}G=u([_(0,E.IBufferService)],G)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let G=$.length-1,X=$[G];X===0&&(G--,X=$[G]);let te=M.length-q-1,I=B;for(;te>=0;){const F=Math.min(I,X);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[te],I-F,X-F,F,!0),X-=F,X===0&&(G--,X=$[G]),I-=F,I===0){te--;const W=Math.max(te,0);I=(0,m.getWrappedLineTrimmedLength)(M,W,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],j=[];for(let G=0;G=0;G--)if($&&$.start>O+q){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(G--,$.newLines[X]);G++,T.push({index:O+1,amount:$.newLines.length}),q+=$.newLines.length,$=E[++B]}else this.lines.set(G,j[O--]);let U=0;for(let G=T.length-1;G>=0;G--)T[G].index+=U,this.lines.onInsertEmitter.fire(T[G]),U+=T[G].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=E[3*(b+T)+j];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` -`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(j===2?E<128?b--:u[S++]=E:j===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ej)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let q=j+1;;++q){if(q>=w||(E=b[q])<32||E>126&&E=w||(E=b[q])<32||E>126&&E=w||(E=b[q])<32||E>126&&E=w||(E=b[q])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,j),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++j47&&E<60);j--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,j),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let q=j+1;;++q)if(q>=w||(E=b[q])===24||E===26||E===27||E>127&&E=w||(E=b[q])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r -`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(R2)),R2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function ob(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function C1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let cv=null,C0=0;const N6=()=>cv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void lb.retry()}})})}let E1=TO();function F0t(){C0++,cv=null,E1=TO()}const lb={flush:(e=!1)=>E1.flush(e),retry:()=>E1.retry(),queue(e,n=0){const t=cv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(cv=e,E1.queue(e,n))}};window.addEventListener("pagehide",()=>void lb.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const M2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:S1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===p6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,uv=new Map,X4=new Set,Z4=()=>{for(const e of X4)e()},U0t=e=>(X4.add(e),()=>{X4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),uv.clear(),Z4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&uv.delete(e)&&Z4()},r=>{t===Va&&(uv.set(e,r instanceof Error?r.message:String(r)),Z4())}),ip.set(e,n)}return n}function D2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=ob(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?uv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const U=j.current;if(!U)return;const Y=_z({...M.current,state:U.state,pane:U.pane},cu(Ka.get(U.projectId),U.taskKey),U.projectId,U.taskKey);D2(U.projectId,U.location,U.taskKey,Y)},[]);R.useEffect(()=>{let U=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!U||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{U&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{U=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const U=Ka.get(n);if(!U)return;if(p.current=U,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(U,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(D2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(U,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):D2(n,r),p.current=Ka.get(n)??U},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const U=Va,Y=X=>{if(U===Va){$();for(const te of ip.values())te.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const q=R.useCallback(()=>{var U;n&&(x?b(Y=>Y+1):(U=ip.get(n))==null||U.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:q,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),J4=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(J4);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:N4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(q){Qn(q instanceof Error?q.message:String(q),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,q])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[q,f.jsx(Gr,{value:i[$],onChange:U=>a({...i,[$]:U.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:T4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const cb=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=ob((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=ob(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return C1(e,(a==null?void 0:a.id)??null,u)}/** +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(j){const M=this._getMouseBufferCoords(j),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(j,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([j,M],O,B)}_areCoordsInSelection(j,M,O){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,H;const O=(H=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:H.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(j);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);O?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,O)}_fireOnSelectionChange(j,M,O){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let O=M;for(let B=0;M>=B;B++){const $=j.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(j,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,O=!0,B=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,H=$.lines.get(j[1]);if(!H)return;const q=$.translateBufferLineToString(j[1],!1);let Y=this._convertViewportColToCharacterIndex(H,j[0]),G=Y;const X=j[0]-Y;let te=0,I=0,L=0,F=0;if(q.charAt(Y)===" "){for(;Y>0&&q.charAt(Y-1)===" ";)Y--;for(;G1&&(F+=re-1,G+=re-1);Z>0&&Y>0&&!this._isCharWordSeparator(H.loadCell(Z-1,this._workCell));){H.loadCell(Z-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,Z--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,Z--}for(;ce1&&(F+=ne-1,G+=ne-1),G++,ce++}}G++;let W=Y+X-te+L,U=Math.min(this._bufferService.cols,G-Y+te+I-L-F);if(M||q.slice(Y,G).trim()!==""){if(O&&W===0&&H.getCodePoint(0)!==32){const Z=$.lines.get(j[1]-1);if(Z&&H.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ce){const re=this._bufferService.cols-ce.start;W-=re,U+=re}}}if(B&&W+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const Z=$.lines.get(j[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const ce=this._getWordAt([0,j[1]+1],!1,!1,!0);ce&&(U+=ce.length)}}return{start:W,length:U}}}_selectWordAt(j,M){const O=this._getWordAt(j,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[O.start,j[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let O=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,j,M,O){var B,$=arguments.length,H=$<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(T,j,M,O);else for(var q=T.length-1;q>=0;q--)(B=T[q])&&(H=($<3?B(H):$>3?B(j,M,H):B(j,M))||H);return $>3&&H&&Object.defineProperty(j,M,H),H},_=this&&this.__param||function(T,j){return function(M,O){j(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=j[M/36%6|0],B=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((j-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const j=v.ensureContrastRatio(E.rgba,N.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const j=E/255,M=N/255,O=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y0||H>0||q>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),q-=Math.max(0,Math.ceil(.1*q)),Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));return($<<24|H<<16|q<<8|255)>>>0}function E(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,H=N>>8&255;return l=B+Math.round((j-B)*d),u=$+Math.round((M-$)*d),_=H+Math.round((O-H)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,j){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(qw(M,S.relativeLuminance(Y>>8))?H:Y}return H}const B=E(N,T,j),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(H>>8))?B:H}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,H)=>this._inputHandler.parse($,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,H){this._bufferService.scrollLines(B,$,H)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(te,I,L,F){var W,U=arguments.length,Z=U<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(te,I,L,F);else for(var ce=te.length-1;ce>=0;ce--)(W=te[ce])&&(Z=(U<3?W(Z):U>3?W(I,L,Z):W(I,L))||Z);return U>3&&Z&&Object.defineProperty(I,L,Z),Z},_=this&&this.__param||function(te,I){return function(L,F){I(L,F,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),j=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var H;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let q=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,F,W,U,Z,ce,re,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=F,this._logService=W,this._optionsService=U,this._oscLinkService=Z,this._coreMouseService=ce,this._unicodeService=re,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:oe})})),this._parser.setDcsHandlerFallback(((Q,le,oe)=>{le==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:oe})})),this._parser.setPrintHandler(((Q,le,oe)=>this.print(Q,le,oe))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,F,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=W}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let F,W=this._activeBuffer.x,U=this._activeBuffer.y,Z=0;const ce=this._parseStack.paused;if(ce){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;W=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(Z=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=Z;Q0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ue=this._parser.precedingJoinState;for(let pe=L;pere){if(ne){const Ie=oe;let Te=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(Ie,Te,0,qe,!1);Te=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(oe.insertCells(this._activeBuffer.x,U-qe,this._activeBuffer.getNullCell(le)),oe.getWidth(re-1)===2&&oe.setCellFromCodepoint(re-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,U,le),U>0)for(;--U;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ue,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new j.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,F,W=!1,U=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),U),W&&(Z.isWrapped=!1)}_resetBufferLine(I,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),F.isWrapped=!1)}eraseInDisplay(I,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=re;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ue=I.params[0];return pe=ue,Se=L?ue===2?4:ue===4?oe(Z.modes.insertMode):ue===12?3:ue===20?oe(le.convertEol):0:ue===1?oe(F.applicationCursorKeys):ue===3?le.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ue===6?oe(F.origin):ue===7?oe(F.wraparound):ue===8?3:ue===9?oe(W==="X10"):ue===12?oe(le.cursorBlink):ue===25?oe(!Z.isCursorHidden):ue===45?oe(F.reverseWraparound):ue===66?oe(F.applicationKeypad):ue===67?4:ue===1e3?oe(W==="VT200"):ue===1002?oe(W==="DRAG"):ue===1003?oe(W==="ANY"):ue===1004?oe(F.sendFocus):ue===1005?4:ue===1006?oe(U==="SGR"):ue===1015?4:ue===1016?oe(U==="SGR_PIXELS"):ue===1048?1:ue===47||ue===1047||ue===1049?oe(ne===Q):ue===2004?oe(F.bracketedPasteMode):0,Z.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,F,W,U){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([F,W,U])):L===5&&(I&=-50331904,I|=33554432|255&F),I}_extractColor(I,L,F){const W=[0,0,-1,0,0,0];let U=0,Z=0;do{if(W[Z+U]=I.params[L+Z],I.hasSubParams(L+Z)){const ce=I.getSubParams(L+Z);let re=0;do W[1]===5&&(U=1),W[Z+re+1+U]=ce[re];while(++re=2||W[1]===2&&Z+U>=5)break;W[1]&&(U=1)}while(++Z+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let F;const W=this._curAttrData;for(let U=0;U=30&&F<=37?(W.fg&=-50331904,W.fg|=16777216|F-30):F>=40&&F<=47?(W.bg&=-50331904,W.bg|=16777216|F-40):F>=90&&F<=97?(W.fg&=-50331904,W.fg|=16777224|F-90):F>=100&&F<=107?(W.bg&=-50331904,W.bg|=16777224|F-100):F===0?this._processSGR0(W):F===1?W.fg|=134217728:F===3?W.bg|=67108864:F===4?(W.fg|=268435456,this._processUnderline(I.hasSubParams(U)?I.getSubParams(U)[0]:1,W)):F===5?W.fg|=536870912:F===7?W.fg|=67108864:F===8?W.fg|=1073741824:F===9?W.fg|=2147483648:F===2?W.bg|=134217728:F===21?this._processUnderline(2,W):F===22?(W.fg&=-134217729,W.bg&=-134217729):F===23?W.bg&=-67108865:F===24?(W.fg&=-268435457,this._processUnderline(0,W)):F===25?W.fg&=-536870913:F===27?W.fg&=-67108865:F===28?W.fg&=-1073741825:F===29?W.fg&=2147483647:F===39?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?U+=this._extractColor(I,U,W):F===53?W.bg|=1073741824:F===55?W.bg&=-1073741825:F===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):F===100?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${F}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(I){const L=I.params[0]||1;let F;return(I.length<2||(F=I.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],F=I.split(";");for(;F.length>1;){const W=F.shift(),U=F.shift();if(/^\d+$/.exec(W)){const Z=parseInt(W);if(X(Z))if(U==="?")L.push({type:0,index:Z});else{const ce=(0,M.parseColor)(U);ce&&L.push({type:1,index:Z,color:ce})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=I.split(":");let W;const U=F.findIndex((Z=>Z.startsWith("id=")));return U!==-1&&(W=F[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const F=I.split(";");for(let W=0;W=this._specialColors.length);++W,++L)if(F[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const U=(0,M.parseColor)(F[W]);U&&this._onColor.fire([{type:1,index:this._specialColors[L],color:U}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],F=I.split(";");for(let W=0;W=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${U}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let G=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(q=te,te=I,I=q),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(te){return 0<=te&&te<256}G=u([_(0,E.IBufferService)],G)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let G=$.length-1,X=$[G];X===0&&(G--,X=$[G]);let te=M.length-H-1,I=B;for(;te>=0;){const F=Math.min(I,X);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[te],I-F,X-F,F,!0),X-=F,X===0&&(G--,X=$[G]),I-=F,I===0){te--;const W=Math.max(te,0);I=(0,m.getWrappedLineTrimmedLength)(M,W,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],j=[];for(let G=0;G=0;G--)if($&&$.start>O+H){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(G--,$.newLines[X]);G++,T.push({index:O+1,amount:$.newLines.length}),H+=$.newLines.length,$=E[++B]}else this.lines.set(G,j[O--]);let q=0;for(let G=T.length-1;G>=0;G--)T[G].index+=q,this.lines.onInsertEmitter.fire(T[G]),q+=T[G].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=E[3*(b+T)+j];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` +`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(j===2?E<128?b--:u[S++]=E:j===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ej)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let H=j+1;;++H){if(H>=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,j),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++j47&&E<60);j--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,j),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let H=j+1;;++H)if(H>=w||(E=b[H])===24||E===26||E===27||E>127&&E=w||(E=b[H])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r +`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(M2)),M2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function lb(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function E1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let uv=null,C0=0;const N6=()=>uv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void cb.retry()}})})}let N1=TO();function F0t(){C0++,uv=null,N1=TO()}const cb={flush:(e=!1)=>N1.flush(e),retry:()=>N1.retry(),queue(e,n=0){const t=uv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(uv=e,N1.queue(e,n))}};window.addEventListener("pagehide",()=>void cb.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const D2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:k1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===p6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,dv=new Map,X4=new Set,Z4=()=>{for(const e of X4)e()},U0t=e=>(X4.add(e),()=>{X4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),dv.clear(),Z4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&dv.delete(e)&&Z4()},r=>{t===Va&&(dv.set(e,r instanceof Error?r.message:String(r)),Z4())}),ip.set(e,n)}return n}function L2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=lb(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?dv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const q=j.current;if(!q)return;const Y=_z({...M.current,state:q.state,pane:q.pane},cu(Ka.get(q.projectId),q.taskKey),q.projectId,q.taskKey);L2(q.projectId,q.location,q.taskKey,Y)},[]);R.useEffect(()=>{let q=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!q||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{q&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{q=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const q=Ka.get(n);if(!q)return;if(p.current=q,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(q,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(L2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(q,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):L2(n,r),p.current=Ka.get(n)??q},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const q=Va,Y=X=>{if(q===Va){$();for(const te of ip.values())te.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const H=R.useCallback(()=>{var q;n&&(x?b(Y=>Y+1):(q=ip.get(n))==null||q.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:H,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),J4=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(J4);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:z4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(H){Qn(H instanceof Error?H.message:String(H),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,H])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[H,f.jsx(Gr,{value:i[$],onChange:q=>a({...i,[$]:q.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:A4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:A4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const ub=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=lb((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=lb(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return E1(e,(a==null?void 0:a.id)??null,u)}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -110,12 +110,12 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var L2={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"};/** + */var O2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lpt=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cpt=R.createContext({}),upt=()=>R.useContext(cpt),dpt=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=upt()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...L2,width:n??u??L2.width,height:n??u??L2.height,stroke:e??p,strokeWidth:x,className:BO("lucide",m,s),...!i&&!lpt(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** + */const lpt=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cpt=R.createContext({}),upt=()=>R.useContext(cpt),dpt=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=upt()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...O2,width:n??u??O2.width,height:n??u??O2.height,stroke:e??p,strokeWidth:x,className:BO("lucide",m,s),...!i&&!lpt(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -135,7 +135,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ppt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],N1=it("arrow-right",ppt);/** + */const ppt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],z1=it("arrow-right",ppt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -225,7 +225,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ppt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ub=it("copy",Ppt);/** + */const Ppt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],db=it("copy",Ppt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -265,12 +265,12 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ypt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],db=it("file-text",Ypt);/** + */const Ypt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],fb=it("file-text",Ypt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xpt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],fb=it("flask-conical",Xpt);/** + */const Xpt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],hb=it("flask-conical",Xpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -290,7 +290,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nmt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],hb=it("folder-tree",nmt);/** + */const nmt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],_b=it("folder-tree",nmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -500,33 +500,33 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function O2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():s6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(ub,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function t3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[q,U]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),H=(oe,ce=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([rb(oe,ce),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>H(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ce=>ce.agentReady);x(ce=>{var Se;if(ce&&oe.some(ye=>ye.id===ce))return ce;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),U(!1);return}const ce=++Y.current;U(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ce===Y.current&&$(Se)).catch(()=>ce===Y.current&&$([])).finally(()=>ce===Y.current&&U(!1))},350);return()=>clearTimeout(pe)},[M]);const ee=oe=>{const ce=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ce||nt.fetchQuery(G4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},de=oe=>j(ce=>ce.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ce=>ce.includes(oe)?ce.filter(pe=>pe!==oe):[...ce,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ce=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ce,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(O2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(N1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>H(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(N1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(O2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),q?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>ee(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>de(oe.paperId),disabled:u,children:f.jsx(Ur,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(N1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?a6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:nb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(t3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ib,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??i6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ib,{tone:e?"success":n||e===null?"danger":"warning",children:e?a6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function _b({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=g6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function I2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[q,U]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(q==null?void 0:q.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(q==null?void 0:q.title)||(q==null?void 0:q.paperId)||"")}`,H=r==="blank"&&!d?F:r==="paper"&&q&&!d?W:u,ee=I2(H.trim(),200),de=ct({...B0(ee),enabled:!!ee&&ee===H.trim()}),re=ee===H.trim()?de.data??null:null,ne=ee===H.trim()?((rr=de.error)==null?void 0:rr.message)??null:null,Q=!!H.trim()&&(ee!==H.trim()||de.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ce=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(v6()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=I2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=I2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!q&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...G4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!q&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(U(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(G4(lt));if(ft!==X.current)return;U(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,U(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(H.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(S2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:H.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&q?{paperId:q.paperId,cloneUrl:q.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&q&&!q.repoUrl?q.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!H.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!H.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(q!=null&&q.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!q&&!(q!=null&&q.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!H.trim()||Zn||Rn||Rr,fn=d&&!H.trim()||Zn||Xn,Cn=d&&!H.trim()?lN():Zn?S2():Xn?sN():null,tn=d&&!H.trim()?lN():Zn?S2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&H.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!q)&&(!E||typeof ce=="string"&&!Te&&!Dt),un=Ut??`github.com/${ce??"you"}/${Ie}`,Mn=ce===void 0||Te||Dt,on=r==="paper"&&!q&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!q&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),q&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:q.title||q.paperId}),q.repoUrl&&f.jsx("div",{className:"id",children:Rgt(q.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!q.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||q)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:q!=null&&q.repoUrl?MSe():k2()}),f.jsx("input",{className:"text-sm font-normal",value:H,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:k2()}),f.jsx("input",{className:"text-sm font-normal",value:H,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&H&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||q)&&H&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ce===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ce===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ce===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?q!=null&&q.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):o6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?u6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":k4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":ev({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(_b,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":N4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:N4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},z1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=z1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(H=>H.id==="opencode"))!=null&&W.models.some(H=>H.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,q=(I={})=>T({models:[],model:null,error:null,...I}),U=async()=>{q();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():U()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:z1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?r6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=z1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Gr,{value:b,disabled:$,onChange:I=>{q({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>q({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await rb(!0)}}}),l=z1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?r6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ab(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:sv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:nb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ce,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:sv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):O4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),q=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,U=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ce=t.find(ye=>ye.id===U))==null?void 0:ce.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=sv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},H=ye=>{e&&n({...e,serviceTier:ye}),T()},ee=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),de=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${q?` · ${q}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(t3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,q&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:q})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[ee(L0(),B,"models"),i.length>0&&ee(G,q,"reasoning"),te.length>0&&ee(tN(),L,"speed"),t.length>0&&ee(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[de(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(t3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[de(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[de(eN()),re(t,U,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[de(tN()),re(te,I??void 0,"default",H)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,H=F.top-12,ee=Math.min(380,X.scrollHeight),de=i?W>=ee||W>=H:HH;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,de?W:H))}px`,X.style.left=`${F.left}px`,X.style.top=`${de?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===rv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),q=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",U=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??q:q})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>U(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>U(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function n3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function dv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():T4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(n3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:C2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":C2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:C2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=iv(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Vr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=iv(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Ur,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Xv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=Y5({from:"__root__"}),t=Yv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Yv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&lb.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Vr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),fv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),hv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(fv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(fv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[fv(e,n,{sessionId:r,ref:s}).queryKey,fv(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ib,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||pb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||pb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return s3(n)})(e)||SI(e)||pb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pb(e,n){if(e){if(typeof e=="string")return s3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s3(e,n):void 0}}function s3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. + */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function I2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():s6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(db,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function t3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),U=(oe,ue=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([sb(oe,ue),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&oe.some(ye=>ye.id===ue))return ue;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ue=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const Z=oe=>{const ue=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ue||nt.fetchQuery(G4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=oe=>j(ue=>ue.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ue=>ue.includes(oe)?ue.filter(pe=>pe!==oe):[...ue,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ue=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(I2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(z1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(I2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(z1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(I2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>Z(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>ce(oe.paperId),disabled:u,children:f.jsx(Ur,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(z1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?a6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:rb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(t3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ab,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??i6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ab,{tone:e?"success":n||e===null?"danger":"warning",children:e?a6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function pb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=g6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function B2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?F:r==="paper"&&H&&!d?W:u,Z=B2(U.trim(),200),ce=ct({...B0(Z),enabled:!!Z&&Z===U.trim()}),re=Z===U.trim()?ce.data??null:null,ne=Z===U.trim()?((rr=ce.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(Z!==U.trim()||ce.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ue=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(v6()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=B2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=B2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...G4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(G4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(k2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?k2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?k2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ue=="string"&&!Te&&!Dt),un=Ut??`github.com/${ue??"you"}/${Ie}`,Mn=ue===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():C2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:C2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:C2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ue===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ue===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),"aria-label":S1(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ue===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):o6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?u6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":C4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":tv({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(pb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":z4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:z4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},j1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=j1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:j1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?r6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=j1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Gr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await sb(!0)}}}),l=j1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?r6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ob(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:iv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:rb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ue,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:iv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):O4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ue=t.find(ye=>ye.id===q))==null?void 0:ue.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=iv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},Z=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(t3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[Z(L0(),B,"models"),i.length>0&&Z(G,H,"reasoning"),te.length>0&&Z(tN(),L,"speed"),t.length>0&&Z(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(t3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(tN()),re(te,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,U=F.top-12,Z=Math.min(380,X.scrollHeight),ce=i?W>=Z||W>=U:UU;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?W:U))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===sv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function n3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function fv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():A4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(n3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:E2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":E2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:E2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=av(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Vr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=av(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Ur,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Zv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Zv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=Y5({from:"__root__"}),t=Xv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Xv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&cb.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Vr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),hv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),_v=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(hv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(hv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[hv(e,n,{sessionId:r,ref:s}).queryKey,hv(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ab,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||mb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||mb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return s3(n)})(e)||SI(e)||mb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mb(e,n){if(e){if(typeof e=="string")return s3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s3(e,n):void 0}}function s3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,i=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var Pg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rm(e,n){return e(n={exports:{}},n.exports),n.exports}var Ui=rm((function(e){/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),q={content:v.slice(1)};switch($){case"+":q.type="insert",q.isInsert=!0,q.lineNumber=u,u++;break;case"-":q.type="delete",q.isDelete=!0,q.lineNumber=l,l++;break;case" ":q.type="normal",q.isNormal=!0,q.oldLineNumber=l,q.newLineNumber=u,l++,u++;break;case"\\":var U=o.changes[o.changes.length-1];U.isDelete||(a.newEndingNewLine=!1),U.isInsert||(a.oldEndingNewLine=!1)}q.type&&o.changes.push(q)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function i3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` +`),x=m.length,S=0;S-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),H={content:v.slice(1)};switch($){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=u,u++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=l,l++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=l,H.newLineNumber=u,l++,u++;break;case"\\":var q=o.changes[o.changes.length-1];q.isDelete||(a.newEndingNewLine=!1),q.isInsert||(a.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function i3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` `),i=r.indexOf(` `,s+1),a=r.slice(0,s),o=r.slice(s+1,i),l=a.split(" ").slice(1,-3).join(" "),u=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(l," b/").concat(u),"index 1111111..2222222 100644","--- a/".concat(l),"+++ b/".concat(u),r.slice(i+1)].join(` -`)})(e.trimStart());return c1t.parse(t).map((function(r){return(function(s,i){var a=s.hunks.map((function(o){return u1t(o,i)}));return Hn(Hn({},s),{},{hunks:a})})(r,n)}))}function d1t(e){return e[0]}function f1t(e){return e[e.length-1]}function a3(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function up(e){return e==="old"?function(n){return ku(n)?-1:Hl(n)?n.oldLineNumber:n.lineNumber}:function(n){return Ki(n)?-1:Hl(n)?n.newLineNumber:n.lineNumber}}function EI(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=mb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&yb(e),s=!t&&!r&&_v(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},xb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return xb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?Eb(e):Nb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function pv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=pv(t,s.onMouseEnter),s.onMouseLeave=pv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),q=S(s),U=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:q,className:Ui("diff-line",U),children:[!m&&Gz(Y,s,C,"old",x,q,B,T,b),!m&&Gz(Y,s,C,"new",x,q,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?Eb(p):Nb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=pv(s,a.onMouseEnter),a.onMouseLeave=pv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function P2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),r3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),r3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),q={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},U=Hn(Hn({},q),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},q),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:P2(t?U:Y)});var G=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[P2(U),P2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=gb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&xb(e),s=!t&&!r&&pv(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},wb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return wb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?Nb(e):zb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function mv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=mv(t,s.onMouseEnter),s.onMouseLeave=mv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),H=S(s),q=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:H,className:Ui("diff-line",q),children:[!m&&Gz(Y,s,C,"old",x,H,B,T,b),!m&&Gz(Y,s,C,"new",x,H,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?Nb(p):zb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=mv(s,a.onMouseEnter),a.onMouseLeave=mv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function F2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),r3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),r3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),H={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},q=Hn(Hn({},H),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},H),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:F2(t?q:Y)});var G=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[F2(q),F2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=(i==null?void 0:i.value.length))return[e];var o=function(d,p){var m=i.value.slice(d,p);return[].concat(Vi(s),[Hn(Hn({},i),{},{value:m})])};if(n>0){var l=o(0,n);a.push(sh(l))}var u=o(Math.max(n,0),t);if(a.push(r?(function(d,p){return[p].concat(Vi(sh(d)))})(u,r):sh(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=_u(e,Vbt);t.push(s);var i,a=W6(r);try{for(a.s();!(i=a.n()).done;)ZI(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(sh([].concat(Vi(t.slice(1)),[e])));return n}function Kbt(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(l){var u=tS(l);return u.value.includes(` `)?u.value.split(` -`).map((function(_){return Ubt(l,Hn(Hn({},u),{},{value:_}))})):[l]})(t),i=xI(s),a=i[0],o=i.slice(1);return[].concat(Vi(n.slice(0,-1)),[[].concat(Vi(r),[a])],Vi(o.map((function(l){return[l]}))))}),[[]])}function Qz(e){return Kbt(ZI(e))}var Qbt=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?wb(e,n,void 0,t):!!r},Ybt=function(e,n){return wb(e,n)},Xbt=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function Zbt(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=Xbt(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&Qbt(t,r,(function(i,a,o){return o==="chlidren"||Ybt(i,a)}))))?e.children[e.children.length-1]=(function(i,a){return"value"in i&&"value"in a?Hn(Hn({},i),{},{value:"".concat(i.value).concat(a.value)}):i})(s,n):e.children.push(n),e.children[e.children.length-1]}function Yz(e){var n,t={type:"root",children:[]},r=W6(e);try{var s=function(){var i=n.value;i.reduce((function(a,o,l){return Zbt(a,l===i.length-1?Hn({},o):Hn(Hn({},o),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(i){r.e(i)}finally{r.f()}return t}var Jbt=Object.prototype.hasOwnProperty,eyt=YI((function(e,n,t){Jbt.call(e,t)?e[t].push(n):J6(e,t,[n])})),tyt=Object.prototype.hasOwnProperty,nyt=function(e){if(e==null)return!0;if(xb(e)&&(Zi(e)||typeof e=="string"||typeof e.splice=="function"||_v(e)||Q6(e)||yb(e)))return!e.length;var n=d3(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(OI(e))return!II(e).length;for(var t in e)if(tyt.call(e,t))return!1;return!0},ryt=function(e,n){var t=n.start,r=n.length,s=t+r,i=e.reduce((function(a,o){var l=kn(a,2),u=l[0],_=l[1],d=_+tS(o).value.length;if(_>s||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(j=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=l+T,O=(j=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(j=i-j))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;ps||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(j=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=l+T,O=(j=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(j=i-j))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=S.length?[w,y,C,E,j]:null}var l,u,_,d,p,m=o(s,i,Math.ceil(s.length/4)),x=o(s,i,Math.ceil(s.length/2));return m||x?(l=x?m&&m[4].length>x[4].length?m:x:m,t.length>r.length?(u=l[0],_=l[1],d=l[2],p=l[3]):(d=l[0],p=l[1],u=l[2],_=l[3]),[u,_,d,p,l[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=0,u=0,_=0,d=0;o0?s[i-1]:-1,l=0,u=0,_=0,d=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=S?(x>=p.length/2||x>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,x))),t[o-1][1]=p.substring(0,p.length-x),t[o+1][1]=m.substring(x),o++):(S>=p.length/2||S>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,S))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-S),t[o+1][0]=-1,t[o+1][1]=p.substring(S),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(S,v){if(!S||!v)return 6;var b=S.charAt(S.length-1),w=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=w.match(n.nonAlphaNumericRegex_),E=y&&b.match(n.whitespaceRegex_),N=C&&w.match(n.whitespaceRegex_),T=E&&b.match(n.linebreakRegex_),j=N&&w.match(n.linebreakRegex_),M=T&&S.match(n.blanklineEndRegex_),O=j&&v.match(n.blanklineStartRegex_);return M||O?5:T||j?4:y&&!E&&N?3:E||N?2:y||C?1:0}for(var s=1;s=m&&(m=x,_=i,d=a,p=o)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=d,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=!1,u=!1,_=!1,d=!1;o0?s[i-1]:-1,_=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",l="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(l,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=l.substring(0,r):(t.splice(0,0,new n.Diff(0,l.substring(0,r))),s++),l=l.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(l,o))!==0&&(t[s][1]=l.substring(l.length-r)+t[s][1],l=l.substring(0,l.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),l.length&&(t.splice(s,0,new n.Diff(1,l)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",l=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,l=a;return t.length!=s&&t[s][0]===-1?l:l+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,l=0;l");switch(u){case 1:r[l]=''+_+"";break;case-1:r[l]=''+_+"";break;case 0:r[l]=""+_+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(N,T){var j=N/r.length,M=Math.abs(s-T);return a.Match_Distance?j+M/a.Match_Distance:M?1:j}var l=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(l=Math.min(o(0,u),l),(u=t.lastIndexOf(r,s+r.length))!=-1&&(l=Math.min(o(0,u),l)));var _,d,p=1<=v;y--){var C=i[t.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(m[y+1]|m[y])<<1|1|m[y+1],w[y]&p){var E=o(S,y-1);if(E<=l){if(l=E,!((u=y-1)>s))break;v=Math.max(1,2*s-u)}}}if(o(S+1,s)>l)break;m=w}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],l=new n.patch_obj,u=0,_=0,d=0,p=i,m=i,x=0;x=2*this.Patch_Margin&&u&&(this.patch_addContext_(l,p),o.push(l),l=new n.patch_obj,u=0,p=m,_=d)}S!==1&&(_+=v.length),S!==-1&&(d+=v.length)}return u&&(this.patch_addContext_(l,p),o.push(l)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(l=this.match_main(r,d.substring(0,this.Match_MaxBits),_))!=-1&&((p=this.match_main(r,d.substring(d.length-this.Match_MaxBits),_+d.length-this.Match_MaxBits))==-1||l>=p)&&(l=-1):l=this.match_main(r,d,_),l==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=l-_,d==(u=p==-1?r.substring(l,l+d.length):r.substring(l,p+this.Match_MaxBits)))r=r.substring(0,l)+this.diff_text2(t[o].diffs)+r.substring(l+d.length);else{var m=this.diff_main(d,u,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(m)/d.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var x,S=0,v=0;vo[0][1].length){var l=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=l,a.start2-=l,a.length1+=l,a.length2+=l}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(l=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,l),a.length1+=l,a.length2+=l),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,_=!1,u.diffs.push(new n.Diff(d,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,d===0?(u.length2+=p.length,o+=p.length):_=!1,u.diffs.push(new n.Diff(d,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(u.diffs)).substring(l.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),_||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}jb.displayName="cpp";jb.aliases=[];function jb(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(jb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,H){return"(?:"+F[+H]+")"})}function r(L,F,W){return RegExp(t(L,F),"")}function s(L,F){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,q=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,q]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var U=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,U]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,U]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,U]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`:"")+_.content]}),["",""]),t=kn(n,2),r=kn(eB(t[0],t[1]),2),s=r[0],i=r[1];if(s.length===0&&i.length===0)return[[],[]];var a=function(u){if(u&&!Hl(u))return u.lineNumber},o=a(e.find(Ki)),l=a(e.find(ku));if(o===void 0||l===void 0)throw new Error("Could not find start line number for edit");return[tj(ej(s),o),tj(ej(i),l)]}function uyt(e){var n=e.reduce((function(r,s){var i=kn(r,3),a=i[0],o=i[1],l=i[2];if(!l||!Ki(l)||!ku(s))return[a,o,s];var u=kn(eB(l.content,s.content),2),_=u[0],d=u[1];return[a.concat(f3(_,l.lineNumber)),o.concat(f3(d,s.lineNumber)),s]}),[[],[],null]),t=kn(n,2);return[t[0],t[1]]}function dyt(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Tb.displayName="cpp";Tb.aliases=[];function Tb(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(Tb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,U){return"(?:"+F[+U]+")"})}function r(L,F,W){return RegExp(t(L,F),"")}function s(L,F){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var q=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,q]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,q]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,q]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}aS.displayName="go";aS.aliases=[];function aS(e){e.register(Go),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ab.displayName="markup-templating";Ab.aliases=[];function Ab(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Ab),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Tb),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Rb.displayName="basic";Rb.aliases=[];function Rb(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Rb),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),h3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const _3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:h3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),F2=Object.keys(_3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Mb=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const q=e.charCodeAt(C);q===88||q===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const q=e.charCodeAt(C);if(!M(q))break;j+=String.fromCharCode(q),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const q=E==="named"?pp(j):!1;q&&(N=j,T=q)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const q=N?1:3;if(t.attribute){const U=e.charCodeAt(C);U===61?(S(q,B),T=""):uj(U)?T="":S(q,B)}else S(q,B)}$=T}else{O||S(2,B);let q=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(q))S(7,B),$="�";else if(q in cj)S(6,B),$=cj[q];else{let U="";Oyt(q)&&S(6,B),q>65535&&(q-=65536,U+=String.fromCharCode(q>>>10|55296),q=56320|q&1023),$=U+String.fromCharCode(q)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const q=x();q.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:q},e.slice(w-1,C)),p=q}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return A1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var q=v.prev;O&&(q=A1(n,q,O),b+=O.length),$yt(n,q,y);var U=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=A1(n,q,U),B&&A1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function A1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Db(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function b3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:i3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:i3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Db(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:b3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${v3} ${n}`:v3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Db(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:b3(m.file),children:b3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${v3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():A4(),w=[{id:"files",label:C4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:fb,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":E2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:E2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),C4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ib,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":E2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({...hv(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Db).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??c6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const H2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},mv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,mv),i&&r.addEventListener("scrollend",_,mv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!H2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,mv),i.addEventListener("touchend",o,mv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let q=1;qthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(H2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const q2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),q2(()=>u._didMount(),[]),q2(()=>(a(u),u._willUpdate())),q2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function y3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Rb.displayName="markup-templating";Rb.aliases=[];function Rb(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Rb),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Ab),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Mb.displayName="basic";Mb.aliases=[];function Mb(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Mb),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),h3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const _3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:h3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),H2=Object.keys(_3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Db=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const H=e.charCodeAt(C);H===88||H===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const H=e.charCodeAt(C);if(!M(H))break;j+=String.fromCharCode(H),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const H=E==="named"?pp(j):!1;H&&(N=j,T=H)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const H=N?1:3;if(t.attribute){const q=e.charCodeAt(C);q===61?(S(H,B),T=""):uj(q)?T="":S(H,B)}else S(H,B)}$=T}else{O||S(2,B);let H=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(H))S(7,B),$="�";else if(H in cj)S(6,B),$=cj[H];else{let q="";Oyt(H)&&S(6,B),H>65535&&(H-=65536,q+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),$=q+String.fromCharCode(H)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const H=x();H.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:H},e.slice(w-1,C)),p=H}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return R1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var H=v.prev;O&&(H=R1(n,H,O),b+=O.length),$yt(n,H,y);var q=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=R1(n,H,q),B&&R1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function R1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Lb(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function b3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:i3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:i3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Lb(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:b3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${v3} ${n}`:v3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Lb(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:b3(m.file),children:b3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${v3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():R4(),w=[{id:"files",label:E4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:hb,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":N2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:N2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),E4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ab,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":N2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({..._v(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Lb).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??c6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const q2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},gv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,gv),i&&r.addEventListener("scrollend",_,gv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!q2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,gv),i.addEventListener("touchend",o,gv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(q2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let H=1;Hthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(q2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const U2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),U2(()=>u._didMount(),[]),U2(()=>(a(u),u._willUpdate())),U2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function y3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Mxt(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=RS(e);if(t.length===1)return t[0]}return e}function Dxt(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function Vh(e){return Dxt(typeof e=="string"?RS(e):e)}function Lxt(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function Oxt(e,n){const t=Vh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function Ixt(e){var l;const n=Vh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u @@ -675,22 +675,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho Z" /> -`,EB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},Fxt={alphaxiv:Bxt,openalex:Pxt,biorxiv:$xt};function NB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":EB[e]},dangerouslySetInnerHTML:{__html:Fxt[e]}})}function Hxt(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function qxt(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=Hxt(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const Uxt=["alphaxiv","openalex","biorxiv"];function Gxt(){const e=dht(),{data:n}=ct(e),t=mn({mutationFn:mft,onSuccess:i=>Vr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:Uxt.map(i=>{const a=n[i];return f.jsxs(or,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(NB,{source:i,size:16,decorative:!0}),EB[i]]}),f.jsx(W_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:N3e()})}function U2(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Wxt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Vxt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` +`,EB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},Fxt={alphaxiv:Bxt,openalex:Pxt,biorxiv:$xt};function NB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":EB[e]},dangerouslySetInnerHTML:{__html:Fxt[e]}})}function Hxt(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function qxt(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=Hxt(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const Uxt=["alphaxiv","openalex","biorxiv"];function Gxt(){const e=dht(),{data:n}=ct(e),t=mn({mutationFn:mft,onSuccess:i=>Vr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:Uxt.map(i=>{const a=n[i];return f.jsxs(or,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(NB,{source:i,size:16,decorative:!0}),EB[i]]}),f.jsx(W_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:N3e()})}function G2(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Wxt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Vxt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` `}]}function Kxt(e,n){const t=n.value?n.value+` -`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Qxt(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Yxt(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),Xxt=Cu(/[#-'*+\--9=?A-Z^-~]/);function gv(e){return e!==null&&(e<32||e===127)}const x3=Cu(/\d/),Zxt=Cu(/[\dA-Fa-f]/),Jxt=Cu(/[!-/:-@[-`{-~]/);function St(e){return e!==null&&e<-2}function lr(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const Lb=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function e2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function t2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function n2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function zB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function r2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function s2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function i2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function a2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function o2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function l2t(e,n,t){const r=e.all(n),s=t?c2t(t):jB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Qxt(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Yxt(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),Xxt=Cu(/[#-'*+\--9=?A-Z^-~]/);function vv(e){return e!==null&&(e<32||e===127)}const x3=Cu(/\d/),Zxt=Cu(/[\dA-Fa-f]/),Jxt=Cu(/[!-/:-@[-`{-~]/);function St(e){return e!==null&&e<-2}function lr(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const Ob=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function e2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function t2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function n2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function zB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function r2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function s2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function i2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function a2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function o2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function l2t(e,n,t){const r=e.all(n),s=t?c2t(t):jB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function u2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _2t(e){const n=MS(e),t=TB(e);if(n&&t)return{start:n,end:t}}function p2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=MS(n.children[1]),l=TB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function m2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(vj(n.slice(s),s>0,!1)),i.join("")}function vj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===mj||i===gj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===mj||i===gj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function b2t(e,n){const t={type:"text",value:v2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function y2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const x2t={blockquote:Wxt,break:Vxt,code:Kxt,delete:Qxt,emphasis:Yxt,footnoteReference:e2t,heading:t2t,html:n2t,imageReference:r2t,image:s2t,inlineCode:i2t,linkReference:a2t,link:o2t,listItem:l2t,list:u2t,paragraph:d2t,root:f2t,strong:h2t,table:p2t,tableCell:g2t,tableRow:m2t,text:b2t,thematicBreak:y2t,toml:Wg,yaml:Wg,definition:Wg,footnoteDefinition:Wg};function Wg(){}const RB=-1,Ob=0,P0=1,vv=2,DS=3,LS=4,OS=5,IS=6,MB=7,DB=8,w2t=typeof self=="object"?self:globalThis,bj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new w2t[e](n)},S2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Ob:case RB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case vv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case DS:return t(new Date(a),s);case LS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case OS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case IS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case MB:{const{name:o,message:l}=a;return t(bj(o,l),s)}case DB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(bj(i,a),s)};return r},yj=e=>S2t(new Map,e)(0),nd="",{toString:k2t}={},{keys:C2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Ob,n];const t=k2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[vv,nd];case"Date":return[DS,nd];case"RegExp":return[LS,nd];case"Map":return[OS,nd];case"Set":return[IS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[MB,t]:[vv,t]},Vg=([e,n])=>e===Ob&&(n==="function"||n==="symbol"),E2t=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Ob:{let _=a;switch(l){case"bigint":o=DB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([RB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case vv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of C2t(a))(e||!Vg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case DS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case LS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case OS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Vg(h0(p))||Vg(h0(m))))&&_.push([i(p),i(m)]);return d}case IS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Vg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xj=(e,{json:n,lossy:t}={})=>{const r=[];return E2t(!(n||t),!!n,new Map,r)(e),r},bv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?yj(xj(e,n)):structuredClone(e):(e,n)=>yj(xj(e,n));function N2t(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function z2t(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function j2t(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||N2t,r=e.options.footnoteBackLabel||z2t,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(n,u),e.applyData(n,u)}function c2t(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r1}function u2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _2t(e){const n=MS(e),t=TB(e);if(n&&t)return{start:n,end:t}}function p2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=MS(n.children[1]),l=TB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function m2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(vj(n.slice(s),s>0,!1)),i.join("")}function vj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===mj||i===gj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===mj||i===gj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function b2t(e,n){const t={type:"text",value:v2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function y2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const x2t={blockquote:Wxt,break:Vxt,code:Kxt,delete:Qxt,emphasis:Yxt,footnoteReference:e2t,heading:t2t,html:n2t,imageReference:r2t,image:s2t,inlineCode:i2t,linkReference:a2t,link:o2t,listItem:l2t,list:u2t,paragraph:d2t,root:f2t,strong:h2t,table:p2t,tableCell:g2t,tableRow:m2t,text:b2t,thematicBreak:y2t,toml:Wg,yaml:Wg,definition:Wg,footnoteDefinition:Wg};function Wg(){}const RB=-1,Ib=0,P0=1,bv=2,DS=3,LS=4,OS=5,IS=6,MB=7,DB=8,w2t=typeof self=="object"?self:globalThis,bj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new w2t[e](n)},S2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Ib:case RB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case bv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case DS:return t(new Date(a),s);case LS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case OS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case IS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case MB:{const{name:o,message:l}=a;return t(bj(o,l),s)}case DB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(bj(i,a),s)};return r},yj=e=>S2t(new Map,e)(0),nd="",{toString:k2t}={},{keys:C2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Ib,n];const t=k2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[bv,nd];case"Date":return[DS,nd];case"RegExp":return[LS,nd];case"Map":return[OS,nd];case"Set":return[IS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[MB,t]:[bv,t]},Vg=([e,n])=>e===Ib&&(n==="function"||n==="symbol"),E2t=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Ib:{let _=a;switch(l){case"bigint":o=DB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([RB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case bv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of C2t(a))(e||!Vg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case DS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case LS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case OS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Vg(h0(p))||Vg(h0(m))))&&_.push([i(p),i(m)]);return d}case IS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Vg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xj=(e,{json:n,lossy:t}={})=>{const r=[];return E2t(!(n||t),!!n,new Map,r)(e),r},yv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?yj(xj(e,n)):structuredClone(e):(e,n)=>yj(xj(e,n));function N2t(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function z2t(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function j2t(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||N2t,r=e.options.footnoteBackLabel||z2t,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...yv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const lm=(function(e){if(e==null)return M2t;if(typeof e=="function")return Ib(e);if(typeof e=="object")return Array.isArray(e)?T2t(e):A2t(e);if(typeof e=="string")return R2t(e);throw new Error("Expected function, string, or object as test")});function T2t(e){const n=[];let t=-1;for(;++t":""))+")"})}return p;function p(){let m=LB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=O2t(t(l,_)),m[0]===w3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==OB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S":""))+")"})}return p;function p(){let m=LB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=O2t(t(l,_)),m[0]===w3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==OB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S0&&t.push({type:"text",value:` `}),t}function wj(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Sj(e,n){const t=B2t(e,n),r=t.one(e,void 0),s=j2t(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function yv(e,n){return e&&"run"in e?async function(t,r){const s=Sj(t,{file:r,...n});await e.run(s,r)}:function(t,r){return Sj(t,{file:r,...e||n})}}function kj(e){if(e)throw e}var G2,Cj;function q2t(){if(Cj)return G2;Cj=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},i=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var _=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!_&&!d)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return G2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ej(e.position):"start"in e||"end"in e?Ej(e):"line"in e||"column"in e?C3(e):""}function C3(e){return Nj(e&&e.line)+":"+Nj(e&&e.column)}function Ej(e){return C3(e&&e.start)+"-"+C3(e&&e.end)}function Nj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:V2t,dirname:K2t,extname:Q2t,join:Y2t,sep:"/"};function V2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function K2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Q2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Y2t(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Z2t(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J2t={cwd:ewt};function ewt(){return"/"}function E3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function twt(e){if(typeof e=="string")e=new URL(e);else if(!E3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nwt(e)}function nwt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];k3(S)&&k3(m)&&(m=W2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function Y2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function X2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Z2(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jj(e){if(!k3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return awt(e)?e:new IB(e)}function awt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function owt(e){return typeof e=="string"||lwt(e)}function lwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Aj=Object.prototype.hasOwnProperty;function Rj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Rj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Rj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Aj.call(e,t)&&++r&&!Aj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const cwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uwt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dwt={};function Mj(e,n){return(dwt.jsx?uwt:cwt).test(e)}const fwt=/[ \t\n\f\r]/g;function hwt(e){return typeof e=="object"?e.type==="text"?Dj(e.value):!1:Dj(e)}function Dj(e){return e.replace(fwt,"")===""}var Gf={},J2,Lj;function _wt(){if(Lj)return J2;Lj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` -`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(U){var Y=U.match(n);Y&&(w+=Y.length);var G=U.lastIndexOf(l);y=~G?U.length-G:y+U.length}function E(){var U={line:w,column:y};return function(Y){return Y.position=new N(U),M(),Y}}function N(U){this.start=U,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(U){var Y=new Error(b.source+":"+w+":"+y+": "+U);if(Y.reason=U,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(U){var Y=U.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(U){var Y;for(U=U||[];Y=B();)Y!==!1&&U.push(Y);return U}function B(){var U=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,U({type:p,comment:G})}}function $(){var U=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=U({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function q(){var U=[];O(U);for(var Y;Y=$();)Y!==!1&&(U.push(Y),O(U));return U}return M(),q()}function S(v){return v?v.replace(o,d):d}return J2=x,J2}var Oj;function pwt(){if(Oj)return Gf;Oj=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(_wt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Mb:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Mb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Lb(e))return 2}function Bb(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,Bb(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),q(Y)):j(Y)}function q(Y){return Y===o?(M++,N.consume(Y),q):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,U,"whitespace")(Y):U(Y)):j(Y)}function U(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const ew={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||gv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(H){return _(H)}function _(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),d}function d(H){return H===33?(e.consume(H),p):H===47?(e.consume(H),i=!0,S):H===63?(e.consume(H),s=3,r.interrupt?n:L):ai(H)?(e.consume(H),a=String.fromCharCode(H),v):t(H)}function p(H){return H===45?(e.consume(H),s=2,m):H===91?(e.consume(H),s=5,o=0,x):ai(H)?(e.consume(H),s=4,r.interrupt?n:L):t(H)}function m(H){return H===45?(e.consume(H),r.interrupt?n:L):t(H)}function x(H){const ee="CDATA[";return H===ee.charCodeAt(o++)?(e.consume(H),o===ee.length?r.interrupt?n:$:x):t(H)}function S(H){return ai(H)?(e.consume(H),a=String.fromCharCode(H),v):t(H)}function v(H){if(H===null||H===47||H===62||lr(H)){const ee=H===47,de=a.toLowerCase();return!ee&&!i&&Gj.includes(de)?(s=1,r.interrupt?n(H):$(H)):M4t.includes(a.toLowerCase())?(s=6,ee?(e.consume(H),b):r.interrupt?n(H):$(H)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(H):i?w(H):y(H))}return H===45||Vs(H)?(e.consume(H),a+=String.fromCharCode(H),v):t(H)}function b(H){return H===62?(e.consume(H),r.interrupt?n:$):t(H)}function w(H){return gn(H)?(e.consume(H),w):O(H)}function y(H){return H===47?(e.consume(H),O):H===58||H===95||ai(H)?(e.consume(H),C):gn(H)?(e.consume(H),y):O(H)}function C(H){return H===45||H===46||H===58||H===95||Vs(H)?(e.consume(H),C):E(H)}function E(H){return H===61?(e.consume(H),N):gn(H)?(e.consume(H),E):y(H)}function N(H){return H===null||H===60||H===61||H===62||H===96?t(H):H===34||H===39?(e.consume(H),l=H,T):gn(H)?(e.consume(H),N):j(H)}function T(H){return H===l?(e.consume(H),l=null,M):H===null||St(H)?t(H):(e.consume(H),T)}function j(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||lr(H)?E(H):(e.consume(H),j)}function M(H){return H===47||H===62||gn(H)?y(H):t(H)}function O(H){return H===62?(e.consume(H),B):t(H)}function B(H){return H===null||St(H)?$(H):gn(H)?(e.consume(H),B):t(H)}function $(H){return H===45&&s===2?(e.consume(H),G):H===60&&s===1?(e.consume(H),X):H===62&&s===4?(e.consume(H),F):H===63&&s===3?(e.consume(H),L):H===93&&s===5?(e.consume(H),I):St(H)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,q)(H)):H===null||St(H)?(e.exit("htmlFlowData"),q(H)):(e.consume(H),$)}function q(H){return e.check(O4t,U,W)(H)}function U(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),Y}function Y(H){return H===null||St(H)?q(H):(e.enter("htmlFlowData"),$(H))}function G(H){return H===45?(e.consume(H),L):$(H)}function X(H){return H===47?(e.consume(H),a="",te):$(H)}function te(H){if(H===62){const ee=a.toLowerCase();return Gj.includes(ee)?(e.consume(H),F):$(H)}return ai(H)&&a.length<8?(e.consume(H),a+=String.fromCharCode(H),te):$(H)}function I(H){return H===93?(e.consume(H),L):$(H)}function L(H){return H===62?(e.consume(H),F):H===45&&s===2?(e.consume(H),L):$(H)}function F(H){return H===null||St(H)?(e.exit("htmlFlowData"),W(H)):(e.consume(H),F)}function W(H){return e.exit("htmlFlow"),n(H)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,q):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),U)}function q(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=q,X(L)):(e.consume(L),q)}function U(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),U)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:x3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(R1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return x3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return W2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ej(e.position):"start"in e||"end"in e?Ej(e):"line"in e||"column"in e?C3(e):""}function C3(e){return Nj(e&&e.line)+":"+Nj(e&&e.column)}function Ej(e){return C3(e&&e.start)+"-"+C3(e&&e.end)}function Nj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:V2t,dirname:K2t,extname:Q2t,join:Y2t,sep:"/"};function V2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function K2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Q2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Y2t(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Z2t(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J2t={cwd:ewt};function ewt(){return"/"}function E3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function twt(e){if(typeof e=="string")e=new URL(e);else if(!E3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nwt(e)}function nwt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];k3(S)&&k3(m)&&(m=V2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function X2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Z2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function J2(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jj(e){if(!k3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return awt(e)?e:new IB(e)}function awt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function owt(e){return typeof e=="string"||lwt(e)}function lwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Aj=Object.prototype.hasOwnProperty;function Rj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Rj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Rj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Aj.call(e,t)&&++r&&!Aj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const cwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uwt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dwt={};function Mj(e,n){return(dwt.jsx?uwt:cwt).test(e)}const fwt=/[ \t\n\f\r]/g;function hwt(e){return typeof e=="object"?e.type==="text"?Dj(e.value):!1:Dj(e)}function Dj(e){return e.replace(fwt,"")===""}var Gf={},ew,Lj;function _wt(){if(Lj)return ew;Lj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` +`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(q){var Y=q.match(n);Y&&(w+=Y.length);var G=q.lastIndexOf(l);y=~G?q.length-G:y+q.length}function E(){var q={line:w,column:y};return function(Y){return Y.position=new N(q),M(),Y}}function N(q){this.start=q,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(q){var Y=new Error(b.source+":"+w+":"+y+": "+q);if(Y.reason=q,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(q){var Y=q.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(q){var Y;for(q=q||[];Y=B();)Y!==!1&&q.push(Y);return q}function B(){var q=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,q({type:p,comment:G})}}function $(){var q=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=q({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function H(){var q=[];O(q);for(var Y;Y=$();)Y!==!1&&(q.push(Y),O(q));return q}return M(),H()}function S(v){return v?v.replace(o,d):d}return ew=x,ew}var Oj;function pwt(){if(Oj)return Gf;Oj=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(_wt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Db:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Db,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Db,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Ob(e))return 2}function $b(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,$b(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),H(Y)):j(Y)}function H(Y){return Y===o?(M++,N.consume(Y),H):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,q,"whitespace")(Y):q(Y)):j(Y)}function q(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const tw={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||vv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(U){return _(U)}function _(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),p):U===47?(e.consume(U),i=!0,S):U===63?(e.consume(U),s=3,r.interrupt?n:L):ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function p(U){return U===45?(e.consume(U),s=2,m):U===91?(e.consume(U),s=5,o=0,x):ai(U)?(e.consume(U),s=4,r.interrupt?n:L):t(U)}function m(U){return U===45?(e.consume(U),r.interrupt?n:L):t(U)}function x(U){const Z="CDATA[";return U===Z.charCodeAt(o++)?(e.consume(U),o===Z.length?r.interrupt?n:$:x):t(U)}function S(U){return ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function v(U){if(U===null||U===47||U===62||lr(U)){const Z=U===47,ce=a.toLowerCase();return!Z&&!i&&Gj.includes(ce)?(s=1,r.interrupt?n(U):$(U)):M4t.includes(a.toLowerCase())?(s=6,Z?(e.consume(U),b):r.interrupt?n(U):$(U)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(U):i?w(U):y(U))}return U===45||Vs(U)?(e.consume(U),a+=String.fromCharCode(U),v):t(U)}function b(U){return U===62?(e.consume(U),r.interrupt?n:$):t(U)}function w(U){return gn(U)?(e.consume(U),w):O(U)}function y(U){return U===47?(e.consume(U),O):U===58||U===95||ai(U)?(e.consume(U),C):gn(U)?(e.consume(U),y):O(U)}function C(U){return U===45||U===46||U===58||U===95||Vs(U)?(e.consume(U),C):E(U)}function E(U){return U===61?(e.consume(U),N):gn(U)?(e.consume(U),E):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(e.consume(U),l=U,T):gn(U)?(e.consume(U),N):j(U)}function T(U){return U===l?(e.consume(U),l=null,M):U===null||St(U)?t(U):(e.consume(U),T)}function j(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||lr(U)?E(U):(e.consume(U),j)}function M(U){return U===47||U===62||gn(U)?y(U):t(U)}function O(U){return U===62?(e.consume(U),B):t(U)}function B(U){return U===null||St(U)?$(U):gn(U)?(e.consume(U),B):t(U)}function $(U){return U===45&&s===2?(e.consume(U),G):U===60&&s===1?(e.consume(U),X):U===62&&s===4?(e.consume(U),F):U===63&&s===3?(e.consume(U),L):U===93&&s===5?(e.consume(U),I):St(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,H)(U)):U===null||St(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),$)}function H(U){return e.check(O4t,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),Y}function Y(U){return U===null||St(U)?H(U):(e.enter("htmlFlowData"),$(U))}function G(U){return U===45?(e.consume(U),L):$(U)}function X(U){return U===47?(e.consume(U),a="",te):$(U)}function te(U){if(U===62){const Z=a.toLowerCase();return Gj.includes(Z)?(e.consume(U),F):$(U)}return ai(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),te):$(U)}function I(U){return U===93?(e.consume(U),L):$(U)}function L(U){return U===62?(e.consume(U),F):U===45&&s===2?(e.consume(U),L):$(U)}function F(U){return U===null||St(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),F)}function W(U){return e.exit("htmlFlow"),n(U)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,H):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),q)}function H(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=H,X(L)):(e.consume(L),H)}function q(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),q)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:x3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(M1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return x3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Kj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,ue(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Qj(t)),ue(this,ru)+J3t(t,r)}}ru=new WeakMap;const H3t=new Set(["*","**","_","__"]);function Qj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Kj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,de(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Qj(t)),de(this,ru)+J3t(t,r)}}ru=new WeakMap;const H3t=new Set(["*","**","_","__"]);function Qj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(Z3t(n)){Yj(n,t,r);continue}const i=V3t(n,e,t);if(i>t){t=i-1;continue}const a=K3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Yj(n,t,r)}return n}function q3t(e,n,t){const r=n[t];return r==="`"?U3t(e,n,t):r==="$"?G3t(e,n,t):r==="~"?W3t(e,n,t):t}function U3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&xv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&xv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function G3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function W3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(xv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!xv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function V3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` +`){X3t(n),n.exclusive||(n.commitIndex=t+1);continue}const s=q3t(n,e,t);if(s>t){t=s-1;continue}if(n.exclusive)continue;if(Z3t(n)){Yj(n,t,r);continue}const i=V3t(n,e,t);if(i>t){t=i-1;continue}const a=K3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Yj(n,t,r)}return n}function q3t(e,n,t){const r=n[t];return r==="`"?U3t(e,n,t):r==="$"?G3t(e,n,t):r==="~"?W3t(e,n,t):t}function U3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&wv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&wv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function G3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function W3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(wv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!wv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function V3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` `)return e.pendingHtml=null,s+1;return n.length}function K3t(e,n,t){const r=Q3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Y3t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Q3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Y3t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Jj(s)||!Jj(r)}function Yj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function X3t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Z3t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function J3t(e,n){n.pendingHtml!==null&&(e=e.slice(0,n5t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return xo(e5t(e,t));const r=t5t(n);if(r)return xo(ih(e,r));const s=i5t(n);return s?s.kind==="delim"?xo(z3(e,s.start,s.token.length)?s$(e,s.token):e.slice(0,s.start)):z3(e,s.start,s.token.length)?s.kind==="fence"?xo(e):s.kind==="code"?xo(ih(e,s.token)):s.token==="$$"?xo(ih(e,(e.endsWith(` `)?"":` `)+"$$")):/\s/.test(e[e.length-1]??"")?xo(e):xo(ih(e,"$")):xo(s.kind==="fence"?e:e.slice(0,s.start)):xo(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function e5t(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return z3(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function t5t(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!H3t.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function n5t(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!r5t(e,s,r))break;t=s,r=s}return t}function r5t(e,n,t){if(e[t-1]!==">"||eo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!a$(r))return!1;for(let s=n+1;s"||i===` @@ -702,10 +702,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `),x=m===-1?d:d.slice(0,m),S=m===-1?"":d.slice(m);if(o5t(x,o,_))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const b=i$(x,o).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let E=0;E1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+l+` `+Zj(o,b)+S}return r+l+` `+p+` -`+d}function ih(e,n){return e+n.slice(s5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function s5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function i5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Xj(e){let n=0;for(let t=0;t0}function Zj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function o5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function xv(e,n){return n===0||e[n-1]===` -`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){ue(this,Dh)!==null&&ue(this,Fp)===n&&l$(ue(this,Lh),r)&&!!ue(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===yv)||(n=n(),n.use(yv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){ue(this,xd)&&(n=ue(this,xd).update(n));let t=ue(this,Oh);if(n===t)return ue(this,Sd);const r=ue(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(ue(this,Dh)),l=ue(this,qp),u=l.slice(i).some(N=>N.some(j3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),U2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=nw(_,d,a);U2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||j3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=nw(_,d,a);U2(N.length===d.length),l.splice(0,l.length,...N)}const p=nw(o.runSync(_),d,a),m=ue(this,Up),x=ue(this,Gp),S=ue(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(ue(this,wd)),Fe(this,wd,ue(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const sw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===sw.svg?jyt:dB,s=t===sw.html?e.tagName.toLowerCase():e.tagName,i=t===sw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` +`+d}function ih(e,n){return e+n.slice(s5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function s5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function i5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Xj(e){let n=0;for(let t=0;t0}function Zj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function o5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function wv(e,n){return n===0||e[n-1]===` +`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){de(this,Dh)!==null&&de(this,Fp)===n&&l$(de(this,Lh),r)&&!!de(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===xv)||(n=n(),n.use(xv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){de(this,xd)&&(n=de(this,xd).update(n));let t=de(this,Oh);if(n===t)return de(this,Sd);const r=de(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(de(this,Dh)),l=de(this,qp),u=l.slice(i).some(N=>N.some(j3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),G2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=rw(_,d,a);G2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||j3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=rw(_,d,a);G2(N.length===d.length),l.splice(0,l.length,...N)}const p=rw(o.runSync(_),d,a),m=de(this,Up),x=de(this,Gp),S=de(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(de(this,wd)),Fe(this,wd,de(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const iw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===iw.svg?jyt:dB,s=t===iw.html?e.tagName.toLowerCase():e.tagName,i=t===iw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` `.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function h$(e,n,t){return e.type==="element"?I5t(e,n,t):e.type==="text"?t.whitespace==="normal"?_$(e,t):B5t(e):[]}function I5t(e,n,t){const r=p$(e,t),s=e.children||[];let i=-1,a=[];if(L5t(e))return a;let o,l;for(T3(e)||lT(e)&&sT(n,e,lT)?l=` -`:D5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(q5t,"-$1").toLowerCase(),G5t={"&":"&",">":">","<":"<",'"':""","'":"'"},W5t=/[&><"']/g,Ks=e=>String(e).replace(W5t,n=>G5t[n]),M1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?M1(e.body[0]):e:e.type==="font"?M1(e.body):e,V5t=new Set(["mathord","textord","atom"]),Wl=e=>V5t.has(M1(e).type),K5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},A3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Q5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Y5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Q5t(n)}function X5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Y5t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(A3)){var r=A3[t];r&&X5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=K5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[Z5t[this.id]]}sub(){return jo[J5t[this.id]]}fracNum(){return jo[e6t[this.id]]}fracDen(){return jo[t6t[this.id]]}cramp(){return jo[n6t[this.id]]}text(){return jo[r6t[this.id]]}isTight(){return this.size>=2}}var XS=0,wv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(wv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],Z5t=[gp,ka,gp,ka,Qh,oi,Qh,oi],J5t=[ka,ka,ka,ka,oi,oi,oi,oi],e6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],t6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],n6t=[wv,wv,Pl,Pl,ka,ka,oi,oi],r6t=[XS,wv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},R3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function s6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var D1=[];R3.forEach(e=>e.blocks.forEach(n=>D1.push(...n)));function m$(e){for(var n=0;n=D1[n]&&e<=D1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,i6t=function(n,t){return"M95,"+(622+n+t)+` +`:D5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(q5t,"-$1").toLowerCase(),G5t={"&":"&",">":">","<":"<",'"':""","'":"'"},W5t=/[&><"']/g,Ks=e=>String(e).replace(W5t,n=>G5t[n]),D1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?D1(e.body[0]):e:e.type==="font"?D1(e.body):e,V5t=new Set(["mathord","textord","atom"]),Wl=e=>V5t.has(D1(e).type),K5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},A3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Q5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Y5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Q5t(n)}function X5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Y5t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(A3)){var r=A3[t];r&&X5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=K5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[Z5t[this.id]]}sub(){return jo[J5t[this.id]]}fracNum(){return jo[e6t[this.id]]}fracDen(){return jo[t6t[this.id]]}cramp(){return jo[n6t[this.id]]}text(){return jo[r6t[this.id]]}isTight(){return this.size>=2}}var XS=0,Sv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(Sv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],Z5t=[gp,ka,gp,ka,Qh,oi,Qh,oi],J5t=[ka,ka,ka,ka,oi,oi,oi,oi],e6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],t6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],n6t=[Sv,Sv,Pl,Pl,ka,ka,oi,oi],r6t=[XS,Sv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},R3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function s6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var L1=[];R3.forEach(e=>e.blocks.forEach(n=>L1.push(...n)));function m$(e){for(var n=0;n=L1[n]&&e<=L1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,i6t=function(n,t){return"M95,"+(622+n+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -955,13 +955,13 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var M3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in M3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in M3)r=M3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class $b{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class D3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof $b||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var iw={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!iw[n]){var t=iw[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return iw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",J="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";P(V,J,he,"≡","\\equiv",!0);P(V,J,he,"≺","\\prec",!0);P(V,J,he,"≻","\\succ",!0);P(V,J,he,"∼","\\sim",!0);P(V,J,he,"⊥","\\perp");P(V,J,he,"⪯","\\preceq",!0);P(V,J,he,"⪰","\\succeq",!0);P(V,J,he,"≃","\\simeq",!0);P(V,J,he,"∣","\\mid",!0);P(V,J,he,"≪","\\ll",!0);P(V,J,he,"≫","\\gg",!0);P(V,J,he,"≍","\\asymp",!0);P(V,J,he,"∥","\\parallel");P(V,J,he,"⋈","\\bowtie",!0);P(V,J,he,"⌣","\\smile",!0);P(V,J,he,"⊑","\\sqsubseteq",!0);P(V,J,he,"⊒","\\sqsupseteq",!0);P(V,J,he,"≐","\\doteq",!0);P(V,J,he,"⌢","\\frown",!0);P(V,J,he,"∋","\\ni",!0);P(V,J,he,"∝","\\propto",!0);P(V,J,he,"⊢","\\vdash",!0);P(V,J,he,"⊣","\\dashv",!0);P(V,J,he,"∋","\\owns");P(V,J,dm,".","\\ldotp");P(V,J,dm,"⋅","\\cdotp");P(V,J,dm,"⋅","·");P(He,J,ve,"⋅","·");P(V,J,ve,"#","\\#");P(He,J,ve,"#","\\#");P(V,J,ve,"&","\\&");P(He,J,ve,"&","\\&");P(V,J,ve,"ℵ","\\aleph",!0);P(V,J,ve,"∀","\\forall",!0);P(V,J,ve,"ℏ","\\hbar",!0);P(V,J,ve,"∃","\\exists",!0);P(V,J,ve,"∇","\\nabla",!0);P(V,J,ve,"♭","\\flat",!0);P(V,J,ve,"ℓ","\\ell",!0);P(V,J,ve,"♮","\\natural",!0);P(V,J,ve,"♣","\\clubsuit",!0);P(V,J,ve,"℘","\\wp",!0);P(V,J,ve,"♯","\\sharp",!0);P(V,J,ve,"♢","\\diamondsuit",!0);P(V,J,ve,"ℜ","\\Re",!0);P(V,J,ve,"♡","\\heartsuit",!0);P(V,J,ve,"ℑ","\\Im",!0);P(V,J,ve,"♠","\\spadesuit",!0);P(V,J,ve,"§","\\S",!0);P(He,J,ve,"§","\\S");P(V,J,ve,"¶","\\P",!0);P(He,J,ve,"¶","\\P");P(V,J,ve,"†","\\dag");P(He,J,ve,"†","\\dag");P(He,J,ve,"†","\\textdagger");P(V,J,ve,"‡","\\ddag");P(He,J,ve,"‡","\\ddag");P(He,J,ve,"‡","\\textdaggerdbl");P(V,J,ui,"⎱","\\rmoustache",!0);P(V,J,na,"⎰","\\lmoustache",!0);P(V,J,ui,"⟯","\\rgroup",!0);P(V,J,na,"⟮","\\lgroup",!0);P(V,J,dt,"∓","\\mp",!0);P(V,J,dt,"⊖","\\ominus",!0);P(V,J,dt,"⊎","\\uplus",!0);P(V,J,dt,"⊓","\\sqcap",!0);P(V,J,dt,"∗","\\ast");P(V,J,dt,"⊔","\\sqcup",!0);P(V,J,dt,"◯","\\bigcirc",!0);P(V,J,dt,"∙","\\bullet",!0);P(V,J,dt,"‡","\\ddagger");P(V,J,dt,"≀","\\wr",!0);P(V,J,dt,"⨿","\\amalg");P(V,J,dt,"&","\\And");P(V,J,he,"⟵","\\longleftarrow",!0);P(V,J,he,"⇐","\\Leftarrow",!0);P(V,J,he,"⟸","\\Longleftarrow",!0);P(V,J,he,"⟶","\\longrightarrow",!0);P(V,J,he,"⇒","\\Rightarrow",!0);P(V,J,he,"⟹","\\Longrightarrow",!0);P(V,J,he,"↔","\\leftrightarrow",!0);P(V,J,he,"⟷","\\longleftrightarrow",!0);P(V,J,he,"⇔","\\Leftrightarrow",!0);P(V,J,he,"⟺","\\Longleftrightarrow",!0);P(V,J,he,"↦","\\mapsto",!0);P(V,J,he,"⟼","\\longmapsto",!0);P(V,J,he,"↗","\\nearrow",!0);P(V,J,he,"↩","\\hookleftarrow",!0);P(V,J,he,"↪","\\hookrightarrow",!0);P(V,J,he,"↘","\\searrow",!0);P(V,J,he,"↼","\\leftharpoonup",!0);P(V,J,he,"⇀","\\rightharpoonup",!0);P(V,J,he,"↙","\\swarrow",!0);P(V,J,he,"↽","\\leftharpoondown",!0);P(V,J,he,"⇁","\\rightharpoondown",!0);P(V,J,he,"↖","\\nwarrow",!0);P(V,J,he,"⇌","\\rightleftharpoons",!0);P(V,fe,he,"≮","\\nless",!0);P(V,fe,he,"","\\@nleqslant");P(V,fe,he,"","\\@nleqq");P(V,fe,he,"⪇","\\lneq",!0);P(V,fe,he,"≨","\\lneqq",!0);P(V,fe,he,"","\\@lvertneqq");P(V,fe,he,"⋦","\\lnsim",!0);P(V,fe,he,"⪉","\\lnapprox",!0);P(V,fe,he,"⊀","\\nprec",!0);P(V,fe,he,"⋠","\\npreceq",!0);P(V,fe,he,"⋨","\\precnsim",!0);P(V,fe,he,"⪹","\\precnapprox",!0);P(V,fe,he,"≁","\\nsim",!0);P(V,fe,he,"","\\@nshortmid");P(V,fe,he,"∤","\\nmid",!0);P(V,fe,he,"⊬","\\nvdash",!0);P(V,fe,he,"⊭","\\nvDash",!0);P(V,fe,he,"⋪","\\ntriangleleft");P(V,fe,he,"⋬","\\ntrianglelefteq",!0);P(V,fe,he,"⊊","\\subsetneq",!0);P(V,fe,he,"","\\@varsubsetneq");P(V,fe,he,"⫋","\\subsetneqq",!0);P(V,fe,he,"","\\@varsubsetneqq");P(V,fe,he,"≯","\\ngtr",!0);P(V,fe,he,"","\\@ngeqslant");P(V,fe,he,"","\\@ngeqq");P(V,fe,he,"⪈","\\gneq",!0);P(V,fe,he,"≩","\\gneqq",!0);P(V,fe,he,"","\\@gvertneqq");P(V,fe,he,"⋧","\\gnsim",!0);P(V,fe,he,"⪊","\\gnapprox",!0);P(V,fe,he,"⊁","\\nsucc",!0);P(V,fe,he,"⋡","\\nsucceq",!0);P(V,fe,he,"⋩","\\succnsim",!0);P(V,fe,he,"⪺","\\succnapprox",!0);P(V,fe,he,"≆","\\ncong",!0);P(V,fe,he,"","\\@nshortparallel");P(V,fe,he,"∦","\\nparallel",!0);P(V,fe,he,"⊯","\\nVDash",!0);P(V,fe,he,"⋫","\\ntriangleright");P(V,fe,he,"⋭","\\ntrianglerighteq",!0);P(V,fe,he,"","\\@nsupseteqq");P(V,fe,he,"⊋","\\supsetneq",!0);P(V,fe,he,"","\\@varsupsetneq");P(V,fe,he,"⫌","\\supsetneqq",!0);P(V,fe,he,"","\\@varsupsetneqq");P(V,fe,he,"⊮","\\nVdash",!0);P(V,fe,he,"⪵","\\precneqq",!0);P(V,fe,he,"⪶","\\succneqq",!0);P(V,fe,he,"","\\@nsubseteqq");P(V,fe,dt,"⊴","\\unlhd");P(V,fe,dt,"⊵","\\unrhd");P(V,fe,he,"↚","\\nleftarrow",!0);P(V,fe,he,"↛","\\nrightarrow",!0);P(V,fe,he,"⇍","\\nLeftarrow",!0);P(V,fe,he,"⇏","\\nRightarrow",!0);P(V,fe,he,"↮","\\nleftrightarrow",!0);P(V,fe,he,"⇎","\\nLeftrightarrow",!0);P(V,fe,he,"△","\\vartriangle");P(V,fe,ve,"ℏ","\\hslash");P(V,fe,ve,"▽","\\triangledown");P(V,fe,ve,"◊","\\lozenge");P(V,fe,ve,"Ⓢ","\\circledS");P(V,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(V,fe,ve,"∡","\\measuredangle",!0);P(V,fe,ve,"∄","\\nexists");P(V,fe,ve,"℧","\\mho");P(V,fe,ve,"Ⅎ","\\Finv",!0);P(V,fe,ve,"⅁","\\Game",!0);P(V,fe,ve,"‵","\\backprime");P(V,fe,ve,"▲","\\blacktriangle");P(V,fe,ve,"▼","\\blacktriangledown");P(V,fe,ve,"■","\\blacksquare");P(V,fe,ve,"⧫","\\blacklozenge");P(V,fe,ve,"★","\\bigstar");P(V,fe,ve,"∢","\\sphericalangle",!0);P(V,fe,ve,"∁","\\complement",!0);P(V,fe,ve,"ð","\\eth",!0);P(He,J,ve,"ð","ð");P(V,fe,ve,"╱","\\diagup");P(V,fe,ve,"╲","\\diagdown");P(V,fe,ve,"□","\\square");P(V,fe,ve,"□","\\Box");P(V,fe,ve,"◊","\\Diamond");P(V,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(V,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(V,fe,ve,"ℶ","\\beth",!0);P(V,fe,ve,"ℸ","\\daleth",!0);P(V,fe,ve,"ℷ","\\gimel",!0);P(V,fe,ve,"ϝ","\\digamma",!0);P(V,fe,ve,"ϰ","\\varkappa");P(V,fe,na,"┌","\\@ulcorner",!0);P(V,fe,ui,"┐","\\@urcorner",!0);P(V,fe,na,"└","\\@llcorner",!0);P(V,fe,ui,"┘","\\@lrcorner",!0);P(V,fe,he,"≦","\\leqq",!0);P(V,fe,he,"⩽","\\leqslant",!0);P(V,fe,he,"⪕","\\eqslantless",!0);P(V,fe,he,"≲","\\lesssim",!0);P(V,fe,he,"⪅","\\lessapprox",!0);P(V,fe,he,"≊","\\approxeq",!0);P(V,fe,dt,"⋖","\\lessdot");P(V,fe,he,"⋘","\\lll",!0);P(V,fe,he,"≶","\\lessgtr",!0);P(V,fe,he,"⋚","\\lesseqgtr",!0);P(V,fe,he,"⪋","\\lesseqqgtr",!0);P(V,fe,he,"≑","\\doteqdot");P(V,fe,he,"≓","\\risingdotseq",!0);P(V,fe,he,"≒","\\fallingdotseq",!0);P(V,fe,he,"∽","\\backsim",!0);P(V,fe,he,"⋍","\\backsimeq",!0);P(V,fe,he,"⫅","\\subseteqq",!0);P(V,fe,he,"⋐","\\Subset",!0);P(V,fe,he,"⊏","\\sqsubset",!0);P(V,fe,he,"≼","\\preccurlyeq",!0);P(V,fe,he,"⋞","\\curlyeqprec",!0);P(V,fe,he,"≾","\\precsim",!0);P(V,fe,he,"⪷","\\precapprox",!0);P(V,fe,he,"⊲","\\vartriangleleft");P(V,fe,he,"⊴","\\trianglelefteq");P(V,fe,he,"⊨","\\vDash",!0);P(V,fe,he,"⊪","\\Vvdash",!0);P(V,fe,he,"⌣","\\smallsmile");P(V,fe,he,"⌢","\\smallfrown");P(V,fe,he,"≏","\\bumpeq",!0);P(V,fe,he,"≎","\\Bumpeq",!0);P(V,fe,he,"≧","\\geqq",!0);P(V,fe,he,"⩾","\\geqslant",!0);P(V,fe,he,"⪖","\\eqslantgtr",!0);P(V,fe,he,"≳","\\gtrsim",!0);P(V,fe,he,"⪆","\\gtrapprox",!0);P(V,fe,dt,"⋗","\\gtrdot");P(V,fe,he,"⋙","\\ggg",!0);P(V,fe,he,"≷","\\gtrless",!0);P(V,fe,he,"⋛","\\gtreqless",!0);P(V,fe,he,"⪌","\\gtreqqless",!0);P(V,fe,he,"≖","\\eqcirc",!0);P(V,fe,he,"≗","\\circeq",!0);P(V,fe,he,"≜","\\triangleq",!0);P(V,fe,he,"∼","\\thicksim");P(V,fe,he,"≈","\\thickapprox");P(V,fe,he,"⫆","\\supseteqq",!0);P(V,fe,he,"⋑","\\Supset",!0);P(V,fe,he,"⊐","\\sqsupset",!0);P(V,fe,he,"≽","\\succcurlyeq",!0);P(V,fe,he,"⋟","\\curlyeqsucc",!0);P(V,fe,he,"≿","\\succsim",!0);P(V,fe,he,"⪸","\\succapprox",!0);P(V,fe,he,"⊳","\\vartriangleright");P(V,fe,he,"⊵","\\trianglerighteq");P(V,fe,he,"⊩","\\Vdash",!0);P(V,fe,he,"∣","\\shortmid");P(V,fe,he,"∥","\\shortparallel");P(V,fe,he,"≬","\\between",!0);P(V,fe,he,"⋔","\\pitchfork",!0);P(V,fe,he,"∝","\\varpropto");P(V,fe,he,"◀","\\blacktriangleleft");P(V,fe,he,"∴","\\therefore",!0);P(V,fe,he,"∍","\\backepsilon");P(V,fe,he,"▶","\\blacktriangleright");P(V,fe,he,"∵","\\because",!0);P(V,fe,he,"⋘","\\llless");P(V,fe,he,"⋙","\\gggtr");P(V,fe,dt,"⊲","\\lhd");P(V,fe,dt,"⊳","\\rhd");P(V,fe,he,"≂","\\eqsim",!0);P(V,J,he,"⋈","\\Join");P(V,fe,he,"≑","\\Doteq",!0);P(V,fe,dt,"∔","\\dotplus",!0);P(V,fe,dt,"∖","\\smallsetminus");P(V,fe,dt,"⋒","\\Cap",!0);P(V,fe,dt,"⋓","\\Cup",!0);P(V,fe,dt,"⩞","\\doublebarwedge",!0);P(V,fe,dt,"⊟","\\boxminus",!0);P(V,fe,dt,"⊞","\\boxplus",!0);P(V,fe,dt,"⋇","\\divideontimes",!0);P(V,fe,dt,"⋉","\\ltimes",!0);P(V,fe,dt,"⋊","\\rtimes",!0);P(V,fe,dt,"⋋","\\leftthreetimes",!0);P(V,fe,dt,"⋌","\\rightthreetimes",!0);P(V,fe,dt,"⋏","\\curlywedge",!0);P(V,fe,dt,"⋎","\\curlyvee",!0);P(V,fe,dt,"⊝","\\circleddash",!0);P(V,fe,dt,"⊛","\\circledast",!0);P(V,fe,dt,"⋅","\\centerdot");P(V,fe,dt,"⊺","\\intercal",!0);P(V,fe,dt,"⋒","\\doublecap");P(V,fe,dt,"⋓","\\doublecup");P(V,fe,dt,"⊠","\\boxtimes",!0);P(V,fe,he,"⇢","\\dashrightarrow",!0);P(V,fe,he,"⇠","\\dashleftarrow",!0);P(V,fe,he,"⇇","\\leftleftarrows",!0);P(V,fe,he,"⇆","\\leftrightarrows",!0);P(V,fe,he,"⇚","\\Lleftarrow",!0);P(V,fe,he,"↞","\\twoheadleftarrow",!0);P(V,fe,he,"↢","\\leftarrowtail",!0);P(V,fe,he,"↫","\\looparrowleft",!0);P(V,fe,he,"⇋","\\leftrightharpoons",!0);P(V,fe,he,"↶","\\curvearrowleft",!0);P(V,fe,he,"↺","\\circlearrowleft",!0);P(V,fe,he,"↰","\\Lsh",!0);P(V,fe,he,"⇈","\\upuparrows",!0);P(V,fe,he,"↿","\\upharpoonleft",!0);P(V,fe,he,"⇃","\\downharpoonleft",!0);P(V,J,he,"⊶","\\origof",!0);P(V,J,he,"⊷","\\imageof",!0);P(V,fe,he,"⊸","\\multimap",!0);P(V,fe,he,"↭","\\leftrightsquigarrow",!0);P(V,fe,he,"⇉","\\rightrightarrows",!0);P(V,fe,he,"⇄","\\rightleftarrows",!0);P(V,fe,he,"↠","\\twoheadrightarrow",!0);P(V,fe,he,"↣","\\rightarrowtail",!0);P(V,fe,he,"↬","\\looparrowright",!0);P(V,fe,he,"↷","\\curvearrowright",!0);P(V,fe,he,"↻","\\circlearrowright",!0);P(V,fe,he,"↱","\\Rsh",!0);P(V,fe,he,"⇊","\\downdownarrows",!0);P(V,fe,he,"↾","\\upharpoonright",!0);P(V,fe,he,"⇂","\\downharpoonright",!0);P(V,fe,he,"⇝","\\rightsquigarrow",!0);P(V,fe,he,"⇝","\\leadsto");P(V,fe,he,"⇛","\\Rrightarrow",!0);P(V,fe,he,"↾","\\restriction");P(V,J,ve,"‘","`");P(V,J,ve,"$","\\$");P(He,J,ve,"$","\\$");P(He,J,ve,"$","\\textdollar");P(V,J,ve,"%","\\%");P(He,J,ve,"%","\\%");P(V,J,ve,"_","\\_");P(He,J,ve,"_","\\_");P(He,J,ve,"_","\\textunderscore");P(V,J,ve,"∠","\\angle",!0);P(V,J,ve,"∞","\\infty",!0);P(V,J,ve,"′","\\prime");P(V,J,ve,"△","\\triangle");P(V,J,ve,"Γ","\\Gamma",!0);P(V,J,ve,"Δ","\\Delta",!0);P(V,J,ve,"Θ","\\Theta",!0);P(V,J,ve,"Λ","\\Lambda",!0);P(V,J,ve,"Ξ","\\Xi",!0);P(V,J,ve,"Π","\\Pi",!0);P(V,J,ve,"Σ","\\Sigma",!0);P(V,J,ve,"Υ","\\Upsilon",!0);P(V,J,ve,"Φ","\\Phi",!0);P(V,J,ve,"Ψ","\\Psi",!0);P(V,J,ve,"Ω","\\Omega",!0);P(V,J,ve,"A","Α");P(V,J,ve,"B","Β");P(V,J,ve,"E","Ε");P(V,J,ve,"Z","Ζ");P(V,J,ve,"H","Η");P(V,J,ve,"I","Ι");P(V,J,ve,"K","Κ");P(V,J,ve,"M","Μ");P(V,J,ve,"N","Ν");P(V,J,ve,"O","Ο");P(V,J,ve,"P","Ρ");P(V,J,ve,"T","Τ");P(V,J,ve,"X","Χ");P(V,J,ve,"¬","\\neg",!0);P(V,J,ve,"¬","\\lnot");P(V,J,ve,"⊤","\\top");P(V,J,ve,"⊥","\\bot");P(V,J,ve,"∅","\\emptyset");P(V,fe,ve,"∅","\\varnothing");P(V,J,Bt,"α","\\alpha",!0);P(V,J,Bt,"β","\\beta",!0);P(V,J,Bt,"γ","\\gamma",!0);P(V,J,Bt,"δ","\\delta",!0);P(V,J,Bt,"ϵ","\\epsilon",!0);P(V,J,Bt,"ζ","\\zeta",!0);P(V,J,Bt,"η","\\eta",!0);P(V,J,Bt,"θ","\\theta",!0);P(V,J,Bt,"ι","\\iota",!0);P(V,J,Bt,"κ","\\kappa",!0);P(V,J,Bt,"λ","\\lambda",!0);P(V,J,Bt,"μ","\\mu",!0);P(V,J,Bt,"ν","\\nu",!0);P(V,J,Bt,"ξ","\\xi",!0);P(V,J,Bt,"ο","\\omicron",!0);P(V,J,Bt,"π","\\pi",!0);P(V,J,Bt,"ρ","\\rho",!0);P(V,J,Bt,"σ","\\sigma",!0);P(V,J,Bt,"τ","\\tau",!0);P(V,J,Bt,"υ","\\upsilon",!0);P(V,J,Bt,"ϕ","\\phi",!0);P(V,J,Bt,"χ","\\chi",!0);P(V,J,Bt,"ψ","\\psi",!0);P(V,J,Bt,"ω","\\omega",!0);P(V,J,Bt,"ε","\\varepsilon",!0);P(V,J,Bt,"ϑ","\\vartheta",!0);P(V,J,Bt,"ϖ","\\varpi",!0);P(V,J,Bt,"ϱ","\\varrho",!0);P(V,J,Bt,"ς","\\varsigma",!0);P(V,J,Bt,"φ","\\varphi",!0);P(V,J,dt,"∗","*",!0);P(V,J,dt,"+","+");P(V,J,dt,"−","-",!0);P(V,J,dt,"⋅","\\cdot",!0);P(V,J,dt,"∘","\\circ",!0);P(V,J,dt,"÷","\\div",!0);P(V,J,dt,"±","\\pm",!0);P(V,J,dt,"×","\\times",!0);P(V,J,dt,"∩","\\cap",!0);P(V,J,dt,"∪","\\cup",!0);P(V,J,dt,"∖","\\setminus",!0);P(V,J,dt,"∧","\\land");P(V,J,dt,"∨","\\lor");P(V,J,dt,"∧","\\wedge",!0);P(V,J,dt,"∨","\\vee",!0);P(V,J,ve,"√","\\surd");P(V,J,na,"⟨","\\langle",!0);P(V,J,na,"∣","\\lvert");P(V,J,na,"∥","\\lVert");P(V,J,ui,"?","?");P(V,J,ui,"!","!");P(V,J,ui,"⟩","\\rangle",!0);P(V,J,ui,"∣","\\rvert");P(V,J,ui,"∥","\\rVert");P(V,J,he,"=","=");P(V,J,he,":",":");P(V,J,he,"≈","\\approx",!0);P(V,J,he,"≅","\\cong",!0);P(V,J,he,"≥","\\ge");P(V,J,he,"≥","\\geq",!0);P(V,J,he,"←","\\gets");P(V,J,he,">","\\gt",!0);P(V,J,he,"∈","\\in",!0);P(V,J,he,"","\\@not");P(V,J,he,"⊂","\\subset",!0);P(V,J,he,"⊃","\\supset",!0);P(V,J,he,"⊆","\\subseteq",!0);P(V,J,he,"⊇","\\supseteq",!0);P(V,fe,he,"⊈","\\nsubseteq",!0);P(V,fe,he,"⊉","\\nsupseteq",!0);P(V,J,he,"⊨","\\models");P(V,J,he,"←","\\leftarrow",!0);P(V,J,he,"≤","\\le");P(V,J,he,"≤","\\leq",!0);P(V,J,he,"<","\\lt",!0);P(V,J,he,"→","\\rightarrow",!0);P(V,J,he,"→","\\to");P(V,fe,he,"≱","\\ngeq",!0);P(V,fe,he,"≰","\\nleq",!0);P(V,J,Vl," ","\\ ");P(V,J,Vl," ","\\space");P(V,J,Vl," ","\\nobreakspace");P(He,J,Vl," ","\\ ");P(He,J,Vl," "," ");P(He,J,Vl," ","\\space");P(He,J,Vl," ","\\nobreakspace");P(V,J,Vl,"","\\nobreak");P(V,J,Vl,"","\\allowbreak");P(V,J,dm,",",",");P(V,J,dm,";",";");P(V,fe,dt,"⊼","\\barwedge",!0);P(V,fe,dt,"⊻","\\veebar",!0);P(V,J,dt,"⊙","\\odot",!0);P(V,J,dt,"⊕","\\oplus",!0);P(V,J,dt,"⊗","\\otimes",!0);P(V,J,ve,"∂","\\partial",!0);P(V,J,dt,"⊘","\\oslash",!0);P(V,fe,dt,"⊚","\\circledcirc",!0);P(V,fe,dt,"⊡","\\boxdot",!0);P(V,J,dt,"△","\\bigtriangleup");P(V,J,dt,"▽","\\bigtriangledown");P(V,J,dt,"†","\\dagger");P(V,J,dt,"⋄","\\diamond");P(V,J,dt,"⋆","\\star");P(V,J,dt,"◃","\\triangleleft");P(V,J,dt,"▹","\\triangleright");P(V,J,na,"{","\\{");P(He,J,ve,"{","\\{");P(He,J,ve,"{","\\textbraceleft");P(V,J,ui,"}","\\}");P(He,J,ve,"}","\\}");P(He,J,ve,"}","\\textbraceright");P(V,J,na,"{","\\lbrace");P(V,J,ui,"}","\\rbrace");P(V,J,na,"[","\\lbrack",!0);P(He,J,ve,"[","\\lbrack",!0);P(V,J,ui,"]","\\rbrack",!0);P(He,J,ve,"]","\\rbrack",!0);P(V,J,na,"(","\\lparen",!0);P(V,J,ui,")","\\rparen",!0);P(He,J,ve,"<","\\textless",!0);P(He,J,ve,">","\\textgreater",!0);P(V,J,na,"⌊","\\lfloor",!0);P(V,J,ui,"⌋","\\rfloor",!0);P(V,J,na,"⌈","\\lceil",!0);P(V,J,ui,"⌉","\\rceil",!0);P(V,J,ve,"\\","\\backslash");P(V,J,ve,"∣","|");P(V,J,ve,"∣","\\vert");P(He,J,ve,"|","\\textbar",!0);P(V,J,ve,"∥","\\|");P(V,J,ve,"∥","\\Vert");P(He,J,ve,"∥","\\textbardbl");P(He,J,ve,"~","\\textasciitilde");P(He,J,ve,"\\","\\textbackslash");P(He,J,ve,"^","\\textasciicircum");P(V,J,he,"↑","\\uparrow",!0);P(V,J,he,"⇑","\\Uparrow",!0);P(V,J,he,"↓","\\downarrow",!0);P(V,J,he,"⇓","\\Downarrow",!0);P(V,J,he,"↕","\\updownarrow",!0);P(V,J,he,"⇕","\\Updownarrow",!0);P(V,J,is,"∐","\\coprod");P(V,J,is,"⋁","\\bigvee");P(V,J,is,"⋀","\\bigwedge");P(V,J,is,"⨄","\\biguplus");P(V,J,is,"⋂","\\bigcap");P(V,J,is,"⋃","\\bigcup");P(V,J,is,"∫","\\int");P(V,J,is,"∫","\\intop");P(V,J,is,"∬","\\iint");P(V,J,is,"∭","\\iiint");P(V,J,is,"∏","\\prod");P(V,J,is,"∑","\\sum");P(V,J,is,"⨂","\\bigotimes");P(V,J,is,"⨁","\\bigoplus");P(V,J,is,"⨀","\\bigodot");P(V,J,is,"∮","\\oint");P(V,J,is,"∯","\\oiint");P(V,J,is,"∰","\\oiiint");P(V,J,is,"⨆","\\bigsqcup");P(V,J,is,"∫","\\smallint");P(He,J,g_,"…","\\textellipsis");P(V,J,g_,"…","\\mathellipsis");P(He,J,g_,"…","\\ldots",!0);P(V,J,g_,"…","\\ldots",!0);P(V,J,g_,"⋯","\\@cdots",!0);P(V,J,g_,"⋱","\\ddots",!0);P(V,J,ve,"⋮","\\varvdots");P(He,J,ve,"⋮","\\varvdots");P(V,J,Cr,"ˊ","\\acute");P(V,J,Cr,"ˋ","\\grave");P(V,J,Cr,"¨","\\ddot");P(V,J,Cr,"~","\\tilde");P(V,J,Cr,"ˉ","\\bar");P(V,J,Cr,"˘","\\breve");P(V,J,Cr,"ˇ","\\check");P(V,J,Cr,"^","\\hat");P(V,J,Cr,"⃗","\\vec");P(V,J,Cr,"˙","\\dot");P(V,J,Cr,"˚","\\mathring");P(V,J,Bt,"","\\@imath");P(V,J,Bt,"","\\@jmath");P(V,J,ve,"ı","ı");P(V,J,ve,"ȷ","ȷ");P(He,J,ve,"ı","\\i",!0);P(He,J,ve,"ȷ","\\j",!0);P(He,J,ve,"ß","\\ss",!0);P(He,J,ve,"æ","\\ae",!0);P(He,J,ve,"œ","\\oe",!0);P(He,J,ve,"ø","\\o",!0);P(He,J,ve,"Æ","\\AE",!0);P(He,J,ve,"Œ","\\OE",!0);P(He,J,ve,"Ø","\\O",!0);P(He,J,Cr,"ˊ","\\'");P(He,J,Cr,"ˋ","\\`");P(He,J,Cr,"ˆ","\\^");P(He,J,Cr,"˜","\\~");P(He,J,Cr,"ˉ","\\=");P(He,J,Cr,"˘","\\u");P(He,J,Cr,"˙","\\.");P(He,J,Cr,"¸","\\c");P(He,J,Cr,"˚","\\r");P(He,J,Cr,"ˇ","\\v");P(He,J,Cr,"¨",'\\"');P(He,J,Cr,"˝","\\H");P(He,J,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,J,ve,"–","--",!0);P(He,J,ve,"–","\\textendash");P(He,J,ve,"—","---",!0);P(He,J,ve,"—","\\textemdash");P(He,J,ve,"‘","`",!0);P(He,J,ve,"‘","\\textquoteleft");P(He,J,ve,"’","'",!0);P(He,J,ve,"’","\\textquoteright");P(He,J,ve,"“","``",!0);P(He,J,ve,"“","\\textquotedblleft");P(He,J,ve,"”","''",!0);P(He,J,ve,"”","\\textquotedblright");P(V,J,ve,"°","\\degree",!0);P(He,J,ve,"°","\\degree");P(He,J,ve,"°","\\textdegree",!0);P(V,J,ve,"£","\\pounds");P(V,J,ve,"£","\\mathsterling",!0);P(He,J,ve,"£","\\pounds");P(He,J,ve,"£","\\textsterling",!0);P(V,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var aw=0;aw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new $b(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},P3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},kv={},Cv={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),F3(i,(x,S)=>{var v,b,w=q3(S),y=q3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},F3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof $b||n instanceof m_&&n.hasClass("enclosing")?n:null},H3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return H3(s[s.length-1],"right");if(t==="left")return H3(s[0],"left")}}return n},q3=function(n,t){if(!n)return null;t&&(n=H3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(kv[n.type]){var s=kv[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function U3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=P3[t].fontName;return JS(i,o,r)?P3[t].variant:null};function uw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||uw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Cv[n.type])return Cv[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=U3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=U3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=U3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Hb=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),qb=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Ub(e){var n=Gb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Gb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=qb(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=Fb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?Hb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Ev(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=qb(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=Hb(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=qb(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=Hb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Wb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Wb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Wb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Wb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var G3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(G3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=G3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===G3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},dw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},fw=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},W3=.008,t1={type:"kern",size:-1*W3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var q=M-S-y,U=Math.round(M*1e3),Y=_6t(d,Math.round(q*1e3)),G=new mu(d,Y),X=et(p/1e3),te=et(U/1e3),I=new ql([G],{width:X,height:te,viewBox:"0 0 "+p+" "+U}),L=gu([],[I],s);L.height=U/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(dw(_,m,i)),$.push(t1),l===null){var F=M-S-y+2*W3;$.push(fw(u,F,s))}else{var W=(M-S-y-C)/2+2*W3;$.push(fw(u,W,s)),$.push(t1),$.push(dw(l,m,i)),$.push(t1),$.push(fw(u,W,s))}$.push(t1),$.push(dw(o,m,i))}var H=s.havingBaseStyle(Yt.TEXT),ee=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[ee],H),Yt.TEXT,s,a)},hw=80,_w=.08,pw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+hw,n<1?i=1:n<1.4&&(i=.7),l=(1+a+_w)/i,u=(1+a)/i,o=pw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+hw)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+_w)/i,o=pw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+_w,u=n+a,_=Math.floor(1e3*n+a)+hw,o=pw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},V3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},mw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return V3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Vb(e,n){var t=Gb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Vb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Vb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Vb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Kb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Qb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Kb,mathmlBuilder:Qb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ce;le=(oe=(ce=H)==null?void 0:ce.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),U.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Ub(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Gb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Ub(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Yb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Yb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Yb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Ev(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Wb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Ev(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=Ev(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=qb(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=Hb(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var gw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var K3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in K3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=q3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return Fb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return Fb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var vw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},bw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(bw.hasOwnProperty(e.text)){var t=bw[e.text].className||"";if(e.mode==="text"){var r=Fb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(vw.hasOwnProperty(e.text))return Ge(["mspace",vw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(bw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(vw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var M3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in M3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in M3)r=M3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class Pb{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class D3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof Pb||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var aw={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!aw[n]){var t=aw[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return aw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",ee="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";P(V,ee,he,"≡","\\equiv",!0);P(V,ee,he,"≺","\\prec",!0);P(V,ee,he,"≻","\\succ",!0);P(V,ee,he,"∼","\\sim",!0);P(V,ee,he,"⊥","\\perp");P(V,ee,he,"⪯","\\preceq",!0);P(V,ee,he,"⪰","\\succeq",!0);P(V,ee,he,"≃","\\simeq",!0);P(V,ee,he,"∣","\\mid",!0);P(V,ee,he,"≪","\\ll",!0);P(V,ee,he,"≫","\\gg",!0);P(V,ee,he,"≍","\\asymp",!0);P(V,ee,he,"∥","\\parallel");P(V,ee,he,"⋈","\\bowtie",!0);P(V,ee,he,"⌣","\\smile",!0);P(V,ee,he,"⊑","\\sqsubseteq",!0);P(V,ee,he,"⊒","\\sqsupseteq",!0);P(V,ee,he,"≐","\\doteq",!0);P(V,ee,he,"⌢","\\frown",!0);P(V,ee,he,"∋","\\ni",!0);P(V,ee,he,"∝","\\propto",!0);P(V,ee,he,"⊢","\\vdash",!0);P(V,ee,he,"⊣","\\dashv",!0);P(V,ee,he,"∋","\\owns");P(V,ee,dm,".","\\ldotp");P(V,ee,dm,"⋅","\\cdotp");P(V,ee,dm,"⋅","·");P(He,ee,ve,"⋅","·");P(V,ee,ve,"#","\\#");P(He,ee,ve,"#","\\#");P(V,ee,ve,"&","\\&");P(He,ee,ve,"&","\\&");P(V,ee,ve,"ℵ","\\aleph",!0);P(V,ee,ve,"∀","\\forall",!0);P(V,ee,ve,"ℏ","\\hbar",!0);P(V,ee,ve,"∃","\\exists",!0);P(V,ee,ve,"∇","\\nabla",!0);P(V,ee,ve,"♭","\\flat",!0);P(V,ee,ve,"ℓ","\\ell",!0);P(V,ee,ve,"♮","\\natural",!0);P(V,ee,ve,"♣","\\clubsuit",!0);P(V,ee,ve,"℘","\\wp",!0);P(V,ee,ve,"♯","\\sharp",!0);P(V,ee,ve,"♢","\\diamondsuit",!0);P(V,ee,ve,"ℜ","\\Re",!0);P(V,ee,ve,"♡","\\heartsuit",!0);P(V,ee,ve,"ℑ","\\Im",!0);P(V,ee,ve,"♠","\\spadesuit",!0);P(V,ee,ve,"§","\\S",!0);P(He,ee,ve,"§","\\S");P(V,ee,ve,"¶","\\P",!0);P(He,ee,ve,"¶","\\P");P(V,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\textdagger");P(V,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\textdaggerdbl");P(V,ee,ui,"⎱","\\rmoustache",!0);P(V,ee,na,"⎰","\\lmoustache",!0);P(V,ee,ui,"⟯","\\rgroup",!0);P(V,ee,na,"⟮","\\lgroup",!0);P(V,ee,dt,"∓","\\mp",!0);P(V,ee,dt,"⊖","\\ominus",!0);P(V,ee,dt,"⊎","\\uplus",!0);P(V,ee,dt,"⊓","\\sqcap",!0);P(V,ee,dt,"∗","\\ast");P(V,ee,dt,"⊔","\\sqcup",!0);P(V,ee,dt,"◯","\\bigcirc",!0);P(V,ee,dt,"∙","\\bullet",!0);P(V,ee,dt,"‡","\\ddagger");P(V,ee,dt,"≀","\\wr",!0);P(V,ee,dt,"⨿","\\amalg");P(V,ee,dt,"&","\\And");P(V,ee,he,"⟵","\\longleftarrow",!0);P(V,ee,he,"⇐","\\Leftarrow",!0);P(V,ee,he,"⟸","\\Longleftarrow",!0);P(V,ee,he,"⟶","\\longrightarrow",!0);P(V,ee,he,"⇒","\\Rightarrow",!0);P(V,ee,he,"⟹","\\Longrightarrow",!0);P(V,ee,he,"↔","\\leftrightarrow",!0);P(V,ee,he,"⟷","\\longleftrightarrow",!0);P(V,ee,he,"⇔","\\Leftrightarrow",!0);P(V,ee,he,"⟺","\\Longleftrightarrow",!0);P(V,ee,he,"↦","\\mapsto",!0);P(V,ee,he,"⟼","\\longmapsto",!0);P(V,ee,he,"↗","\\nearrow",!0);P(V,ee,he,"↩","\\hookleftarrow",!0);P(V,ee,he,"↪","\\hookrightarrow",!0);P(V,ee,he,"↘","\\searrow",!0);P(V,ee,he,"↼","\\leftharpoonup",!0);P(V,ee,he,"⇀","\\rightharpoonup",!0);P(V,ee,he,"↙","\\swarrow",!0);P(V,ee,he,"↽","\\leftharpoondown",!0);P(V,ee,he,"⇁","\\rightharpoondown",!0);P(V,ee,he,"↖","\\nwarrow",!0);P(V,ee,he,"⇌","\\rightleftharpoons",!0);P(V,fe,he,"≮","\\nless",!0);P(V,fe,he,"","\\@nleqslant");P(V,fe,he,"","\\@nleqq");P(V,fe,he,"⪇","\\lneq",!0);P(V,fe,he,"≨","\\lneqq",!0);P(V,fe,he,"","\\@lvertneqq");P(V,fe,he,"⋦","\\lnsim",!0);P(V,fe,he,"⪉","\\lnapprox",!0);P(V,fe,he,"⊀","\\nprec",!0);P(V,fe,he,"⋠","\\npreceq",!0);P(V,fe,he,"⋨","\\precnsim",!0);P(V,fe,he,"⪹","\\precnapprox",!0);P(V,fe,he,"≁","\\nsim",!0);P(V,fe,he,"","\\@nshortmid");P(V,fe,he,"∤","\\nmid",!0);P(V,fe,he,"⊬","\\nvdash",!0);P(V,fe,he,"⊭","\\nvDash",!0);P(V,fe,he,"⋪","\\ntriangleleft");P(V,fe,he,"⋬","\\ntrianglelefteq",!0);P(V,fe,he,"⊊","\\subsetneq",!0);P(V,fe,he,"","\\@varsubsetneq");P(V,fe,he,"⫋","\\subsetneqq",!0);P(V,fe,he,"","\\@varsubsetneqq");P(V,fe,he,"≯","\\ngtr",!0);P(V,fe,he,"","\\@ngeqslant");P(V,fe,he,"","\\@ngeqq");P(V,fe,he,"⪈","\\gneq",!0);P(V,fe,he,"≩","\\gneqq",!0);P(V,fe,he,"","\\@gvertneqq");P(V,fe,he,"⋧","\\gnsim",!0);P(V,fe,he,"⪊","\\gnapprox",!0);P(V,fe,he,"⊁","\\nsucc",!0);P(V,fe,he,"⋡","\\nsucceq",!0);P(V,fe,he,"⋩","\\succnsim",!0);P(V,fe,he,"⪺","\\succnapprox",!0);P(V,fe,he,"≆","\\ncong",!0);P(V,fe,he,"","\\@nshortparallel");P(V,fe,he,"∦","\\nparallel",!0);P(V,fe,he,"⊯","\\nVDash",!0);P(V,fe,he,"⋫","\\ntriangleright");P(V,fe,he,"⋭","\\ntrianglerighteq",!0);P(V,fe,he,"","\\@nsupseteqq");P(V,fe,he,"⊋","\\supsetneq",!0);P(V,fe,he,"","\\@varsupsetneq");P(V,fe,he,"⫌","\\supsetneqq",!0);P(V,fe,he,"","\\@varsupsetneqq");P(V,fe,he,"⊮","\\nVdash",!0);P(V,fe,he,"⪵","\\precneqq",!0);P(V,fe,he,"⪶","\\succneqq",!0);P(V,fe,he,"","\\@nsubseteqq");P(V,fe,dt,"⊴","\\unlhd");P(V,fe,dt,"⊵","\\unrhd");P(V,fe,he,"↚","\\nleftarrow",!0);P(V,fe,he,"↛","\\nrightarrow",!0);P(V,fe,he,"⇍","\\nLeftarrow",!0);P(V,fe,he,"⇏","\\nRightarrow",!0);P(V,fe,he,"↮","\\nleftrightarrow",!0);P(V,fe,he,"⇎","\\nLeftrightarrow",!0);P(V,fe,he,"△","\\vartriangle");P(V,fe,ve,"ℏ","\\hslash");P(V,fe,ve,"▽","\\triangledown");P(V,fe,ve,"◊","\\lozenge");P(V,fe,ve,"Ⓢ","\\circledS");P(V,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(V,fe,ve,"∡","\\measuredangle",!0);P(V,fe,ve,"∄","\\nexists");P(V,fe,ve,"℧","\\mho");P(V,fe,ve,"Ⅎ","\\Finv",!0);P(V,fe,ve,"⅁","\\Game",!0);P(V,fe,ve,"‵","\\backprime");P(V,fe,ve,"▲","\\blacktriangle");P(V,fe,ve,"▼","\\blacktriangledown");P(V,fe,ve,"■","\\blacksquare");P(V,fe,ve,"⧫","\\blacklozenge");P(V,fe,ve,"★","\\bigstar");P(V,fe,ve,"∢","\\sphericalangle",!0);P(V,fe,ve,"∁","\\complement",!0);P(V,fe,ve,"ð","\\eth",!0);P(He,ee,ve,"ð","ð");P(V,fe,ve,"╱","\\diagup");P(V,fe,ve,"╲","\\diagdown");P(V,fe,ve,"□","\\square");P(V,fe,ve,"□","\\Box");P(V,fe,ve,"◊","\\Diamond");P(V,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(V,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(V,fe,ve,"ℶ","\\beth",!0);P(V,fe,ve,"ℸ","\\daleth",!0);P(V,fe,ve,"ℷ","\\gimel",!0);P(V,fe,ve,"ϝ","\\digamma",!0);P(V,fe,ve,"ϰ","\\varkappa");P(V,fe,na,"┌","\\@ulcorner",!0);P(V,fe,ui,"┐","\\@urcorner",!0);P(V,fe,na,"└","\\@llcorner",!0);P(V,fe,ui,"┘","\\@lrcorner",!0);P(V,fe,he,"≦","\\leqq",!0);P(V,fe,he,"⩽","\\leqslant",!0);P(V,fe,he,"⪕","\\eqslantless",!0);P(V,fe,he,"≲","\\lesssim",!0);P(V,fe,he,"⪅","\\lessapprox",!0);P(V,fe,he,"≊","\\approxeq",!0);P(V,fe,dt,"⋖","\\lessdot");P(V,fe,he,"⋘","\\lll",!0);P(V,fe,he,"≶","\\lessgtr",!0);P(V,fe,he,"⋚","\\lesseqgtr",!0);P(V,fe,he,"⪋","\\lesseqqgtr",!0);P(V,fe,he,"≑","\\doteqdot");P(V,fe,he,"≓","\\risingdotseq",!0);P(V,fe,he,"≒","\\fallingdotseq",!0);P(V,fe,he,"∽","\\backsim",!0);P(V,fe,he,"⋍","\\backsimeq",!0);P(V,fe,he,"⫅","\\subseteqq",!0);P(V,fe,he,"⋐","\\Subset",!0);P(V,fe,he,"⊏","\\sqsubset",!0);P(V,fe,he,"≼","\\preccurlyeq",!0);P(V,fe,he,"⋞","\\curlyeqprec",!0);P(V,fe,he,"≾","\\precsim",!0);P(V,fe,he,"⪷","\\precapprox",!0);P(V,fe,he,"⊲","\\vartriangleleft");P(V,fe,he,"⊴","\\trianglelefteq");P(V,fe,he,"⊨","\\vDash",!0);P(V,fe,he,"⊪","\\Vvdash",!0);P(V,fe,he,"⌣","\\smallsmile");P(V,fe,he,"⌢","\\smallfrown");P(V,fe,he,"≏","\\bumpeq",!0);P(V,fe,he,"≎","\\Bumpeq",!0);P(V,fe,he,"≧","\\geqq",!0);P(V,fe,he,"⩾","\\geqslant",!0);P(V,fe,he,"⪖","\\eqslantgtr",!0);P(V,fe,he,"≳","\\gtrsim",!0);P(V,fe,he,"⪆","\\gtrapprox",!0);P(V,fe,dt,"⋗","\\gtrdot");P(V,fe,he,"⋙","\\ggg",!0);P(V,fe,he,"≷","\\gtrless",!0);P(V,fe,he,"⋛","\\gtreqless",!0);P(V,fe,he,"⪌","\\gtreqqless",!0);P(V,fe,he,"≖","\\eqcirc",!0);P(V,fe,he,"≗","\\circeq",!0);P(V,fe,he,"≜","\\triangleq",!0);P(V,fe,he,"∼","\\thicksim");P(V,fe,he,"≈","\\thickapprox");P(V,fe,he,"⫆","\\supseteqq",!0);P(V,fe,he,"⋑","\\Supset",!0);P(V,fe,he,"⊐","\\sqsupset",!0);P(V,fe,he,"≽","\\succcurlyeq",!0);P(V,fe,he,"⋟","\\curlyeqsucc",!0);P(V,fe,he,"≿","\\succsim",!0);P(V,fe,he,"⪸","\\succapprox",!0);P(V,fe,he,"⊳","\\vartriangleright");P(V,fe,he,"⊵","\\trianglerighteq");P(V,fe,he,"⊩","\\Vdash",!0);P(V,fe,he,"∣","\\shortmid");P(V,fe,he,"∥","\\shortparallel");P(V,fe,he,"≬","\\between",!0);P(V,fe,he,"⋔","\\pitchfork",!0);P(V,fe,he,"∝","\\varpropto");P(V,fe,he,"◀","\\blacktriangleleft");P(V,fe,he,"∴","\\therefore",!0);P(V,fe,he,"∍","\\backepsilon");P(V,fe,he,"▶","\\blacktriangleright");P(V,fe,he,"∵","\\because",!0);P(V,fe,he,"⋘","\\llless");P(V,fe,he,"⋙","\\gggtr");P(V,fe,dt,"⊲","\\lhd");P(V,fe,dt,"⊳","\\rhd");P(V,fe,he,"≂","\\eqsim",!0);P(V,ee,he,"⋈","\\Join");P(V,fe,he,"≑","\\Doteq",!0);P(V,fe,dt,"∔","\\dotplus",!0);P(V,fe,dt,"∖","\\smallsetminus");P(V,fe,dt,"⋒","\\Cap",!0);P(V,fe,dt,"⋓","\\Cup",!0);P(V,fe,dt,"⩞","\\doublebarwedge",!0);P(V,fe,dt,"⊟","\\boxminus",!0);P(V,fe,dt,"⊞","\\boxplus",!0);P(V,fe,dt,"⋇","\\divideontimes",!0);P(V,fe,dt,"⋉","\\ltimes",!0);P(V,fe,dt,"⋊","\\rtimes",!0);P(V,fe,dt,"⋋","\\leftthreetimes",!0);P(V,fe,dt,"⋌","\\rightthreetimes",!0);P(V,fe,dt,"⋏","\\curlywedge",!0);P(V,fe,dt,"⋎","\\curlyvee",!0);P(V,fe,dt,"⊝","\\circleddash",!0);P(V,fe,dt,"⊛","\\circledast",!0);P(V,fe,dt,"⋅","\\centerdot");P(V,fe,dt,"⊺","\\intercal",!0);P(V,fe,dt,"⋒","\\doublecap");P(V,fe,dt,"⋓","\\doublecup");P(V,fe,dt,"⊠","\\boxtimes",!0);P(V,fe,he,"⇢","\\dashrightarrow",!0);P(V,fe,he,"⇠","\\dashleftarrow",!0);P(V,fe,he,"⇇","\\leftleftarrows",!0);P(V,fe,he,"⇆","\\leftrightarrows",!0);P(V,fe,he,"⇚","\\Lleftarrow",!0);P(V,fe,he,"↞","\\twoheadleftarrow",!0);P(V,fe,he,"↢","\\leftarrowtail",!0);P(V,fe,he,"↫","\\looparrowleft",!0);P(V,fe,he,"⇋","\\leftrightharpoons",!0);P(V,fe,he,"↶","\\curvearrowleft",!0);P(V,fe,he,"↺","\\circlearrowleft",!0);P(V,fe,he,"↰","\\Lsh",!0);P(V,fe,he,"⇈","\\upuparrows",!0);P(V,fe,he,"↿","\\upharpoonleft",!0);P(V,fe,he,"⇃","\\downharpoonleft",!0);P(V,ee,he,"⊶","\\origof",!0);P(V,ee,he,"⊷","\\imageof",!0);P(V,fe,he,"⊸","\\multimap",!0);P(V,fe,he,"↭","\\leftrightsquigarrow",!0);P(V,fe,he,"⇉","\\rightrightarrows",!0);P(V,fe,he,"⇄","\\rightleftarrows",!0);P(V,fe,he,"↠","\\twoheadrightarrow",!0);P(V,fe,he,"↣","\\rightarrowtail",!0);P(V,fe,he,"↬","\\looparrowright",!0);P(V,fe,he,"↷","\\curvearrowright",!0);P(V,fe,he,"↻","\\circlearrowright",!0);P(V,fe,he,"↱","\\Rsh",!0);P(V,fe,he,"⇊","\\downdownarrows",!0);P(V,fe,he,"↾","\\upharpoonright",!0);P(V,fe,he,"⇂","\\downharpoonright",!0);P(V,fe,he,"⇝","\\rightsquigarrow",!0);P(V,fe,he,"⇝","\\leadsto");P(V,fe,he,"⇛","\\Rrightarrow",!0);P(V,fe,he,"↾","\\restriction");P(V,ee,ve,"‘","`");P(V,ee,ve,"$","\\$");P(He,ee,ve,"$","\\$");P(He,ee,ve,"$","\\textdollar");P(V,ee,ve,"%","\\%");P(He,ee,ve,"%","\\%");P(V,ee,ve,"_","\\_");P(He,ee,ve,"_","\\_");P(He,ee,ve,"_","\\textunderscore");P(V,ee,ve,"∠","\\angle",!0);P(V,ee,ve,"∞","\\infty",!0);P(V,ee,ve,"′","\\prime");P(V,ee,ve,"△","\\triangle");P(V,ee,ve,"Γ","\\Gamma",!0);P(V,ee,ve,"Δ","\\Delta",!0);P(V,ee,ve,"Θ","\\Theta",!0);P(V,ee,ve,"Λ","\\Lambda",!0);P(V,ee,ve,"Ξ","\\Xi",!0);P(V,ee,ve,"Π","\\Pi",!0);P(V,ee,ve,"Σ","\\Sigma",!0);P(V,ee,ve,"Υ","\\Upsilon",!0);P(V,ee,ve,"Φ","\\Phi",!0);P(V,ee,ve,"Ψ","\\Psi",!0);P(V,ee,ve,"Ω","\\Omega",!0);P(V,ee,ve,"A","Α");P(V,ee,ve,"B","Β");P(V,ee,ve,"E","Ε");P(V,ee,ve,"Z","Ζ");P(V,ee,ve,"H","Η");P(V,ee,ve,"I","Ι");P(V,ee,ve,"K","Κ");P(V,ee,ve,"M","Μ");P(V,ee,ve,"N","Ν");P(V,ee,ve,"O","Ο");P(V,ee,ve,"P","Ρ");P(V,ee,ve,"T","Τ");P(V,ee,ve,"X","Χ");P(V,ee,ve,"¬","\\neg",!0);P(V,ee,ve,"¬","\\lnot");P(V,ee,ve,"⊤","\\top");P(V,ee,ve,"⊥","\\bot");P(V,ee,ve,"∅","\\emptyset");P(V,fe,ve,"∅","\\varnothing");P(V,ee,Bt,"α","\\alpha",!0);P(V,ee,Bt,"β","\\beta",!0);P(V,ee,Bt,"γ","\\gamma",!0);P(V,ee,Bt,"δ","\\delta",!0);P(V,ee,Bt,"ϵ","\\epsilon",!0);P(V,ee,Bt,"ζ","\\zeta",!0);P(V,ee,Bt,"η","\\eta",!0);P(V,ee,Bt,"θ","\\theta",!0);P(V,ee,Bt,"ι","\\iota",!0);P(V,ee,Bt,"κ","\\kappa",!0);P(V,ee,Bt,"λ","\\lambda",!0);P(V,ee,Bt,"μ","\\mu",!0);P(V,ee,Bt,"ν","\\nu",!0);P(V,ee,Bt,"ξ","\\xi",!0);P(V,ee,Bt,"ο","\\omicron",!0);P(V,ee,Bt,"π","\\pi",!0);P(V,ee,Bt,"ρ","\\rho",!0);P(V,ee,Bt,"σ","\\sigma",!0);P(V,ee,Bt,"τ","\\tau",!0);P(V,ee,Bt,"υ","\\upsilon",!0);P(V,ee,Bt,"ϕ","\\phi",!0);P(V,ee,Bt,"χ","\\chi",!0);P(V,ee,Bt,"ψ","\\psi",!0);P(V,ee,Bt,"ω","\\omega",!0);P(V,ee,Bt,"ε","\\varepsilon",!0);P(V,ee,Bt,"ϑ","\\vartheta",!0);P(V,ee,Bt,"ϖ","\\varpi",!0);P(V,ee,Bt,"ϱ","\\varrho",!0);P(V,ee,Bt,"ς","\\varsigma",!0);P(V,ee,Bt,"φ","\\varphi",!0);P(V,ee,dt,"∗","*",!0);P(V,ee,dt,"+","+");P(V,ee,dt,"−","-",!0);P(V,ee,dt,"⋅","\\cdot",!0);P(V,ee,dt,"∘","\\circ",!0);P(V,ee,dt,"÷","\\div",!0);P(V,ee,dt,"±","\\pm",!0);P(V,ee,dt,"×","\\times",!0);P(V,ee,dt,"∩","\\cap",!0);P(V,ee,dt,"∪","\\cup",!0);P(V,ee,dt,"∖","\\setminus",!0);P(V,ee,dt,"∧","\\land");P(V,ee,dt,"∨","\\lor");P(V,ee,dt,"∧","\\wedge",!0);P(V,ee,dt,"∨","\\vee",!0);P(V,ee,ve,"√","\\surd");P(V,ee,na,"⟨","\\langle",!0);P(V,ee,na,"∣","\\lvert");P(V,ee,na,"∥","\\lVert");P(V,ee,ui,"?","?");P(V,ee,ui,"!","!");P(V,ee,ui,"⟩","\\rangle",!0);P(V,ee,ui,"∣","\\rvert");P(V,ee,ui,"∥","\\rVert");P(V,ee,he,"=","=");P(V,ee,he,":",":");P(V,ee,he,"≈","\\approx",!0);P(V,ee,he,"≅","\\cong",!0);P(V,ee,he,"≥","\\ge");P(V,ee,he,"≥","\\geq",!0);P(V,ee,he,"←","\\gets");P(V,ee,he,">","\\gt",!0);P(V,ee,he,"∈","\\in",!0);P(V,ee,he,"","\\@not");P(V,ee,he,"⊂","\\subset",!0);P(V,ee,he,"⊃","\\supset",!0);P(V,ee,he,"⊆","\\subseteq",!0);P(V,ee,he,"⊇","\\supseteq",!0);P(V,fe,he,"⊈","\\nsubseteq",!0);P(V,fe,he,"⊉","\\nsupseteq",!0);P(V,ee,he,"⊨","\\models");P(V,ee,he,"←","\\leftarrow",!0);P(V,ee,he,"≤","\\le");P(V,ee,he,"≤","\\leq",!0);P(V,ee,he,"<","\\lt",!0);P(V,ee,he,"→","\\rightarrow",!0);P(V,ee,he,"→","\\to");P(V,fe,he,"≱","\\ngeq",!0);P(V,fe,he,"≰","\\nleq",!0);P(V,ee,Vl," ","\\ ");P(V,ee,Vl," ","\\space");P(V,ee,Vl," ","\\nobreakspace");P(He,ee,Vl," ","\\ ");P(He,ee,Vl," "," ");P(He,ee,Vl," ","\\space");P(He,ee,Vl," ","\\nobreakspace");P(V,ee,Vl,"","\\nobreak");P(V,ee,Vl,"","\\allowbreak");P(V,ee,dm,",",",");P(V,ee,dm,";",";");P(V,fe,dt,"⊼","\\barwedge",!0);P(V,fe,dt,"⊻","\\veebar",!0);P(V,ee,dt,"⊙","\\odot",!0);P(V,ee,dt,"⊕","\\oplus",!0);P(V,ee,dt,"⊗","\\otimes",!0);P(V,ee,ve,"∂","\\partial",!0);P(V,ee,dt,"⊘","\\oslash",!0);P(V,fe,dt,"⊚","\\circledcirc",!0);P(V,fe,dt,"⊡","\\boxdot",!0);P(V,ee,dt,"△","\\bigtriangleup");P(V,ee,dt,"▽","\\bigtriangledown");P(V,ee,dt,"†","\\dagger");P(V,ee,dt,"⋄","\\diamond");P(V,ee,dt,"⋆","\\star");P(V,ee,dt,"◃","\\triangleleft");P(V,ee,dt,"▹","\\triangleright");P(V,ee,na,"{","\\{");P(He,ee,ve,"{","\\{");P(He,ee,ve,"{","\\textbraceleft");P(V,ee,ui,"}","\\}");P(He,ee,ve,"}","\\}");P(He,ee,ve,"}","\\textbraceright");P(V,ee,na,"{","\\lbrace");P(V,ee,ui,"}","\\rbrace");P(V,ee,na,"[","\\lbrack",!0);P(He,ee,ve,"[","\\lbrack",!0);P(V,ee,ui,"]","\\rbrack",!0);P(He,ee,ve,"]","\\rbrack",!0);P(V,ee,na,"(","\\lparen",!0);P(V,ee,ui,")","\\rparen",!0);P(He,ee,ve,"<","\\textless",!0);P(He,ee,ve,">","\\textgreater",!0);P(V,ee,na,"⌊","\\lfloor",!0);P(V,ee,ui,"⌋","\\rfloor",!0);P(V,ee,na,"⌈","\\lceil",!0);P(V,ee,ui,"⌉","\\rceil",!0);P(V,ee,ve,"\\","\\backslash");P(V,ee,ve,"∣","|");P(V,ee,ve,"∣","\\vert");P(He,ee,ve,"|","\\textbar",!0);P(V,ee,ve,"∥","\\|");P(V,ee,ve,"∥","\\Vert");P(He,ee,ve,"∥","\\textbardbl");P(He,ee,ve,"~","\\textasciitilde");P(He,ee,ve,"\\","\\textbackslash");P(He,ee,ve,"^","\\textasciicircum");P(V,ee,he,"↑","\\uparrow",!0);P(V,ee,he,"⇑","\\Uparrow",!0);P(V,ee,he,"↓","\\downarrow",!0);P(V,ee,he,"⇓","\\Downarrow",!0);P(V,ee,he,"↕","\\updownarrow",!0);P(V,ee,he,"⇕","\\Updownarrow",!0);P(V,ee,is,"∐","\\coprod");P(V,ee,is,"⋁","\\bigvee");P(V,ee,is,"⋀","\\bigwedge");P(V,ee,is,"⨄","\\biguplus");P(V,ee,is,"⋂","\\bigcap");P(V,ee,is,"⋃","\\bigcup");P(V,ee,is,"∫","\\int");P(V,ee,is,"∫","\\intop");P(V,ee,is,"∬","\\iint");P(V,ee,is,"∭","\\iiint");P(V,ee,is,"∏","\\prod");P(V,ee,is,"∑","\\sum");P(V,ee,is,"⨂","\\bigotimes");P(V,ee,is,"⨁","\\bigoplus");P(V,ee,is,"⨀","\\bigodot");P(V,ee,is,"∮","\\oint");P(V,ee,is,"∯","\\oiint");P(V,ee,is,"∰","\\oiiint");P(V,ee,is,"⨆","\\bigsqcup");P(V,ee,is,"∫","\\smallint");P(He,ee,g_,"…","\\textellipsis");P(V,ee,g_,"…","\\mathellipsis");P(He,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"⋯","\\@cdots",!0);P(V,ee,g_,"⋱","\\ddots",!0);P(V,ee,ve,"⋮","\\varvdots");P(He,ee,ve,"⋮","\\varvdots");P(V,ee,Cr,"ˊ","\\acute");P(V,ee,Cr,"ˋ","\\grave");P(V,ee,Cr,"¨","\\ddot");P(V,ee,Cr,"~","\\tilde");P(V,ee,Cr,"ˉ","\\bar");P(V,ee,Cr,"˘","\\breve");P(V,ee,Cr,"ˇ","\\check");P(V,ee,Cr,"^","\\hat");P(V,ee,Cr,"⃗","\\vec");P(V,ee,Cr,"˙","\\dot");P(V,ee,Cr,"˚","\\mathring");P(V,ee,Bt,"","\\@imath");P(V,ee,Bt,"","\\@jmath");P(V,ee,ve,"ı","ı");P(V,ee,ve,"ȷ","ȷ");P(He,ee,ve,"ı","\\i",!0);P(He,ee,ve,"ȷ","\\j",!0);P(He,ee,ve,"ß","\\ss",!0);P(He,ee,ve,"æ","\\ae",!0);P(He,ee,ve,"œ","\\oe",!0);P(He,ee,ve,"ø","\\o",!0);P(He,ee,ve,"Æ","\\AE",!0);P(He,ee,ve,"Œ","\\OE",!0);P(He,ee,ve,"Ø","\\O",!0);P(He,ee,Cr,"ˊ","\\'");P(He,ee,Cr,"ˋ","\\`");P(He,ee,Cr,"ˆ","\\^");P(He,ee,Cr,"˜","\\~");P(He,ee,Cr,"ˉ","\\=");P(He,ee,Cr,"˘","\\u");P(He,ee,Cr,"˙","\\.");P(He,ee,Cr,"¸","\\c");P(He,ee,Cr,"˚","\\r");P(He,ee,Cr,"ˇ","\\v");P(He,ee,Cr,"¨",'\\"');P(He,ee,Cr,"˝","\\H");P(He,ee,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,ee,ve,"–","--",!0);P(He,ee,ve,"–","\\textendash");P(He,ee,ve,"—","---",!0);P(He,ee,ve,"—","\\textemdash");P(He,ee,ve,"‘","`",!0);P(He,ee,ve,"‘","\\textquoteleft");P(He,ee,ve,"’","'",!0);P(He,ee,ve,"’","\\textquoteright");P(He,ee,ve,"“","``",!0);P(He,ee,ve,"“","\\textquotedblleft");P(He,ee,ve,"”","''",!0);P(He,ee,ve,"”","\\textquotedblright");P(V,ee,ve,"°","\\degree",!0);P(He,ee,ve,"°","\\degree");P(He,ee,ve,"°","\\textdegree",!0);P(V,ee,ve,"£","\\pounds");P(V,ee,ve,"£","\\mathsterling",!0);P(He,ee,ve,"£","\\pounds");P(He,ee,ve,"£","\\textsterling",!0);P(V,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var ow=0;ow{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new Pb(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},P3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},Cv={},Ev={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),F3(i,(x,S)=>{var v,b,w=q3(S),y=q3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},F3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof Pb||n instanceof m_&&n.hasClass("enclosing")?n:null},H3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return H3(s[s.length-1],"right");if(t==="left")return H3(s[0],"left")}}return n},q3=function(n,t){if(!n)return null;t&&(n=H3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(Cv[n.type]){var s=Cv[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function U3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=P3[t].fontName;return JS(i,o,r)?P3[t].variant:null};function dw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||dw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Ev[n.type])return Ev[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=U3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=U3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=U3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},qb=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),Ub=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Gb(e){var n=Wb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Wb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=Ub(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=Hb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?qb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Nv(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=Ub(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=qb(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=Ub(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=qb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Vb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Vb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Vb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Vb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var G3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(G3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=G3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===G3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},fw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},hw=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},W3=.008,t1={type:"kern",size:-1*W3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var H=M-S-y,q=Math.round(M*1e3),Y=_6t(d,Math.round(H*1e3)),G=new mu(d,Y),X=et(p/1e3),te=et(q/1e3),I=new ql([G],{width:X,height:te,viewBox:"0 0 "+p+" "+q}),L=gu([],[I],s);L.height=q/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(fw(_,m,i)),$.push(t1),l===null){var F=M-S-y+2*W3;$.push(hw(u,F,s))}else{var W=(M-S-y-C)/2+2*W3;$.push(hw(u,W,s)),$.push(t1),$.push(fw(l,m,i)),$.push(t1),$.push(hw(u,W,s))}$.push(t1),$.push(fw(o,m,i))}var U=s.havingBaseStyle(Yt.TEXT),Z=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[Z],U),Yt.TEXT,s,a)},_w=80,pw=.08,mw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+_w,n<1?i=1:n<1.4&&(i=.7),l=(1+a+pw)/i,u=(1+a)/i,o=mw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+_w)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+pw)/i,o=mw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+pw,u=n+a,_=Math.floor(1e3*n+a)+_w,o=mw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},V3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},gw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return V3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Kb(e,n){var t=Wb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Kb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Kb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Kb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Kb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Qb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Yb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ue;le=(oe=(ue=U)==null?void 0:ue.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),q.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Wb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Gb(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Wb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Gb(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Xb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Xb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Xb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Nv(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Vb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Nv(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=Nv(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=Ub(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=qb(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var vw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var K3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in K3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=q3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return Hb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return Hb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var bw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(yw.hasOwnProperty(e.text)){var t=yw[e.text].className||"";if(e.mode==="text"){var r=Hb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(bw.hasOwnProperty(e.text))return Ge(["mspace",bw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(yw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(bw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r ]`,CSt="\\\\[a-zA-Z@]+",ESt="\\\\[^\uD800-\uDFFF]",NSt="("+CSt+")"+aP+"*",zSt=`\\\\( |[ \r ]+ ?)[ \r ]*`,Q3="[̀-ͯ]",jSt=new RegExp(Q3+"+$"),TSt="("+aP+"+)|"+(zSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Q3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Q3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+NSt)+("|"+ESt+")");class HT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(TSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Yi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Yi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class ASt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var RSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var qT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=qT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=qT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},MSt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in UT?n=UT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&MSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new ASt(RSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new HT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new HT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var GT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),yw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Xb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new DSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Xb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Lb(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class ASt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var RSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var qT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=qT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=qT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},MSt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in UT?n=UT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&MSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new ASt(RSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new HT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new HT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var GT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),xw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Zb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new DSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Zb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Ob(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` `:" ")+i.indentLines(i.containerFlow(r,o.current()),n?pP:mkt))),u(),l}}function mkt(e,n,t){return n===0?e:pP(e,n,t)}function pP(e,n,t){return(t?"":" ")+e}const gkt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mP.peek=wkt;function vkt(){return{canContainEols:["delete"],enter:{strikethrough:ykt},exit:{strikethrough:xkt}}}function bkt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gkt}],handlers:{delete:mP}}}function ykt(e){this.enter({type:"delete",children:[]},e)}function xkt(e){this.exit(e)}function mP(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function wkt(){return"~"}function Skt(e){return e.length}function kkt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||Skt,i=[],a=[],o=[],l=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++bl[b])&&(l[b]=y)}S.push(w)}a[_]=S,o[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dl[d]&&(l[d]=w),m[d]=w),p[d]=y}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),Nkt);return s(),a}function Nkt(e,n,t){return">"+(t?"":" ")+e}function zkt(e,n){return YT(e,n.inConstruct,!0)&&!YT(e,n.notInConstruct,!1)}function YT(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":` -`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function Dkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function bp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Nv(e,n,t){const r=Kh(e),s=Kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vP.peek=Lkt;function vP(e,n,t,r){const s=Dkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=Nv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Nv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Lkt(e,n,t){return t.options.emphasis||"*"}function Okt(e,n){let t=!1;return $S(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,w3}),!!((!e.depth||e.depth<3)&&GS(e)&&(n.options.setext||t))}function Ikt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Okt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` +`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function Dkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function bp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zv(e,n,t){const r=Kh(e),s=Kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vP.peek=Lkt;function vP(e,n,t,r){const s=Dkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=zv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Lkt(e,n,t){return t.options.emphasis||"*"}function Okt(e,n){let t=!1;return $S(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,w3}),!!((!e.depth||e.depth<3)&&GS(e)&&(n.options.setext||t))}function Ikt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Okt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` `,after:` `});return d(),_(),p+` `+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` `))+1))}const a="#".repeat(s),o=t.enter("headingAtx"),l=t.enter("phrasing");i.move(a+" ");let u=t.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=bp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}bP.peek=Bkt;function bP(e){return e.value||""}function Bkt(){return"<"}yP.peek=$kt;function yP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function $kt(){return"!"}xP.peek=Pkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pkt(){return"!"}wP.peek=Fkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Hkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Hkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=qkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function qkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ukt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Wkt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Gkt(t):hk(t);const o=e.ordered?a==="."?")":".":Ukt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Qkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Ykt=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xkt(e,n,t,r){return(e.children.some(function(a){return Ykt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zkt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=Jkt;function NP(e,n,t,r){const s=Zkt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=Nv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Nv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Jkt(e,n,t){return t.options.strong||"*"}function e7t(e,n,t,r){return t.safe(e.value,r)}function t7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(t7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Ekt,break:XT,code:Akt,definition:Mkt,emphasis:vP,hardBreak:XT,heading:Ikt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Wkt,listItem:Kkt,paragraph:Qkt,root:Xkt,strong:NP,text:e7t,thematicBreak:n7t};function r7t(){return{enter:{table:s7t,tableData:ZT,tableHeader:ZT,tableRow:a7t},exit:{codeText:o7t,table:i7t,tableData:kw,tableHeader:kw,tableRow:kw}}}function s7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function i7t(e){this.exit(e),this.data.inTable=void 0}function a7t(e){this.enter({type:"tableRow",children:[]},e)}function kw(e){this.exit(e)}function ZT(e){this.enter({type:"tableCell",children:[]},e)}function o7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function l7t(e,n){return n==="|"?n:e}function c7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=bp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}bP.peek=Bkt;function bP(e){return e.value||""}function Bkt(){return"<"}yP.peek=$kt;function yP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function $kt(){return"!"}xP.peek=Pkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pkt(){return"!"}wP.peek=Fkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Hkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Hkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=qkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function qkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ukt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Wkt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Gkt(t):hk(t);const o=e.ordered?a==="."?")":".":Ukt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Qkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Ykt=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xkt(e,n,t,r){return(e.children.some(function(a){return Ykt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zkt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=Jkt;function NP(e,n,t,r){const s=Zkt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=zv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Jkt(e,n,t){return t.options.strong||"*"}function e7t(e,n,t,r){return t.safe(e.value,r)}function t7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(t7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Ekt,break:XT,code:Akt,definition:Mkt,emphasis:vP,hardBreak:XT,heading:Ikt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Wkt,listItem:Kkt,paragraph:Qkt,root:Xkt,strong:NP,text:e7t,thematicBreak:n7t};function r7t(){return{enter:{table:s7t,tableData:ZT,tableHeader:ZT,tableRow:a7t},exit:{codeText:o7t,table:i7t,tableData:Cw,tableHeader:Cw,tableRow:Cw}}}function s7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function i7t(e){this.exit(e),this.data.inTable=void 0}function a7t(e){this.enter({type:"tableRow",children:[]},e)}function Cw(e){this.exit(e)}function ZT(e){this.enter({type:"tableCell",children:[]},e)}function o7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function l7t(e,n){return n==="|"?n:e}function c7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:o}};function a(m,x,S,v){return u(_(m,S,v),m.align)}function o(m,x,S,v){const b=d(m,S,v),w=u([b]);return w.slice(0,w.indexOf(` -`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const U=r.events[B][1].type;if(U==="lineEnding"||U==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,q=$==="tableHead"||$==="tableRow"?N:l;return q===N&&r.parser.lazy[r.now().line]?t(O):q(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,H=$==="tableHead"||$==="tableRow"?N:l;return H===N&&r.parser.lazy[r.now().line]?t(O):H(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,l){const u=i.value||"",_=o.createTracker(l),d="$".repeat(Math.max(gP(u,"$")+1,2)),p=o.enter("mathFlow");let m=_.move(d);if(i.meta){const x=o.enter("mathFlowMeta");m+=_.move(o.safe(i.meta,{after:` `,before:m,encode:["$"],..._.current()})),x()}return m+=_.move(` `),u&&(m+=_.move(u+` @@ -990,12 +990,12 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, `,n+r);if(o===-1)return e.length;for(o+=1;o=a.listIndent&&d.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return l===-1?e.length:l+1;if(l===-1)return e.length;o=l+1}return e.length}function lCt(e,n,t){const r=Zh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function uCt(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function fCt(e,{predictMath:n=!1}={}){const t=uCt(e),r=new Set,s=new Set;for(let u=0;u`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Wr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:s6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(ub,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Cw(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Cw(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Wr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Wr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(yv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const l=i?g3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Wr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const zv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` -`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${zv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${zv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ab(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Zb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Ew(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),rb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Ew(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Ew(o).variant,children:Ew(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Zb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():eb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(q=>({...q,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(q=>({...q,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,q]=tF(B);function U(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Zb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):U()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:NN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),q(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Zb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:eb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},Jb={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],Nw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=Nw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,q){const U=cA.includes($);if(!(p||Nw.includes($)&&!q.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:U&&q.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const q=e.targets.find(Y=>Y.id===$);if(!q)return;o(q.id);const U=q.id===s?i:"";u(U),d(g0(q.id,U)),Nw.includes(q.id)||M(q.id,U)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const q=e.targets.find(U=>U.id===$.id);return q?f.jsx(u_,{kind:Jb[q.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":EN(),title:EN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:Jb[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(N1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:Jb[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:Jb[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():eb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:eb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Zb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:k4({name:Ne(e)}),"aria-label":k4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},zw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":jN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=zw[n.channel])==null?void 0:d.call(zw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x,r.githubDefaultPromptSeen]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:zN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":zN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:R4()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":R4(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():A4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:z4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var W;const t=mn({mutationFn:H=>GL(...H)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=H=>{Vr(r.queryKey,ee=>(typeof H=="function"?H(ee??null):H)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((W=s.error)==null?void 0:W.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),q=R.useRef(null);R.useEffect(()=>{!e||q.current===e.id||(q.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const U=async()=>{await s.refetch({cancelRefetch:!1})},Y=H=>{const ee=H instanceof Error?H.message:String(H);return ee.toLowerCase().includes("archived")?tPe():ee.includes("(fetch first)")||ee.includes("non-fast-forward")?iPe():ee.includes("403")||ee.toLowerCase().includes("permission denied")?cPe():ee},G=()=>{e&&(l(!0),_(null),yft(e.id).then(H=>{a(H.git),n(H.project),nt.fetchQuery(v6()).then(ee=>{!ee.githubForNewProjects&&!ee.githubDefaultPromptSeen&&(y(ee.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(H=>_(Y(H))).finally(()=>l(!1)))},X=H=>{S(!0),b(null),t.mutateAsync([H,w??H,!0]).then(()=>m(!1)).catch(ee=>b(ee instanceof Error?ee.message:String(ee))).finally(()=>S(!1))},te=H=>H.split(",").map(ee=>ee.trim()).filter(ee=>ee.length>0),I=e?e.githubTopics.join(", "):"",L=!!(e&&C!==null&&N!==null&&(C!==e.githubAutoTopicsEnabled||N!==I)),F=()=>{!e||C===null||N===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:te(N)}).then(H=>{E(H.githubAutoTopicsEnabled),T(H.githubTopics.join(", ")),n(H)}).catch(H=>B(H instanceof Error?H.message:String(H))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(H=>`${H.name}: ${H.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(H=>_(String(H))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>U()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:RN()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":R4(),disabled:C===null||j,onClick:()=>E(H=>!(H??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:N??"",onChange:H=>T(H.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":RN()}),f.jsx(Le,{variant:"primary",disabled:!L||j,onClick:F,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[AN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(H=>{a(H.git),n(H.project)}).catch(H=>_(H instanceof Error?H.message:String(H))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:H=>H.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},jw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=jw[e])==null?void 0:n.call(jw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(sb,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:TN(),"aria-label":TN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function jv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${jv(e.plugin)}: `:""}${jv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Tw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||n5(r).localeCompare(n5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:n5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function r5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(jv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),jv(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` -`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const s5=6.5,pA=2*Math.PI*s5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Tv="!";function mA(e){return e.startsWith(Tv)?e.slice(Tv.length).trim():null}function T8t(e){return e.startsWith(Tv)?e.slice(Tv.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` +`,u+3),p=d===-1?e.length:d;/^[ \t]*$/.test(e.slice(_,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Wr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:s6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(db,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Ew(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Ew(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Wr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Wr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(xv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` +`)))return f.jsx("code",{className:s,...r,children:t});const l=i?g3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Wr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const jv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` +`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${jv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${jv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ob(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Jb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Nw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),sb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Nw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Nw(o).variant,children:Nw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Jb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():tb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Jb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Jb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:tb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ey={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],zw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=zw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||zw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),zw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ey[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ey[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ey[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ey[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():tb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:tb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Jb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:C4({name:Ne(e)}),"aria-label":C4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},jw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=jw[n.channel])==null?void 0:d.call(jw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x,r.githubDefaultPromptSeen]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:j4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Vr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(v6()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(()=>m(!1)).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Tw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Tw[e])==null?void 0:n.call(Tw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ib,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Tv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${Tv(e.plugin)}: `:""}${Tv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Aw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||n5(r).localeCompare(n5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:n5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function r5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(Tv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),Tv(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` +`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const s5=6.5,pA=2*Math.PI*s5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Av="!";function mA(e){return e.startsWith(Av)?e.slice(Av.length).trim():null}function T8t(e){return e.startsWith(Av)?e.slice(Av.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` ${t} ${e.replace(/^\n|\n$/g,"")} @@ -1010,7 +1010,7 @@ ${e} `:`\\(${e}\\)`}function D8t(e,n){const t=n.trim().split(` `),r=" ".repeat(e.length+1);return[`${e} ${t[0]??""}`,...t.slice(1).map(s=>s?`${r}${s}`:"")].join(` `)}function L8t(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,l)=>a[l]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` -`)}function O8t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function I8t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function B8t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const uF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",gk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,dF=1024,fF=2e4,Aw=8,s1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function gA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Rw(e,n){return gA(e).compareBoundaryPoints(Range.START_TO_START,gA(n))<0}function vA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const $8t=new Set(["A","B","CODE","EM","I","STRONG"]);function P8t(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if($8t.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function F8t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function H8t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Rw(s,u)&&t.append(vA(s,u)),t.append(o.cloneNode(!0)),s=_,!Rw(s,r))break}return i.length===0?t.append(e.cloneContents()):Rw(s,r)&&t.append(vA(s,r)),P8t(e,t),F8t(t),t}function q8t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>xp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` +`)}function O8t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function I8t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function B8t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const uF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",gk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,dF=1024,fF=2e4,Rw=8,s1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function gA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Mw(e,n){return gA(e).compareBoundaryPoints(Range.START_TO_START,gA(n))<0}function vA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const $8t=new Set(["A","B","CODE","EM","I","STRONG"]);function P8t(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if($8t.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function F8t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function H8t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Mw(s,u)&&t.append(vA(s,u)),t.append(o.cloneNode(!0)),s=_,!Mw(s,r))break}return i.length===0?t.append(e.cloneContents()):Mw(s,r)&&t.append(vA(s,r)),P8t(e,t),F8t(t),t}function q8t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>xp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` ${L8t(n,!!e.querySelector("tr:first-child th"))} @@ -1046,27 +1046,27 @@ ${n.trim()} `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim();if(!d)return null;const p=H8t(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(j=>j.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),E=34,N=74,T=y>=E+Aw?y-E-Aw:C+Aw;return{text:U8t(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function V8t(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?W8t(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function K8t(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(s1);return}const t=new Highlight(...n);return CSS.highlights.set(s1,t),()=>{CSS.highlights.get(s1)===t&&CSS.highlights.delete(s1)}},[e])}function Q8t({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?G8t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Fo,{text:t??e.text})})}function Y8t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Ide()}),f.jsx(Q8t,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ude(),"aria-label":eY({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Ur,{size:13})})]},t.id))}function vk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=so(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(XO,{size:l?13:14,className:"text-muted"}),e.length===1?Yae():nie({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:bE(),"aria-label":bE(),onClick:t,children:f.jsx(Ur,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Mde(),children:f.jsx(Y8t,{annotations:e,onRemove:r?m:void 0})})]})}function X8t(e){return f.jsx(vk,{...e,variant:"composer"})}const Z8t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),yA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),J8t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),e9t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),a5="prompt-actions flex flex-wrap gap-2",xA=[],t9t=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Mw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function n9t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Dw(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Lw(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function r9t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function _h(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=dF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function ey(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!d)return null;const p=H8t(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(j=>j.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),E=34,N=74,T=y>=E+Rw?y-E-Rw:C+Rw;return{text:U8t(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function V8t(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?W8t(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function K8t(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(s1);return}const t=new Highlight(...n);return CSS.highlights.set(s1,t),()=>{CSS.highlights.get(s1)===t&&CSS.highlights.delete(s1)}},[e])}function Q8t({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?G8t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Fo,{text:t??e.text})})}function Y8t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Ide()}),f.jsx(Q8t,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ude(),"aria-label":eY({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Ur,{size:13})})]},t.id))}function vk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=so(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(XO,{size:l?13:14,className:"text-muted"}),e.length===1?Yae():nie({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:bE(),"aria-label":bE(),onClick:t,children:f.jsx(Ur,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Mde(),children:f.jsx(Y8t,{annotations:e,onRemove:r?m:void 0})})]})}function X8t(e){return f.jsx(vk,{...e,variant:"composer"})}const Z8t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),yA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),J8t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),e9t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),a5="prompt-actions flex flex-wrap gap-2",xA=[],t9t=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Dw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function n9t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Lw(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Ow(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function r9t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function _h(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=dF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function ty(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` `).trim()}function s9t(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function i9t(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Mxt(r),_F(r)}function _F(e){return o9t(e).replace(/[\t\r ]+/g," ").trim()}function a9t(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&mF(s)?{ref:r,path:s}:null}function u9t(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function wA(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function d9t(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const l=wA(s,o);if(!l)return null;s=l}return s?wA(s,e):e}const ko="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",f9t=new RegExp(`\\bchat_(${ko})\\b`,"gi"),Nd=`(?:${ko}|[0-9a-f]{8})`;function ph(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,d=null,p=!1;for(let m=u;m{let _=!1;for(let d=u;dOxt(t.raw,n))}function ya(e,n){return ty(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function o5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ty(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:o5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ty(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Lw(i,"targetIds")),_=_h(Lw(i,"runTargetIds")),d=_h(Lw(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Dw(i,"search_query","q"),N=Dw(i,"image_query","q"),T=Dw(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),q=ty(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),U=q?Iee():kZ(),Y=q?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:U,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:U,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Mw(X.path);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const te=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=te>=0?O[te]:null,L=I?l9t(I):null,F=L?d9t(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const re=Mw(F);return{kind:re?"skill":"read",label:re?v2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re??void 0}}const H=O.find(re=>(re==null?void 0:re.name)==="git"),ee=H==null?void 0:H.args[0];if(ee==="grep"){const re=H==null?void 0:H.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?y2({pattern:Ne(re)}):b2(),searchPattern:re}}if(ee==="status")return{kind:"command",label:mle()};if(ee==="diff")return{kind:"command",label:Ede()};if(ee==="log")return{kind:"command",label:Kue()};const de=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return de("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||de("typecheck")?{kind:"command",label:Ole()}:de("lint")?{kind:"command",label:ile()}:de("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Mw(p):null;return N?{kind:"skill",label:v2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?y2({pattern:Ne(E)}):b2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Av({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Ow({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Wr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function l5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Wr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Wr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Wr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Ow,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ey(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ey((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:y3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(l5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Av,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Av,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:q,activity:U})=>f.jsx(kA,{part:$,repeatCount:q,activity:U,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Ur,iconClass:"text-accent-red"}:{label:Cue(),icon:db,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Wr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:a5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:a5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":s6(),disabled:!e,onClick:p,children:f.jsx(ub,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const te=n.parts.filter(ee=>ee.type==="text").map(ee=>ee.text??"").join(` -`),I=ee=>!!(v!=null&&v.some(de=>de.name===ee)),L=n.parts.filter(ee=>ee.type==="image"&&ee.text).map(N9t),F=L.filter(ee=>!ee.isPdf),W=L.filter(ee=>ee.isPdf),H=n.parts.filter(ee=>ee.type==="annotation"&&ee.text).map(ee=>({id:ee.id,text:ee.text??""}));if(O!==null){const ee=()=>{const de=O.trim();!de||N||(B(null),j(n.id,de))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:de=>B(de.target.value),onKeyDown:de=>{de.key==="Escape"?(de.preventDefault(),B(null)):de.key==="Enter"&&!de.shiftKey&&!de.nativeEvent.isComposing&&(de.preventDefault(),ee())}}),f.jsxs("div",{className:`${a5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:ee,disabled:N||!O.trim(),children:E4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[H.length>0&&f.jsx(vk,{annotations:H,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((ee,de)=>f.jsx("a",{href:ee.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:ee.src,alt:vie()})},de))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((ee,de)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:ee.src,target:"_blank",rel:"noreferrer",children:[f.jsx(db,{size:15}),f.jsx("span",{children:ee.name})]},de))})]}),w!==void 0&&f.jsx(z9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const q=n.parts.find(te=>te.type==="tool"&&y3(te)),U=n.parts.find(om)??q,Y=n.parts.filter(te=>te!==U&&!(q&&y3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),U&&f.jsx(SF,{part:U,usageLimited:!!q,busy:m,recovering:x===((X=(G=U.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:L1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:L1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:L1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function L1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Rv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Rv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ey(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=L1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?n6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ey(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Av,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Wr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(H=>H.role==="user"&&!H.id.startsWith(Cd));return kxt(a,n,W,H=>H.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),q=R.useCallback(W=>j[W].id,[j]),U=R.useCallback(W=>{if(B)return j.map((ee,de)=>de);const H=new Set(yB(W));return j.forEach((ee,de)=>{O.current.has(ee.id)&&H.add(de)}),[...H].sort((ee,de)=>ee-de)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:q,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:U});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var de;const H=window.getSelection();if(!H||H.isCollapsed||!H.rangeCount)return;const ee=H.getRangeAt(0);for(const re of((de=t.current)==null?void 0:de.querySelectorAll("[data-message-id]"))??[])ee.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),te=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ce,pe;const H=j[W.index],ee=H.parts.find(om),de=(Q=(ne=ee==null?void 0:ee.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=ee?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":H.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(H.id),onFocusCapture:()=>O.current.add(H.id),children:f.jsx(j9t,{message:H,forkCount:(le=M.get(H.id))==null?void 0:le.count,forkIndex:(oe=M.get(H.id))==null?void 0:oe.index,forkPrevId:(ce=M.get(H.id))==null?void 0:ce.prevId,forkNextId:(pe=M.get(H.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===H.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:de===C?C:null,onRecover:E,skills:N,predictTextTail:_&&H===G&&H.role==="assistant"})},H.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,fb],Iw=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ab(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:q=t9t}=ct($),U=R.useCallback(ie=>{Vr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[W,H]=R.useState(new Set),[ee,de]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ce=R.useRef({projectId:e,activeId:I,mainView:i});(ce.current.projectId!==e||ce.current.activeId!==I||ce.current.mainView!==i)&&(ce.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=r5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Tw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==r5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=q.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Tw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:sv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=nb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{U(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Pr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));U(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Pr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(w2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=F.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(F.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{F.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();H(e===N2?new Set([p6,m6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>av(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>av(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&H(be=>Ext(be,ie.ids,we.busySessions,q,i==="chat"?I:null))},[e,we.busySessions,q,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Fr=I?we.queuedBySession[I]??[]:[],oa=Fr.some(ie=>ie.dispatchState==="retrying"),Jl=Fr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Fr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Fr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Fr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===N2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Pr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ce.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(w2())}catch{Te(IE()),ho()}return}const Z=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!Z){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(Z,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&ee==="archived"&&de("active");const Tn=Z?{model:Z.model,serviceTier:Z.serviceTier,permissionMode:Z.permissionMode,planMode:zn,reasoningLevel:Z.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ce.current,Oe=F.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return F.current===Oe&&(U(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Oe&&ce.current===Ae&&(L.current(Ue.id,{replace:!0}),ce.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ce.current;let Oe=I;const Ue=()=>{const Ln=ce.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(w2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&ee==="archived"&&de("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){Jv(ie),ce.current.projectId===e&&ce.current.activeId===ie&&ce.current.mainView==="chat"&&L.current(null,{replace:!0}),H(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{U(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=q.filter(ie=>P9t(ee,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{de("active"),w(null)},[w]),Ru=R.useCallback(ie=>{de("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===ee))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:ee,onChange:de})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===N2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:ee==="archived"?Hae():q.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(dv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:o6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),te(!0)}}),X&&f.jsx(ZP,{onClose:()=>{te(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Iw[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Iw[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=Iw[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Fr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Fr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} +`){a();continue}t+=_,r+=_}return a(),n}function ny(e,n){return ph(e).filter(t=>Oxt(t.raw,n))}function ya(e,n){return ny(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function o5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ny(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:o5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ny(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Ow(i,"targetIds")),_=_h(Ow(i,"runTargetIds")),d=_h(Ow(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Lw(i,"search_query","q"),N=Lw(i,"image_query","q"),T=Lw(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),H=ny(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),q=H?Iee():kZ(),Y=H?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Dw(X.path);return{kind:re?"skill":"read",label:re?b2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const te=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=te>=0?O[te]:null,L=I?l9t(I):null,F=L?d9t(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const re=Dw(F);return{kind:re?"skill":"read",label:re?b2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?x2({pattern:Ne(re)}):y2(),searchPattern:re??void 0}}const U=O.find(re=>(re==null?void 0:re.name)==="git"),Z=U==null?void 0:U.args[0];if(Z==="grep"){const re=U==null?void 0:U.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?x2({pattern:Ne(re)}):y2(),searchPattern:re}}if(Z==="status")return{kind:"command",label:mle()};if(Z==="diff")return{kind:"command",label:Ede()};if(Z==="log")return{kind:"command",label:Kue()};const ce=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return ce("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||ce("typecheck")?{kind:"command",label:Ole()}:ce("lint")?{kind:"command",label:ile()}:ce("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Dw(p):null;return N?{kind:"skill",label:b2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?x2({pattern:Ne(E)}):y2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Rv({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Iw({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Wr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function l5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Wr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Wr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Wr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ty(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ty((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:y3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Rv,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(l5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Rv,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Rv,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:H,activity:q})=>f.jsx(kA,{part:$,repeatCount:H,activity:q,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Ur,iconClass:"text-accent-red"}:{label:Cue(),icon:fb,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Wr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:a5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:a5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":s6(),disabled:!e,onClick:p,children:f.jsx(db,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const te=n.parts.filter(Z=>Z.type==="text").map(Z=>Z.text??"").join(` +`),I=Z=>!!(v!=null&&v.some(ce=>ce.name===Z)),L=n.parts.filter(Z=>Z.type==="image"&&Z.text).map(N9t),F=L.filter(Z=>!Z.isPdf),W=L.filter(Z=>Z.isPdf),U=n.parts.filter(Z=>Z.type==="annotation"&&Z.text).map(Z=>({id:Z.id,text:Z.text??""}));if(O!==null){const Z=()=>{const ce=O.trim();!ce||N||(B(null),j(n.id,ce))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:ce=>B(ce.target.value),onKeyDown:ce=>{ce.key==="Escape"?(ce.preventDefault(),B(null)):ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),Z())}}),f.jsxs("div",{className:`${a5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:Z,disabled:N||!O.trim(),children:N4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[U.length>0&&f.jsx(vk,{annotations:U,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((Z,ce)=>f.jsx("a",{href:Z.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:Z.src,alt:vie()})},ce))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((Z,ce)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:Z.src,target:"_blank",rel:"noreferrer",children:[f.jsx(fb,{size:15}),f.jsx("span",{children:Z.name})]},ce))})]}),w!==void 0&&f.jsx(z9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const H=n.parts.find(te=>te.type==="tool"&&y3(te)),q=n.parts.find(om)??H,Y=n.parts.filter(te=>te!==q&&!(H&&y3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),q&&f.jsx(SF,{part:q,usageLimited:!!H,busy:m,recovering:x===((X=(G=q.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:O1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:O1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:O1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function O1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Mv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Mv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ty(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=O1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?n6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ty(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Rv,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Wr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(U=>U.role==="user"&&!U.id.startsWith(Cd));return kxt(a,n,W,U=>U.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),H=R.useCallback(W=>j[W].id,[j]),q=R.useCallback(W=>{if(B)return j.map((Z,ce)=>ce);const U=new Set(yB(W));return j.forEach((Z,ce)=>{O.current.has(Z.id)&&U.add(ce)}),[...U].sort((Z,ce)=>Z-ce)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:H,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:q});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var ce;const U=window.getSelection();if(!U||U.isCollapsed||!U.rangeCount)return;const Z=U.getRangeAt(0);for(const re of((ce=t.current)==null?void 0:ce.querySelectorAll("[data-message-id]"))??[])Z.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),te=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ue,pe;const U=j[W.index],Z=U.parts.find(om),ce=(Q=(ne=Z==null?void 0:Z.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=Z?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":U.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(U.id),onFocusCapture:()=>O.current.add(U.id),children:f.jsx(j9t,{message:U,forkCount:(le=M.get(U.id))==null?void 0:le.count,forkIndex:(oe=M.get(U.id))==null?void 0:oe.index,forkPrevId:(ue=M.get(U.id))==null?void 0:ue.prevId,forkNextId:(pe=M.get(U.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===U.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:ce===C?C:null,onRecover:E,skills:N,predictTextTail:_&&U===G&&U.role==="assistant"})},U.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,hb],Bw=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ob(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:H=t9t}=ct($),q=R.useCallback(ie=>{Vr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[W,U]=R.useState(new Set),[Z,ce]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ue=R.useRef({projectId:e,activeId:I,mainView:i});(ue.current.projectId!==e||ue.current.activeId!==I||ue.current.mainView!==i)&&(ue.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=r5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Aw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==r5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=H.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Aw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:iv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=rb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Pr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Pr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(S2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=F.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(F.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{F.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();U(e===z2?new Set([p6,m6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>ov(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>ov(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&U(be=>Ext(be,ie.ids,we.busySessions,H,i==="chat"?I:null))},[e,we.busySessions,H,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Fr=I?we.queuedBySession[I]??[]:[],oa=Fr.some(ie=>ie.dispatchState==="retrying"),Jl=Fr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Fr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Fr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Fr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===z2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Pr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ue.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(S2())}catch{Te(IE()),ho()}return}const J=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!J){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(J,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&Z==="archived"&&ce("active");const Tn=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ue.current,Oe=F.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return F.current===Oe&&(q(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Oe&&ue.current===Ae&&(L.current(Ue.id,{replace:!0}),ue.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ue.current;let Oe=I;const Ue=()=>{const Ln=ue.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(S2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&Z==="archived"&&ce("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){eb(ie),ue.current.projectId===e&&ue.current.activeId===ie&&ue.current.mainView==="chat"&&L.current(null,{replace:!0}),U(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=H.filter(ie=>P9t(Z,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{ce("active"),w(null)},[w]),Ru=R.useCallback(ie=>{ce("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===Z))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:Z,onChange:ce})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===z2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:Z==="archived"?Hae():H.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(fv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:o6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),te(!0)}}),X&&f.jsx(ZP,{onClose:()=>{te(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Bw[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Bw[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=Bw[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Fr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Fr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} -${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Ur,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(db,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Tw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:x2(),"aria-label":x2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:x2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Pr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Ur,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():E4(),"aria-label":xs?AE():E4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Rv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(sb,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(_b,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const c5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:c5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Wr(S=>i(m,S));return f.jsxs("button",{type:"button",className:c5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({...hv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?tb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({...hv(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(hv(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const H=new Set(r);H.has(W)?H.delete(W):H.add(W),i(H)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):c6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,q=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),U=O?O.branch:n.baselineBranch,Y=(W,H)=>O?a(W,e,void 0,H):a(W,void 0,n.baselineBranch,H),G=(S==null?void 0:S.root)==="worktree",X=async(W,H)=>{try{await adt(l,W,H,{sessionId:e}),N()}catch(ee){Qn(ee instanceof Error?ee.message:String(ee),"error")}},te=W=>{const H=(S==null?void 0:S.path)??n.repoPath;jF(H,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:q,branchTitle:q,githubHref:n.githubEnabled&&U?tb(n.githubOwner,n.githubRepo,U):void 0,githubTitle:U?pD({branch:Ne(U)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,H)=>{y(AF(W,H))},onRename:(W,H)=>{E(null),X(W,{action:"rename",newName:H})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` +${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Ur,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(fb,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Aw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:w2(),"aria-label":w2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:w2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Pr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Ur,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():N4(),"aria-label":xs?AE():N4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Mv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(ib,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(pb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const c5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:c5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Wr(S=>i(m,S));return f.jsxs("button",{type:"button",className:c5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({..._v(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?nb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({..._v(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(_v(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const U=new Set(r);U.has(W)?U.delete(W):U.add(W),i(U)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):c6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,H=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),q=O?O.branch:n.baselineBranch,Y=(W,U)=>O?a(W,e,void 0,U):a(W,void 0,n.baselineBranch,U),G=(S==null?void 0:S.root)==="worktree",X=async(W,U)=>{try{await adt(l,W,U,{sessionId:e}),N()}catch(Z){Qn(Z instanceof Error?Z.message:String(Z),"error")}},te=W=>{const U=(S==null?void 0:S.path)??n.repoPath;jF(U,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&q?nb(n.githubOwner,n.githubRepo,q):void 0,githubTitle:q?pD({branch:Ne(q)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,U)=>{y(AF(W,U))},onRename:(W,U)=>{E(null),X(W,{action:"rename",newName:U})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` `),d=FP(_,AS(n));return _.endsWith(` -`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${zv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${zv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function TA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[FD()," ",Ne(n)]})]})}function u5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(TA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(TA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[FD()," ",t]})})]})}const fEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...fEt(e),enabled:n,subscribed:n}).data??null}function hEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function _Et(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function pEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(u5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?nv():rh(),"data-tip-align":"end","aria-label":d?nv():rh(),onClick:()=>p(b=>!b),children:f.jsx(e3,{size:13})}),f.jsx(sb,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(e6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(e6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const q=Math.round($.clientX-((T==null?void 0:T.left)??0)),U=Math.min(Math.max(q,$F),PF);u(U);try{localStorage.setItem(IF,String(U))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(e6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Ur,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:tb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:ev({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(_b,{size:12})]})}const Bw=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Wr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Wr(i),children:[f.jsx(hb,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Bw,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Wr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let d5=!1;function OA(e){d5=!0;try{return window.confirm(e)}finally{d5=!1}}const f5=e=>e.replace(/\r\n/g,` +`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${jv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${jv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function TA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[FD()," ",Ne(n)]})]})}function u5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(TA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(TA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[FD()," ",t]})})]})}const fEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...fEt(e),enabled:n,subscribed:n}).data??null}function hEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function _Et(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function pEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(u5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?rv():rh(),"data-tip-align":"end","aria-label":d?rv():rh(),onClick:()=>p(b=>!b),children:f.jsx(e3,{size:13})}),f.jsx(ib,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(e6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(e6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const H=Math.round($.clientX-((T==null?void 0:T.left)??0)),q=Math.min(Math.max(H,$F),PF);u(q);try{localStorage.setItem(IF,String(q))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(e6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Ur,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:nb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:tv({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(pb,{size:12})]})}const $w=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Wr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Wr(i),children:[f.jsx(_b,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Wr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let d5=!1;function OA(e){d5=!0;try{return window.confirm(e)}finally{d5=!1}}const f5=e=>e.replace(/\r\n/g,` `),IA=(e,n,t)=>{const r=f5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r `),conflict:null}},Cl=e=>e.draft!==e.baseline,$Et=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),PEt=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),q=R.useRef(o);q.current=o;const U=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(U.current)return;Y.current=n,U.current=!0,m(!0);const L=q.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(F=>{var H,ee;const W=F.pdfPath;if(F.ok&&W){S(de=>({path:W,version:((de==null?void 0:de.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((H=F.log)==null?void 0:H.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((ee=F.log)==null?void 0:ee.trim())||S3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{U.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ce=>ce&&{...ce,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const q=R.useRef(!1),U=R.useRef(l);U.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||q.current||Y.current?!1:(q.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ce=>{G.current=!1,N(ce),ce.pulled.includes(n)&&(Y.current?O(!0):U.current(ce.pulled))}).catch(ce=>{G.current=!0,N(null),j(ce instanceof Error?ce.message:String(ce))}).finally(()=>{q.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;te.current!==oe&&X()&&(te.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),H=R.useRef(Promise.resolve()),ee=R.useRef(!1);ee.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const de=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let oe=!1;const ce=()=>{const Se=de.current;de.current=!1,!(!Se&&ee.current)&&(H.current=H.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ce();const pe=setInterval(ce,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),H.current=H.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):U.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{q.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ce=>{ce.remoteChanged&&X()}).catch(ce=>{G.current=!0,j(ce instanceof Error?ce.message:String(ce))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{de.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ce=await BL(oe);te.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ce.hasToken})},saveSession:async oe=>{const ce=await $L(oe,{host:m==null?void 0:m.host});B(ce.hasSession),de.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),de.current=!0,w(ce=>ce+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,te.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),te.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?j4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(j4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Ur,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":z4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:z4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?j4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:_6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(ub,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Vr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",q=t==="abs",U=xk(n),Y=zF(n),G=lEt(n),X=U||G,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),H=S.set,ee=S.saving,de=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ce=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,q))==null?void 0:xt.path)??null},[q,Se]),Ie=R.useCallback(Ve=>q?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,q,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,q);return xt?KEt(Ie(xt.path),xt):null},[q,Se,Ie]),vt=LF(ce==null?void 0:ce.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ce!=null&&!ce.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ce!=null&&!ce.binary&&!ce.truncated&&!vt&&!mt,ut=rt&&ce.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ce.version=="string"||Ct),Re=(W==null?void 0:W.draft)??f5((ce==null?void 0:ce.content)??""),Ze=(W==null?void 0:W.baseline)??f5((ce==null?void 0:ce.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);de(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof D4){const xn=S.getSnapshot();return!xn||!Cl(xn)||H({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{de(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,ready:ce!=null&&!ce.notFound,source:we?Re:(ce==null?void 0:ce.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{H(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!ee);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?H({...xt,conflict:On}):!On&&xt.conflict&&H({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(H(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,ee,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ce||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ce]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(ee||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(ee?Ei():I2e()),children:ee?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(e3,{size:13}):f.jsx(db,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(sb,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?nv():rh(),"data-tip-align":"end","aria-label":y?nv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(e3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ce!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:ee,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:ee,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Ur,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ce===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ce===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ce&&typeof ce.version=="string"?IA(ce.path,ce.content,ce.version):null);xt&&H($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{d5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ce.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(u5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ce.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(u5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):U&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ce.content,entries:x}):f.jsx(Fo,{text:ce.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ce.content,truncated:ce.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ce.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ce.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const $w=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:$w,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:$w,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:$w,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:fb,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Wr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Wr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Wr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(hb,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ny(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}O1.prototype=ny.prototype={constructor:O1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===h5&&n.documentElement.namespaceURI===h5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=ry(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function _5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}_5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=ny("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Pw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function p5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,p5,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Lv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Lv(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Lv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Dv:Math.pow(Dv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Fw(e>=240?e-240:e+120,s,r),Fw(e,s,r),Fw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Lv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Lv(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function Fw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Ov=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=p5(s)).r,(i=p5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=Hw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=(Bv=Ep.now())+sy,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-Bv;n>gH&&(sy-=n,Bv=e)}function Rjt(){for(var e,n=Iv,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Iv=t);j0=e,v5(r)}function v5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-sy)),y0&&(y0=clearInterval(y0))):(y0||(Bv=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new $v;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=ny("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,b5=2,B1=3,sR=4,y5=5,$1=6;function iy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>B1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===B1)return nR(a);m.state===sR?(m.state=$1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_b5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ay=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ay;return e.__zoom}function qw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||ay}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=I1,u=ny("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(U){U.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(U,Y,G,X){var te=U.selection?U.selection():U;te.property("__zoom",iR),U!==te?E(U,Y,G,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(U,Y,G,X){b.scaleTo(U,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},G,X)},b.scaleTo=function(U,Y,G,X){b.transform(U,function(){var te=n.apply(this,arguments),I=this.__zoom,L=G==null?C(te):typeof G=="function"?G.apply(this,arguments):G,F=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,F),te,a)},G,X)},b.translateBy=function(U,Y,G,X){b.transform(U,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(U,Y,G,X,te){b.transform(U,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(ay.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,te)};function w(U,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===U.k?U:new Ol(Y,U.x,U.y)}function y(U,Y,G){var X=Y[0]-G[0]*U.k,te=Y[1]-G[1]*U.k;return X===U.x&&te===U.y?U:new Ol(U.k,X,te)}function C(U){return[(+U[0][0]+ +U[1][0])/2,(+U[0][1]+ +U[1][1])/2]}function E(U,Y,G,X){U.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),W=G==null?C(F):typeof G=="function"?G.apply(te,I):G,H=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),ee=te.__zoom,de=typeof Y=="function"?Y.apply(te,I):Y,re=l(ee.invert(W).concat(H/ee.k),de.invert(W).concat(H/de.k));return function(ne){if(ne===1)ne=de;else{var Q=re(ne),le=H/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(U,Y,G){return!G&&U.__zooming||new T(U,Y)}function T(U,Y){this.that=U,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(U,Y),this.taps=0}T.prototype={event:function(U){return U&&(this.sourceEvent=U),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(U,Y){return this.mouse&&U!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&U!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&U!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(U){var Y=Hi(this.that).datum();u.call(U,this.that,new PTt(U,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(U,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(U),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(U);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===te)return;G.mouse=[I,X.invert(I)],P1(this),G.start()}x0(U),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,te),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(U,...Y){if(p||!e.apply(this,arguments))return;var G=U.currentTarget,X=N(this,Y,!0).event(U),te=Hi(U.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",H,!0),I=Ua(U,G),L=U.clientX,F=U.clientY;lH(U.view),qw(U),X.mouse=[I,this.__zoom.invert(I)],P1(this),X.start();function W(ee){if(x0(ee),!X.moved){var de=ee.clientX-L,re=ee.clientY-F;X.moved=de*de+re*re>S}X.event(ee).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(ee,G),X.mouse[1]),X.extent,a))}function H(ee){te.on("mousemove.zoom mouseup.zoom",null),cH(ee.view,X.moved),x0(ee),X.event(ee).end()}}function O(U,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(U.changedTouches?U.changedTouches[0]:U,this),te=G.invert(X),I=G.k*(U.shiftKey?.5:2),L=t(y(w(G,I),X,te),n.apply(this,Y),a);x0(U),o>0?Hi(this).transition().duration(o).call(E,L,X,U):Hi(this).call(b.transform,L,X,U)}}function B(U,...Y){if(e.apply(this,arguments)){var G=U.touches,X=G.length,te=N(this,Y,U.changedTouches.length===X).event(U),I,L,F,W;for(qw(U),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Pv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pv||(Pv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?Fv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ly(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=oy(t,Fv(s)),r=!0)}),r?ly(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},oy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),x5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),ly=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Fv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>ly(oy(x5(e),x5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},Hv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const U=Math.abs(e[p]-t[p]);if(U<=i){const Y=Math.min(i-1,i-U);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const U=p==="x"?"y":"x",Y=o[p]===l[U],G=u[U]>_[U],X=u[U]<_[U];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),q=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=q?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function S5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=S5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function k5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Uw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:q}){const{nodeLookup:U,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:W}=n();i={x:$,y:q};let H=!1;const ee=o.size>1,de=ee&&Y?x5(mm(o)):null,re=ee&&X?wAt({dragItems:o,snapGrid:G,x:$,y:q}):null;for(const[ne,Q]of o){if(!U.has(ne))continue;let le={x:$-Q.distance.x,y:q-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(ee&&Y&&!Q.extent&&de){const{positionAbsolute:Se}=Q.internals,ye=Se.x-de.x+Y[0][0],qe=Se.x+Q.measured.width-de.x2+Y[1][0],Ie=Se.y-de.y+Y[0][1],Te=Se.y+Q.measured.height-de.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ce,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:U,nodeExtent:oe||Y,nodeOrigin:te,onError:F});H=H||Q.position.x!==ce.x||Q.position.y!==ce.y,Q.position=ce,Q.internals.positionAbsolute=pe}if(x=x||H,!!H&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Uw({nodeId:N,dragItems:o,nodeLookup:U});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:q,autoPanSpeed:U,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,U);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await q({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var ee;const{nodeLookup:q,multiSelectionActive:U,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!U&&N&&((ee=q.get(N))!=null&&ee.selected||W()),E&&I&&N&&(e==null||e(N));const H=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=H,o=xAt(q,Y,H,N),o.size>0&&(t||L||!N&&F)){const[de,re]=Uw({nodeId:N,dragItems:o,nodeLookup:q});t==null||t($.sourceEvent,o,de,re),L==null||L($.sourceEvent,de,re),N||F==null||F($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:q,nodeDragThreshold:U,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(q==null?void 0:q.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,U===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:q,transform:U,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:U,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&q&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,W=L.y-u.y;Math.sqrt(F*F+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:q,updateNodePositions:U,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(U(o,!1),x=!1),s||Y||!N&&G){const[X,te]=Uw({nodeId:N,dragItems:o,nodeLookup:q,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||G==null||G($.sourceEvent,te)}}}).filter($=>{const q=$.target;return!$.button&&(!w||!vR(q,`.${w}`,C))&&(!y||vR(q,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Hv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:q}=Za(e),U=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!U)return;const X=QH(s,U,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,W=null;function H(){if(!_||!Y)return;const[ce,pe]=Mk(te,Y,N);p({x:ce,y:pe}),O=requestAnimationFrame(H)}const ee={...X,nodeId:s,type:U,position:X.position},de=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(de,ee,Nt.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:de,to:te,toHandle:null,toPosition:aR[ee.position],toNode:null,pointer:te};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:U})}T===0&&Q();function le(ce){if(!G){const{x:Te,y:vt}=Za(ce),Dt=Te-$,Ut=vt-q;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!ee){oe(ce);return}const pe=C();te=Za(ce,Y),B=EAt(vm(te,pe,!1,[1,1]),t,l,ee),I||(H(),I=!0);const Se=ZH(ce,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,F=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,ee,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:aR[ee.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function oe(ce){if(!("touches"in ce&&ce.touches.length>0)){if(G){(B||W)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ce,ye),i&&(w==null||w(ce,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const C5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const cy=e=>({x:e.x,y:e.y,zoom:e.k}),Gw=({x:e,y:n,zoom:t})=>ay.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ww=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=cy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=cy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,cy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=cy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(q=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).transform(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:q,userSelectionActive:U,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:W,zoomActivationKeyPressed:H,lib:ee,onTransformChange:de,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){U&&!u.isZoomingOrPanning&&b();const le=Y&&!H&&!U;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ce=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ce);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!q,onPanZoom:i,onTransformChange:de});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:q,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:H,panOnDrag:G,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:U,noPanClassName:$,noWheelClassName:B,lib:ee,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,q){const U=Gw(B),Y=d==null?void 0:d.constrain()(U,$,q);return Y&&await S(Y),Y}async function y(B,$){const q=Gw(B);return await S(q,$),q}function C(B){if(p){const $=Gw(B),q=p.property("__zoom");(q.k!==B.zoom||q.x!==B.x||q.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(q=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleTo(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),B)}):!1}async function T(B,$){return p?new Promise(q=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleBy(Ww(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>q(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,q=-i[1]*N;let U=f1(O,S,v),Y=f1(B,b,w);if(a){let te=0,I=0;l&&j<0?te=Hc(y+j+$,a[0][0]):!l&&j>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+q,a[0][1]):!u&&M>0&&(I=qc(C+B+q,a[1][1])),U=Math.max(U,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&j>0?te=qc(y+j,o[0][0]):!l&&j<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),U=Math.max(U,te),Y=Math.max(Y,I)}if(s){if(_){const te=f1(O/T,b,w)*T;if(U=Math.max(U,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+q+O/T,a[1][1])*T:I=Hc(C+q+(l?j:-j)/T,a[0][1])*T,U=Math.max(U,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,U=Math.max(U,I)}}if(d){const te=f1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?U:-U),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:q,snapGrid:U,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:q,snapGrid:U,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const W=FAt(F,y,F.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:q,snapToGrid:U,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:q,snapToGrid:U,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,W={},H=y.origin??Y,{width:ee,height:de,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,H,T,j),Q=ee!==L,le=de!==F,oe=re!==te&&Q,ce=ne!==I&≤if(!oe&&!ce&&!Q&&!le)return;if((oe||ce||H[0]===1||H[1]===1)&&(W.x=oe?re:b.x,W.y=ce?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-te,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+H[0]*(ee-L),y:Te.position.y-Ie+H[1]*(de-F)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ee:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?de:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=H[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const uy=R.createContext(null),QAt=uy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(uy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(uy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const dy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});dy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(dy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` +`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),H=R.useRef(o);H.current=o;const q=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(q.current)return;Y.current=n,q.current=!0,m(!0);const L=H.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(F=>{var U,Z;const W=F.pdfPath;if(F.ok&&W){S(ce=>({path:W,version:((ce==null?void 0:ce.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((U=F.log)==null?void 0:U.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((Z=F.log)==null?void 0:Z.trim())||S3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{q.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ue=>ue&&{...ue,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const H=R.useRef(!1),q=R.useRef(l);q.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||H.current||Y.current?!1:(H.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ue=>{G.current=!1,N(ue),ue.pulled.includes(n)&&(Y.current?O(!0):q.current(ue.pulled))}).catch(ue=>{G.current=!0,N(null),j(ue instanceof Error?ue.message:String(ue))}).finally(()=>{H.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;te.current!==oe&&X()&&(te.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),U=R.useRef(Promise.resolve()),Z=R.useRef(!1);Z.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const ce=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let oe=!1;const ue=()=>{const Se=ce.current;ce.current=!1,!(!Se&&Z.current)&&(U.current=U.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ue();const pe=setInterval(ue,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),U.current=U.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):q.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{H.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ue=>{ue.remoteChanged&&X()}).catch(ue=>{G.current=!0,j(ue instanceof Error?ue.message:String(ue))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{ce.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ue=await BL(oe);te.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ue.hasToken})},saveSession:async oe=>{const ue=await $L(oe,{host:m==null?void 0:m.host});B(ue.hasSession),ce.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),ce.current=!0,w(ue=>ue+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,te.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),te.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?T4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(T4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Ur,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":j4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:j4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?T4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:_6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(db,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Vr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",H=t==="abs",q=xk(n),Y=zF(n),G=lEt(n),X=q||G,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),U=S.set,Z=S.saving,ce=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ue=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,H))==null?void 0:xt.path)??null},[H,Se]),Ie=R.useCallback(Ve=>H?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,H,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,H);return xt?KEt(Ie(xt.path),xt):null},[H,Se,Ie]),vt=LF(ue==null?void 0:ue.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ue!=null&&!ue.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ue!=null&&!ue.binary&&!ue.truncated&&!vt&&!mt,ut=rt&&ue.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ue.version=="string"||Ct),Re=(W==null?void 0:W.draft)??f5((ue==null?void 0:ue.content)??""),Ze=(W==null?void 0:W.baseline)??f5((ue==null?void 0:ue.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);ce(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof D4){const xn=S.getSnapshot();return!xn||!Cl(xn)||U({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{ce(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,ready:ue!=null&&!ue.notFound,source:we?Re:(ue==null?void 0:ue.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{U(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!Z);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?U({...xt,conflict:On}):!On&&xt.conflict&&U({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(U(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,Z,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ue||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ue]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(Z||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(Z?Ei():I2e()),children:Z?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(e3,{size:13}):f.jsx(fb,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(ib,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?rv():rh(),"data-tip-align":"end","aria-label":y?rv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(e3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ue!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Ur,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ue===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ue===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ue&&typeof ue.version=="string"?IA(ue.path,ue.content,ue.version):null);xt&&U($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{d5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ue.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(u5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ue.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(u5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):q&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ue.content,entries:x}):f.jsx(Fo,{text:ue.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ue.content,truncated:ue.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ue.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ue.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const Pw=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:Pw,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:Pw,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:Pw,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:hb,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Wr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Wr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Wr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(_b,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ry(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}I1.prototype=ry.prototype={constructor:I1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===h5&&n.documentElement.namespaceURI===h5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=sy(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function _5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}_5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=ry("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Fw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function p5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,p5,dH(_m,{brighter(e){return e=e==null?Lv:Math.pow(Lv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Ov(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Ov(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Ov(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Lv:Math.pow(Lv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Hw(e>=240?e-240:e+120,s,r),Hw(e,s,r),Hw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Ov(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ov(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function Hw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Iv=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=p5(s)).r,(i=p5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=qw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=($v=Ep.now())+iy,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-$v;n>gH&&(iy-=n,$v=e)}function Rjt(){for(var e,n=Bv,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Bv=t);j0=e,v5(r)}function v5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-iy)),y0&&(y0=clearInterval(y0))):(y0||($v=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new Pv;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=ry("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,b5=2,$1=3,sR=4,y5=5,P1=6;function ay(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>$1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===$1)return nR(a);m.state===sR?(m.state=P1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_b5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var oy=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return oy;return e.__zoom}function Uw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||oy}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=B1,u=ry("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(q){q.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,Y,G,X){var te=q.selection?q.selection():q;te.property("__zoom",iR),q!==te?E(q,Y,G,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(q,Y,G,X){b.scaleTo(q,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},G,X)},b.scaleTo=function(q,Y,G,X){b.transform(q,function(){var te=n.apply(this,arguments),I=this.__zoom,L=G==null?C(te):typeof G=="function"?G.apply(this,arguments):G,F=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,F),te,a)},G,X)},b.translateBy=function(q,Y,G,X){b.transform(q,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(q,Y,G,X,te){b.transform(q,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(oy.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,te)};function w(q,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===q.k?q:new Ol(Y,q.x,q.y)}function y(q,Y,G){var X=Y[0]-G[0]*q.k,te=Y[1]-G[1]*q.k;return X===q.x&&te===q.y?q:new Ol(q.k,X,te)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function E(q,Y,G,X){q.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),W=G==null?C(F):typeof G=="function"?G.apply(te,I):G,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=te.__zoom,ce=typeof Y=="function"?Y.apply(te,I):Y,re=l(Z.invert(W).concat(U/Z.k),ce.invert(W).concat(U/ce.k));return function(ne){if(ne===1)ne=ce;else{var Q=re(ne),le=U/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(q,Y,G){return!G&&q.__zooming||new T(q,Y)}function T(q,Y){this.that=q,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,Y),this.taps=0}T.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Y){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Y=Hi(this.that).datum();u.call(q,this.that,new PTt(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(q,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(q),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(q);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===te)return;G.mouse=[I,X.invert(I)],F1(this),G.start()}x0(q),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,te),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(q,...Y){if(p||!e.apply(this,arguments))return;var G=q.currentTarget,X=N(this,Y,!0).event(q),te=Hi(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",U,!0),I=Ua(q,G),L=q.clientX,F=q.clientY;lH(q.view),Uw(q),X.mouse=[I,this.__zoom.invert(I)],F1(this),X.start();function W(Z){if(x0(Z),!X.moved){var ce=Z.clientX-L,re=Z.clientY-F;X.moved=ce*ce+re*re>S}X.event(Z).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(Z,G),X.mouse[1]),X.extent,a))}function U(Z){te.on("mousemove.zoom mouseup.zoom",null),cH(Z.view,X.moved),x0(Z),X.event(Z).end()}}function O(q,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(q.changedTouches?q.changedTouches[0]:q,this),te=G.invert(X),I=G.k*(q.shiftKey?.5:2),L=t(y(w(G,I),X,te),n.apply(this,Y),a);x0(q),o>0?Hi(this).transition().duration(o).call(E,L,X,q):Hi(this).call(b.transform,L,X,q)}}function B(q,...Y){if(e.apply(this,arguments)){var G=q.touches,X=G.length,te=N(this,Y,q.changedTouches.length===X).event(q),I,L,F,W;for(Uw(q),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Fv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fv||(Fv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?Hv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ly(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return cy(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=ly(t,Hv(s)),r=!0)}),r?cy(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},ly=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),x5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),cy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Hv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>cy(ly(x5(e),x5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},qv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const q=Math.abs(e[p]-t[p]);if(q<=i){const Y=Math.min(i-1,i-q);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const q=p==="x"?"y":"x",Y=o[p]===l[q],G=u[q]>_[q],X=u[q]<_[q];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),H=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=H?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function S5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=S5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function k5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Gw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:H}){const{nodeLookup:q,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:W}=n();i={x:$,y:H};let U=!1;const Z=o.size>1,ce=Z&&Y?x5(mm(o)):null,re=Z&&X?wAt({dragItems:o,snapGrid:G,x:$,y:H}):null;for(const[ne,Q]of o){if(!q.has(ne))continue;let le={x:$-Q.distance.x,y:H-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(Z&&Y&&!Q.extent&&ce){const{positionAbsolute:Se}=Q.internals,ye=Se.x-ce.x+Y[0][0],qe=Se.x+Q.measured.width-ce.x2+Y[1][0],Ie=Se.y-ce.y+Y[0][1],Te=Se.y+Q.measured.height-ce.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ue,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:q,nodeExtent:oe||Y,nodeOrigin:te,onError:F});U=U||Q.position.x!==ue.x||Q.position.y!==ue.y,Q.position=ue,Q.internals.positionAbsolute=pe}if(x=x||U,!!U&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Gw({nodeId:N,dragItems:o,nodeLookup:q});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:H,autoPanSpeed:q,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,q);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await H({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var Z;const{nodeLookup:H,multiSelectionActive:q,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!q&&N&&((Z=H.get(N))!=null&&Z.selected||W()),E&&I&&N&&(e==null||e(N));const U=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=U,o=xAt(H,Y,U,N),o.size>0&&(t||L||!N&&F)){const[ce,re]=Gw({nodeId:N,dragItems:o,nodeLookup:H});t==null||t($.sourceEvent,o,ce,re),L==null||L($.sourceEvent,ce,re),N||F==null||F($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:H,nodeDragThreshold:q,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,q===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:q,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&H&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,W=L.y-u.y;Math.sqrt(F*F+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:H,updateNodePositions:q,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(q(o,!1),x=!1),s||Y||!N&&G){const[X,te]=Gw({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||G==null||G($.sourceEvent,te)}}}).filter($=>{const H=$.target;return!$.button&&(!w||!vR(H,`.${w}`,C))&&(!y||vR(H,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())qv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:H}=Za(e),q=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!q)return;const X=QH(s,q,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,W=null;function U(){if(!_||!Y)return;const[ue,pe]=Mk(te,Y,N);p({x:ue,y:pe}),O=requestAnimationFrame(U)}const Z={...X,nodeId:s,type:q,position:X.position},ce=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(ce,Z,Nt.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ce,to:te,toHandle:null,toPosition:aR[Z.position],toNode:null,pointer:te};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:q})}T===0&&Q();function le(ue){if(!G){const{x:Te,y:vt}=Za(ue),Dt=Te-$,Ut=vt-H;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!Z){oe(ue);return}const pe=C();te=Za(ue,Y),B=EAt(vm(te,pe,!1,[1,1]),t,l,Z),I||(U(),I=!0);const Se=ZH(ue,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,F=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,Z,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:aR[Z.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function oe(ue){if(!("touches"in ue&&ue.touches.length>0)){if(G){(B||W)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ue,ye),i&&(w==null||w(ue,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const C5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const uy=e=>({x:e.x,y:e.y,zoom:e.k}),Ww=({x:e,y:n,zoom:t})=>oy.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Vw=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=uy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=uy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,uy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=uy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).transform(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:q,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:W,zoomActivationKeyPressed:U,lib:Z,onTransformChange:ce,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){q&&!u.isZoomingOrPanning&&b();const le=Y&&!U&&!q;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ue=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ue);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:ce});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:U,panOnDrag:G,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:q,noPanClassName:$,noWheelClassName:B,lib:Z,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,H){const q=Ww(B),Y=d==null?void 0:d.constrain()(q,$,H);return Y&&await S(Y),Y}async function y(B,$){const H=Ww(B);return await S(H,$),H}function C(B){if(p){const $=Ww(B),H=p.property("__zoom");(H.k!==B.zoom||H.x!==B.x||H.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleTo(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}async function T(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleBy(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,H=-i[1]*N;let q=f1(O,S,v),Y=f1(B,b,w);if(a){let te=0,I=0;l&&j<0?te=Hc(y+j+$,a[0][0]):!l&&j>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+H,a[0][1]):!u&&M>0&&(I=qc(C+B+H,a[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&j>0?te=qc(y+j,o[0][0]):!l&&j<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(s){if(_){const te=f1(O/T,b,w)*T;if(q=Math.max(q,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+H+O/T,a[1][1])*T:I=Hc(C+H+(l?j:-j)/T,a[0][1])*T,q=Math.max(q,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,q=Math.max(q,I)}}if(d){const te=f1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?q:-q),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:H,snapGrid:q,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:H,snapGrid:q,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const W=FAt(F,y,F.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:H,snapToGrid:q,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,W={},U=y.origin??Y,{width:Z,height:ce,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,U,T,j),Q=Z!==L,le=ce!==F,oe=re!==te&&Q,ue=ne!==I&≤if(!oe&&!ue&&!Q&&!le)return;if((oe||ue||U[0]===1||U[1]===1)&&(W.x=oe?re:b.x,W.y=ue?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-te,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+U[0]*(Z-L),y:Te.position.y-Ie+U[1]*(ce-F)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=U[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const dy=R.createContext(null),QAt=dy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(dy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(dy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const fy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});fy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(fy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=Hv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=Hv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const fy={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(q=>{b==null||b({x:q[0],y:q[1],zoom:q[2]}),w||E.setState({transform:q})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoom:(G,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(G,X),te==null||te(X)}});const{x:q,y:U,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[q,U,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var q;(q=B.current)==null||q.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:fy,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Vw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),q=R.useRef(!1),U=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(q.current||$.current||b.getState().connection.inProgress){q.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{q.current&&(Q.stopPropagation(),q.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ce=Q.target===j.current;if(!ce&&!!Q.target.closest(".nokey")||!e||!(a&&ce||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),q.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ce||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ce,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ce),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(U.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!q.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ce,y:pe}=U.current;F(ce,pe),v.current=requestAnimationFrame(W)})}const H=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>H(),[]);const ee=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ce}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);U.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!q.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ce(),o==null||o(Q)}q.current=!0,Y.current||(W(),Y.current=!0),F(pe,Se)},de=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),q.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),H())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),H()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Vw(G,j),onContextMenu:Vw(X,j),onWheel:Vw(te,j),onPointerEnter:T?void 0:p,onPointerMove:T?ee:m,onPointerUp:de,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:fy,children:[S,f.jsx(ARt,{})]})}function E5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{E5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:W,setEdges:H,onError:ee}=v.getState();H(vRt(F,W,{onError:ee}))}I==null||I(F),o==null||o(F)},q=X=>{if(!b)return;const te=PH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();C5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},U=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:W,lib:H,rfId:ee,nodeLookup:de,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=C5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:ee,doc:ne,lib:H,nodeLookup:de});oe&&le&&$(le);const ce=structuredClone(re);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,I==null||I(X,ce),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:q,onTouchStart:q,onClick:w?U:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const qv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(qv,m.key)&&(m.preventDefault(),l({direction:qv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:q,preventScrolling:U,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:W}=An(QRt,kr),H=Ap(u,{target:IR}),ee=Ap(S,{target:IR}),de=ee||j,re=ee||C,ne=_&&de!==!0,Q=H||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!H&&de,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:q,zoomActivationKeyCode:v,preventScrolling:U,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:de,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:H,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),q=OH(y),U=tMt({node:y,nodeType:N,hasDimensions:q,resizeObserver:d}),Y=uq({nodeRef:U,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),te=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,H=i?Q=>i(Q,{...C.userNode}):void 0,ee=a?Q=>a(Q,{...C.userNode}):void 0,de=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&E5({id:e,store:$,nodeRef:U}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";E5({id:e,store:$,unselect:le,nodeRef:U})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(qv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:qv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=U.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ce,setCenter:pe}=$.getState();if(!ce)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:U,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:q?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:W,onContextMenu:H,onClick:de,onDoubleClick:ee,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:fy,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Pv.Arrow]:oMt,[Pv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function hy({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(hy,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=w5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(hy,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(hy,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:q,rfId:U,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",te=(F,W)=>{p(!1),d==null||d(F,t,E.type,W)},I=F=>u==null?void 0:u(t,F),L=(F,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,W)};C5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:q,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:U,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var W,H;return((H=(W=x.getState()).isValidConnection)==null?void 0:H.call(W,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var W,H;return(H=(W=x.getState()).onConnectEnd)==null?void 0:H.call(W,...F)},onReconnectEnd:te,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[q,U]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),H=R.useMemo(()=>y.markerStart?`url('#${S5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),ee=R.useMemo(()=>y.markerEnd?`url('#${S5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const de=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ce=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:de,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ce:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!q&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:H,markerEnd:ee,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,setUpdateHover:$,setReconnecting:U})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=w5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=w5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:q,maxZoom:U,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:H,autoPanOnSelection:ee,onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ce,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:de,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ce,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:H,autoPanOnSelection:ee,defaultViewport:B,translateExtent:$,minZoom:q,maxZoom:U,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=k5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=k5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),q={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const U=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:U})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(q)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(k5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(uy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:q,onSelectionDragStart:U,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:W=Kc.Bezier,connectionLineStyle:H,connectionLineComponent:ee,connectionLineContainerStyle:de,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ce=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Pr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Pr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:U,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:H,connectionLineComponent:ee,connectionLineContainerStyle:de,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ce,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:q}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...fy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(dy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Kw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Kw(n),u=Kw(e),_=Kw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:q,ariaLabelConfig:U}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,te=T.height/G,I=Math.max(X,te),L=I*Y,F=I*G,W=C*I,H=T.x-(L-T.width)/2-W,ee=T.y-(F-T.height)/2-W,de=L+W*2,re=F+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:q,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,q]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ce=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??U["minimap.ariaLabel"];return f.jsx(dy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${H} ${ee} ${de} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ce,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-W},${ee-W}h${de+W*2}v${re+W*2}h${-de-W*2}z - M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:q,snapToGrid:U,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:q,snapToGrid:U,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:q,nodeLookup:U,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],te={x:B.x,y:B.y},I=U.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,F=B.width??I.measured.width??0,W=B.height??I.measured.height??0,H={id:I.id,parentId:I.parentId,rect:{width:F,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:W},I.parentId,U,L)}},ee=Pk([H],U,Y,G);X.push(...ee),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*W,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}q(X)},onEnd:({width:B,height:$})=>{const q={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([q])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Qw=380,Yw=12,vDt=350,bDt=150,N5=new EventTarget;function yDt(){N5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return N5.addEventListener("move",u),()=>{N5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Yw+Qw<=window.innerWidth,d=s.x-Yw-Qw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Yw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` +`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=qv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=qv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const hy={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(H=>{b==null||b({x:H[0],y:H[1],zoom:H[2]}),w||E.setState({transform:H})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoom:(G,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(G,X),te==null||te(X)}});const{x:H,y:q,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[H,q,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:hy,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Kw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),H=R.useRef(!1),q=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(H.current||$.current||b.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{H.current&&(Q.stopPropagation(),H.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ue=Q.target===j.current;if(!ue&&!!Q.target.closest(".nokey")||!e||!(a&&ue||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),H.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ue||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ue,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ue),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(q.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!H.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ue,y:pe}=q.current;F(ue,pe),v.current=requestAnimationFrame(W)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>U(),[]);const Z=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ue}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);q.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!H.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ue(),o==null||o(Q)}H.current=!0,Y.current||(W(),Y.current=!0),F(pe,Se)},ce=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),U())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),U()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Kw(G,j),onContextMenu:Kw(X,j),onWheel:Kw(te,j),onPointerEnter:T?void 0:p,onPointerMove:T?Z:m,onPointerUp:ce,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:hy,children:[S,f.jsx(ARt,{})]})}function E5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{E5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:W,setEdges:U,onError:Z}=v.getState();U(vRt(F,W,{onError:Z}))}I==null||I(F),o==null||o(F)},H=X=>{if(!b)return;const te=PH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();C5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},q=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:W,lib:U,rfId:Z,nodeLookup:ce,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=C5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:Z,doc:ne,lib:U,nodeLookup:ce});oe&&le&&$(le);const ue=structuredClone(re);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,I==null||I(X,ue),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:w?q:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const Uv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Uv,m.key)&&(m.preventDefault(),l({direction:Uv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,preventScrolling:q,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:W}=An(QRt,kr),U=Ap(u,{target:IR}),Z=Ap(S,{target:IR}),ce=Z||j,re=Z||C,ne=_&&ce!==!0,Q=U||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!U&&ce,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,zoomActivationKeyCode:v,preventScrolling:q,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ce,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),H=OH(y),q=tMt({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),Y=uq({nodeRef:q,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),te=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,U=i?Q=>i(Q,{...C.userNode}):void 0,Z=a?Q=>a(Q,{...C.userNode}):void 0,ce=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&E5({id:e,store:$,nodeRef:q}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";E5({id:e,store:$,unselect:le,nodeRef:q})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(Uv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:Uv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=q.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ue,setCenter:pe}=$.getState();if(!ue)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:H?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:W,onContextMenu:U,onClick:ce,onDoubleClick:Z,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:hy,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Fv.Arrow]:oMt,[Fv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function _y({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(_y,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=w5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(_y,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(_y,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(_y,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:H,rfId:q,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",te=(F,W)=>{p(!1),d==null||d(F,t,E.type,W)},I=F=>u==null?void 0:u(t,F),L=(F,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,W)};C5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:q,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var W,U;return((U=(W=x.getState()).isValidConnection)==null?void 0:U.call(W,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var W,U;return(U=(W=x.getState()).onConnectEnd)==null?void 0:U.call(W,...F)},onReconnectEnd:te,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[H,q]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),U=R.useMemo(()=>y.markerStart?`url('#${S5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),Z=R.useMemo(()=>y.markerEnd?`url('#${S5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const ce=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ue=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:ce,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ue:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!H&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,setUpdateHover:$,setReconnecting:q})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=w5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=w5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ue,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ue,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=k5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=k5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),H={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const q=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:q})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(H)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(k5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(dy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:H,onSelectionDragStart:q,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:W=Kc.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ue=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Pr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Pr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:q,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ue,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:H}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...hy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(fy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Qw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Qw(n),u=Qw(e),_=Qw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:H,ariaLabelConfig:q}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,te=T.height/G,I=Math.max(X,te),L=I*Y,F=I*G,W=C*I,U=T.x-(L-T.width)/2-W,Z=T.y-(F-T.height)/2-W,ce=L+W*2,re=F+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:H,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,H]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ue=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??q["minimap.ariaLabel"];return f.jsx(fy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${U} ${Z} ${ce} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ue,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-W},${Z-W}h${ce+W*2}v${re+W*2}h${-ce-W*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:H,nodeLookup:q,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],te={x:B.x,y:B.y},I=q.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,F=B.width??I.measured.width??0,W=B.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:F,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:W},I.parentId,q,L)}},Z=Pk([U],q,Y,G);X.push(...Z),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*W,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}H(X)},onEnd:({width:B,height:$})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Yw=380,Xw=12,vDt=350,bDt=150,N5=new EventTarget;function yDt(){N5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return N5.addEventListener("move",u),()=>{N5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Xw+Yw<=window.innerWidth,d=s.x-Xw-Yw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Xw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` diff --git `);$=G!==-1?$.slice(0,G+1):$.slice(0,$.lastIndexOf(` -`)+1)}let q=[];try{q=$.trim()?i3($):[]}catch{return null}if(B.truncated&&q.every(G=>G.hunks.length===0))return null;let U=0,Y=0;for(const G of q){const X=Db(G);U+=X.additions,Y+=X.deletions}return{fileCount:q.length,additions:U,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Qw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Wr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Wr(a),children:[f.jsx(hb,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&g6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,F1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function z5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function H1(e){if(e.children.length===0)return z5(e);const n=e.children.reduce((t,r)=>t+H1(r),0)+F1*(e.children.length-1);return Math.max(z5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Wr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Wr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Wr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(hb,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:ev({name:Ne(t.branchName)}),"aria-label":ev({name:Ne(t.branchName)}),href:tb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(_b,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-z5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+H1(O),0)+F1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=H1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+F1}}let w=0;for(const y of S){const C=H1(y);b(y,w+C/2,0),w+=C+F1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Uv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Uv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Uv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:Z=>Z.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const Z=t?Wa(t):"experiments";return typeof Z=="object"&&"path"in Z&&Z.line&&p!==v.current.value?{...Z,lineScrollRequest:v.current.value}:Z},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var Z;return((Z=w.data)==null?void 0:Z.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((Z,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:C1(je.projectId,je.activeSessionId,Z),replace:ge})},[s]),B=R.useCallback(Z=>{const ge=Ll(Z);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),q=R.useCallback(Z=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:Z??void 0})},[t,O]),U=R.useCallback(Z=>{s.navigate({href:Z?`/projects/${encodeURIComponent(Z)}`:"/projects"})},[s]),Y=R.useCallback(Z=>{var ge;if(n)if(Z==="chat"){const je=l.current;s.navigate({href:C1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${Z==="skills"?"skills":`settings/${Z}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(Z=>{Vr(te.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[te]),W=R.useMemo(()=>Zp(),[n]),H=ct(W),ee=H.data??null,de=R.useCallback(Z=>{Vr(W.queryKey,ge=>(typeof Z=="function"?Z(ge??null):Z)??void 0)},[W]),re=R.useRef(void 0);re.current=ee==null?void 0:ee.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!H.data&&H.error?Bne():null].filter(Z=>Z!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(W4(n)),ce=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ce);Ct.current=ce;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ce.every(Z=>Z.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ce:ce.filter(Z=>Z.chatSessionId===u),[ce,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const Z=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>Z.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=Z=>{let ge=En.current.get(Z);return ge||(ge=new HEt,En.current.set(Z,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(Z=>{const ge=[...Z];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(Z=>{dr.current=Z,zi(Z)},[]),Pr=R.useCallback(Z=>{const ge=Et(Z);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in Z){const Me=Ms(je,en.current,Z);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(Z=>{const ge=Et(Z),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(Z)];vs.current=je,Rn(je),B(Z)},[B]),cs=R.useCallback((Z,ge,je)=>{const $e=Et(Z),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Pr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(Z));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(Z)];vs.current=tt,Rn(tt),O(Ll(Z,je))},[Pr,ls,Ls,O]),bs=R.useCallback(Z=>{const ge=dr.current;ge&&Et(ge)===Et(Z)&&Ls(null)},[Ls]);R.useEffect(()=>{let Z=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){Z=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),Z=!0;return}if(Z&&$e.key==="Enter"){$e.preventDefault(),Z=!1;const Lt=dr.current;Lt&&bs(Lt);return}Z=!1},je=()=>{Z=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((Z,ge)=>{const je=Et(Z),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(Z=>Z+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((Z,ge,je)=>{if(Rn(Z.tabHistory),vs.current=Z.tabHistory,Nr(Z.experimentsTabOpen),fn(Z.filesTabOpen),tn(Z.artifactsTabOpen),un(Z.expTabs),on(Z.fileTabs),lt(Me=>Me===Z.planTabs?Me:Z.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(Z.subagentTabs),On(Z.codeTabs),ls(Z.contentTabOrder),Ls(Z.previewTab),Jt(Z.filesView),ur(Z.filesToggled),Zt(Z.scope),Ke(Z.panelMax),ji(Z.treeViewport),Yn(M.current.activeSessionId===O0&&Z.fileTabs.some(Me=>Yu(Me,{path:S1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of Z.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Fr,workspace:oa}=K0t({projectId:ee&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(ee==null?void 0:ee.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const Z=Jl.current;(Z==null?void 0:Z.projectId)===n&&Z.taskId===u&&Z.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((Z,ge)=>{var at;if(!n)return;Z&&ge!=null&&ge.replace&&u===null&&(Fr(),W0t(n,Z));const je=cu(DO(n),Z??"new"),$e=je?je.active:Wc(n)?(at=T6(Z??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&Z&&u===null?M.current.pane:$e;s.navigate({href:C1(n,Z,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Fr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(Z=>Z+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:Z})=>{var ge;return((ge=Rd(Z.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(Z=>Z.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const Z=ob(i.href);!ee||!$n||!Z||(lb.queue({lastLocation:Z,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===Z?250:0),La.current=Z)},[i.href,ee,$n,oo,os,Ze]);const ec=(ee==null?void 0:ee.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async Z=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:Z}),de($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||ee!=null&&ee.tourCompleted||Ai()},[n,ec,Ai,ee==null?void 0:ee.tourCompleted]);const Mt=(L==null?void 0:L.find(Z=>Z.id===n))??null;R.useEffect(()=>{const Z=Q||ee===null?null:Mt==null?void 0:Mt.name;document.title=Z?`${Oo(Z)} — OpenResearch`:"OpenResearch"},[Q,ee,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(Z=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:Z})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((Z=!1)=>{Z&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},Z))},[O,xs]),Ri=()=>{I.refetch(),H.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!ee||lo.current)return;lo.current=!0,le.current=ee.preferredAgent;const Z=N6()??ee.workspace;Z&&(Cs(Z.railOpen),ks(Math.min(Z.panelWidth,T0())),_t(Z.experimentsView))},[ee]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(Z=>{const ge=++sc.current;de($e=>$e&&{...$e,preferredAgent:Z});const je=co.current.then(()=>r.mutateAsync({preferredAgent:Z})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&de(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const Z=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const Os=R.useCallback(Z=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(Z)).then(je=>{if(hr.current!==Z||Ut.current!==Z||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const Z=hr.current;Z&&(Ut.current=Z,vt.current.clear(),Dt.current.clear(),Os(Z))},onRun:Z=>{if(Z.projectId!==hr.current||Z.projectId!==Ut.current)return;const ge=vt.current.get(Z.id),je=Dt.current.has(Z.id);if(ge&&ge.updatedAt>Z.updatedAt||(vt.current.set(Z.id,Z),Dt.current.add(Z.id),Z.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(Z.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=Z.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(Z.id,Z)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((Z,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:Z,view:ge};un(at=>at.some(tt=>M2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((Z,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===Z||Me.id.startsWith(Z)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ce.map(Z=>{var ge;return[Z.id,((ge=Z.title)==null?void 0:ge.trim())||Z.slug||El()]})),[ce,G]),Zs=YR(zu),el=R.useMemo(()=>{const Z=new Map;for(const ge of Ie)Z.set(ge.id,Zs.get(ge.experimentId)??El());return Z},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(Z=>{const ge=tl.get(Z);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(Z=>{const ge=Zs.get(Z);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(Z));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((Z,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===Z||$e.id.startsWith(Z));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(Z=>{const ge=nr.findIndex(je=>M2(je,Z));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[nr,yr,b]),uo=R.useCallback((Z,ge="preview")=>{Z.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,Z);Dr.current.fileTabs.some(at=>Yu(at,Z))||C.current.delete(Me),E.current.add(Me)}const $e=RO(Z);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,Z));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(Z,ge)},[cs]),fi=R.useCallback((Z,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(Z,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((Z,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(Z,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(Z=>uo({path:Z,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((Z,ge,je,$e,Me,at="preview")=>{const tt=fi(Z,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((Z,ge)=>{bs(Z),ge()},[bs]),of=R.useCallback(Z=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,Z));if(ge===-1)return;const je=n?Ms(n,u,Z):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(Z,{path:S1,source:"artifacts"})&&Yn(!1),yr(Z,Et(b)===Et(Z)))},[u,Mn,yr,n,b]),lf=R.useCallback(Z=>{Z.lineScrollRequest!==void 0&&m(Z.lineScrollRequest)},[]),x_=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:Z};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(Z=>{const ge=xt.findIndex(je=>je.promptId===Z.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,xt,b]),lc=R.useCallback((Z,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:Z,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(Z=>{const ge=ft.findIndex(je=>je.spawnPartId===Z.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let Z=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Rv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{Z&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=av(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{Z=!1,at()}},[ft]);const uc=R.useCallback((Z,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:Z,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:Z,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((Z,ge)=>{On(je=>je.map($e=>qf($e,Z)?{...$e,...ge}:$e)),ge.view&&O(Ll({...Z,...ge}))},[]),S_=R.useCallback(Z=>{const ge=xn.findIndex(je=>qf(je,Z));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(Z,Et(b)===Et(Z)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(Z=>{Z==="experiments"?Nr(!1):Z==="files"?fn(!1):tn(!1),yr(Z,b===Z)},[yr,b]),ff=Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=Z.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Uv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(Z,ge)=>{F(je=>je?QR(je,Z):[Z]),s.navigate({href:`/projects/${encodeURIComponent(Z.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(Z=>Yu(Z,{path:S1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const Z=nl.data.messages.flatMap(je=>{const $e=Rv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=Z==null?void 0:Z.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(Z=>qf(Z,Ae))??null:null,Ue=new Map;for(const Z of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(Z),Z);const zn=ca?Et(ca):null,jn=di.filter(Z=>Z!==zn).map(Z=>Ue.get(Z)).filter(q0t),fr=Z=>ao!==null&&Et(ao)===Et(Z),Ln=Z=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,Z),label:Z.path.split("/").pop()||Z.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>of(Z)},`file:${z6(Z)}`),_r=Bs?ce.find(Z=>Z.id===Bs.id)??null:null,da=Oe?ce.find(Z=>Z.id===Oe.experimentId&&Z.branchName===Oe.branch)??null:null,_f=Z=>{var je,$e;if("path"in Z)return Ln(Z);if("id"in Z){const Me=ce.find(at=>at.id===Z.id);return f.jsx(Fc,{active:Bs!==null&&M2(Bs,Z),label:Me?Me.title||Me.slug:"…",icon:Z.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>Tu(Z)},Et(Z))}if("kind"in Z&&Z.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===Z.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>w_(Z)},Et(Z));if("kind"in Z)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===Z.spawnPartId,label:((je=uf[Z.spawnPartId])==null?void 0:je.label)??Z.label??Wne(),shimmer:(($e=uf[Z.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>cf(Z)},Et(Z));const ge=ce.find(Me=>Me.id===Z.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,Z),label:(ge==null?void 0:ge.slug)??Z.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(Z),onSelect:()=>Lr(Z),onPromote:()=>bs(Z),onClose:()=>S_(Z)},Et(Z))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>U(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||ee===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(dv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>U(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(Z=>Z.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(ee==null?void 0:ee.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:ee.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:Z=>{F(ge=>ge?QR(ge,Z):[Z])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ce,runs:Ie,onOpenExperiment:(Z,ge)=>Is(Z,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(Z=>Z.id===u&&Z.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:C4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(fb,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(Z=>!Z),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Ur,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(Z=>Z.id===d&&Z.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(Z=>!Z),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ce,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ce.length>0?gne():void 0,experiments:br,onOpen:(Z,ge)=>{Is(Z.id,"overview",ge)},onOpenLogs:(Z,ge,je)=>{Is(Z,"terminal",je,ge)},onOpenCode:(Z,ge)=>{const je=ce.find($e=>$e.id===Z);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:Z=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:Z,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(Z,ge,je,$e)=>oc(Z,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const Z=Ms(n,u,Dn);C.current.delete(Z),E.current.add(Z)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:Z=>{N.current[Ms(n,u,Dn)]=Z,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(Z,ge,je,$e)=>hi(Dn,()=>oc(Z,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:Z=>{rr.current.set(Ms(n,u,Dn),Z),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(Z=>Z.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(Z,ge,je,$e,Me)=>hi(Qr,()=>oc(Z,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(Z,ge,je,$e,Me)=>hi(be,()=>Au(Z,be.sessionId,ge,je,$e,Me)),onOpenRun:(Z,ge)=>hi(be,()=>Oa(Z,ge)),runExperimentName:ac,onOpenExperiment:(Z,ge)=>hi(be,()=>ju(Z,ge)),experimentName:sf,onOpenSubagent:(Z,ge,je)=>hi(be,()=>lc(be.sessionId,Z,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:Z=>df(Oe,{view:Z}),onToggledChange:Z=>df(Oe,{toggled:Z}),onOpenFile:(Z,ge,je,$e)=>hi(Oe,()=>oc(Z,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:q,parentExperiment:ce.find(Z=>Z.id===_r.parentExperimentId)??null,onOpenView:(Z,ge,je)=>{hi(Bs,()=>Is(_r.id,Z,je,ge))},onOpenCode:(Z,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,Z,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(Z,ge)=>{Kr(!1),k_(Z,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const j5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=j5.useParams(),{pane:n}=j5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>cb}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>cb}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>cb}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=j5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=cb._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); +`)+1)}let H=[];try{H=$.trim()?i3($):[]}catch{return null}if(B.truncated&&H.every(G=>G.hunks.length===0))return null;let q=0,Y=0;for(const G of H){const X=Lb(G);q+=X.additions,Y+=X.deletions}return{fileCount:H.length,additions:q,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Yw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Wr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Wr(a),children:[f.jsx(_b,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&g6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,H1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function z5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function q1(e){if(e.children.length===0)return z5(e);const n=e.children.reduce((t,r)=>t+q1(r),0)+H1*(e.children.length-1);return Math.max(z5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Wr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Wr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Wr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(_b,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:tv({name:Ne(t.branchName)}),"aria-label":tv({name:Ne(t.branchName)}),href:nb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(pb,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-z5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+q1(O),0)+H1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=q1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+H1}}let w=0;for(const y of S){const C=q1(y);b(y,w+C/2,0),w+=C+H1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Gv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Gv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Gv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:J=>J.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const J=t?Wa(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var J;return((J=w.data)==null?void 0:J.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((J,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:E1(je.projectId,je.activeSessionId,J),replace:ge})},[s]),B=R.useCallback(J=>{const ge=Ll(J);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),H=R.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:J??void 0})},[t,O]),q=R.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Y=R.useCallback(J=>{var ge;if(n)if(J==="chat"){const je=l.current;s.navigate({href:E1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(J=>{Vr(te.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[te]),W=R.useMemo(()=>Zp(),[n]),U=ct(W),Z=U.data??null,ce=R.useCallback(J=>{Vr(W.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[W]),re=R.useRef(void 0);re.current=Z==null?void 0:Z.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!U.data&&U.error?Bne():null].filter(J=>J!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(W4(n)),ue=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ue);Ct.current=ue;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ue.every(J=>J.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ue:ue.filter(J=>J.chatSessionId===u),[ue,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const J=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>J.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=J=>{let ge=En.current.get(J);return ge||(ge=new HEt,En.current.set(J,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(J=>{const ge=[...J];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(J=>{dr.current=J,zi(J)},[]),Pr=R.useCallback(J=>{const ge=Et(J);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in J){const Me=Ms(je,en.current,J);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(J=>{const ge=Et(J),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(J)];vs.current=je,Rn(je),B(J)},[B]),cs=R.useCallback((J,ge,je)=>{const $e=Et(J),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Pr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(J));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(J)];vs.current=tt,Rn(tt),O(Ll(J,je))},[Pr,ls,Ls,O]),bs=R.useCallback(J=>{const ge=dr.current;ge&&Et(ge)===Et(J)&&Ls(null)},[Ls]);R.useEffect(()=>{let J=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),J=!0;return}if(J&&$e.key==="Enter"){$e.preventDefault(),J=!1;const Lt=dr.current;Lt&&bs(Lt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((J,ge)=>{const je=Et(J),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(J=>J+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((J,ge,je)=>{if(Rn(J.tabHistory),vs.current=J.tabHistory,Nr(J.experimentsTabOpen),fn(J.filesTabOpen),tn(J.artifactsTabOpen),un(J.expTabs),on(J.fileTabs),lt(Me=>Me===J.planTabs?Me:J.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(J.subagentTabs),On(J.codeTabs),ls(J.contentTabOrder),Ls(J.previewTab),Jt(J.filesView),ur(J.filesToggled),Zt(J.scope),Ke(J.panelMax),ji(J.treeViewport),Yn(M.current.activeSessionId===O0&&J.fileTabs.some(Me=>Yu(Me,{path:k1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of J.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Fr,workspace:oa}=K0t({projectId:Z&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(Z==null?void 0:Z.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const J=Jl.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((J,ge)=>{var at;if(!n)return;J&&ge!=null&&ge.replace&&u===null&&(Fr(),W0t(n,J));const je=cu(DO(n),J??"new"),$e=je?je.active:Wc(n)?(at=T6(J??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&J&&u===null?M.current.pane:$e;s.navigate({href:E1(n,J,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Fr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(J=>J+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:J})=>{var ge;return((ge=Rd(J.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(J=>J.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const J=lb(i.href);!Z||!$n||!J||(cb.queue({lastLocation:J,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===J?250:0),La.current=J)},[i.href,Z,$n,oo,os,Ze]);const ec=(Z==null?void 0:Z.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async J=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:J}),ce($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||Z!=null&&Z.tourCompleted||Ai()},[n,ec,Ai,Z==null?void 0:Z.tourCompleted]);const Mt=(L==null?void 0:L.find(J=>J.id===n))??null;R.useEffect(()=>{const J=Q||Z===null?null:Mt==null?void 0:Mt.name;document.title=J?`${Oo(J)} — OpenResearch`:"OpenResearch"},[Q,Z,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(J=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:J})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},J))},[O,xs]),Ri=()=>{I.refetch(),U.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!Z||lo.current)return;lo.current=!0,le.current=Z.preferredAgent;const J=N6()??Z.workspace;J&&(Cs(J.railOpen),ks(Math.min(J.panelWidth,T0())),_t(J.experimentsView))},[Z]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(J=>{const ge=++sc.current;ce($e=>$e&&{...$e,preferredAgent:J});const je=co.current.then(()=>r.mutateAsync({preferredAgent:J})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const J=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Os=R.useCallback(J=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(J)).then(je=>{if(hr.current!==J||Ut.current!==J||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const J=hr.current;J&&(Ut.current=J,vt.current.clear(),Dt.current.clear(),Os(J))},onRun:J=>{if(J.projectId!==hr.current||J.projectId!==Ut.current)return;const ge=vt.current.get(J.id),je=Dt.current.has(J.id);if(ge&&ge.updatedAt>J.updatedAt||(vt.current.set(J.id,J),Dt.current.add(J.id),J.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(J.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=J.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(J.id,J)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((J,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:J,view:ge};un(at=>at.some(tt=>D2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((J,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ue.map(J=>{var ge;return[J.id,((ge=J.title)==null?void 0:ge.trim())||J.slug||El()]})),[ue,G]),Zs=YR(zu),el=R.useMemo(()=>{const J=new Map;for(const ge of Ie)J.set(ge.id,Zs.get(ge.experimentId)??El());return J},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(J=>{const ge=tl.get(J);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(J=>{const ge=Zs.get(J);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((J,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===J||$e.id.startsWith(J));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(J=>{const ge=nr.findIndex(je=>D2(je,J));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[nr,yr,b]),uo=R.useCallback((J,ge="preview")=>{J.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,J);Dr.current.fileTabs.some(at=>Yu(at,J))||C.current.delete(Me),E.current.add(Me)}const $e=RO(J);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,J));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(J,ge)},[cs]),fi=R.useCallback((J,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(J,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((J,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(J,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(J=>uo({path:J,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((J,ge,je,$e,Me,at="preview")=>{const tt=fi(J,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((J,ge)=>{bs(J),ge()},[bs]),of=R.useCallback(J=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,J));if(ge===-1)return;const je=n?Ms(n,u,J):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(J,{path:k1,source:"artifacts"})&&Yn(!1),yr(J,Et(b)===Et(J)))},[u,Mn,yr,n,b]),lf=R.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),x_=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:J};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(J=>{const ge=xt.findIndex(je=>je.promptId===J.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,xt,b]),lc=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(J=>{const ge=ft.findIndex(je=>je.spawnPartId===J.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let J=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Mv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{J&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=ov(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{J=!1,at()}},[ft]);const uc=R.useCallback((J,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:J,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:J,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((J,ge)=>{On(je=>je.map($e=>qf($e,J)?{...$e,...ge}:$e)),ge.view&&O(Ll({...J,...ge}))},[]),S_=R.useCallback(J=>{const ge=xn.findIndex(je=>qf(je,J));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(J=>{J==="experiments"?Nr(!1):J==="files"?fn(!1):tn(!1),yr(J,b===J)},[yr,b]),ff=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=J.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Gv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(J,ge)=>{F(je=>je?QR(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(J=>Yu(J,{path:k1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const J=nl.data.messages.flatMap(je=>{const $e=Mv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=J==null?void 0:J.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(J=>qf(J,Ae))??null:null,Ue=new Map;for(const J of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(J),J);const zn=ca?Et(ca):null,jn=di.filter(J=>J!==zn).map(J=>Ue.get(J)).filter(q0t),fr=J=>ao!==null&&Et(ao)===Et(J),Ln=J=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>of(J)},`file:${z6(J)}`),_r=Bs?ue.find(J=>J.id===Bs.id)??null:null,da=Oe?ue.find(J=>J.id===Oe.experimentId&&J.branchName===Oe.branch)??null:null,_f=J=>{var je,$e;if("path"in J)return Ln(J);if("id"in J){const Me=ue.find(at=>at.id===J.id);return f.jsx(Fc,{active:Bs!==null&&D2(Bs,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>Tu(J)},Et(J))}if("kind"in J&&J.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===J.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>w_(J)},Et(J));if("kind"in J)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===J.spawnPartId,label:((je=uf[J.spawnPartId])==null?void 0:je.label)??J.label??Wne(),shimmer:(($e=uf[J.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>cf(J)},Et(J));const ge=ue.find(Me=>Me.id===J.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,J),label:(ge==null?void 0:ge.slug)??J.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>S_(J)},Et(J))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||Z===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(J=>J.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(Z==null?void 0:Z.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:Z.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:J=>{F(ge=>ge?QR(ge,J):[J])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ue,runs:Ie,onOpenExperiment:(J,ge)=>Is(J,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:E4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(hb,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(J=>!J),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Ur,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(J=>J.id===d&&J.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(J=>!J),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ue,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ue.length>0?gne():void 0,experiments:br,onOpen:(J,ge)=>{Is(J.id,"overview",ge)},onOpenLogs:(J,ge,je)=>{Is(J,"terminal",je,ge)},onOpenCode:(J,ge)=>{const je=ue.find($e=>$e.id===J);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(J,ge,je,$e)=>oc(J,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const J=Ms(n,u,Dn);C.current.delete(J),E.current.add(J)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:J=>{N.current[Ms(n,u,Dn)]=J,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(J,ge,je,$e)=>hi(Dn,()=>oc(J,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:J=>{rr.current.set(Ms(n,u,Dn),J),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(J=>J.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(J,ge,je,$e,Me)=>hi(Qr,()=>oc(J,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(J,ge,je,$e,Me)=>hi(be,()=>Au(J,be.sessionId,ge,je,$e,Me)),onOpenRun:(J,ge)=>hi(be,()=>Oa(J,ge)),runExperimentName:ac,onOpenExperiment:(J,ge)=>hi(be,()=>ju(J,ge)),experimentName:sf,onOpenSubagent:(J,ge,je)=>hi(be,()=>lc(be.sessionId,J,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:J=>df(Oe,{view:J}),onToggledChange:J=>df(Oe,{toggled:J}),onOpenFile:(J,ge,je,$e)=>hi(Oe,()=>oc(J,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:H,parentExperiment:ue.find(J=>J.id===_r.parentExperimentId)??null,onOpenView:(J,ge,je)=>{hi(Bs,()=>Is(_r.id,J,je,ge))},onOpenCode:(J,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,J,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(J,ge)=>{Kr(!1),k_(J,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const j5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=j5.useParams(),{pane:n}=j5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>ub}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>ub}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>ub}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=j5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=ub._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); diff --git a/ui/dist/index.html b/ui/dist/index.html index b8703ea63..3550f41cb 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/src/components/NewProjectForm.tsx b/ui/src/components/NewProjectForm.tsx index 017087c88..4891e474e 100644 --- a/ui/src/components/NewProjectForm.tsx +++ b/ui/src/components/NewProjectForm.tsx @@ -622,7 +622,7 @@ export function NewProjectForm({ {githubSyncEnabled && ( <> - + - + {m.new_project_form_automatic_topics_include_openresearch_and()} @@ -642,6 +642,7 @@ export function NewProjectForm({ value={githubTopics} onChange={(event) => setGithubTopics(event.target.value)} placeholder={m.new_project_form_extra_topics_comma_separated_e_g_llm()} + aria-label={m.settings_page_repository_topics()} disabled={pending} /> diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index 109d1641b..829968e3d 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -3080,19 +3080,24 @@ function GitTab({ const parseTopicDraft = (raw: string) => raw.split(",").map((topic) => topic.trim()).filter((topic) => topic.length > 0); - const savedTopics = project ? project.githubTopics.join(", ") : ""; + // Compare parsed topics, not raw drafts: ", " and "," spell the same set, so + // spacing alone must not mark the field dirty and trigger a pointless PATCH. + const draftTopics = topicsCustom === null ? null : parseTopicDraft(topicsCustom); + const savedTopics = project?.githubTopics ?? null; const topicsDirty = Boolean( - project && topicsAuto !== null && topicsCustom !== null - && (topicsAuto !== project.githubAutoTopicsEnabled || topicsCustom !== savedTopics), + project && topicsAuto !== null && draftTopics !== null && savedTopics !== null + && (topicsAuto !== project.githubAutoTopicsEnabled + || draftTopics.length !== savedTopics.length + || draftTopics.some((topic, index) => topic !== savedTopics[index])), ); const saveTopics = () => { - if (!project || topicsAuto === null || topicsCustom === null) return; + if (!project || topicsAuto === null || draftTopics === null) return; setTopicsSaving(true); setTopicsError(null); void updateProject(project.id, { githubAutoTopicsEnabled: topicsAuto, - githubTopics: parseTopicDraft(topicsCustom), + githubTopics: draftTopics, }) .then((updated) => { // Re-seed from the server's sanitized values so the field shows what was kept. @@ -3170,7 +3175,7 @@ function GitTab({ setTopicsAuto((current) => !(current ?? false))} /> From 6dac69cc39be21aec88bb5882df5786f5c849e42 Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 13:16:42 +0800 Subject: [PATCH 5/9] Compare topic sets order-insensitively and stop echoing the prompt flag - Skip the topic PUT by comparing the stored and merged sets rather than their order. GitHub need not echo our PUT order back, so the previous check would have re-written topics on every push and burned API calls. - Drop the cached prompt-seen flag from the auto-topics toggle. That handler only owns the auto-topics default, and re-sending a stale flag could undo a one-time prompt another flow had just answered. --- src/local/github.rs | 38 ++++++++++++++++++- .../{index-Dh0e4aL2.js => index-C0T8HXXW.js} | 2 +- ui/dist/index.html | 2 +- ui/src/components/SettingsPage.tsx | 3 +- 4 files changed, 41 insertions(+), 4 deletions(-) rename ui/dist/assets/{index-Dh0e4aL2.js => index-C0T8HXXW.js} (99%) diff --git a/src/local/github.rs b/src/local/github.rs index 6612af67a..4941f6764 100644 --- a/src/local/github.rs +++ b/src/local/github.rs @@ -207,7 +207,7 @@ pub async fn set_repo_topics(owner: &str, repo: &str, topics: &[String]) -> Resu // topics this merge exists to protect. let existing = repo_topics(owner, repo).await?; let merged = merge_topics(&sanitize_topics(topics), &existing); - if merged.is_empty() || merged == existing { + if merged.is_empty() || topics_match(&existing, &merged) { // Never PUT an empty set (it clears the repo) and skip a no-op write. return Ok(()); } @@ -255,6 +255,17 @@ async fn repo_topics(owner: &str, repo: &str) -> Result> { .unwrap_or_default()) } +/// Whether the repository already carries exactly this set of topics. Order is +/// deliberately ignored: GitHub need not echo our PUT order back, and an +/// order-sensitive check would re-PUT on every push. +fn topics_match(current: &[String], next: &[String]) -> bool { + let mut current = sanitize_topics(current); + let mut next = sanitize_topics(next); + current.sort_unstable(); + next.sort_unstable(); + current == next +} + /// GitHub's topic PUT replaces the whole set, so merge instead of overwrite: a /// repository shared by several projects — or one whose owner added topics by /// hand — keeps everything it already had. Desired topics win the cap because @@ -498,6 +509,31 @@ mod tests { ); } + #[test] + fn topic_sets_compare_ignoring_order_and_spacing() { + let stored = vec!["openresearch".to_string(), "paper-repro".to_string()]; + // Same set, different order: GitHub need not echo our PUT order back. + let reordered = vec!["paper-repro".to_string(), "openresearch".to_string()]; + assert!(topics_match(&stored, &reordered)); + + // Normalization-only differences also count as unchanged. + assert!(topics_match( + &stored, + &[" Paper_Repro ".to_string(), "OpenResearch".to_string()] + )); + + // A genuinely different set still writes. + assert!(!topics_match(&stored, &["openresearch".to_string()])); + assert!(!topics_match( + &stored, + &[ + "openresearch".to_string(), + "paper-repro".to_string(), + "llm".to_string() + ] + )); + } + #[test] fn merging_topics_preserves_what_the_repository_already_had() { let desired = vec!["openresearch".to_string(), "paper-repro".to_string()]; diff --git a/ui/dist/assets/index-Dh0e4aL2.js b/ui/dist/assets/index-C0T8HXXW.js similarity index 99% rename from ui/dist/assets/index-Dh0e4aL2.js rename to ui/dist/assets/index-C0T8HXXW.js index cbdf5206f..e18055534 100644 --- a/ui/dist/assets/index-Dh0e4aL2.js +++ b/ui/dist/assets/index-C0T8HXXW.js @@ -993,7 +993,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, `,u+3),p=d===-1?e.length:d;/^[ \t]*$/.test(e.slice(_,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Wr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:s6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(db,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Ew(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Ew(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Wr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Wr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(xv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` `)))return f.jsx("code",{className:s,...r,children:t});const l=i?g3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Wr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const jv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` -`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${jv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${jv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ob(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Jb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Nw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),sb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Nw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Nw(o).variant,children:Nw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Jb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():tb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Jb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Jb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:tb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ey={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],zw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=zw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||zw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),zw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ey[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ey[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ey[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ey[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():tb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:tb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Jb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:C4({name:Ne(e)}),"aria-label":C4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},jw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=jw[n.channel])==null?void 0:d.call(jw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x,r.githubDefaultPromptSeen]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:j4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Vr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(v6()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(()=>m(!1)).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Tw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Tw[e])==null?void 0:n.call(Tw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ib,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Tv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${Tv(e.plugin)}: `:""}${Tv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Aw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${jv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${jv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ob(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Jb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Nw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),sb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Nw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Nw(o).variant,children:Nw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Jb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():tb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Jb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Jb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:tb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ey={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],zw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=zw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||zw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),zw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ey[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ey[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ey[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ey[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():tb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:tb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Jb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:C4({name:Ne(e)}),"aria-label":C4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},jw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=jw[n.channel])==null?void 0:d.call(jw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:j4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Vr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(v6()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(()=>m(!1)).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Tw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Tw[e])==null?void 0:n.call(Tw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ib,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Tv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${Tv(e.plugin)}: `:""}${Tv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Aw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||n5(r).localeCompare(n5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:n5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function r5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(Tv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),Tv(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` `)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const s5=6.5,pA=2*Math.PI*s5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Av="!";function mA(e){return e.startsWith(Av)?e.slice(Av.length).trim():null}function T8t(e){return e.startsWith(Av)?e.slice(Av.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` diff --git a/ui/dist/index.html b/ui/dist/index.html index 3550f41cb..dc96f4f0c 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index 829968e3d..da42bab68 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -2775,10 +2775,11 @@ function ProjectDefaultsTab() { const enabled = !settings.githubAutoTopicsForNewProjects; setSaving(true); setError(null); + // Only the auto-topics default is sent. Echoing the cached prompt-seen flag + // could flip it back if another flow just answered the one-time prompt. void setProjectDefaultsMutation.mutateAsync([ settings.githubForNewProjects, enabled, - settings.githubDefaultPromptSeen, ]) .then(setSettings) .catch((err) => setError(err instanceof Error ? err.message : String(err))) From b9a078888e8362946bcebdd2809239899344fcfc Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 13:22:42 +0800 Subject: [PATCH 6/9] Refresh the cached project defaults after answering the sync prompt The one-time prompt updated the server but left getProjectDefaultsQuery holding the pre-answer values. The settings page and the new-project form both read that cache, so a later toggle would send the stale value back and undo the answer. Write the response into the shared cache instead. --- .../{index-C0T8HXXW.js => index-CFHdEJ5E.js} | 154 +++++++++--------- ui/dist/index.html | 2 +- ui/src/components/SettingsPage.tsx | 8 +- 3 files changed, 85 insertions(+), 79 deletions(-) rename ui/dist/assets/{index-C0T8HXXW.js => index-CFHdEJ5E.js} (94%) diff --git a/ui/dist/assets/index-C0T8HXXW.js b/ui/dist/assets/index-CFHdEJ5E.js similarity index 94% rename from ui/dist/assets/index-C0T8HXXW.js rename to ui/dist/assets/index-CFHdEJ5E.js index e18055534..71a479d9a 100644 --- a/ui/dist/assets/index-C0T8HXXW.js +++ b/ui/dist/assets/index-CFHdEJ5E.js @@ -1,4 +1,4 @@ -var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in e?sG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>iG(e,typeof n!="symbol"?n+"":n,t),r2=(e,n,t)=>n.has(e)||Z8("Cannot "+t);var de=(e,n,t)=>(r2(e,n,"read from private field"),t?t.call(e):n.get(e)),st=(e,n,t)=>n.has(e)?Z8("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(r2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ot=(e,n,t)=>(r2(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return de(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s2={exports:{}},s0={};/** +var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in e?sG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>iG(e,typeof n!="symbol"?n+"":n,t),s2=(e,n,t)=>n.has(e)||Z8("Cannot "+t);var de=(e,n,t)=>(s2(e,n,"read from private field"),t?t.call(e):n.get(e)),st=(e,n,t)=>n.has(e)?Z8("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(s2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ot=(e,n,t)=>(s2(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return de(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i2={exports:{}},s0={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var J8;function aG(){if(J8)return s0;J8=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var e9;function oG(){return e9||(e9=1,s2.exports=aG()),s2.exports}var f=oG(),i2={exports:{}},Xt={};/** + */var J8;function aG(){if(J8)return s0;J8=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var e9;function oG(){return e9||(e9=1,i2.exports=aG()),i2.exports}var f=oG(),a2={exports:{}},Xt={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,W){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,W,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,W,U){var Z=U.ref;return{$$typeof:e,type:F,key:W,ref:Z!==void 0?Z:null,props:U}}function O(F,W){return M(F.type,W,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var W={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(U){return W[U]})}var H=/\/+/g;function q(F,W){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):W.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(W){F.status==="pending"&&(F.status="fulfilled",F.value=W)},function(W){F.status==="pending"&&(F.status="rejected",F.reason=W)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function G(F,W,U,Z,ce){var re=typeof F;(re==="undefined"||re==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,G(ne(F._payload),W,U,Z,ce)}}if(ne)return ce=ce(F),ne=Z===""?"."+q(F,0):Z,E(ce)?(U="",ne!=null&&(U=ne.replace(H,"$&/")+"/"),G(ce,W,U,"",function(oe){return oe})):ce!=null&&(B(ce)&&(ce=O(ce,U+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+ne)),W.push(ce)),1;ne=0;var Q=Z===""?".":Z+":";if(E(F))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,T5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,T5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return de(this,Qc).setTimeout(e,n)}clearTimeout(e){de(this,Qc).clearTimeout(e)}setInterval(e,n){return de(this,Qc).setInterval(e,n)}clearInterval(e){de(this,Qc).clearInterval(e)}},Qc=new WeakMap,T5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==A5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function A5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Zw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Zw(e)&&Zw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Jw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?R5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const M5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===M5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const L5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){de(this,Yc)||this.setEventListener(de(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=de(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){de(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof de(this,ud)=="boolean"?de(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const O5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,Xc)||this.setEventListener(de(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=de(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){de(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return de(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const U1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?U1.isOnline():!0}var G1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof G1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new G1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>O5.isFocused()&&(e.networkMode==="always"||U1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(L5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L5()?1/0:3e5))}clearGcTimeout(){de(this,dd)!==void 0&&(ad.clearTimeout(de(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,de(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??de(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return de(this,wh)}get promise(){var n;return(n=de(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...de(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,wa).remove(this)}setData(n,t){const r=Jw(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=de(this,hs))==null?void 0:r.promise;return(s=de(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return de(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===M5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),de(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(de(this,hs)&&(de(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?de(this,hs).cancel({revert:!0}):de(this,hs).cancelRetry()),this.scheduleGc()),de(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=de(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(de(this,hs))return de(this,hs).continueRetry(),de(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:de(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:de(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=de(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof G1&&E.revert&&this.setState({...de(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=de(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=de(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof G1){if(E.silent)return de(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=de(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=de(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{de(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),de(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,e4,t4,n4,r4,s4,i4,a4,o4,nM,I5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(de(this,Sn).addObserver(this),u9(de(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,s4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return l4(de(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return l4(de(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,i4).call(this),Ot(this,Un,a4).call(this),de(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=de(this,Sn);if(this.options=de(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,de(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,o4).call(this),de(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&de(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:de(this,Sn),observer:this});const s=this.hasListeners();s&&d9(de(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||$r(this.options.staleTime,de(this,Sn))!==$r(t.staleTime,de(this,Sn)))&&Ot(this,Un,t4).call(this);const i=Ot(this,Un,n4).call(this);s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||i!==de(this,Zc))&&Ot(this,Un,r4).call(this,i)}getOptimisticResult(n){const t=de(this,ni).getQueryCache().build(de(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,de(this,Sn).state)),r}getCurrentResult(){return de(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){de(this,Nh).add(n)}getCurrentQuery(){return de(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=de(this,ni).defaultQueryOptions(n),r=de(this,ni).getQueryCache().build(de(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=de(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),de(this,ri)))}createResult(n,t){var N;const r=de(this,Sn),s=this.options,i=de(this,ri),a=de(this,pd),o=de(this,kh),l=n!==r?n.state:de(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=de(this,Eh))==null?void 0:N.state.data,de(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=Jw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===de(this,Dp))p=de(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=Jw(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);de(this,zl)&&(m=de(this,zl),p=de(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:B5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=de(this,ri),t=this.createResult(de(this,Sn),this.options);if(Fe(this,pd,de(this,Sn).state),Fe(this,kh,this.options),de(this,pd).data!==void 0&&Fe(this,Eh,de(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!de(this,Nh).size)return!0;const o=new Set(a??de(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(de(this,ri)).some(l=>{const u=l;return de(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(de(this,ri))}),de(this,ni).getQueryCache().notify({query:de(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,s4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,o4).call(this);let t=de(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},e4=function(n){return!L5()&&$r(this.options.enabled,de(this,Sn))!==!1&&uM(n)},t4=function(){Ot(this,Un,i4).call(this);const n=$r(this.options.staleTime,de(this,Sn));if(de(this,ri).isStale||!Ot(this,Un,e4).call(this,n))return;const t=dM(de(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{de(this,ri).isStale||this.updateResult()},t))},n4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(de(this,Sn)):this.options.refetchInterval)??!1},r4=function(n){Ot(this,Un,a4).call(this),Fe(this,Zc,n),!(de(this,Zc)===0||!Ot(this,Un,e4).call(this,de(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||O5.isFocused())&&Ot(this,Un,S0).call(this)},de(this,Zc)))},s4=function(){Ot(this,Un,t4).call(this),Ot(this,Un,r4).call(this,Ot(this,Un,n4).call(this))},i4=function(){de(this,md)!==void 0&&(ad.clearTimeout(de(this,md)),Fe(this,md,void 0))},a4=function(){de(this,gd)!==void 0&&(ad.clearInterval(de(this,gd)),Fe(this,gd,void 0))},o4=function(){const n=de(this,ni).getQueryCache().build(de(this,ni),this.options);if(n===de(this,Sn))return;const t=de(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&l4(e,n,n.refetchOnMount)}function l4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&B5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&B5(e,t)}function B5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){de(this,Eo).includes(n)||(de(this,Eo).push(n),this.clearGcTimeout(),de(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,de(this,Eo).filter(t=>t!==n)),this.scheduleGc(),de(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){de(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():de(this,qs).remove(this))}continue(){var n;return((n=de(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:de(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),de(this,qs).config.onMutate&&await de(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=de(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=de(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=de(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=de(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{de(this,vd)===s&&Fe(this,vd,void 0),de(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{de(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),de(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){de(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);r?r.push(n):de(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(de(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&de(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{de(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),de(this,jl).clear(),de(this,qa).clear()})}getAll(){return Array.from(de(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,c4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=de(this,Tl).defaultMutationOptions(t),A0(this.options,r)||de(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:de(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=de(this,Us))==null?void 0:s.state.status)==="pending"&&de(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&de(this,Us)&&(de(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=de(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,c4).call(this,t)}getCurrentResult(){return de(this,Jc)}reset(){var t;(t=de(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,c4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=de(this,Us))==null||s.removeObserver(this),Fe(this,Us,de(this,Tl).getMutationCache().build(de(this,Tl),this.options)),de(this,Us).addObserver(this),de(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=de(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},c4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(de(this,Al)&&this.hasListeners()){const d=de(this,Jc).variables,p=de(this,Jc).context,m={client:de(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=de(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=de(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=de(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=de(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(de(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,u4,d4,vM,f4,h4,_4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&de(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,h4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,de(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=de(this,Fi),s=Ot(this,ms,f4).call(this,de(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=de(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,h4).call(this,d,p)})})),Ot(this,ms,_4).call(this)))})}getCurrentResult(){return de(this,si)}getQueries(){return de(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return de(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,f4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,d4).call(this,a??s,t,i),()=>Ot(this,ms,u4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,u4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},d4=function(n,t,r){if(t){const s=de(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(de(this,si)!==de(this,Bp)||i||t!==de(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,de(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,R5(de(this,yd),t(n)))),de(this,yd)}return n},vM=function(){var n;return!((n=de(this,bd))!=null&&n.combine)||de(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=de(this,si)[r])==null?void 0:s.data)===void 0})},f4=function(n){const t=new Map;de(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=de(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new I5(de(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},h4=function(n,t){const r=de(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,de(this,si).slice()),de(this,si)[r]=t,Ot(this,ms,_4).call(this))},_4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=de(this,yd),s=t?r:Ot(this,ms,d4).call(this,Ot(this,ms,u4).call(this,de(this,si),de(this,Pp)),(n=de(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(de(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??A5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){de(this,zo).has(n.queryHash)||(de(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=de(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&de(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return de(this,zo).get(n)}getAll(){return[...de(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,de(this,nu)===1&&(Fe(this,Rh,O5.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onFocus())})),Fe(this,Mh,U1.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,de(this,nu)===0&&((e=de(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=de(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return de(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return de(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=de(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return de(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=de(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return de(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>de(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=de(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=de(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>de(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(de(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>de(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return U1.isOnline()?de(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,zr)}getMutationCache(){return de(this,eu)}getDefaultOptions(){return de(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){de(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...de(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){de(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...de(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...de(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=A5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===M5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...de(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){de(this,zr).clear(),de(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?D5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||D5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},p4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>p4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&p4(b,S)){const w=new I5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),p4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,I5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&D5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Wv=0;const m4=new Set,HG=()=>Wv,_9=e=>(m4.add(e),()=>{m4.delete(e)}),za=()=>["workspace",Wv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Wv++,du.clear(),$5({queryKey:t}),m4.forEach(r=>r()),!0}const Fn=e=>e[1]===Wv;async function $5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Vr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var a2={exports:{}},i0={},o2={exports:{}},l2={};/** + */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,W){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,W,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,W,U){var Z=U.ref;return{$$typeof:e,type:F,key:W,ref:Z!==void 0?Z:null,props:U}}function O(F,W){return M(F.type,W,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var W={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(U){return W[U]})}var H=/\/+/g;function q(F,W){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):W.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(W){F.status==="pending"&&(F.status="fulfilled",F.value=W)},function(W){F.status==="pending"&&(F.status="rejected",F.reason=W)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function G(F,W,U,Z,ce){var re=typeof F;(re==="undefined"||re==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,G(ne(F._payload),W,U,Z,ce)}}if(ne)return ce=ce(F),ne=Z===""?"."+q(F,0):Z,E(ce)?(U="",ne!=null&&(U=ne.replace(H,"$&/")+"/"),G(ce,W,U,"",function(oe){return oe})):ce!=null&&(B(ce)&&(ce=O(ce,U+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+ne)),W.push(ce)),1;ne=0;var Q=Z===""?".":Z+":";if(E(F))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,A5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,A5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return de(this,Qc).setTimeout(e,n)}clearTimeout(e){de(this,Qc).clearTimeout(e)}setInterval(e,n){return de(this,Qc).setInterval(e,n)}clearInterval(e){de(this,Qc).clearInterval(e)}},Qc=new WeakMap,A5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==R5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function R5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Jw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Jw(e)&&Jw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function e4(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?M5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const D5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===D5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function L5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const O5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){de(this,Yc)||this.setEventListener(de(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=de(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){de(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof de(this,ud)=="boolean"?de(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const I5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,Xc)||this.setEventListener(de(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=de(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){de(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return de(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const U1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?U1.isOnline():!0}var G1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof G1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new G1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>I5.isFocused()&&(e.networkMode==="always"||U1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(O5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(O5()?1/0:3e5))}clearGcTimeout(){de(this,dd)!==void 0&&(ad.clearTimeout(de(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,de(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??de(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return de(this,wh)}get promise(){var n;return(n=de(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...de(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,wa).remove(this)}setData(n,t){const r=e4(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=de(this,hs))==null?void 0:r.promise;return(s=de(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return de(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),de(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(de(this,hs)&&(de(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?de(this,hs).cancel({revert:!0}):de(this,hs).cancelRetry()),this.scheduleGc()),de(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=de(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(de(this,hs))return de(this,hs).continueRetry(),de(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:de(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:de(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=de(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof G1&&E.revert&&this.setState({...de(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=de(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=de(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof G1){if(E.silent)return de(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=de(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=de(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{de(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),de(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,t4,n4,r4,s4,i4,a4,o4,l4,nM,B5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(de(this,Sn).addObserver(this),u9(de(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,i4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c4(de(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c4(de(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,a4).call(this),Ot(this,Un,o4).call(this),de(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=de(this,Sn);if(this.options=de(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,de(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,l4).call(this),de(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&de(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:de(this,Sn),observer:this});const s=this.hasListeners();s&&d9(de(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||$r(this.options.staleTime,de(this,Sn))!==$r(t.staleTime,de(this,Sn)))&&Ot(this,Un,n4).call(this);const i=Ot(this,Un,r4).call(this);s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||i!==de(this,Zc))&&Ot(this,Un,s4).call(this,i)}getOptimisticResult(n){const t=de(this,ni).getQueryCache().build(de(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,de(this,Sn).state)),r}getCurrentResult(){return de(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){de(this,Nh).add(n)}getCurrentQuery(){return de(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=de(this,ni).defaultQueryOptions(n),r=de(this,ni).getQueryCache().build(de(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=de(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),de(this,ri)))}createResult(n,t){var N;const r=de(this,Sn),s=this.options,i=de(this,ri),a=de(this,pd),o=de(this,kh),l=n!==r?n.state:de(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=de(this,Eh))==null?void 0:N.state.data,de(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=e4(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===de(this,Dp))p=de(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=e4(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);de(this,zl)&&(m=de(this,zl),p=de(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:$5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=de(this,ri),t=this.createResult(de(this,Sn),this.options);if(Fe(this,pd,de(this,Sn).state),Fe(this,kh,this.options),de(this,pd).data!==void 0&&Fe(this,Eh,de(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!de(this,Nh).size)return!0;const o=new Set(a??de(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(de(this,ri)).some(l=>{const u=l;return de(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(de(this,ri))}),de(this,ni).getQueryCache().notify({query:de(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,i4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,l4).call(this);let t=de(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},t4=function(n){return!O5()&&$r(this.options.enabled,de(this,Sn))!==!1&&uM(n)},n4=function(){Ot(this,Un,a4).call(this);const n=$r(this.options.staleTime,de(this,Sn));if(de(this,ri).isStale||!Ot(this,Un,t4).call(this,n))return;const t=dM(de(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{de(this,ri).isStale||this.updateResult()},t))},r4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(de(this,Sn)):this.options.refetchInterval)??!1},s4=function(n){Ot(this,Un,o4).call(this),Fe(this,Zc,n),!(de(this,Zc)===0||!Ot(this,Un,t4).call(this,de(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||I5.isFocused())&&Ot(this,Un,S0).call(this)},de(this,Zc)))},i4=function(){Ot(this,Un,n4).call(this),Ot(this,Un,s4).call(this,Ot(this,Un,r4).call(this))},a4=function(){de(this,md)!==void 0&&(ad.clearTimeout(de(this,md)),Fe(this,md,void 0))},o4=function(){de(this,gd)!==void 0&&(ad.clearInterval(de(this,gd)),Fe(this,gd,void 0))},l4=function(){const n=de(this,ni).getQueryCache().build(de(this,ni),this.options);if(n===de(this,Sn))return;const t=de(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&c4(e,n,n.refetchOnMount)}function c4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&$5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&$5(e,t)}function $5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){de(this,Eo).includes(n)||(de(this,Eo).push(n),this.clearGcTimeout(),de(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,de(this,Eo).filter(t=>t!==n)),this.scheduleGc(),de(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){de(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():de(this,qs).remove(this))}continue(){var n;return((n=de(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:de(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),de(this,qs).config.onMutate&&await de(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=de(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=de(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=de(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=de(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{de(this,vd)===s&&Fe(this,vd,void 0),de(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{de(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),de(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){de(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);r?r.push(n):de(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(de(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&de(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{de(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),de(this,jl).clear(),de(this,qa).clear()})}getAll(){return Array.from(de(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,u4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=de(this,Tl).defaultMutationOptions(t),A0(this.options,r)||de(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:de(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=de(this,Us))==null?void 0:s.state.status)==="pending"&&de(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&de(this,Us)&&(de(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=de(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,u4).call(this,t)}getCurrentResult(){return de(this,Jc)}reset(){var t;(t=de(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,u4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=de(this,Us))==null||s.removeObserver(this),Fe(this,Us,de(this,Tl).getMutationCache().build(de(this,Tl),this.options)),de(this,Us).addObserver(this),de(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=de(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},u4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(de(this,Al)&&this.hasListeners()){const d=de(this,Jc).variables,p=de(this,Jc).context,m={client:de(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=de(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=de(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=de(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=de(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(de(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,d4,f4,vM,h4,_4,p4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&de(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,_4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,de(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=de(this,Fi),s=Ot(this,ms,h4).call(this,de(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=de(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,_4).call(this,d,p)})})),Ot(this,ms,p4).call(this)))})}getCurrentResult(){return de(this,si)}getQueries(){return de(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return de(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,h4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,f4).call(this,a??s,t,i),()=>Ot(this,ms,d4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,d4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},f4=function(n,t,r){if(t){const s=de(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(de(this,si)!==de(this,Bp)||i||t!==de(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,de(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,M5(de(this,yd),t(n)))),de(this,yd)}return n},vM=function(){var n;return!((n=de(this,bd))!=null&&n.combine)||de(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=de(this,si)[r])==null?void 0:s.data)===void 0})},h4=function(n){const t=new Map;de(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=de(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new B5(de(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},_4=function(n,t){const r=de(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,de(this,si).slice()),de(this,si)[r]=t,Ot(this,ms,p4).call(this))},p4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=de(this,yd),s=t?r:Ot(this,ms,f4).call(this,Ot(this,ms,d4).call(this,de(this,si),de(this,Pp)),(n=de(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(de(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??R5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){de(this,zo).has(n.queryHash)||(de(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=de(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&de(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return de(this,zo).get(n)}getAll(){return[...de(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,de(this,nu)===1&&(Fe(this,Rh,I5.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onFocus())})),Fe(this,Mh,U1.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,de(this,nu)===0&&((e=de(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=de(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return de(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return de(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=de(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return de(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=de(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return de(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>de(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=de(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=de(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>de(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(de(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>de(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return U1.isOnline()?de(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,zr)}getMutationCache(){return de(this,eu)}getDefaultOptions(){return de(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){de(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...de(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){de(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...de(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...de(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=R5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===D5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...de(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){de(this,zr).clear(),de(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?L5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||L5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},m4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>m4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&m4(b,S)){const w=new B5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),m4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,B5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&L5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Vv=0;const g4=new Set,HG=()=>Vv,_9=e=>(g4.add(e),()=>{g4.delete(e)}),za=()=>["workspace",Vv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Vv++,du.clear(),P5({queryKey:t}),g4.forEach(r=>r()),!0}const Fn=e=>e[1]===Vv;async function P5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Pr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var o2={exports:{}},i0={},l2={exports:{}},c2={};/** * @license React * scheduler.production.js * @@ -22,7 +22,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var te=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(U,te))Zs(ce,U)?(G[I]=ce,G[Z]=te,I=Z):(G[I]=U,G[W]=te,I=W);else if(Zs(ce,te))G[I]=ce,G[Z]=te,I=Z;else break e}}return X}function s(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-G),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=B,$=function(){q.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=te,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var te=p;p=X;try{return G.apply(this,arguments)}finally{p=te}}}})(l2)),l2}var m9;function GG(){return m9||(m9=1,o2.exports=UG()),o2.exports}var c2={exports:{}},Hs={};/** + */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var te=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(U,te))Zs(ce,U)?(G[I]=ce,G[Z]=te,I=Z):(G[I]=U,G[W]=te,I=W);else if(Zs(ce,te))G[I]=ce,G[Z]=te,I=Z;else break e}}return X}function s(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-G),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=B,$=function(){q.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=te,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var te=p;p=X;try{return G.apply(this,arguments)}finally{p=te}}}})(c2)),c2}var m9;function GG(){return m9||(m9=1,l2.exports=UG()),l2.exports}var u2={exports:{}},Hs={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var g9;function WG(){if(g9)return Hs;g9=1;var e=Vp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),c2.exports=WG(),c2.exports}/** + */var g9;function WG(){if(g9)return Hs;g9=1;var e=Vp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),u2.exports=WG(),u2.exports}/** * @license React * react-dom-client.production.js * @@ -45,8 +45,8 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in `);for(A=k=0;k<_e.length&&!_e[k].includes("DetermineComponentFrameRoot");)k++;for(;AA||_e[k]!==Ce[A]){var De=` `+_e[k].replace(" at new "," at ");return c.displayName&&De.includes("")&&(De=De.replace("",c.displayName)),De}while(1<=k&&0<=A);break}}}finally{qe=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?ye(g):""}function Te(c,h){switch(c.tag){case 26:case 27:case 5:return ye(c.type);case 16:return ye("Lazy");case 13:return c.child!==h&&h!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ie(c.type,!1);case 11:return Ie(c.type.render,!1);case 1:return Ie(c.type,!0);case 31:return ye("Activity");default:return""}}function vt(c){try{var h="",g=null;do h+=Te(c,g),g=c,c=c.return;while(c);return h}catch(k){return` Error generating stack: `+k.message+` -`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Pr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=xy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=yy(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function My(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dy(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Ly(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Oy=!1;function R_(){if(Oy){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Oy=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Oy=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,tx(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function Jy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,te,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function ex(){return Ts(J_)}function Q7(){return qr().memoizedState}function Y7(){return qr().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:jy()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=vy(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=vy(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function tx(c,h,g,k){if(k={lane:2,revertLane:Mx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=vy(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Ky(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Xy,useDeferredValue:function(c,h){var g=ei();return Zy(g,c,h)},useTransition:function(){var c=Ky(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),px(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=Cy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=Cy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Ix(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(Hr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return U(Hr,Hr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=Hr.current,U(Hr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),By(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(Sy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ue(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(Hr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),By(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(Sy(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ue(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(Hr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),By(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function mx(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function gx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function vx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Fr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(vx(c,h,g),c=c.sibling;c!==null;)vx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,bx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,Px=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Fx={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Ex,Ex=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=ix(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function Tx(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(wx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):Sx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Ax=!1,sg=!1,Rx=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Ax||(Ax=!0,bU())}function V_(c,h){if(!Rx&&sg){Rx=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Rx=!1}}function vU(){c8()}function c8(){sg=Ax=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Pr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Pr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Pr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Pr(g.imageSizes)+'"]')):A+='[href="'+Pr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Pr(k)+'"][href="'+Pr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Kx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Qx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Qx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Pr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Pr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Pr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Kx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Qx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Kx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Yx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Yx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),a2.exports=VG(),a2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(W1(e)&&W1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function V1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Vv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Vv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=K1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=F5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Vv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),F5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=F5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Vv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&P5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:K1(1e3),matchCache:K1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function F5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function Q1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return Q1(e,t)===Q1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function u2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function g4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=g4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=g4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=g4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function d2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=d2(s):Array.isArray(i)?i.push(d2(s)):t[r]=[i,d2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=v4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function v4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Y1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=H5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Y1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=H5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),H=!!v;H||(_=u),u=Y1(O,B),v=[$,B,(v==null?void 0:v[2])||M],H||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,H=!B&&!$||d;d=!1;const q=H?"GO":$?"BACK":"FORWARD",Y=H?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:q})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const H=$.enableBeforeUnload??!0;if(H===!0){O=!0;break}if(typeof H=="function"&&H()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Y1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=H5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function H5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Kv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=K1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=v4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Y1(i.href,{});i={...i,to:v4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,H]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!H||H.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(V1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Kv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&V1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function b4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=b4(e,"component");let r=b4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?b4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function q5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Qv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function U5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:V5(e,n,t,U5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=V5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function G5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=G5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=G5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function W5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?U5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],V5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Qv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,H;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const q=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=q&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(q){o.invalid=!0,Ml(e,o),m=R0(e,n,l,q,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const q=o._flight;o._flight=w,(H=G5(e,o,q))==null||H.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(q=>(E&&(B9(o,q,u),q[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),q)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},q=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,q,i)]).then(q=>j.then(Y=>(E&&!q&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),q)));if(r.push([t,j,M]),!y)return j.then(q=>$9(o,q));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(q=>(o.isFetching=!1,B9(O,q,!1),q));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(q=>$9(O,q))}async function y4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function V5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:U5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Qv?y4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await y4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Qv){const w=await y4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:q5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function x4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>x4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!q5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=q5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));W5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Kv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Kv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});W5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>x4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&x4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),W5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||P5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},K5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Yv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const w4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){w4[S4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,Z1(e))}});let Eg=0,S4=0,Co,k4=0;function dV(e){try{++k4,e()}finally{--k4||YM()}}function Z1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(k4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),Z1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,Z1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,Z1(this)}};return n(),t}var f2={exports:{}},h2={},_2={exports:{}},p2={};/** +`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Fr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=wy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=xy(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function Dy(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ly(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Oy(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Iy=!1;function R_(){if(Iy){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Iy=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Iy=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,nx(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function ex(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,te,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function tx(){return Ts(J_)}function Q7(){return Ur().memoizedState}function Y7(){return Ur().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:Ty()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=by(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=by(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function nx(c,h,g,k){if(k={lane:2,revertLane:Dx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=by(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Qy(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Zy,useDeferredValue:function(c,h){var g=ei();return Jy(g,c,h)},useTransition:function(){var c=Qy(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),mx(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=Ey(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=Ey(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Bx(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(qr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return U(qr,qr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=qr.current,U(qr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),$y(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(ky(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ue(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(qr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),$y(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(ky(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ue(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(qr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),$y(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function gx(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function vx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function bx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Hr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(bx(c,h,g),c=c.sibling;c!==null;)bx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,yx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,Fx=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Hx={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Nx,Nx=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=ax(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function Ax(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(Sx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):kx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Rx=!1,sg=!1,Mx=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Rx||(Rx=!0,bU())}function V_(c,h){if(!Mx&&sg){Mx=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Mx=!1}}function vU(){c8()}function c8(){sg=Rx=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Fr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Fr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Fr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Fr(g.imageSizes)+'"]')):A+='[href="'+Fr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Fr(k)+'"][href="'+Fr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Qx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Yx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Yx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Fr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Fr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Fr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Qx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Yx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Qx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Xx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Xx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),o2.exports=VG(),o2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(W1(e)&&W1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function V1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Kv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Kv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=K1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=H5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Kv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),H5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=H5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Kv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&F5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:K1(1e3),matchCache:K1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function H5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function Q1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return Q1(e,t)===Q1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function d2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function v4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=v4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=v4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=v4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function f2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=f2(s):Array.isArray(i)?i.push(f2(s)):t[r]=[i,f2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=b4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function b4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Y1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=q5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Y1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=q5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),H=!!v;H||(_=u),u=Y1(O,B),v=[$,B,(v==null?void 0:v[2])||M],H||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,H=!B&&!$||d;d=!1;const q=H?"GO":$?"BACK":"FORWARD",Y=H?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:q})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const H=$.enableBeforeUnload??!0;if(H===!0){O=!0;break}if(typeof H=="function"&&H()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Y1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=q5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function q5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Qv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=K1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=b4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Y1(i.href,{});i={...i,to:b4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,H]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!H||H.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(V1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Qv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&V1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function y4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=y4(e,"component");let r=y4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?y4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function U5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Yv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function G5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:K5(e,n,t,G5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=K5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function W5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=W5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=W5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function V5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?G5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],K5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Yv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,H;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const q=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=q&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(q){o.invalid=!0,Ml(e,o),m=R0(e,n,l,q,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const q=o._flight;o._flight=w,(H=W5(e,o,q))==null||H.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(q=>(E&&(B9(o,q,u),q[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),q)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},q=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,q,i)]).then(q=>j.then(Y=>(E&&!q&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),q)));if(r.push([t,j,M]),!y)return j.then(q=>$9(o,q));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(q=>(o.isFetching=!1,B9(O,q,!1),q));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(q=>$9(O,q))}async function x4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function K5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:G5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Yv?x4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await x4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Yv){const w=await x4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:U5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function w4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>w4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!U5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=U5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));V5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Qv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Qv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});V5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>w4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&w4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),V5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||F5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},Q5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Xv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const S4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){S4[k4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,Z1(e))}});let Eg=0,k4=0,Co,C4=0;function dV(e){try{++C4,e()}finally{--C4||YM()}}function Z1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(C4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),Z1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,Z1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,Z1(this)}};return n(),t}var h2={exports:{}},_2={},p2={exports:{}},m2={};/** * @license React * use-sync-external-store-shim.production.js * @@ -54,7 +54,7 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var G9;function hV(){if(G9)return p2;G9=1;var e=Vp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return p2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,p2}var W9;function _V(){return W9||(W9=1,_2.exports=hV()),_2.exports}/** + */var G9;function hV(){if(G9)return m2;G9=1;var e=Vp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return m2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,m2}var W9;function _V(){return W9||(W9=1,p2.exports=hV()),p2.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -62,13 +62,13 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var V9;function pV(){if(V9)return h2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return h2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},h2}var K9;function mV(){return K9||(K9=1,f2.exports=pV()),f2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Q5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Yv),r=e.from??t,s=n.stores.getMatchStore(r),i=Q5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&P5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Xv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Y5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function m2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return V1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),V1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=Q1(e.pathname,r),o=Q1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:H,hash:q,state:Y,mask:G,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,W=VM(),U=m2(e.search),Z=m2(e.params),ce=m2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,U,Z,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,ce,t.basepath,W,we!==void 0)]},[ce,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ue=oe?Bh(s,{})??SV:g2,pe=oe?g2:Bh(i,{})??g2,Se=[C,ue.className,pe.className].filter(Boolean).join(" "),ye=(y||ue.style||pe.style)&&{...y,...ue.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){v2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&v2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&v2(r)};return{...F,...ue,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var g2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,v2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Zv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Xv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Zv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Y5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Xv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Zv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(K5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function Jv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Jv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?K5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Yv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Jv(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Yv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:Jv(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Kv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=Jv(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Yv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(K5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Q5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Q5(e,n))}const J1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))J1.set(s,(J1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?J1.get(s):void 0,a=await t();if(!s||J1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],X5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...X5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...X5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function eb(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])$5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])eb(r.id);$5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",Z5=["en","zh-CN","fa"],cD="orx:locale",J5=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=J5;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&ev.has(r)){const i=ev.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=J5;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&ev.has(l)){const u=ev.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of Z5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&Z5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${Z5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:J5}const ev=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,C4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,tv=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,b2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",y2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,x2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",nv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",E4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,e6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? + */var V9;function pV(){if(V9)return _2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return _2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},_2}var K9;function mV(){return K9||(K9=1,h2.exports=pV()),h2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Y5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Xv),r=e.from??t,s=n.stores.getMatchStore(r),i=Y5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&F5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Zv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function X5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function g2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return V1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),V1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=Q1(e.pathname,r),o=Q1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:H,hash:q,state:Y,mask:G,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,W=VM(),U=g2(e.search),Z=g2(e.params),ce=g2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,U,Z,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,ce,t.basepath,W,we!==void 0)]},[ce,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ue=oe?Bh(s,{})??SV:v2,pe=oe?v2:Bh(i,{})??v2,Se=[C,ue.className,pe.className].filter(Boolean).join(" "),ye=(y||ue.style||pe.style)&&{...y,...ue.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){b2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&b2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&b2(r)};return{...F,...ue,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var v2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,b2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Jv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>X5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Zv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Jv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>X5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Zv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Jv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(Q5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function eb(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=eb(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?Q5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Xv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return eb(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Xv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:eb(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Qv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=eb(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Xv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(Q5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Y5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Y5(e,n))}const J1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))J1.set(s,(J1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?J1.get(s):void 0,a=await t();if(!s||J1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],Z5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...Z5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...Z5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function tb(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])P5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])tb(r.id);P5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",J5=["en","zh-CN","fa"],cD="orx:locale",e6=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=e6;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&ev.has(r)){const i=ev.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=e6;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&ev.has(l)){const u=ev.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of J5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&J5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${J5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:e6}const ev=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,E4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,tv=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,y2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",x2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,w2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",nv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",N4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,t6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? Its transcript will be permanently removed.`,Vie=e=>`删除“${e==null?void 0:e.title}”? 其对话记录将被永久移除。`,Kie=e=>`«${e==null?void 0:e.title}» حذف شود؟ -رونوشت آن برای همیشه حذف خواهد شد.`,Qie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Xie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Zie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Jie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xie(e):t==="fa"?Zie(e):Yie(e)}),eae=()=>"Could not exit Plan mode. Try again.",tae=()=>"无法退出计划模式。请重试。",nae=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",rae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Expand tool activity",iae=()=>"展开工具活动",aae=()=>"باز کردن فعالیت ابزارها",oae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=()=>"experiments",cae=()=>"实验",uae=()=>"آزمایش‌ها",dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cae():t==="fa"?uae():lae()}),fae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,hae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,_ae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,pae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,gae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,vae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,bae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=e=>`Message not sent: ${e==null?void 0:e.error}`,xae=e=>`消息未发送:${e==null?void 0:e.error}`,wae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,Sae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xae(e):t==="fa"?wae(e):yae(e)}),kae=()=>"Model unavailable",Cae=()=>"模型不可用",Eae=()=>"مدل در دسترس نیست",Nae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),zae=()=>"New session",jae=()=>"新会话",Tae=()=>"نشست جدید",hE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jae():t==="fa"?Tae():zae()}),Aae=()=>"No active sessions",Rae=()=>"没有活跃会话",Mae=()=>"نشست فعالی وجود ندارد",Dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No activity",Oae=()=>"无活动",Iae=()=>"بدون فعالیت",Bae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No archived sessions",Pae=()=>"没有已归档的会话",Fae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"No sessions yet",Uae=()=>"还没有会话",Gae=()=>"هنوز نشستی وجود ندارد",Wae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"1 annotation",Kae=()=>"1 条批注",Qae=()=>"۱ یادداشت",Yae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"Open sub-agent transcript",Zae=()=>"打开子智能体记录",Jae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",eoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),toe=()=>"About this demo",noe=()=>"关于此演示",roe=()=>"دربارهٔ این نسخهٔ نمایشی",_E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?noe():t==="fa"?roe():toe()}),soe=()=>"Accept and auto mode",ioe=()=>"接受并使用自动模式",aoe=()=>"پذیرش و حالت خودکار",ooe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Accept and bypass all",coe=()=>"接受并跳过所有审批",uoe=()=>"پذیرش و عبور از همهٔ تأییدها",doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"Active",hoe=()=>"活跃",_oe=()=>"فعال",poe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"All",goe=()=>"全部",voe=()=>"همه",boe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Allow",xoe=()=>"允许",woe=()=>"اجازه دادن",Soe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Approval required",Coe=()=>"需要批准",Eoe=()=>"نیازمند تأیید",Noe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Archived",joe=()=>"已归档",Toe=()=>"بایگانی‌شده",pE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Aoe=()=>"Ask about this",Roe=()=>"询问此内容",Moe=()=>"دربارهٔ این بپرسید",Doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Loe=()=>"Attach a PDF or image",Ooe=()=>"附加 PDF 或图片",Ioe=()=>"پیوست PDF یا تصویر",mE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),Boe=()=>"Bash",$oe=()=>"Bash",Poe=()=>"Bash",xD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$oe():t==="fa"?Poe():Boe()}),Foe=()=>"Browsed the web",Hoe=()=>"已浏览网页",qoe=()=>"وب مرور شد",gE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hoe():t==="fa"?qoe():Foe()}),Uoe=()=>"Built the project",Goe=()=>"已构建项目",Woe=()=>"پروژه ساخته شد",Voe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancel",Qoe=()=>"取消",Yoe=()=>"لغو",Xoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Cancelled an experiment run",Joe=()=>"已取消实验运行",ele=()=>"اجرای آزمایش لغو شد",tle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked code style",rle=()=>"已检查代码风格",sle=()=>"سبک کد بررسی شد",ile=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked compute options",ole=()=>"已检查算力选项",lle=()=>"گزینه‌های رایانشی بررسی شد",cle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=()=>"Checked experiment status",dle=()=>"已检查实验状态",fle=()=>"وضعیت آزمایش بررسی شد",vE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dle():t==="fa"?fle():ule()}),hle=()=>"Checked Git status",_le=()=>"已检查 Git 状态",ple=()=>"وضعیت Git بررسی شد",mle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked local times",vle=()=>"已查询当地时间",ble=()=>"زمان‌های محلی بررسی شد",yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked market data",wle=()=>"已查询市场数据",Sle=()=>"داده‌های بازار بررسی شد",kle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked sports data",Ele=()=>"已查询体育数据",Nle=()=>"داده‌های ورزشی بررسی شد",zle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked the weather",Tle=()=>"已查询天气",Ale=()=>"آب‌وهوا بررسی شد",Rle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Checked types",Dle=()=>"已检查类型",Lle=()=>"نوع‌ها بررسی شد",Ole=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ile=()=>"Clear annotations",Ble=()=>"清除批注",$le=()=>"پاک کردن یادداشت‌ها",bE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Customize",Fle=()=>"自定义",Hle=()=>"سفارشی‌سازی",qle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),Ule=()=>"Data sources",Gle=()=>"数据源",Wle=()=>"منابع داده",w2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gle():t==="fa"?Wle():Ule()}),Vle=()=>"Delegated a task to a new agent",Kle=()=>"已将任务委派给新智能体",Qle=()=>"وظیفه به عامل جدید واگذار شد",Yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Xle=()=>"Delete",Zle=()=>"删除",Jle=()=>"حذف",wD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zle():t==="fa"?Jle():Xle()}),ece=()=>"Deny",tce=()=>"拒绝",nce=()=>"رد کردن",rce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),sce=()=>"Edit and re-send",ice=()=>"编辑并重新发送",ace=()=>"ویرایش و ارسال دوباره",yE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ice():t==="fa"?ace():sce()}),oce=()=>"Edit message",lce=()=>"编辑消息",cce=()=>"ویرایش پیام",uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),dce=()=>"Edited a file",fce=()=>"已编辑文件",hce=()=>"فایل ویرایش شد",xE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fce():t==="fa"?hce():dce()}),_ce=()=>"Exit Bash mode",pce=()=>"退出 Bash 模式",mce=()=>"خروج از حالت Bash",wE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pce():t==="fa"?mce():_ce()}),gce=()=>"Exit Plan mode",vce=()=>"退出计划模式",bce=()=>"خروج از حالت طرح",SE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vce():t==="fa"?bce():gce()}),yce=()=>"Failed:",xce=()=>"失败:",wce=()=>"ناموفق:",t6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xce():t==="fa"?wce():yce()}),Sce=()=>"Filter sessions",kce=()=>"筛选会话",Cce=()=>"فیلتر نشست‌ها",kE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"is unavailable.",Nce=()=>"不可用。",zce=()=>"در دسترس نیست.",jce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Later queued messages will wait until this is retried or removed.",Ace=()=>"后续排队的消息会等待此消息重试或移除。",Rce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Mce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Dce=()=>"Listed files",Lce=()=>"已列出文件",Oce=()=>"فایل‌ها فهرست شد",CE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lce():t==="fa"?Oce():Dce()}),Ice=()=>"Listed project runs",Bce=()=>"已列出项目运行",$ce=()=>"اجراهای پروژه فهرست شد",Pce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Listed projects",Hce=()=>"已列出项目",qce=()=>"پروژه‌ها فهرست شد",Uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"Loading conversation…",Wce=()=>"正在加载对话…",Vce=()=>"در حال بارگیری گفتگو…",Kce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"New Chat",Yce=()=>"新对话",Xce=()=>"گفتگوی جدید",Zce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Jce=()=>"Next version",eue=()=>"下一版本",tue=()=>"نسخهٔ بعدی",EE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),nue=()=>"Open the session this agent spawned",rue=()=>"打开此智能体创建的会话",sue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",iue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Opened web pages",oue=()=>"已打开网页",lue=()=>"صفحه‌های وب باز شد",cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan",due=()=>"计划",fue=()=>"طرح",hue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan approved",pue=()=>"计划已批准",mue=()=>"طرح تأیید شد",gue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan rejected",bue=()=>"计划已拒绝",yue=()=>"طرح رد شد",xue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan resolved",Sue=()=>"计划已处理",kue=()=>"طرح تعیین تکلیف شد",Cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Plan revision requested",Nue=()=>"已请求修改计划",zue=()=>"درخواست بازنگری طرح ثبت شد",jue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),Tue=()=>"Previous version",Aue=()=>"上一版本",Rue=()=>"نسخهٔ قبلی",NE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aue():t==="fa"?Rue():Tue()}),Mue=()=>"Ran a command",Due=()=>"已运行命令",Lue=()=>"فرمان اجرا شد",Oue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Ran tests",Bue=()=>"已运行测试",$ue=()=>"آزمون‌ها اجرا شد",Pue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read a file",Hue=()=>"已读取文件",que=()=>"فایل خوانده شد",Uue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read Git history",Wue=()=>"已读取 Git 历史",Vue=()=>"تاریخچهٔ Git خوانده شد",Kue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Read project details",Yue=()=>"已读取项目详情",Xue=()=>"جزئیات پروژه خوانده شد",Zue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Reject",ede=()=>"拒绝",tde=()=>"رد کردن",nde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove",sde=()=>"移除",ide=()=>"حذف",ade=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove annotation",lde=()=>"移除批注",cde=()=>"حذف یادداشت",ude=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),dde=()=>"Remove file",fde=()=>"移除文件",hde=()=>"حذف فایل",zE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),_de=()=>"Remove image",pde=()=>"移除图片",mde=()=>"حذف تصویر",jE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),gde=()=>"Remove queued message",vde=()=>"移除排队消息",bde=()=>"حذف پیام صف",TE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vde():t==="fa"?bde():gde()}),yde=()=>"Rename",xde=()=>"重命名",wde=()=>"تغییر نام",SD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xde():t==="fa"?wde():yde()}),Sde=()=>"Reviewed code changes",kde=()=>"已审查代码更改",Cde=()=>"تغییرات کد بازبینی شد",Ede=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Nde=()=>"Run",zde=()=>"运行",jde=()=>"اجرا",AE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zde():t==="fa"?jde():Nde()}),Tde=()=>"Selected chat text",Ade=()=>"已选聊天文本",Rde=()=>"متن انتخاب‌شدهٔ گفتگو",Mde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Selected text:",Lde=()=>"已选文本:",Ode=()=>"متن انتخاب‌شده:",Ide=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Send",$de=()=>"发送",Pde=()=>"ارسال",N4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"Session options",Hde=()=>"会话选项",qde=()=>"گزینه‌های نشست",RE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hde():t==="fa"?qde():Fde()}),Ude=()=>"Session title",Gde=()=>"会话标题",Wde=()=>"عنوان نشست",Vde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Kde=()=>"Show sidebar",Qde=()=>"显示侧边栏",Yde=()=>"نمایش نوار کناری",ME=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qde():t==="fa"?Yde():Kde()}),Xde=()=>"Started an experiment run",Zde=()=>"已启动实验运行",Jde=()=>"اجرای آزمایش آغاز شد",efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Reading the project to suggest where to start…",nfe=()=>"正在阅读项目以建议从哪里开始…",rfe=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",sfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Starter prompts",afe=()=>"入门提示",ofe=()=>"پیشنهادهای شروع",lfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),cfe=()=>"Stop",ufe=()=>"停止",dfe=()=>"توقف",DE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ufe():t==="fa"?dfe():cfe()}),ffe=()=>"Submit",hfe=()=>"提交",_fe=()=>"ارسال",pfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Tool failed",gfe=()=>"工具失败",vfe=()=>"ابزار ناموفق بود",bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),yfe=()=>"Used tools",xfe=()=>"已使用工具",wfe=()=>"ابزارها استفاده شد",kD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xfe():t==="fa"?wfe():yfe()}),Sfe=()=>"View full plan",kfe=()=>"查看完整计划",Cfe=()=>"مشاهدهٔ طرح کامل",Efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waited for an experiment run",zfe=()=>"已等待实验运行",jfe=()=>"برای اجرای آزمایش صبر شد",Tfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"Waiting for your input…",Rfe=()=>"正在等待你的输入…",Mfe=()=>"منتظر ورودی شما…",Dfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"What should we research?",Ofe=()=>"我们应该研究什么?",Ife=()=>"چه چیزی را پژوهش کنیم؟",Bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"You, mid-task",Pfe=()=>"你(任务进行中)",Ffe=()=>"شما، هنگام انجام وظیفه",Hfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Pasted image",Ufe=()=>"粘贴的图片",Gfe=()=>"تصویر جای‌گذاری‌شده",Wfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Vfe=()=>"Plan",Kfe=()=>"计划",Qfe=()=>"طرح",CD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kfe():t==="fa"?Qfe():Vfe()}),Yfe=()=>"Plan mode — ready to proceed?",Xfe=()=>"计划模式 — 准备好继续了吗?",Zfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Jfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),ehe=()=>"Proposed plan",the=()=>"提议的计划",nhe=()=>"طرح پیشنهادی",LE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),rhe=()=>"Question",she=()=>"问题",ihe=()=>"پرسش",ahe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Queued",lhe=()=>"已排队",che=()=>"در صف",uhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),dhe=()=>"Recents",fhe=()=>"最近",hhe=()=>"اخیر",ED=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fhe():t==="fa"?hhe():dhe()}),_he=()=>"Re-check its setup.",phe=()=>"请重新检查其设置。",mhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",ghe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not recover this turn. Try again.",bhe=()=>"无法恢复本轮。请重试。",yhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=()=>"Could not remove the queued message. Try again.",She=()=>"无法移除排队消息。请重试。",khe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Che=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?She():t==="fa"?khe():whe()}),Ehe=e=>`Could not re-send: ${e==null?void 0:e.error}`,Nhe=e=>`无法重新发送:${e==null?void 0:e.error}`,zhe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,jhe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),The=()=>"Resolved",Ahe=()=>"已处理",Rhe=()=>"رسیدگی شد",Mhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"Could not retry the queued message. Try again.",Lhe=()=>"无法重试排队消息。请重试。",Ohe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Ihe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"run logs",$he=()=>"运行日志",Phe=()=>"گزارش‌های اجرا",Fhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Hhe=()=>"Scroll to bottom",qhe=()=>"滚动到底部",Uhe=()=>"رفتن به پایین گفتگو",OE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qhe():t==="fa"?Uhe():Hhe()}),Ghe=()=>"The selected harness is unavailable",Whe=()=>"所选智能体工具不可用",Vhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",S2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Whe():t==="fa"?Vhe():Ghe()}),Khe=()=>"Session limit reached",Qhe=()=>"已达到会话使用限额",Yhe=()=>"به سقف مصرف نشست رسیده‌اید",Xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"The chat session was not created",Jhe=()=>"未能创建聊天会话",e_e=()=>"نشست گفت‌وگو ایجاد نشد",t_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>"Show full conversation",r_e=()=>"显示完整对话",s_e=()=>"نمایش کامل گفتگو",i_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>" · Spawned by another agent",o_e=()=>" · 由另一个智能体创建",l_e=()=>" · ساخته‌شده به‌دست عامل دیگر",c_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=()=>"Starting…",d_e=()=>"正在启动…",f_e=()=>"در حال شروع…",h_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d_e():t==="fa"?f_e():u_e()}),__e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,p_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,m_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,g_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p_e(e):t==="fa"?m_e(e):__e(e)}),v_e=()=>"Could not stop the turn. Try again.",b_e=()=>"无法停止本轮。请重试。",y_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",x_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b_e():t==="fa"?y_e():v_e()}),w_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,S_e=e=>`无法切换分支:${e==null?void 0:e.error}`,k_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,C_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S_e(e):t==="fa"?k_e(e):w_e(e)}),E_e=()=>"The agent",N_e=()=>"智能体",z_e=()=>"عامل",j_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Thinking",A_e=()=>"正在思考",R_e=()=>"در حال فکر کردن",M_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),D_e=()=>"Could not toggle Plan mode. Try again.",L_e=()=>"无法切换计划模式。请重试。",O_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",IE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=()=>"This turn did not finish.",B_e=()=>"本轮未完成。",$_e=()=>"این نوبت کامل نشد.",BE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),P_e=()=>"Type a custom answer…",F_e=()=>"输入自定义回答…",H_e=()=>"پاسخ دلخواه را بنویسید…",q_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Unarchive",G_e=()=>"取消归档",W_e=()=>"خارج کردن از بایگانی",V_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),K_e=()=>"Untitled",Q_e=()=>"未命名",Y_e=()=>"بدون عنوان",Ng=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q_e():t==="fa"?Y_e():K_e()}),X_e=()=>"Could not update permissions. Try again.",Z_e=()=>"无法更新权限。请重试。",J_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",e0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=()=>"Work details",n0e=()=>"工作详情",r0e=()=>"جزئیات کار",s0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),i0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,a0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,o0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,l0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=e=>`Worked for ${e==null?void 0:e.duration}`,u0e=e=>`已工作 ${e==null?void 0:e.duration}`,d0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,f0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u0e(e):t==="fa"?d0e(e):c0e(e)}),h0e=()=>"Working…",_0e=()=>"正在工作…",p0e=()=>"در حال کار…",n6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_0e():t==="fa"?p0e():h0e()}),m0e=()=>"Close tab",g0e=()=>"关闭标签页",v0e=()=>"بستن زبانه",b0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),y0e=()=>"Changes",x0e=()=>"更改",w0e=()=>"تغییرات",ND=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x0e():t==="fa"?w0e():y0e()}),S0e=()=>"Code browser view",k0e=()=>"代码浏览器视图",C0e=()=>"نمای مرورگر کد",E0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Files",z0e=()=>"文件",j0e=()=>"فایل‌ها",T0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Refresh",R0e=()=>"刷新",M0e=()=>"تازه‌سازی",$E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"listing truncated",L0e=()=>"列表已截断",O0e=()=>"فهرست کوتاه شده است",I0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"No files.",$0e=()=>"没有文件。",P0e=()=>"فایلی وجود ندارد.",F0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Refresh failed:",q0e=()=>"刷新失败:",U0e=()=>"تازه‌سازی ناموفق بود:",G0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Cancelling…",V0e=()=>"正在取消…",K0e=()=>"در حال لغو…",Q0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Y0e=()=>"Checking…",X0e=()=>"正在检查…",Z0e=()=>"در حال بررسی…",Xi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X0e():t==="fa"?Z0e():Y0e()}),J0e=()=>"Copied",epe=()=>"已复制",tpe=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),npe=e=>`Failed to load: ${e==null?void 0:e.error}`,rpe=e=>`加载失败:${e==null?void 0:e.error}`,spe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,zD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?rpe(e):t==="fa"?spe(e):npe(e)}),ipe=()=>"Loading…",ape=()=>"正在加载…",ope=()=>"در حال بارگیری…",jD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),lpe=e=>`+ ${e==null?void 0:e.count} more`,cpe=e=>`另有 ${e==null?void 0:e.count} 项`,upe=e=>`${e==null?void 0:e.count}+ مورد دیگر`,dpe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cpe(e):t==="fa"?upe(e):lpe(e)}),fpe=()=>"Rendered view",hpe=()=>"渲染视图",_pe=()=>"نمای رندرشده",rv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hpe():t==="fa"?_pe():fpe()}),ppe=()=>"Save",mpe=()=>"保存",gpe=()=>"ذخیره",no=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mpe():t==="fa"?gpe():ppe()}),vpe=()=>"Saving…",bpe=()=>"正在保存…",ype=()=>"در حال ذخیره…",Ei=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bpe():t==="fa"?ype():vpe()}),xpe=()=>"Show less",wpe=()=>"收起",Spe=()=>"نمایش کمتر",TD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wpe():t==="fa"?Spe():xpe()}),kpe=()=>"Show more",Cpe=()=>"展开",Epe=()=>"نمایش بیشتر",Npe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),zpe=()=>"Stop",jpe=()=>"停止",Tpe=()=>"توقف",AD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Ape=()=>"Stopping…",Rpe=()=>"正在停止…",Mpe=()=>"در حال توقف…",Dpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Lpe=()=>"View source",Ope=()=>"查看源代码",Ipe=()=>"نمایش متن منبع",rh=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ope():t==="fa"?Ipe():Lpe()}),Bpe=()=>"Runs as a remote Hugging Face Job",$pe=()=>"作为远程 Hugging Face Job 运行",Ppe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs as a Job on your Kubernetes cluster",qpe=()=>"作为 Kubernetes 集群上的 Job 运行",Upe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs directly on this computer",Vpe=()=>"直接在此计算机上运行",Kpe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs in a remote Modal sandbox",Xpe=()=>"在远程 Modal 沙箱中运行",Zpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on an ephemeral OpenResearch box",tme=()=>"在临时 OpenResearch 主机上运行",nme=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs on the connected Ray cluster",ime=()=>"在已连接的 Ray 集群上运行",ame=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs as a scheduled job on your Slurm cluster",cme=()=>"作为 Slurm 集群上的调度作业运行",ume=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs on a host from your SSH config",hme=()=>"在 SSH 配置中的主机上运行",_me=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"Runs through Tinker’s remote compute",gme=()=>"通过 Tinker 远程算力运行",vme=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"HF Jobs",xme=()=>"HF Jobs",wme=()=>"HF Jobs",Sme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"Kubernetes",Cme=()=>"Kubernetes",Eme=()=>"Kubernetes",Nme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"This machine",jme=()=>"此计算机",Tme=()=>"این رایانه",RD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jme():t==="fa"?Tme():zme()}),Ame=()=>"Modal",Rme=()=>"Modal",Mme=()=>"Modal",Dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"OpenResearch",Ome=()=>"OpenResearch",Ime=()=>"OpenResearch",Bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Ray",Pme=()=>"Ray",Fme=()=>"Ray",Hme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"Slurm",Ume=()=>"Slurm",Gme=()=>"Slurm",Wme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"SSH",Kme=()=>"SSH",Qme=()=>"SSH",Yme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"Tinker",Zme=()=>"Tinker",Jme=()=>"Tinker",ege=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",nge=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",rge=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",sge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",age=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",oge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",lge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",uge=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",dge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",fge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"This computer must stay awake and online while Tinker runs.",_ge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",pge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",mge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window",vge=()=>"上下文窗口",bge=()=>"پنجرهٔ زمینه",yge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=()=>"Context window used",wge=()=>"已使用的上下文窗口",Sge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",kge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wge():t==="fa"?Sge():xge()}),Cge=e=>`${e==null?void 0:e.value} tokens`,Ege=e=>`${e==null?void 0:e.value} 个 token`,Nge=e=>`${e==null?void 0:e.value} توکن`,zge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Age=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Rge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tge(e):t==="fa"?Age(e):jge(e)}),Mge=()=>"No runs yet — ask the agent to launch one.",Dge=()=>"尚无运行——让智能体启动一个。",Lge=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Oge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Ige=()=>"Run",Bge=()=>"运行",$ge=()=>"اجرا",PE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bge():t==="fa"?$ge():Ige()}),Pge=()=>"Switch run",Fge=()=>"切换运行",Hge=()=>"تغییر اجرا",qge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fge():t==="fa"?Hge():Pge()}),Uge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Gge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Wge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Qge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Yge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Xge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}m`,Jge=e=>`${e==null?void 0:e.value} 分钟`,e1e=e=>`${e==null?void 0:e.value} دقیقه`,t1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=e=>`${e==null?void 0:e.value}s`,r1e=e=>`${e==null?void 0:e.value} 秒`,s1e=e=>`${e==null?void 0:e.value} ثانیه`,i1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):n1e(e)}),a1e=()=>"Code",o1e=()=>"代码",l1e=()=>"کد",c1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"created",d1e=()=>"创建于",f1e=()=>"ایجادشده",h1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"from",p1e=()=>"来自",m1e=()=>"از",g1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Logs",b1e=()=>"日志",y1e=()=>"گزارش‌ها",x1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Latest run",S1e=()=>"最新运行",k1e=()=>"آخرین اجرا",C1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Code",N1e=()=>"代码",z1e=()=>"کد",j1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"Commit",A1e=()=>"提交",R1e=()=>"کامیت",M1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"created",L1e=()=>"创建于",O1e=()=>"ایجادشده",I1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Description",$1e=()=>"说明",P1e=()=>"توضیحات",F1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"Duration",q1e=()=>"时长",U1e=()=>"مدت",G1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"exit",V1e=()=>"退出码",K1e=()=>"خروج",Q1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"from",X1e=()=>"来自",Z1e=()=>"از",J1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Logs",tve=()=>"日志",nve=()=>"گزارش‌ها",rve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run",ive=()=>"运行",ave=()=>"اجرا",ove=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Run history",cve=()=>"运行历史",uve=()=>"تاریخچهٔ اجرا",dve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Started",hve=()=>"开始时间",_ve=()=>"آغاز",pve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Runs",gve=()=>"运行",vve=()=>"اجراها",bve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",xve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",wve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",Sve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No runs yet",Cve=()=>"还没有运行",Eve=()=>"هنوز اجرایی وجود ندارد",Nve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"No experiments yet.",jve=()=>"还没有实验。",Tve=()=>"هنوز آزمایشی وجود ندارد.",Ave=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Not run yet",Mve=()=>"尚未运行",Dve=()=>"هنوز اجرا نشده",Lve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"1 run",Ive=()=>"1 次运行",Bve=()=>"۱ اجرا",$ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"Open logs",Fve=()=>"打开日志",Hve=()=>"باز کردن گزارش‌ها",qve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fve():t==="fa"?Hve():Pve()}),Uve=e=>`${e==null?void 0:e.count} runs`,Gve=e=>`${e==null?void 0:e.count} 次运行`,Wve=e=>`${e==null?void 0:e.count} اجرا`,Vve=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gve(e):t==="fa"?Wve(e):Uve(e)}),Kve=()=>"Stop requested",Qve=()=>"已请求停止",Yve=()=>"درخواست توقف ثبت شد",Xve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Stop run",Jve=()=>"停止运行",ebe=()=>"توقف اجرا",tbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Code",rbe=()=>"代码",sbe=()=>"کد",ibe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Experiments",obe=()=>"实验",lbe=()=>"آزمایش‌ها",cbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Logs",dbe=()=>"日志",fbe=()=>"گزارش‌ها",hbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Stop failed:",pbe=()=>"停止失败:",mbe=()=>"توقف ناموفق بود:",gbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),vbe=()=>"Clipboard access is unavailable.",bbe=()=>"无法访问剪贴板。",ybe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",MD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bbe():t==="fa"?ybe():vbe()}),xbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,wbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,Sbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,kbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):xbe(e)}),Cbe=()=>"Duplicate",Ebe=()=>"创建副本",Nbe=()=>"ایجاد نسخهٔ تکراری",zbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),jbe=e=>`File actions for ${e==null?void 0:e.path}`,Tbe=e=>`${e==null?void 0:e.path} 的文件操作`,Abe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Rbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tbe(e):t==="fa"?Abe(e):jbe(e)}),Mbe=()=>"Open",Dbe=()=>"打开",Lbe=()=>"باز کردن",Obe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Mbe()}),Ibe=e=>`Rename ${e==null?void 0:e.path}`,Bbe=e=>`重命名 ${e==null?void 0:e.path}`,$be=e=>`تغییر نام ${e==null?void 0:e.path}`,Pbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Hbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,qbe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Ube=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Hbe(e):t==="fa"?qbe(e):Fbe(e)}),Gbe=()=>"Binary file — no inline preview.",Wbe=()=>"二进制文件——无法内嵌预览。",Vbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Kbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Qbe=()=>"This file changed on disk. Your edits have not been overwritten.",Ybe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Xbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",FE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Qbe()}),Zbe=()=>"Compile failed",Jbe=()=>"编译失败",eye=()=>"کامپایل ناموفق بود",tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),nye=()=>"Compile PDF",rye=()=>"编译 PDF",sye=()=>"کامپایل PDF",HE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rye():t==="fa"?sye():nye()}),iye=()=>"Compiled, but the engine reported errors — check the output below.",aye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",oye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",lye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy command",uye=()=>"复制命令",dye=()=>"کپی فرمان",fye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Copy install command",_ye=()=>"复制安装命令",pye=()=>"کپی فرمان نصب",mye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"This file was deleted on disk. Your edits have not been discarded.",vye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",bye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",qE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vye():t==="fa"?bye():gye()}),yye=()=>"Discard my edits and reload",xye=()=>"放弃我的编辑并重新加载",wye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Sye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),kye=()=>"Discard unsaved changes and close this file?",Cye=()=>"要丢弃未保存的更改并关闭此文件吗?",Eye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",UE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cye():t==="fa"?Eye():kye()}),Nye=()=>"Dismiss",zye=()=>"关闭",jye=()=>"بستن",Tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss compile message",Rye=()=>"关闭编译消息",Mye=()=>"بستن پیام کامپایل",Dye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Dismiss Overleaf message",Oye=()=>"关闭 Overleaf 消息",Iye=()=>"بستن پیام Overleaf",Bye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),$ye=()=>"Download",Pye=()=>"下载",Fye=()=>"بارگیری",DD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pye():t==="fa"?Fye():$ye()}),Hye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,qye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Uye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Gye=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qye(e):t==="fa"?Uye(e):Hye(e)}),Wye=()=>"Failed to load file:",Vye=()=>"加载文件失败:",Kye=()=>"بارگیری فایل ناموفق بود:",GE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vye():t==="fa"?Kye():Wye()}),Qye=()=>"File truncated — showing the first 512 KB.",Yye=()=>"文件已截断——仅显示前 512 KB。",Xye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Zye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=()=>"The page below stops partway — the full file could not be loaded.",exe=()=>"下方页面在中途结束——无法加载完整文件。",txe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",nxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?exe():t==="fa"?txe():Jye()}),rxe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,sxe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ixe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,axe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sxe(e):t==="fa"?ixe(e):rxe(e)}),oxe=()=>"Loading…",lxe=()=>"正在加载…",cxe=()=>"در حال بارگیری…",LD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lxe():t==="fa"?cxe():oxe()}),uxe=()=>"File not found.",dxe=()=>"找不到文件。",fxe=()=>"فایل پیدا نشد.",hxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dxe():t==="fa"?fxe():uxe()}),_xe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pxe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mxe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pxe(e):t==="fa"?mxe(e):_xe(e)}),vxe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,bxe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,yxe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,xxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bxe(e):t==="fa"?yxe(e):vxe(e)}),wxe=()=>"File not found on disk.",Sxe=()=>"磁盘上找不到此文件。",kxe=()=>"فایل روی دیسک پیدا نشد.",Cxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Nxe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,zxe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,jxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nxe(e):t==="fa"?zxe(e):Exe(e)}),Txe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Axe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Rxe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Mxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Axe(e):t==="fa"?Rxe(e):Txe(e)}),Dxe=()=>"Open in default editor",Lxe=()=>"在默认编辑器中打开",Oxe=()=>"باز کردن در ویرایشگر پیش‌فرض",WE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Ixe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Bxe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",$xe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Pxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Fxe=()=>"Overwrite disk file",Hxe=()=>"覆盖磁盘文件",qxe=()=>"بازنویسی فایل روی دیسک",Uxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hxe():t==="fa"?qxe():Fxe()}),Gxe=()=>"Compiled PDF is out of date",Wxe=()=>"已编译的 PDF 不是最新版本",Vxe=()=>"PDF کامپایل‌شده به‌روز نیست",Kxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wxe():t==="fa"?Vxe():Gxe()}),Qxe=()=>"project clone",Yxe=()=>"项目克隆",Xxe=()=>"کلون پروژه",zg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yxe():t==="fa"?Xxe():Qxe()}),Zxe=()=>"Recompile PDF",Jxe=()=>"重新编译 PDF",e2e=()=>"کامپایل دوبارهٔ PDF",VE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jxe():t==="fa"?e2e():Zxe()}),t2e=()=>"Reload from disk",n2e=()=>"从磁盘重新加载",r2e=()=>"بارگذاری مجدد از دیسک",s2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Save failed",a2e=()=>"保存失败",o2e=()=>"ذخیره ناموفق بود",l2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Saving…",u2e=()=>"正在保存…",d2e=()=>"در حال ذخیره…",f2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Selected — press ⌘C",_2e=()=>"已选中 — 按 ⌘C 复制",p2e=()=>"انتخاب شد — برای کپی ⌘C را بزنید",m2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"session’s worktree",v2e=()=>"会话工作树",b2e=()=>"درخت کاری نشست",jg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v2e():t==="fa"?b2e():g2e()}),y2e=()=>"Show compiled PDF",x2e=()=>"显示已编译的 PDF",w2e=()=>"نمایش PDF کامپایل‌شده",KE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x2e():t==="fa"?w2e():y2e()}),S2e=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",k2e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",C2e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",E2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"This session's worktree isn't available — showing the project clone's copy.",z2e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",j2e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",T2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z2e():t==="fa"?j2e():N2e()}),A2e=()=>"Unsaved",R2e=()=>"未保存",M2e=()=>"ذخیره نشده",OD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R2e():t==="fa"?M2e():A2e()}),D2e=()=>"Unsaved — ⌘S to save",L2e=()=>"未保存 — 按 ⌘S 保存",O2e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",I2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L2e():t==="fa"?O2e():D2e()}),B2e=()=>"Update orx on the remote machine to edit this file safely.",$2e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",P2e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",F2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$2e():t==="fa"?P2e():B2e()}),H2e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",q2e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",U2e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",G2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q2e():t==="fa"?U2e():H2e()}),W2e=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",V2e=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",K2e=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Q2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V2e():t==="fa"?K2e():W2e()}),Y2e=()=>"Back to preview",X2e=()=>"返回预览",Z2e=()=>"بازگشت به پیش‌نمایش",J2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),ewe=e=>`${e==null?void 0:e.count} changed files`,twe=e=>`${e==null?void 0:e.count} 个已更改文件`,nwe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,ID=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?twe(e):t==="fa"?nwe(e):ewe(e)}),rwe=()=>"Changed files",swe=()=>"已更改文件",iwe=()=>"فایل‌های تغییرکرده",awe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Diff preview truncated",lwe=()=>"差异预览已截断",cwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),dwe=e=>`${e==null?void 0:e.count} files shown (partial)`,fwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,_we=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fwe(e):t==="fa"?hwe(e):dwe(e)}),pwe=()=>"No changes.",mwe=()=>"没有更改。",gwe=()=>"تغییری وجود ندارد.",vwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No complete file preview was available before the cutoff.",ywe=()=>"在截断位置之前没有完整的文件预览。",xwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",wwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"No textual diff for this file.",kwe=()=>"此文件没有文本差异。",Cwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Ewe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"1 changed file",zwe=()=>"1 个已更改文件",jwe=()=>"۱ فایل تغییرکرده",BD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zwe():t==="fa"?jwe():Nwe()}),Twe=()=>"1 file shown (partial)",Awe=()=>"显示 1 个文件(部分)",Rwe=()=>"۱ فایل نمایش داده شده (ناقص)",Mwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=()=>"Unable to parse this diff.",Lwe=()=>"无法解析此差异。",Owe=()=>"خواندن این تفاوت ممکن نبود.",Iwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lwe():t==="fa"?Owe():Dwe()}),Bwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$we=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Pwe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Fwe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$we(e):t==="fa"?Pwe(e):Bwe(e)}),Hwe=()=>"View full diff",qwe=()=>"查看完整差异",Uwe=()=>"نمایش تفاوت کامل",Gwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"Create a token ↗",Vwe=()=>"创建令牌 ↗",Kwe=()=>"ساخت توکن ↗",Qwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Ywe=()=>"All projects",Xwe=()=>"所有项目",Zwe=()=>"همهٔ پروژه‌ها",QE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xwe():t==="fa"?Zwe():Ywe()}),Jwe=()=>"Configure Repository",e4e=()=>"配置仓库",t4e=()=>"پیکربندی مخزن",n4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Create a new project",s4e=()=>"新建项目",i4e=()=>"ایجاد پروژهٔ جدید",a4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"Hide sidebar",l4e=()=>"隐藏侧边栏",c4e=()=>"پنهان کردن نوار کناری",YE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),u4e=()=>"Project",d4e=()=>"项目",f4e=()=>"پروژه",h4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d4e():t==="fa"?f4e():u4e()}),_4e=e=>`${e==null?void 0:e.count} cancelled`,p4e=e=>`${e==null?void 0:e.count} 次取消`,m4e=e=>`${e==null?void 0:e.count} لغوشده`,g4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} done`,b4e=e=>`${e==null?void 0:e.count} 次完成`,y4e=e=>`${e==null?void 0:e.count} تمام‌شده`,x4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} failed`,S4e=e=>`${e==null?void 0:e.count} 次失败`,k4e=e=>`${e==null?void 0:e.count} ناموفق`,C4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count} files`,N4e=e=>`${e==null?void 0:e.count} 个文件`,z4e=e=>`${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count}+ files`,A4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,R4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,M4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=e=>`${e==null?void 0:e.count} live`,L4e=e=>`${e==null?void 0:e.count} 次进行中`,O4e=e=>`${e==null?void 0:e.count} فعال`,I4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L4e(e):t==="fa"?O4e(e):D4e(e)}),B4e=()=>"1 file",$4e=()=>"1 个文件",P4e=()=>"۱ فایل",F4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=()=>"1 run",q4e=()=>"1 次运行",U4e=()=>"۱ اجرا",G4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q4e():t==="fa"?U4e():H4e()}),W4e=e=>`${e==null?void 0:e.count} runs`,V4e=e=>`${e==null?void 0:e.count} 次运行`,K4e=e=>`${e==null?void 0:e.count} اجرا`,Q4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V4e(e):t==="fa"?K4e(e):W4e(e)}),Y4e=()=>"No instances yet.",X4e=()=>"还没有实例。",Z4e=()=>"هنوز نمونه‌ای وجود ندارد.",J4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Nothing running right now.",t3e=()=>"当前没有运行中的实例。",n3e=()=>"اکنون چیزی در حال اجرا نیست.",r3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its history.",i3e=()=>"请选择一个项目以查看其历史记录。",a3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"Select a project to see its runs.",c3e=()=>"请选择一个项目以查看其运行。",u3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",d3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=()=>"View history",h3e=()=>"查看历史记录",_3e=()=>"مشاهدهٔ تاریخچه",p3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h3e():t==="fa"?_3e():f3e()}),m3e=e=>`View history (${e==null?void 0:e.count})`,g3e=e=>`查看历史记录(${e==null?void 0:e.count})`,v3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,b3e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?g3e(e):t==="fa"?v3e(e):m3e(e)}),y3e=()=>"The engine exited without producing a PDF or a log.",x3e=()=>"引擎已退出,但没有生成 PDF 或日志。",w3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",S3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Loading…",C3e=()=>"正在加载…",E3e=()=>"در حال بارگیری…",N3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),z3e=()=>"Add local model",j3e=()=>"添加本地模型",T3e=()=>"افزودن مدل محلی",$D=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?j3e():t==="fa"?T3e():z3e()}),A3e=()=>"Local server address",R3e=()=>"本地服务器地址",M3e=()=>"نشانی سرور محلی",D3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"Find models",O3e=()=>"查找模型",I3e=()=>"یافتن مدل‌ها",B3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),$3e=()=>"(OpenAI compatible)",P3e=()=>"(兼容 OpenAI)",F3e=()=>"(سازگار با OpenAI)",PD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P3e():t==="fa"?F3e():$3e()}),H3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",q3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",U3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",G3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Connected",V3e=()=>"已连接",K3e=()=>"متصل شد",Q3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Context window",X3e=()=>"上下文窗口",Z3e=()=>"پنجرهٔ زمینه",J3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",t5e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",n5e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",r5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),s5e=()=>"Custom Endpoint",i5e=()=>"自定义端点",a5e=()=>"نقطهٔ اتصال سفارشی",r6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),o5e=e=>`Disconnect ${e==null?void 0:e.name}`,l5e=e=>`断开 ${e==null?void 0:e.name}`,c5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,u5e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?l5e(e):t==="fa"?c5e(e):o5e(e)}),d5e=()=>"Get OpenCode",f5e=()=>"获取 OpenCode",h5e=()=>"دریافت OpenCode",_5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",m5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",g5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",v5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"API key (optional)",y5e=()=>"API 密钥(可选)",x5e=()=>"کلید API (اختیاری)",w5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Save model",k5e=()=>"保存模型",C5e=()=>"ذخیرهٔ مدل",E5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Model server",z5e=()=>"模型服务器",j5e=()=>"سرور مدل",XE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Local models",A5e=()=>"本地模型",R5e=()=>"مدل‌های محلی",ZE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A5e():t==="fa"?R5e():T5e()}),M5e=()=>"API token (optional)",D5e=()=>"API 令牌(可选)",L5e=()=>"توکن API (اختیاری)",O5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),I5e=()=>"Copy",B5e=()=>"复制",$5e=()=>"کپی",s6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B5e():t==="fa"?$5e():I5e()}),P5e=()=>"Copy code",F5e=()=>"复制代码",H5e=()=>"کپی کد",q5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),U5e=()=>"Download",G5e=()=>"下载",W5e=()=>"بارگیری",FD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G5e():t==="fa"?W5e():U5e()}),V5e=()=>"This browser can’t preview this media format.",K5e=()=>"此浏览器无法预览该媒体格式。",Q5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Y5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>"Add Local Model",Z5e=()=>"添加本地模型",J5e=()=>"افزودن مدل محلی",e6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),t6e=()=>" · CLI configuration",n6e=()=>" · CLI 配置",r6e=()=>" · پیکربندی CLI",HD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),s6e=()=>"· Default",i6e=()=>"· 默认",a6e=()=>"· پیش‌فرض",qD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i6e():t==="fa"?a6e():s6e()}),o6e=()=>"Default model",l6e=()=>"默认模型",c6e=()=>"مدل پیش‌فرض",JE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l6e():t==="fa"?c6e():o6e()}),u6e=()=>"Detecting harnesses…",d6e=()=>"正在检测智能体工具…",f6e=()=>"در حال شناسایی ابزارهای عامل…",h6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Effort",p6e=()=>"推理强度",m6e=()=>"میزان استدلال",g6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Fast speed ·",b6e=()=>"快速 ·",y6e=()=>"سرعت بالا ·",x6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),w6e=()=>"Mode",S6e=()=>"模式",k6e=()=>"حالت",eN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),C6e=()=>"Model",E6e=()=>"模型",N6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E6e():t==="fa"?N6e():C6e()}),z6e=e=>`${e==null?void 0:e.count} more — search to find`,j6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,T6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,A6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?j6e(e):t==="fa"?T6e(e):z6e(e)}),R6e=()=>"Not available",M6e=()=>"不可用",D6e=()=>"در دسترس نیست",L6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),O6e=()=>"Search models…",I6e=()=>"搜索模型…",B6e=()=>"جست‌وجوی مدل‌ها…",UD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Sessions keep their harness. Start a new chat to switch.",P6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",F6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",H6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),q6e=()=>"Speed",U6e=()=>"速度",G6e=()=>"سرعت",tN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?U6e():t==="fa"?G6e():q6e()}),W6e=()=>"Unavailable",V6e=()=>"不可用",K6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V6e():t==="fa"?K6e():W6e()}),Q6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Y6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,X6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Z6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Y6e(e):t==="fa"?X6e(e):Q6e(e)}),J6e=()=>"Variant",eSe=()=>"变体",tSe=()=>"گونه",nSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced",sSe=()=>"高级",iSe=()=>"پیشرفته",aSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · Connect GitHub",lSe=()=>"高级 · 连接 GitHub",cSe=()=>"پیشرفته · اتصال GitHub",uSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Advanced · GitHub sync on",fSe=()=>"高级 · GitHub 同步已开启",hSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",_Se=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",mSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",gSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",vSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mSe():t==="fa"?gSe():pSe()}),bSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,ySe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,xSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,wSe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ySe(e):t==="fa"?xSe(e):bSe(e)}),SSe=()=>"Choose an existing project folder",kSe=()=>"选择现有项目文件夹",CSe=()=>"انتخاب پوشهٔ موجود پروژه",nN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kSe():t==="fa"?CSe():SSe()}),ESe=()=>"Choosing…",NSe=()=>"正在选择…",zSe=()=>"در حال انتخاب…",jSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone destination",ASe=()=>"克隆位置",RSe=()=>"مقصد کلون",MSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Clone paper project",LSe=()=>"克隆论文项目",OSe=()=>"کلون پروژهٔ مقاله",ISe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),BSe=()=>"Create project",$Se=()=>"创建项目",PSe=()=>"ایجاد پروژه",rN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Creating…",HSe=()=>"正在创建…",qSe=()=>"در حال ایجاد…",USe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),GSe=()=>"Choose a different destination. This path is a file, not a folder.",WSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",VSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",k2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WSe():t==="fa"?VSe():GSe()}),KSe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",QSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",YSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",sN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QSe():t==="fa"?YSe():KSe()}),XSe=()=>"Auto-apply repository topics",ZSe=()=>"自动添加仓库 topic",JSe=()=>"اعمال خودکار موضوع‌های مخزن",eke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.",nke=()=>"自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",rke=()=>"موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",ske=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Blank project",ake=()=>"空白项目",oke=()=>"پروژهٔ خالی",lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Cancel",uke=()=>"取消",dke=()=>"لغو",fke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Change",_ke=()=>"更改",pke=()=>"تغییر",mke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Change selected paper",vke=()=>"更改所选论文",bke=()=>"تغییر مقالهٔ انتخاب‌شده",yke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vke():t==="fa"?bke():gke()}),xke=()=>"Check out a Git branch before using this folder.",wke=()=>"使用此文件夹前,请先检出一个 Git 分支。",Ske=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",kke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wke():t==="fa"?Ske():xke()}),Cke=()=>"Checking project location.",Eke=()=>"正在检查项目位置。",Nke=()=>"در حال بررسی محل پروژه.",iN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),zke=()=>"Existing folder",jke=()=>"现有文件夹",Tke=()=>"پوشهٔ موجود",Ake=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"Experiment branches will be pushed to the remote GitHub repository.",Mke=()=>"实验分支将推送到远程 GitHub 仓库。",Dke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Oke=()=>"Extra topics (comma-separated), e.g. llm, benchmark",Ike=()=>"附加 topic(逗号分隔),例如 llm, benchmark",Bke=()=>"موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark",GD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),$ke=()=>"From a paper",Pke=()=>"从论文创建",Fke=()=>"از یک مقاله",Hke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Uke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Gke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Wke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"my-research",Kke=()=>"my-research",Qke=()=>"my-research",aN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Yke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Xke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Zke=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Jke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xke():t==="fa"?Zke():Yke()}),e7e=()=>"No public repository found on alphaXiv",t7e=()=>"在 alphaXiv 上未找到公开仓库",n7e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",r7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),s7e=()=>"OpenResearch will start a blank project with this paper's PDF.",i7e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",a7e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",o7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i7e():t==="fa"?a7e():s7e()}),l7e=()=>"Paper",c7e=()=>"论文",u7e=()=>"مقاله",d7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c7e():t==="fa"?u7e():l7e()}),f7e=()=>"Project location",h7e=()=>"项目位置",_7e=()=>"محل پروژه",C2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h7e():t==="fa"?_7e():f7e()}),p7e=()=>"Project name",m7e=()=>"项目名称",g7e=()=>"نام پروژه",oN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),v7e=()=>"Search for a paper by arXiv ID, URL, or title",b7e=()=>"按 arXiv ID、网址或标题搜索论文",y7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",x7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b7e():t==="fa"?y7e():v7e()}),w7e=()=>"Sync experiments to GitHub",S7e=()=>"将实验同步到 GitHub",k7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",C7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"That folder no longer exists. Choose it again.",N7e=()=>"该文件夹已不存在。请重新选择。",z7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",j7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),T7e=()=>"The selected folder contains an invalid Git repository.",A7e=()=>"所选文件夹包含无效的 Git 仓库。",R7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",M7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A7e():t==="fa"?R7e():T7e()}),D7e=()=>"The selected path is not a folder.",L7e=()=>"所选路径不是文件夹。",O7e=()=>"مسیر انتخاب‌شده پوشه نیست.",I7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L7e():t==="fa"?O7e():D7e()}),B7e=e=>`Checking ${e==null?void 0:e.repository}.`,$7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,P7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,F7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$7e(e):t==="fa"?P7e(e):B7e(e)}),H7e=e=>`Creates ${e==null?void 0:e.repository}.`,q7e=e=>`将创建 ${e==null?void 0:e.repository}。`,U7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,G7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?q7e(e):t==="fa"?U7e(e):H7e(e)}),W7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,V7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,K7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Q7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V7e(e):t==="fa"?K7e(e):W7e(e)}),Y7e=()=>"Project location is required.",X7e=()=>"必须填写项目位置。",Z7e=()=>"محل پروژه الزامی است.",lN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),J7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",eCe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",tCe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",cN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eCe():t==="fa"?tCe():J7e()}),nCe=()=>"A linked public code repository is cloned without credentials.",rCe=()=>"关联的公开代码仓库无需凭据即可克隆。",sCe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",iCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,oCe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,lCe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,cCe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oCe(e):t==="fa"?lCe(e):aCe(e)}),uCe=()=>"Searching alphaXiv…",dCe=()=>"正在搜索 alphaXiv…",fCe=()=>"در حال جست‌وجوی alphaXiv…",hCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Use folder",pCe=()=>"使用文件夹",mCe=()=>"استفاده از پوشه",gCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Can’t reach OpenResearch. This page is no longer live.",bCe=()=>"无法连接 OpenResearch。此页面已不再实时同步。",yCe=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",z4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"A workspace for your research agents",wCe=()=>"面向研究智能体的工作空间",SCe=()=>"فضای کاری برای عامل‌های پژوهشی شما",kCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Add papers that represent your research interests, including papers by other authors.",ECe=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",NCe=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",zCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"API key",TCe=()=>"API 密钥",ACe=()=>"کلید API",i6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),RCe=()=>"AI/ML",MCe=()=>"人工智能与机器学习",DCe=()=>"هوش مصنوعی و یادگیری ماشین",LCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MCe():t==="fa"?DCe():RCe()}),OCe=()=>"Biology",ICe=()=>"生物学",BCe=()=>"زیست‌شناسی",$Ce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),PCe=()=>"Other",FCe=()=>"其他",HCe=()=>"سایر",qCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FCe():t==="fa"?HCe():PCe()}),UCe=()=>"Physics",GCe=()=>"物理学",WCe=()=>"فیزیک",VCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GCe():t==="fa"?WCe():UCe()}),KCe=()=>"Back",QCe=()=>"返回",YCe=()=>"بازگشت",uN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QCe():t==="fa"?YCe():KCe()}),XCe=()=>"Check failed",ZCe=()=>"检查失败",JCe=()=>"بررسی ناموفق بود",e8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZCe():t==="fa"?JCe():XCe()}),t8e=()=>"Checking",n8e=()=>"正在检查",r8e=()=>"در حال بررسی",s8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"Checking Git…",a8e=()=>"正在检查 Git…",o8e=()=>"در حال بررسی Git…",l8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Choose a coding agent",u8e=()=>"选择编程智能体",d8e=()=>"یک عامل کدنویسی انتخاب کنید",f8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Choose a coding agent to continue.",_8e=()=>"选择一个编程智能体以继续。",p8e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",m8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Choose at least one research area to continue.",v8e=()=>"请至少选择一个研究领域后再继续。",b8e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",y8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Choose one or more.",w8e=()=>"请选择一项或多项。",S8e=()=>"یک یا چند مورد را انتخاب کنید.",k8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Choose your preferred coding agent",E8e=()=>"请选择首选编程智能体",N8e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",z8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Consolidate your research",T8e=()=>"集中管理研究",A8e=()=>"پژوهش خود را یکپارچه کنید",R8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Continue",D8e=()=>"继续",L8e=()=>"ادامه",dN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Describe your research area to continue.",I8e=()=>"请描述你的研究领域后再继续。",B8e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",$8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",F8e=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",H8e=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",q8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G8e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",W8e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",V8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Everything stays local",Q8e=()=>"一切都保留在本地",Y8e=()=>"همه‌چیز محلی می‌ماند",X8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Get started",J8e=()=>"开始使用",e9e=()=>"شروع",t9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J8e():t==="fa"?e9e():Z8e()}),n9e=()=>"Git is required for local experiments. Install Git, then re-check.",r9e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",s9e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",i9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Ground your agents",o9e=()=>"为智能体提供可靠依据",l9e=()=>"عامل‌هایتان را به منابع متصل کنید",c9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),u9e=()=>"Install broken",d9e=()=>"安装损坏",f9e=()=>"نصب خراب است",h9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d9e():t==="fa"?f9e():u9e()}),_9e=()=>"Install Git to continue",p9e=()=>"请安装 Git 后再继续",m9e=()=>"برای ادامه Git را نصب کنید",g9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p9e():t==="fa"?m9e():_9e()}),v9e=()=>"Local Git",b9e=()=>"本地 Git",y9e=()=>"Git محلی",x9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b9e():t==="fa"?y9e():v9e()}),w9e=()=>", and ",S9e=()=>" 和 ",k9e=()=>" و ",C9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Compatible with",N9e=()=>"兼容",z9e=()=>"سازگار با",j9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),T9e=()=>"Use your own local models",A9e=()=>"使用你自己的本地模型",R9e=()=>"از مدل‌های محلی خود استفاده کنید",M9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),D9e=()=>"Not detected",L9e=()=>"未检测到",O9e=()=>"شناسایی نشد",fN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),I9e=()=>"Not found",B9e=()=>"未找到",$9e=()=>"پیدا نشد",WD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Not signed in",F9e=()=>"未登录",H9e=()=>"وارد نشده",q9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),U9e=()=>"OpenResearch uses a coding agent already installed on this machine.",G9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",W9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",V9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G9e():t==="fa"?W9e():U9e()}),K9e=()=>"Other research area",Q9e=()=>"其他研究领域",Y9e=()=>"حوزهٔ پژوهشی دیگر",X9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q9e():t==="fa"?Y9e():K9e()}),Z9e=()=>"Re-check",J9e=()=>"重新检查",eEe=()=>"بررسی دوباره",VD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J9e():t==="fa"?eEe():Z9e()}),tEe=()=>"Ready",nEe=()=>"已就绪",rEe=()=>"آماده",a6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Re-check Git before continuing",iEe=()=>"请重新检查 Git 后再继续",aEe=()=>"پیش از ادامه Git را دوباره بررسی کنید",oEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Representative papers",cEe=()=>"代表性论文",uEe=()=>"مقاله‌های شاخص",dEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Research background",hEe=()=>"研究背景",_Ee=()=>"پیشینهٔ پژوهشی",pEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",vEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",hN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Search alphaXiv by title to link a paper…",yEe=()=>"按标题搜索 alphaXiv 以关联论文…",xEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Searching alphaXiv…",kEe=()=>"正在搜索 alphaXiv…",CEe=()=>"در حال جست‌وجوی alphaXiv…",EEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Selected",zEe=()=>"已选择",jEe=()=>"انتخاب‌شده",TEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Local model unavailable",REe=()=>"本地模型不可用",MEe=()=>"مدل محلی در دسترس نیست",KD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),DEe=()=>"Setting things up…",LEe=()=>"正在设置…",OEe=()=>"در حال راه‌اندازی…",IEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LEe():t==="fa"?OEe():DEe()}),BEe=()=>"Connect a local model or sign in to a coding agent to continue",$Ee=()=>"连接本地模型或登录编码智能体以继续",PEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",FEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ee():t==="fa"?PEe():BEe()}),HEe=()=>"Connect a local model or sign in to an agent to continue.",qEe=()=>"连接本地模型或登录一个智能体以继续。",UEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",GEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qEe():t==="fa"?UEe():HEe()}),WEe=()=>"Signed in",VEe=()=>"已登录",KEe=()=>"وارد شده",QEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VEe():t==="fa"?KEe():WEe()}),YEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",XEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",ZEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",JEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XEe():t==="fa"?ZEe():YEe()}),eNe=()=>"· Step 1 of 2",tNe=()=>"· 第 1 步,共 2 步",nNe=()=>"· مرحلهٔ ۱ از ۲",rNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tNe():t==="fa"?nNe():eNe()}),sNe=()=>"· Step 2 of 2",iNe=()=>"· 第 2 步,共 2 步",aNe=()=>"· مرحلهٔ ۲ از ۲",oNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Tell us about your research",cNe=()=>"介绍一下你的研究",uNe=()=>"از پژوهش خود بگویید",dNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),fNe=()=>"Tell us your other research area",hNe=()=>"告诉我们你的其他研究领域",_Ne=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",pNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hNe():t==="fa"?_Ne():fNe()}),mNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",gNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",vNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",bNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gNe():t==="fa"?vNe():mNe()}),yNe=()=>"Unable to verify",xNe=()=>"无法验证",wNe=()=>"تأیید ممکن نیست",SNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xNe():t==="fa"?wNe():yNe()}),kNe=()=>"Update required",CNe=()=>"需要更新",ENe=()=>"نیازمند به‌روزرسانی",NNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Waiting for the Git check",jNe=()=>"正在等待 Git 检查",TNe=()=>"در انتظار بررسی Git",ANe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jNe():t==="fa"?TNe():zNe()}),RNe=()=>"Waiting for the local tool checks",MNe=()=>"正在等待本地工具检查",DNe=()=>"در انتظار بررسی ابزارهای محلی",LNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MNe():t==="fa"?DNe():RNe()}),ONe=()=>"What areas are you interested in?",INe=()=>"你对哪些领域感兴趣?",BNe=()=>"به چه حوزه‌هایی علاقه دارید؟",$Ne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),PNe=()=>"Your code, data, and experiment history stay on your machine.",FNe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",HNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",qNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FNe():t==="fa"?HNe():PNe()}),UNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",GNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",WNe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",VNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GNe():t==="fa"?WNe():UNe()}),KNe=()=>"Add cookie",QNe=()=>"添加 cookie",YNe=()=>"افزودن کوکی",XNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Changed here and on Overleaf — choose which copy to keep",JNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",eze=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",tze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"Create a token ↗",rze=()=>"创建令牌 ↗",sze=()=>"ساخت توکن ↗",ize=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),aze=()=>"Overleaf Git token",oze=()=>"Overleaf Git 令牌",lze=()=>"توکن Git در Overleaf",_N=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oze():t==="fa"?lze():aze()}),cze=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",uze=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",dze=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",fze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Import from browser",_ze=()=>"从浏览器导入",pze=()=>"وارد کردن از مرورگر",mze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"In step with Overleaf",vze=()=>"已与 Overleaf 同步",bze=()=>"با Overleaf همگام است",QD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),yze=()=>"The last sync did not finish.",xze=()=>"上次同步未完成。",wze=()=>"آخرین همگام‌سازی کامل نشد.",Sze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xze():t==="fa"?wze():yze()}),kze=()=>"Link and sync",Cze=()=>"关联并同步",Eze=()=>"پیوند و همگام‌سازی",Nze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"Connecting to Overleaf…",jze=()=>"正在连接 Overleaf…",Tze=()=>"در حال اتصال به Overleaf…",Aze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Edits are live on Overleaf",Mze=()=>"编辑已在 Overleaf 实时同步",Dze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Lze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mze():t==="fa"?Dze():Rze()}),Oze=()=>"Retry",Ize=()=>"重试",Bze=()=>"تلاش دوباره",$ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Live sync stopped.",Fze=()=>"实时同步已停止。",Hze=()=>"همگام‌سازی زنده متوقف شد.",qze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Live sync starts once the paper is in step with Overleaf.",Gze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Wze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Vze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Kze=()=>"My projects ↗",Qze=()=>"我的项目 ↗",Yze=()=>"پروژه‌های من ↗",pN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qze():t==="fa"?Yze():Kze()}),Xze=()=>"Nothing could be synced.",Zze=()=>"没有内容可以同步。",Jze=()=>"هیچ موردی قابل همگام‌سازی نبود.",eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open Overleaf ↗",nje=()=>"打开 Overleaf ↗",rje=()=>"باز کردن Overleaf ↗",sje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Cancel",aje=()=>"取消",oje=()=>"لغو",YD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",cje=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",uje=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",dje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Keep this copy",hje=()=>"保留此副本",_je=()=>"نگه داشتن این نسخه",pje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Open in Overleaf",gje=()=>"在 Overleaf 中打开",vje=()=>"باز کردن در Overleaf",bje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),yje=()=>"Replace the Overleaf token",xje=()=>"替换 Overleaf 令牌",wje=()=>"جایگزینی توکن Overleaf",mN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xje():t==="fa"?wje():yje()}),Sje=()=>"Sync files",kje=()=>"同步文件",Cje=()=>"همگام‌سازی فایل‌ها",Eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Unlink",zje=()=>"取消关联",jje=()=>"قطع پیوند",Tje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=()=>"Upload a copy as a new project ↗",Rje=()=>"上传副本作为新项目 ↗",Mje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",XD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rje():t==="fa"?Mje():Aje()}),Dje=()=>"Use Overleaf's",Lje=()=>"使用 Overleaf 的副本",Oje=()=>"استفاده از نسخهٔ Overleaf",Ije=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"This paper stays in step with Overleaf.",$je=()=>"此论文将与 Overleaf 保持同步。",Pje=()=>"این مقاله با Overleaf همگام می‌ماند.",Fje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$je():t==="fa"?Pje():Bje()}),Hje=()=>"Paste it instead",qje=()=>"改为粘贴",Uje=()=>"به‌جایش بچسبانید",Gje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qje():t==="fa"?Uje():Hje()}),Wje=e=>`Pulled ${e==null?void 0:e.paths}.`,Vje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Kje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Qje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vje(e):t==="fa"?Kje(e):Wje(e)}),Yje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Xje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Zje=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Jje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),eTe=e=>`Pushed ${e==null?void 0:e.paths}.`,tTe=e=>`已推送 ${e==null?void 0:e.paths}。`,nTe=e=>`${e==null?void 0:e.paths} ارسال شد.`,rTe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tTe(e):t==="fa"?nTe(e):eTe(e)}),sTe=()=>"Add a fresh Overleaf session cookie to start following again.",iTe=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",aTe=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",oTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Save the file first",cTe=()=>"请先保存文件",uTe=()=>"ابتدا فایل را ذخیره کنید",dTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),fTe=()=>"Save this file to sync it with Overleaf",hTe=()=>"保存此文件以与 Overleaf 同步",_Te=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",ZD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),pTe=()=>"Save token",mTe=()=>"保存令牌",gTe=()=>"ذخیرهٔ توکن",vTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),bTe=()=>"Send this paper to Overleaf",yTe=()=>"将此论文发送到 Overleaf",xTe=()=>"ارسال مقاله به Overleaf",wTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yTe():t==="fa"?xTe():bTe()}),STe=()=>"Overleaf session cookie",kTe=()=>"Overleaf 会话 cookie",CTe=()=>"کوکی نشست Overleaf",j4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kTe():t==="fa"?CTe():STe()}),ETe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",NTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",zTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",jTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=()=>"Overleaf sync failed",ATe=()=>"Overleaf 同步失败",RTe=()=>"همگام‌سازی با Overleaf ناموفق بود",T4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ATe():t==="fa"?RTe():TTe()}),MTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",DTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",LTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",OTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Syncing with Overleaf…",BTe=()=>"正在与 Overleaf 同步…",$Te=()=>"در حال همگام‌سازی با Overleaf…",JD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),PTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",FTe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",HTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",qTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FTe():t==="fa"?HTe():PTe()}),UTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",GTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",WTe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",VTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GTe():t==="fa"?WTe():UTe()}),KTe=()=>"Toggle Plan mode for this chat",QTe=()=>"切换此聊天的计划模式",YTe=()=>"تغییر حالت طرح این گفت‌وگو",XTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QTe():t==="fa"?YTe():KTe()}),ZTe=()=>"Accept and auto mode",JTe=()=>"接受并使用自动模式",eAe=()=>"پذیرش و حالت خودکار",tAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JTe():t==="fa"?eAe():ZTe()}),nAe=()=>"Accept and bypass all",rAe=()=>"接受并跳过所有审批",sAe=()=>"پذیرش و عبور از همهٔ تأییدها",iAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rAe():t==="fa"?sAe():nAe()}),aAe=()=>"Accept plan",oAe=()=>"接受计划",lAe=()=>"پذیرش طرح",cAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oAe():t==="fa"?lAe():aAe()}),uAe=e=>`${e==null?void 0:e.agent} proposed a plan`,dAe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,fAe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,hAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dAe(e):t==="fa"?fAe(e):uAe(e)}),_Ae=e=>`${e==null?void 0:e.agent} is ready to proceed`,pAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,mAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,gAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pAe(e):t==="fa"?mAe(e):_Ae(e)}),vAe=()=>"Back",bAe=()=>"返回",yAe=()=>"بازگشت",xAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bAe():t==="fa"?yAe():vAe()}),wAe=()=>"More approval options",SAe=()=>"更多批准选项",kAe=()=>"گزینه‌های تأیید بیشتر",CAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Open plan",NAe=()=>"打开计划",zAe=()=>"باز کردن طرح",jAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),TAe=()=>"Reject",AAe=()=>"拒绝",RAe=()=>"رد کردن",MAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),DAe=()=>"Revise",LAe=()=>"修改",OAe=()=>"بازنگری",IAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LAe():t==="fa"?OAe():DAe()}),BAe=()=>"Revise…",$Ae=()=>"修改…",PAe=()=>"بازنگری…",FAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ae():t==="fa"?PAe():BAe()}),HAe=()=>"What should change? (optional)",qAe=()=>"需要更改什么?(可选)",UAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",GAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qAe():t==="fa"?UAe():HAe()}),WAe=e=>`${e==null?void 0:e.count} active`,VAe=e=>`${e==null?void 0:e.count} 个活跃`,KAe=e=>`${e==null?void 0:e.count} فعال`,QAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?VAe(e):t==="fa"?KAe(e):WAe(e)}),YAe=e=>`${e==null?void 0:e.count} total agents`,XAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,ZAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,JAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?XAe(e):t==="fa"?ZAe(e):YAe(e)}),eRe=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,tRe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,nRe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,rRe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tRe(e):t==="fa"?nRe(e):eRe(e)}),sRe=()=>"Agents",iRe=()=>"智能体",aRe=()=>"عامل‌ها",gN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),oRe=()=>"arXiv paper ID:",lRe=()=>"arXiv 论文 ID:",cRe=()=>"شناسهٔ مقالهٔ arXiv:",uRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Cancel",fRe=()=>"取消",hRe=()=>"لغو",_Re=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),pRe=()=>"Created",mRe=()=>"创建时间",gRe=()=>"ایجادشده",vRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mRe():t==="fa"?gRe():pRe()}),bRe=()=>"Delete project?",yRe=()=>"删除项目?",xRe=()=>"پروژه حذف شود؟",wRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"Delete project",kRe=()=>"删除项目",CRe=()=>"حذف پروژه",ERe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"Deleting…",zRe=()=>"正在删除…",jRe=()=>"در حال حذف…",TRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),ARe=()=>"Experiments",RRe=()=>"实验",MRe=()=>"آزمایش‌ها",vN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RRe():t==="fa"?MRe():ARe()}),DRe=()=>"The local folder and linked GitHub repository are kept.",LRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",ORe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",IRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"The local folder is kept.",$Re=()=>"本地文件夹会保留。",PRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",FRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"New project",qRe=()=>"新建项目",URe=()=>"پروژهٔ جدید",eL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"No projects yet — create one to get started.",WRe=()=>"尚无项目——新建一个即可开始。",VRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",KRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Project",YRe=()=>"项目",XRe=()=>"پروژه",ZRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),JRe=()=>"Projects",eMe=()=>"项目",tMe=()=>"پروژه‌ها",nMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eMe():t==="fa"?tMe():JRe()}),rMe=()=>"Repository",sMe=()=>"仓库",iMe=()=>"مخزن",bN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),aMe=()=>"Idle",oMe=()=>"空闲",lMe=()=>"بیکار",cMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Local",dMe=()=>"本地",fMe=()=>"محلی",o6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dMe():t==="fa"?fMe():uMe()}),hMe=()=>"1 total agent",_Me=()=>"共 1 个智能体",pMe=()=>"در مجموع ۱ عامل",mMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=e=>`${e==null?void 0:e.count} running`,vMe=e=>`${e==null?void 0:e.count} 个运行中`,bMe=e=>`${e==null?void 0:e.count} در حال اجرا`,yMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vMe(e):t==="fa"?bMe(e):gMe(e)}),xMe=e=>`${e==null?void 0:e.count} total`,wMe=e=>`共 ${e==null?void 0:e.count} 个`,SMe=e=>`در مجموع ${e==null?void 0:e.count}`,yN=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wMe(e):t==="fa"?SMe(e):xMe(e)}),kMe=()=>"Installing the compatible binary. This may take a few minutes.",CMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",EMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",NMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),zMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,jMe=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,TMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,AMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jMe(e):t==="fa"?TMe(e):zMe(e)}),RMe=()=>"Check again",MMe=()=>"再次检查",DMe=()=>"بررسی دوباره",xN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MMe():t==="fa"?DMe():RMe()}),LMe=()=>"Closing…",OMe=()=>"正在关闭…",IMe=()=>"در حال بستن…",BMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OMe():t==="fa"?IMe():LMe()}),$Me=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,PMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,FMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,HMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PMe(e):t==="fa"?FMe(e):$Me(e)}),qMe=()=>"Preparing your remote workspace…",UMe=()=>"正在准备远程工作区…",GMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",WMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UMe():t==="fa"?GMe():qMe()}),VMe=e=>`Connecting to ${e==null?void 0:e.host}`,KMe=e=>`正在连接到 ${e==null?void 0:e.host}`,QMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,YMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KMe(e):t==="fa"?QMe(e):VMe(e)}),XMe=()=>"Close remote host picker",ZMe=()=>"关闭远程主机选择器",JMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",eDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZMe():t==="fa"?JMe():XMe()}),tDe=()=>"Choose a configured SSH host.",nDe=()=>"选择已配置的 SSH 主机。",rDe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",sDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nDe():t==="fa"?rDe():tDe()}),iDe=()=>"Connect to remote",aDe=()=>"连接到远程主机",oDe=()=>"اتصال به میزبان راه‌دور",tL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aDe():t==="fa"?oDe():iDe()}),lDe=()=>"Disconnect",cDe=()=>"断开连接",uDe=()=>"قطع اتصال",A4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Your remote work is still running. Reconnect when you’re ready.",fDe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",hDe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",_De=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`Disconnected from ${e==null?void 0:e.host}`,mDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,gDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,nL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),vDe=e=>`Could not connect to ${e==null?void 0:e.host}`,bDe=e=>`无法连接到 ${e==null?void 0:e.host}`,yDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,xDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bDe(e):t==="fa"?yDe(e):vDe(e)}),wDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",SDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",kDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",CDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SDe():t==="fa"?kDe():wDe()}),EDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",NDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",zDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",jDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),TDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ADe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,RDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,MDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ADe(e):t==="fa"?RDe(e):TDe(e)}),DDe=()=>"OpenResearch binary",LDe=()=>"OpenResearch 二进制文件",ODe=()=>"فایل اجرایی OpenResearch",IDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LDe():t==="fa"?ODe():DDe()}),BDe=()=>"OpenResearch Database",$De=()=>"OpenResearch 数据库",PDe=()=>"پایگاه دادهٔ OpenResearch",FDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",qDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",UDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",GDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qDe():t==="fa"?UDe():HDe()}),WDe=()=>"Install OpenResearch?",VDe=()=>"安装 OpenResearch?",KDe=()=>"OpenResearch نصب شود؟",QDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VDe():t==="fa"?KDe():WDe()}),YDe=()=>"Installing…",XDe=()=>"正在安装…",ZDe=()=>"در حال نصب…",JDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),eLe=()=>"No matching SSH hosts",tLe=()=>"没有匹配的 SSH 主机",nLe=()=>"میزبان SSH منطبقی پیدا نشد",rLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iLe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aLe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=()=>"Open remote",cLe=()=>"打开远程工作区",uLe=()=>"باز کردن راه‌دور",dLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),fLe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",hLe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",_Le=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",pLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",gLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",vLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",bLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gLe():t==="fa"?vLe():mLe()}),yLe=()=>"Preparing remote workspace…",xLe=()=>"正在准备远程工作区…",wLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",SLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),kLe=()=>"Reconnect",CLe=()=>"重新连接",ELe=()=>"اتصال دوباره",wN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),NLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",zLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",jLe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",TLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zLe():t==="fa"?jLe():NLe()}),ALe=e=>`Reconnecting to ${e==null?void 0:e.host}`,RLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,MLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,DLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RLe(e):t==="fa"?MLe(e):ALe(e)}),LLe=()=>"Search SSH hosts",OLe=()=>"搜索 SSH 主机",ILe=()=>"جستجوی میزبان‌های SSH",SN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),BLe=e=>`SSH: ${e==null?void 0:e.host}`,$Le=e=>`SSH:${e==null?void 0:e.host}`,PLe=e=>`SSH: ${e==null?void 0:e.host}`,E2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),FLe=()=>"Start a new OpenResearch host",HLe=()=>"启动新的 OpenResearch 主机",qLe=()=>"راه‌اندازی میزبان جدید OpenResearch",ULe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HLe():t==="fa"?qLe():FLe()}),GLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,WLe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,VLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,KLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WLe(e):t==="fa"?VLe(e):GLe(e)}),QLe=()=>"Stop OpenResearch",YLe=()=>"停止 OpenResearch",XLe=()=>"توقف OpenResearch",ZLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,eOe=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,tOe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,nOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eOe(e):t==="fa"?tOe(e):JLe(e)}),rOe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,sOe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,iOe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,aOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sOe(e):t==="fa"?iOe(e):rOe(e)}),oOe=()=>"Stop OpenResearch on host",lOe=()=>"停止主机上的 OpenResearch",cOe=()=>"توقف OpenResearch روی میزبان",rL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>"This will also:",dOe=()=>"这还将:",fOe=()=>"این کار همچنین:",hOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"End 1 pending approval.",pOe=()=>"结束 1 个待审批请求。",mOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",gOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),vOe=()=>"Leave 1 submitted experiment running.",bOe=()=>"让 1 个已提交实验继续运行。",yOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bOe():t==="fa"?yOe():vOe()}),wOe=()=>"Disconnect 1 other client.",SOe=()=>"断开 1 个其他客户端。",kOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",COe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Keep 1 queued message saved.",NOe=()=>"保留 1 条排队消息。",zOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",jOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),TOe=()=>"Interrupt 1 active agent turn.",AOe=()=>"中断 1 个活动代理任务。",ROe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",MOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AOe():t==="fa"?ROe():TOe()}),DOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,LOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,OOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,IOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LOe(e):t==="fa"?OOe(e):DOe(e)}),BOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,$Oe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,POe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,FOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,qOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,UOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,GOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qOe(e):t==="fa"?UOe(e):HOe(e)}),WOe=()=>"Stopping host…",VOe=()=>"正在停止主机…",KOe=()=>"در حال توقف میزبان…",QOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Update",XOe=()=>"更新",ZOe=()=>"به‌روزرسانی",kN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,eIe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,tIe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,nIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eIe(e):t==="fa"?tIe(e):JOe(e)}),rIe=()=>"Update OpenResearch?",sIe=()=>"更新 OpenResearch?",iIe=()=>"OpenResearch به‌روزرسانی شود؟",aIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Updating…",lIe=()=>"正在更新…",cIe=()=>"در حال به‌روزرسانی…",uIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),dIe=()=>"Disable syncing",fIe=()=>"关闭同步",hIe=()=>"غیرفعال کردن همگام‌سازی",_Ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fIe():t==="fa"?hIe():dIe()}),pIe=()=>"Enable GitHub syncing",mIe=()=>"启用 GitHub 同步",gIe=()=>"فعال‌سازی همگام‌سازی GitHub",vIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mIe():t==="fa"?gIe():pIe()}),bIe=()=>"Enabling…",yIe=()=>"正在启用…",xIe=()=>"در حال فعال‌سازی…",wIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yIe():t==="fa"?xIe():bIe()}),SIe=()=>"Updating…",kIe=()=>"正在更新…",CIe=()=>"در حال به‌روزرسانی…",EIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,zIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,jIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,TIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zIe(e):t==="fa"?jIe(e):NIe(e)}),AIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,RIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,MIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,DIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RIe(e):t==="fa"?MIe(e):AIe(e)}),LIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,OIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,IIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,BIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OIe(e):t==="fa"?IIe(e):LIe(e)}),$Ie=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,PIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,FIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,HIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PIe(e):t==="fa"?FIe(e):$Ie(e)}),qIe=()=>"CLI is retrying…",UIe=()=>"CLI 正在重试…",GIe=()=>"CLI در حال تلاش دوباره است…",WIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UIe():t==="fa"?GIe():qIe()}),VIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,KIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,QIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,YIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KIe(e):t==="fa"?QIe(e):VIe(e)}),XIe=()=>"Sending again…",ZIe=()=>"正在重新发送…",JIe=()=>"در حال ارسال دوباره…",eBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,nBe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,rBe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,sBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Retrying…",aBe=()=>"正在重试…",oBe=()=>"در حال تلاش دوباره…",sL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),lBe=()=>"Default speed",cBe=()=>"默认速度",uBe=()=>"سرعت پیش‌فرض",dBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cBe():t==="fa"?uBe():lBe()}),fBe=()=>"Standard",hBe=()=>"标准",_Be=()=>"استاندارد",pBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hBe():t==="fa"?_Be():fBe()}),mBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,gBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,vBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,bBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gBe(e):t==="fa"?vBe(e):mBe(e)}),yBe=()=>"Appearance",xBe=()=>"外观",wBe=()=>"ظاهر",SBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check",CBe=()=>"检查",EBe=()=>"بررسی",NBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"Check again",jBe=()=>"再次检查",TBe=()=>"بررسی دوباره",Qp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),ABe=()=>"Check for updates",RBe=()=>"检查更新",MBe=()=>"بررسی به‌روزرسانی",DBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RBe():t==="fa"?MBe():ABe()}),LBe=()=>"Check now",OBe=()=>"立即检查",IBe=()=>"اکنون بررسی کن",BBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Check setup",PBe=()=>"检查设置",FBe=()=>"بررسی راه‌اندازی",HBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PBe():t==="fa"?FBe():$Be()}),qBe=()=>"orx checks a few times a day on its own.",UBe=()=>"orx 每天会自动检查几次。",GBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",WBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UBe():t==="fa"?GBe():qBe()}),VBe=()=>"Choose a flavor",KBe=()=>"选择配置",QBe=()=>"انتخاب پیکربندی",YBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KBe():t==="fa"?QBe():VBe()}),XBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,ZBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,JBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZBe(e):t==="fa"?JBe(e):XBe(e)}),t$e=()=>"clean",n$e=()=>"无更改",r$e=()=>"بدون تغییر",s$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>`Already linked at ${e==null?void 0:e.link}.`,a$e=e=>`已链接到 ${e==null?void 0:e.link}。`,o$e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=e=>`Linked ${e==null?void 0:e.link}.`,u$e=e=>`已链接 ${e==null?void 0:e.link}。`,d$e=e=>`${e==null?void 0:e.link} پیوند شد.`,f$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u$e(e):t==="fa"?d$e(e):c$e(e)}),h$e=()=>"Connect",_$e=()=>"连接",p$e=()=>"اتصال",l6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_$e():t==="fa"?p$e():h$e()}),m$e=()=>"Connected via GitHub CLI",g$e=()=>"已通过 GitHub CLI 连接",v$e=()=>"از طریق GitHub CLI متصل است",iL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g$e():t==="fa"?v$e():m$e()}),b$e=()=>"Connecting…",y$e=()=>"正在连接…",x$e=()=>"در حال اتصال…",aL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y$e():t==="fa"?x$e():b$e()}),w$e=e=>`CPU cores: ${e==null?void 0:e.count}`,S$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,k$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,C$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S$e(e):t==="fa"?k$e(e):w$e(e)}),E$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",N$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",z$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",j$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"the current project",A$e=()=>"当前项目",R$e=()=>"پروژهٔ فعلی",M$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),D$e=e=>`${e==null?void 0:e.value} (custom)`,L$e=e=>`${e==null?void 0:e.value}(自定义)`,O$e=e=>`${e==null?void 0:e.value} (سفارشی)`,I$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L$e(e):t==="fa"?O$e(e):D$e(e)}),B$e=()=>"detached",$$e=()=>"分离头指针",P$e=()=>"جدا از شاخه",c6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Disconnected",H$e=()=>"已断开连接",q$e=()=>"قطع اتصال",oL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),U$e=()=>"Environment tab",G$e=()=>"环境标签页",W$e=()=>"زبانهٔ محیط",V$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G$e():t==="fa"?W$e():U$e()}),K$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Y$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,X$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Q$e(e):t==="fa"?Y$e(e):K$e(e)}),Z$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",J$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",ePe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",tPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J$e():t==="fa"?ePe():Z$e()}),nPe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",rPe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",sPe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",iPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",oPe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",lPe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",cPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=e=>`GPU × ${e==null?void 0:e.count}`,dPe=e=>`${e==null?void 0:e.count} 个 GPU`,fPe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,hPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dPe(e):t==="fa"?fPe(e):uPe(e)}),_Pe=()=>"has changes",pPe=()=>"有更改",mPe=()=>"دارای تغییر",gPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),vPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,bPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,yPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,xPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bPe(e):t==="fa"?yPe(e):vPe(e)}),wPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",SPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",kPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",CPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"Install",NPe=()=>"安装",zPe=()=>"نصب",jPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),TPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,APe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,RPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,MPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?APe(e):t==="fa"?RPe(e):TPe(e)}),DPe=e=>`Install the ${e==null?void 0:e.command} command`,LPe=e=>`安装 ${e==null?void 0:e.command} 命令`,OPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,IPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LPe(e):t==="fa"?OPe(e):DPe(e)}),BPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",$Pe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",PPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",FPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Pe():t==="fa"?PPe():BPe()}),HPe=()=>"Install the new release now instead of waiting for the background update.",qPe=()=>"立即安装新版本,无需等待后台更新。",UPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qPe():t==="fa"?UPe():HPe()}),WPe=()=>"Discard your unsaved Kubernetes changes?",VPe=()=>"要放弃未保存的 Kubernetes 更改吗?",KPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",QPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VPe():t==="fa"?KPe():WPe()}),YPe=()=>"Key from",XPe=()=>"密钥来自",ZPe=()=>"کلید از",JPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XPe():t==="fa"?ZPe():YPe()}),eFe=()=>"Use current kubectl context",tFe=()=>"使用当前 kubectl 上下文",nFe=()=>"استفاده از کانتکست فعلی kubectl",rFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=e=>`Use current context (${e==null?void 0:e.context})`,iFe=e=>`使用当前上下文(${e==null?void 0:e.context})`,aFe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,oFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iFe(e):t==="fa"?aFe(e):sFe(e)}),lFe=()=>"Language",cFe=()=>"语言",uFe=()=>"زبان",dFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),fFe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,hFe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,_Fe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,pFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hFe(e):t==="fa"?_Fe(e):fFe(e)}),mFe=()=>"Make default",gFe=()=>"设为默认值",vFe=()=>"پیش‌فرض شود",bFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gFe():t==="fa"?vFe():mFe()}),yFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",xFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",wFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",SFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xFe():t==="fa"?wFe():yFe()}),kFe=()=>"Replace token ID",CFe=()=>"替换令牌 ID",EFe=()=>"جایگزینی شناسهٔ توکن",NFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Replace token secret",jFe=()=>"替换令牌密钥",TFe=()=>"جایگزینی رمز توکن",AFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jFe():t==="fa"?TFe():zFe()}),RFe=()=>"How to get a Modal token",MFe=()=>"如何获取 Modal 令牌",DFe=()=>"روش دریافت توکن Modal",LFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MFe():t==="fa"?DFe():RFe()}),OFe=()=>"Token ID",IFe=()=>"令牌 ID",BFe=()=>"شناسهٔ توکن",$Fe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Token secret",FFe=()=>"令牌密钥",HFe=()=>"رمز توکن",qFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FFe():t==="fa"?HFe():PFe()}),UFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,GFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,WFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,lL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?GFe(e):t==="fa"?WFe(e):UFe(e)}),VFe=e=>`Needs ${e==null?void 0:e.tool}`,KFe=e=>`需要 ${e==null?void 0:e.tool}`,QFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,YFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KFe(e):t==="fa"?QFe(e):VFe(e)}),XFe=()=>"Needs tools",ZFe=()=>"缺少工具",JFe=()=>"به ابزارها نیاز دارد",eHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZFe():t==="fa"?JFe():XFe()}),tHe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,nHe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,rHe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,sHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nHe(e):t==="fa"?rHe(e):tHe(e)}),iHe=()=>"New runs use SSH; choose a host when launching.",aHe=()=>"新运行将使用 SSH;启动时请选择主机。",oHe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"New token",uHe=()=>"新令牌",dHe=()=>"توکن جدید",fHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"No default flavor",_He=()=>"不设默认配置",pHe=()=>"بدون پیکربندی پیش‌فرض",mHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"none",vHe=()=>"无",bHe=()=>"هیچ‌کدام",u6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vHe():t==="fa"?bHe():gHe()}),yHe=()=>"Not connected",xHe=()=>"未连接",wHe=()=>"متصل نیست",cL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"not found on PATH",kHe=()=>"在 PATH 中未找到",CHe=()=>"در PATH پیدا نشد",EHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,zHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,jHe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,THe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"not initialized",RHe=()=>"尚未初始化",MHe=()=>"راه‌اندازی نشده",DHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Not set",OHe=()=>"未设置",IHe=()=>"تنظیم نشده",R4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"OAuth (subscription login)",$He=()=>"OAuth(订阅登录)",PHe=()=>"OAuth (ورود با اشتراک)",FHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,qHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,UHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,GHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):HHe(e)}),WHe=()=>"Setting up…",VHe=()=>"正在设置…",KHe=()=>"در حال راه‌اندازی…",QHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Account",XHe=()=>"账户",ZHe=()=>"حساب",d6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Add one with",eqe=()=>"使用以下命令添加:",tqe=()=>"یکی با این فرمان اضافه کنید:",nqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Add variable",sqe=()=>"添加变量",iqe=()=>"افزودن متغیر",aqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"Agent models",lqe=()=>"智能体模型",cqe=()=>"مدل‌های عامل",uqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),dqe=()=>"Anonymous usage analytics",fqe=()=>"匿名使用情况分析",hqe=()=>"تحلیل ناشناس استفاده",CN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fqe():t==="fa"?hqe():dqe()}),_qe=()=>"Auth",pqe=()=>"身份验证",mqe=()=>"احراز هویت",gqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),vqe=()=>"Authentication",bqe=()=>"身份验证",yqe=()=>"احراز هویت",uL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bqe():t==="fa"?yqe():vqe()}),xqe=()=>"Auto-apply GitHub topics for new projects",wqe=()=>"为新项目自动添加 GitHub topic",Sqe=()=>"اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید",EN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wqe():t==="fa"?Sqe():xqe()}),kqe=()=>"Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.",Cqe=()=>"为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",Eqe=()=>"مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",dL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cqe():t==="fa"?Eqe():kqe()}),Nqe=()=>"Back to Compute",zqe=()=>"返回算力设置",jqe=()=>"بازگشت به رایانش",fL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zqe():t==="fa"?jqe():Nqe()}),Tqe=()=>"Backend",Aqe=()=>"后端",Rqe=()=>"بک‌اند",Mqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aqe():t==="fa"?Rqe():Tqe()}),Dqe=()=>"Baseline",Lqe=()=>"基线",Oqe=()=>"خط مبنا",Iqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"Binary",$qe=()=>"可执行文件",Pqe=()=>"فایل اجرایی",Fqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Cancel",qqe=()=>"取消",Uqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qqe():t==="fa"?Uqe():Hqe()}),Gqe=()=>"Cancel new variable",Wqe=()=>"取消新变量",Vqe=()=>"لغو متغیر جدید",Kqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wqe():t==="fa"?Vqe():Gqe()}),Qqe=()=>"Checking compute targets…",Yqe=()=>"正在检查算力目标…",Xqe=()=>"در حال بررسی مقصدهای رایانشی…",Zqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Qqe()}),Jqe=()=>"Checking kubectl…",eUe=()=>"正在检查 kubectl…",tUe=()=>"در حال بررسی kubectl…",nUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eUe():t==="fa"?tUe():Jqe()}),rUe=()=>"Checking Modal…",sUe=()=>"正在检查 Modal…",iUe=()=>"در حال بررسی Modal…",aUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Choose a preset flavor",lUe=()=>"选择预设规格",cUe=()=>"یک پیکربندی آماده انتخاب کنید",NN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),uUe=()=>"cluster default",dUe=()=>"集群默认值",fUe=()=>"پیش‌فرض خوشه",zN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dUe():t==="fa"?fUe():uUe()}),hUe=()=>"cluster default (e.g. 4h, 30m)",_Ue=()=>"集群默认值(例如 4h、30m)",pUe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",mUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ue():t==="fa"?pUe():hUe()}),gUe=()=>"Cluster unreachable",vUe=()=>"无法连接集群",bUe=()=>"خوشه در دسترس نیست",yUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vUe():t==="fa"?bUe():gUe()}),xUe=()=>"Compute",wUe=()=>"算力",SUe=()=>"رایانش",hL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wUe():t==="fa"?SUe():xUe()}),kUe=()=>"Connect compute backends and choose where new runs execute.",CUe=()=>"连接算力后端,并选择新运行的执行位置。",EUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",NUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"Connected",jUe=()=>"已连接",TUe=()=>"متصل",AUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jUe():t==="fa"?TUe():zUe()}),RUe=()=>"Context",MUe=()=>"上下文",DUe=()=>"زمینه",LUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MUe():t==="fa"?DUe():RUe()}),OUe=()=>"Current",IUe=()=>"当前",BUe=()=>"فعلی",$Ue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),PUe=()=>"Currently off:",FUe=()=>"当前已关闭:",HUe=()=>"اکنون خاموش است:",qUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FUe():t==="fa"?HUe():PUe()}),UUe=()=>"Custom flavor",GUe=()=>"自定义规格",WUe=()=>"پیکربندی سفارشی",VUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GUe():t==="fa"?WUe():UUe()}),KUe=()=>"Custom flavor…",QUe=()=>"自定义规格…",YUe=()=>"پیکربندی سفارشی…",XUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QUe():t==="fa"?YUe():KUe()}),ZUe=()=>"Data directory",JUe=()=>"数据目录",eGe=()=>"پوشهٔ داده",tGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JUe():t==="fa"?eGe():ZUe()}),nGe=()=>"default",rGe=()=>"默认",sGe=()=>"پیش‌فرض",iGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rGe():t==="fa"?sGe():nGe()}),aGe=()=>"Default",oGe=()=>"默认",lGe=()=>"پیش‌فرض",_L=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oGe():t==="fa"?lGe():aGe()}),cGe=()=>"Default destination",uGe=()=>"默认目标",dGe=()=>"مقصد پیش‌فرض",fGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uGe():t==="fa"?dGe():cGe()}),hGe=()=>"Detecting hardware…",_Ge=()=>"正在检测硬件…",pGe=()=>"در حال شناسایی سخت‌افزار…",mGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Detecting harnesses…",vGe=()=>"正在检测智能体工具…",bGe=()=>"در حال شناسایی ابزارهای عامل…",yGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",wGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",SGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",kGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Effective URL",EGe=()=>"实际使用的网址",NGe=()=>"نشانی مؤثر",zGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Enable GitHub syncing for new projects",TGe=()=>"为新项目启用 GitHub 同步",AGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",jN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),RGe=()=>"Environment",MGe=()=>"环境",DGe=()=>"محیط",pL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MGe():t==="fa"?DGe():RGe()}),LGe=()=>"Failed",OGe=()=>"失败",IGe=()=>"ناموفق",f6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OGe():t==="fa"?IGe():LGe()}),BGe=()=>"General",$Ge=()=>"常规",PGe=()=>"عمومی",FGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ge():t==="fa"?PGe():BGe()}),HGe=()=>"GitHub publishing",qGe=()=>"GitHub 发布",UGe=()=>"انتشار در GitHub",GGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qGe():t==="fa"?UGe():HGe()}),WGe=()=>"Git token",VGe=()=>"Git 令牌",KGe=()=>"توکن Git",QGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VGe():t==="fa"?KGe():WGe()}),YGe=()=>"Harnesses",XGe=()=>"智能体工具",ZGe=()=>"ابزارهای عامل",JGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XGe():t==="fa"?ZGe():YGe()}),eWe=()=>"hf_…",tWe=()=>"hf_…",nWe=()=>"hf_…",rWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",iWe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",aWe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",oWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"Initialize Git",cWe=()=>"初始化 Git",uWe=()=>"راه‌اندازی Git",dWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),fWe=()=>"Install",hWe=()=>"安装",_We=()=>"نصب",mL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hWe():t==="fa"?_We():fWe()}),pWe=()=>"Install broken",mWe=()=>"安装损坏",gWe=()=>"نصب خراب است",vWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mWe():t==="fa"?gWe():pWe()}),bWe=()=>"Install GitHub CLI",yWe=()=>"安装 GitHub CLI",xWe=()=>"نصب GitHub CLI",wWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yWe():t==="fa"?xWe():bWe()}),SWe=()=>"Install updates automatically",kWe=()=>"自动安装更新",CWe=()=>"نصب خودکار به‌روزرسانی‌ها",TN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),EWe=()=>"Instance history",NWe=()=>"实例历史",zWe=()=>"تاریخچهٔ نمونه‌ها",jWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NWe():t==="fa"?zWe():EWe()}),TWe=()=>"Invalid Token",AWe=()=>"令牌无效",RWe=()=>"توکن نامعتبر",MWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AWe():t==="fa"?RWe():TWe()}),DWe=()=>"Jobs / Dashboard URL",LWe=()=>"Jobs / 控制台网址",OWe=()=>"نشانی Jobs / داشبورد",IWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"kubectl not found",$We=()=>"未找到 kubectl",PWe=()=>"kubectl پیدا نشد",FWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$We():t==="fa"?PWe():BWe()}),HWe=()=>"Latest",qWe=()=>"最新版本",UWe=()=>"جدیدترین",GWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qWe():t==="fa"?UWe():HWe()}),WWe=()=>"Loading…",VWe=()=>"正在加载…",KWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VWe():t==="fa"?KWe():WWe()}),QWe=()=>"Loading Ray settings…",YWe=()=>"正在加载 Ray 设置…",XWe=()=>"در حال بارگیری تنظیمات Ray…",ZWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YWe():t==="fa"?XWe():QWe()}),JWe=()=>"Loading slurm settings…",eVe=()=>"正在加载 Slurm 设置…",tVe=()=>"در حال بارگیری تنظیمات Slurm…",nVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eVe():t==="fa"?tVe():JWe()}),rVe=()=>"Loading status…",sVe=()=>"正在加载状态…",iVe=()=>"در حال بارگیری وضعیت…",aVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sVe():t==="fa"?iVe():rVe()}),oVe=()=>"Local only",lVe=()=>"仅本地",cVe=()=>"فقط محلی",uVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lVe():t==="fa"?cVe():oVe()}),dVe=()=>"Local repository",fVe=()=>"本地仓库",hVe=()=>"مخزن محلی",_Ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fVe():t==="fa"?hVe():dVe()}),pVe=()=>"Login node",mVe=()=>"登录节点",gVe=()=>"گرهٔ ورود",vVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mVe():t==="fa"?gVe():pVe()}),bVe=()=>"Make GitHub syncing the default?",yVe=()=>"将 GitHub 同步设为默认值?",xVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",wVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yVe():t==="fa"?xVe():bVe()}),SVe=()=>"Missing bash/tar",kVe=()=>"缺少 bash/tar",CVe=()=>"bash/tar موجود نیست",EVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kVe():t==="fa"?CVe():SVe()}),NVe=()=>"More compute options",zVe=()=>"更多算力选项",jVe=()=>"گزینه‌های رایانشی بیشتر",TVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zVe():t==="fa"?jVe():NVe()}),AVe=()=>"Move failed:",RVe=()=>"移动失败:",MVe=()=>"انتقال ناموفق بود:",DVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RVe():t==="fa"?MVe():AVe()}),LVe=()=>"Moved. orx is now using the new location.",OVe=()=>"已移动。orx 现在使用新位置。",IVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",BVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OVe():t==="fa"?IVe():LVe()}),$Ve=()=>"Namespace",PVe=()=>"命名空间",FVe=()=>"فضای نام",HVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PVe():t==="fa"?FVe():$Ve()}),qVe=()=>"New location",UVe=()=>"新位置",GVe=()=>"محل جدید",WVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UVe():t==="fa"?GVe():qVe()}),VVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",KVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",QVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",YVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KVe():t==="fa"?QVe():VVe()}),XVe=()=>"New variable key",ZVe=()=>"新变量键名",JVe=()=>"کلید متغیر جدید",eKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZVe():t==="fa"?JVe():XVe()}),tKe=()=>"New variable value",nKe=()=>"新变量值",rKe=()=>"مقدار متغیر جدید",sKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nKe():t==="fa"?rKe():tKe()}),iKe=()=>"No code, prompts, file contents, or account identifiers are sent.",aKe=()=>"不会发送代码、提示词、文件内容或账户标识符。",oKe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",lKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aKe():t==="fa"?oKe():iKe()}),cKe=()=>"No hosts found in ~/.ssh/config.",uKe=()=>"在 ~/.ssh/config 中未找到主机。",dKe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",fKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uKe():t==="fa"?dKe():cKe()}),hKe=()=>"No job-create permission",_Ke=()=>"没有创建 Job 的权限",pKe=()=>"مجوز ساخت Job وجود ندارد",mKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ke():t==="fa"?pKe():hKe()}),gKe=()=>"No Write Permissions",vKe=()=>"无写入权限",bKe=()=>"بدون مجوز نوشتن",yKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vKe():t==="fa"?bKe():gKe()}),xKe=()=>"No key on this computer to register — load a registered key with",wKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",SKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",kKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wKe():t==="fa"?SKe():xKe()}),CKe=()=>"No key on this computer yet — create one with",EKe=()=>"此计算机上还没有密钥——使用以下命令创建:",NKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",zKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EKe():t==="fa"?NKe():CKe()}),jKe=()=>"No Slurm CLI",TKe=()=>"无 Slurm CLI",AKe=()=>"بدون CLI اسلورم",RKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TKe():t==="fa"?AKe():jKe()}),MKe=()=>"None registered",DKe=()=>"未注册任何密钥",LKe=()=>"هیچ‌کدام ثبت نشده",OKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DKe():t==="fa"?LKe():MKe()}),IKe=()=>"Not checked",BKe=()=>"未检查",$Ke=()=>"بررسی نشده",gL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BKe():t==="fa"?$Ke():IKe()}),PKe=()=>"Not configured",FKe=()=>"未配置",HKe=()=>"پیکربندی نشده",tb=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FKe():t==="fa"?HKe():PKe()}),qKe=()=>"Not installed",UKe=()=>"未安装",GKe=()=>"نصب نیست",WKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UKe():t==="fa"?GKe():qKe()}),VKe=()=>"Not now",KKe=()=>"暂不",QKe=()=>"اکنون نه",YKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KKe():t==="fa"?QKe():VKe()}),XKe=()=>"Not on this computer",ZKe=()=>"不在此计算机上",JKe=()=>"روی این رایانه نیست",eQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZKe():t==="fa"?JKe():XKe()}),tQe=()=>"Not set (pass --host per launch)",nQe=()=>"未设置(每次启动时传入 --host)",rQe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",sQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Not signed in",aQe=()=>"未登录",oQe=()=>"وارد نشده",vL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),lQe=()=>"On this computer",cQe=()=>"在此计算机上",uQe=()=>"روی این رایانه",dQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cQe():t==="fa"?uQe():lQe()}),fQe=()=>"Open a project to inspect its repository and GitHub publication state.",hQe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",_Qe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",pQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hQe():t==="fa"?_Qe():fQe()}),mQe=()=>"Open job page",gQe=()=>"打开作业页面",vQe=()=>"باز کردن صفحهٔ کار",AN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gQe():t==="fa"?vQe():mQe()}),bQe=()=>"Open on GitHub",yQe=()=>"在 GitHub 上打开",xQe=()=>"باز کردن در GitHub",RN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yQe():t==="fa"?xQe():bQe()}),wQe=()=>", or create one with",SQe=()=>",或使用以下命令创建:",kQe=()=>"، یا با این فرمان یکی بسازید:",CQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SQe():t==="fa"?kQe():wQe()}),EQe=()=>"Org",NQe=()=>"组织",zQe=()=>"سازمان",jQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"Orgs",AQe=()=>"组织",RQe=()=>"سازمان‌ها",MQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),DQe=()=>"orx can't update this install",LQe=()=>"orx 无法更新此安装",OQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",IQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LQe():t==="fa"?OQe():DQe()}),BQe=()=>"Overleaf",$Qe=()=>"Overleaf",PQe=()=>"Overleaf",bL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),FQe=()=>"Overleaf Git authentication token",HQe=()=>"Overleaf Git 身份验证令牌",qQe=()=>"توکن احراز هویت Git در Overleaf",UQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HQe():t==="fa"?qQe():FQe()}),GQe=()=>"Overridden by env",WQe=()=>"已被环境变量覆盖",VQe=()=>"بازنویسی‌شده توسط محیط",KQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WQe():t==="fa"?VQe():GQe()}),QQe=()=>"Partition",YQe=()=>"分区",XQe=()=>"پارتیشن",ZQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YQe():t==="fa"?XQe():QQe()}),JQe=()=>"Path",eYe=()=>"路径",tYe=()=>"مسیر",nYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eYe():t==="fa"?tYe():JQe()}),rYe=()=>"Plan",sYe=()=>"方案",iYe=()=>"سطح اشتراک",aYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sYe():t==="fa"?iYe():rYe()}),oYe=()=>"Project",lYe=()=>"项目",cYe=()=>"پروژه",uYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lYe():t==="fa"?cYe():oYe()}),dYe=()=>"Ray version",fYe=()=>"Ray 版本",hYe=()=>"نسخهٔ Ray",_Ye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),pYe=()=>"Reachable",mYe=()=>"可访问",gYe=()=>"در دسترس",vYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mYe():t==="fa"?gYe():pYe()}),bYe=()=>"Reading ~/.ssh/config…",yYe=()=>"正在读取 ~/.ssh/config…",xYe=()=>"در حال خواندن ‎~/.ssh/config…",yL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yYe():t==="fa"?xYe():bYe()}),wYe=()=>"Ready",SYe=()=>"就绪",kYe=()=>"آماده",Yp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),CYe=()=>"Ready to move",EYe=()=>"可以移动",NYe=()=>"آمادهٔ انتقال",zYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EYe():t==="fa"?NYe():CYe()}),jYe=()=>"Configured",TYe=()=>"已配置",AYe=()=>"پیکربندی‌شده",h6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),RYe=()=>"Refresh",MYe=()=>"刷新",DYe=()=>"تازه‌سازی",Xp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MYe():t==="fa"?DYe():RYe()}),LYe=()=>"Remotes",OYe=()=>"远程仓库",IYe=()=>"مخزن‌های دوردست",BYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OYe():t==="fa"?IYe():LYe()}),$Ye=()=>"Repository",PYe=()=>"仓库",FYe=()=>"مخزن",HYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PYe():t==="fa"?FYe():$Ye()}),qYe=()=>"Repository topics",UYe=()=>"仓库 topic",GYe=()=>"موضوع‌های مخزن",S1=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UYe():t==="fa"?GYe():qYe()}),WYe=()=>"Restart to finish updating",VYe=()=>"重新启动以完成更新",KYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",QYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VYe():t==="fa"?KYe():WYe()}),YYe=()=>"Running instances",XYe=()=>"正在运行的实例",ZYe=()=>"نمونه‌های در حال اجرا",JYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),eXe=()=>"Runtime",tXe=()=>"运行时间",nXe=()=>"زمان اجرا",rXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>". Save it under that key if it's meant for HF Jobs.",iXe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",aXe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",oXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>"Session cookie",cXe=()=>"会话 cookie",uXe=()=>"کوکی نشست",dXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),fXe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",hXe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",_Xe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",pXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hXe():t==="fa"?_Xe():fXe()}),mXe=()=>"Settings",gXe=()=>"设置",vXe=()=>"تنظیمات",_6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gXe():t==="fa"?vXe():mXe()}),bXe=()=>"Signed in",yXe=()=>"已登录",xXe=()=>"وارد شده",wXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yXe():t==="fa"?xXe():bXe()}),SXe=()=>"Source",kXe=()=>"来源",CXe=()=>"منبع",xL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kXe():t==="fa"?CXe():SXe()}),EXe=()=>"SSH Key",NXe=()=>"SSH 密钥",zXe=()=>"کلید SSH",jXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NXe():t==="fa"?zXe():EXe()}),TXe=()=>"Started",AXe=()=>"开始时间",RXe=()=>"آغاز",MXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),DXe=()=>"State",LXe=()=>"状态",OXe=()=>"وضعیت",IXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LXe():t==="fa"?OXe():DXe()}),BXe=()=>"Status",$Xe=()=>"状态",PXe=()=>"وضعیت",l_=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),FXe=()=>"Storage",HXe=()=>"存储",qXe=()=>"ذخیره‌سازی",UXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HXe():t==="fa"?qXe():FXe()}),GXe=()=>"Sync",WXe=()=>"同步",VXe=()=>"همگام‌سازی",KXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"Syncing off",YXe=()=>"同步已关闭",XXe=()=>"همگام‌سازی خاموش",ZXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Test connection",eZe=()=>"测试连接",tZe=()=>"آزمایش اتصال",nZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Testing…",sZe=()=>"正在测试…",iZe=()=>"در حال آزمایش…",aZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),oZe=()=>", then add it with",lZe=()=>",然后使用以下命令添加:",cZe=()=>"، سپس با این فرمان اضافه‌اش کنید:",uZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lZe():t==="fa"?cZe():oZe()}),dZe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",fZe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",hZe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",_Ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fZe():t==="fa"?hZe():dZe()}),pZe=()=>"This saved destination is not configured. Set it up below or choose another backend.",mZe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",gZe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",vZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mZe():t==="fa"?gZe():pZe()}),bZe=()=>"This value looks like a Hugging Face token — compute runs only read it from",yZe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",xZe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",wZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yZe():t==="fa"?xZe():bZe()}),SZe=()=>"Time limit",kZe=()=>"时间限制",CZe=()=>"محدودیت زمانی",EZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Unable to verify",zZe=()=>"无法验证",jZe=()=>"تأیید ممکن نیست",M4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),TZe=()=>"Unknown",AZe=()=>"未知",RZe=()=>"نامشخص",wL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AZe():t==="fa"?RZe():TZe()}),MZe=()=>"Update required",DZe=()=>"需要更新",LZe=()=>"نیازمند به‌روزرسانی",OZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DZe():t==="fa"?LZe():MZe()}),IZe=()=>"Updates",BZe=()=>"更新",$Ze=()=>"به‌روزرسانی‌ها",MN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BZe():t==="fa"?$Ze():IZe()}),PZe=()=>"Usage analytics",FZe=()=>"使用情况分析",HZe=()=>"تحلیل استفاده",qZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FZe():t==="fa"?HZe():PZe()}),UZe=()=>"value",GZe=()=>"值",WZe=()=>"مقدار",SL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GZe():t==="fa"?WZe():UZe()}),VZe=()=>"Variables available to runs and the research agent (API keys, tokens).",KZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",QZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",YZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZe():t==="fa"?QZe():VZe()}),XZe=()=>"Version",ZZe=()=>"版本",JZe=()=>"نسخه",kL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZe():t==="fa"?JZe():XZe()}),eJe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",tJe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",nJe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",rJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tJe():t==="fa"?nJe():eJe()}),sJe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",iJe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",aJe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",oJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iJe():t==="fa"?aJe():sJe()}),lJe=()=>"Pick a login node first",cJe=()=>"请先选择登录节点",uJe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",dJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cJe():t==="fa"?uJe():lJe()}),fJe=()=>"Providers",hJe=()=>"提供商",_Je=()=>"ارائه‌دهندگان",pJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hJe():t==="fa"?_Je():fJe()}),mJe=()=>"Reconnect",gJe=()=>"重新连接",vJe=()=>"اتصال دوباره",CL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gJe():t==="fa"?vJe():mJe()}),bJe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yJe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,xJe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,wJe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yJe(e):t==="fa"?xJe(e):bJe(e)}),SJe=()=>"Reinstall with the orx installer to get automatic updates.",kJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",CJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",EJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kJe():t==="fa"?CJe():SJe()}),NJe=()=>"Re-link",zJe=()=>"重新链接",jJe=()=>"پیوند دوباره",TJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zJe():t==="fa"?jJe():NJe()}),AJe=()=>"Remove cookie",RJe=()=>"移除 cookie",MJe=()=>"حذف کوکی",DJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RJe():t==="fa"?MJe():AJe()}),LJe=()=>"Remove token",OJe=()=>"移除令牌",IJe=()=>"حذف توکن",BJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OJe():t==="fa"?IJe():LJe()}),$Je=()=>"Removing…",PJe=()=>"正在移除…",FJe=()=>"در حال حذف…",DN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PJe():t==="fa"?FJe():$Je()}),HJe=()=>"Replace anyway",qJe=()=>"仍要替换",UJe=()=>"به‌هرحال جایگزین کن",GJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qJe():t==="fa"?UJe():HJe()}),WJe=()=>"Replace key",VJe=()=>"替换密钥",KJe=()=>"جایگزینی کلید",QJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJe():t==="fa"?KJe():WJe()}),YJe=()=>"Replace token",XJe=()=>"替换令牌",ZJe=()=>"جایگزینی توکن",JJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XJe():t==="fa"?ZJe():YJe()}),eet=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,tet=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,net=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,ret=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tet(e):t==="fa"?net(e):eet(e)}),set=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,iet=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,aet=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,oet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iet(e):t==="fa"?aet(e):set(e)}),cet=()=>"Run `gh auth login` in your terminal.",uet=()=>"请在终端中运行 `gh auth login`。",det=()=>"در پایانه `gh auth login` را اجرا کنید.",fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uet():t==="fa"?det():cet()}),het=()=>"Saved",_et=()=>"已保存",pet=()=>"ذخیره شده",LN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_et():t==="fa"?pet():het()}),met=()=>"Set up",get=()=>"设置",vet=()=>"راه‌اندازی",bet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?get():t==="fa"?vet():met()}),yet=()=>"Set up SSH key",xet=()=>"设置 SSH 密钥",wet=()=>"راه‌اندازی کلید SSH",ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"Sign in",Eet=()=>"登录",Net=()=>"ورود",EL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),zet=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,jet=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Tet=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,NL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jet(e):t==="fa"?Tet(e):zet(e)}),Aet=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Ret=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Met=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Det=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ret():t==="fa"?Met():Aet()}),Let=()=>"The terminal disconnected before setup completed. Try again.",Oet=()=>"设置完成前终端连接已断开。请重试。",Iet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",ON=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oet():t==="fa"?Iet():Let()}),Bet=()=>"Dark",$et=()=>"深色",Pet=()=>"تیره",Fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$et():t==="fa"?Pet():Bet()}),Het=()=>"Theme",qet=()=>"主题",Uet=()=>"پوسته",IN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qet():t==="fa"?Uet():Het()}),Get=()=>"Light",Wet=()=>"浅色",Vet=()=>"روشن",Ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wet():t==="fa"?Vet():Get()}),Qet=()=>"System",Yet=()=>"系统",Xet=()=>"سیستم",Zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=()=>"Set up billing in the Tinker console",ett=()=>"在 Tinker 控制台设置账单",ttt=()=>"تنظیم پرداخت در کنسول Tinker",ntt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ett():t==="fa"?ttt():Jet()}),rtt=()=>"Billing setup required",stt=()=>"需要设置账单",itt=()=>"تنظیم پرداخت لازم است",att=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",ltt=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",ctt=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",utt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"Invalid Key",ftt=()=>"密钥无效",htt=()=>"کلید نامعتبر",_tt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Token from",mtt=()=>"令牌来自",gtt=()=>"توکن از",vtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),btt=()=>"Update now",ytt=()=>"立即更新",xtt=()=>"اکنون به‌روزرسانی کن",wtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ytt():t==="fa"?xtt():btt()}),Stt=e=>`Update to ${e==null?void 0:e.version}`,ktt=e=>`更新到 ${e==null?void 0:e.version}`,Ctt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Ett=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ktt(e):t==="fa"?Ctt(e):Stt(e)}),Ntt=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",ztt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",jtt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Ttt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ztt():t==="fa"?jtt():Ntt()}),Att=()=>"Updating default destination…",Rtt=()=>"正在更新默认运行位置…",Mtt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Dtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rtt():t==="fa"?Mtt():Att()}),Ltt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",Ott=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Itt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Btt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ott():t==="fa"?Itt():Ltt()}),$tt=()=>"Validating…",Ptt=()=>"正在验证…",Ftt=()=>"در حال اعتبارسنجی…",zL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ptt():t==="fa"?Ftt():$tt()}),Htt=()=>"View settings",qtt=()=>"查看设置",Utt=()=>"مشاهدهٔ تنظیمات",Gtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qtt():t==="fa"?Utt():Htt()}),Wtt=()=>"Skill",Vtt=()=>"技能",Ktt=()=>"مهارت",Qtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vtt():t==="fa"?Ktt():Wtt()}),Ytt=()=>"Loading skill…",Xtt=()=>"正在加载技能…",Ztt=()=>"در حال بارگیری مهارت…",Jtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xtt():t==="fa"?Ztt():Ytt()}),ent=()=>"Personal",tnt=()=>"个人",nnt=()=>"شخصی",rnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Alternatively, tell your agent to save a reusable skill for you.",int=()=>"或者,请你的智能体为你保存可重复使用的技能。",ant=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",ont=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,cnt=e=>`删除技能“${e==null?void 0:e.name}”?`,unt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,dnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cnt(e):t==="fa"?unt(e):lnt(e)}),fnt=e=>`Delete skill ${e==null?void 0:e.name}`,hnt=e=>`删除技能 ${e==null?void 0:e.name}`,_nt=e=>`حذف مهارت ${e==null?void 0:e.name}`,pnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hnt(e):t==="fa"?_nt(e):fnt(e)}),mnt=e=>`Delete the “${e==null?void 0:e.name}” template?`,gnt=e=>`删除模板“${e==null?void 0:e.name}”?`,vnt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,bnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gnt(e):t==="fa"?vnt(e):mnt(e)}),ynt=e=>`Delete template ${e==null?void 0:e.name}`,xnt=e=>`删除模板 ${e==null?void 0:e.name}`,wnt=e=>`حذف قالب ${e==null?void 0:e.name}`,Snt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xnt(e):t==="fa"?wnt(e):ynt(e)}),knt=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",Cnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Ent=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Nnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cnt():t==="fa"?Ent():knt()}),znt=()=>"Drop a SKILL.md or .zip here, or click to choose",jnt=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Tnt=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Ant=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jnt():t==="fa"?Tnt():znt()}),Rnt=()=>"Drop a .tex or .zip here, or click to choose",Mnt=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Dnt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Lnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mnt():t==="fa"?Dnt():Rnt()}),Ont=()=>"File too large (max 20 MB).",Int=()=>"文件过大(最大 20 MB)。",Bnt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",jL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Int():t==="fa"?Bnt():Ont()}),$nt=()=>" + 1 file",Pnt=()=>" + 1 个文件",Fnt=()=>" + ۱ فایل",Hnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pnt():t==="fa"?Fnt():$nt()}),qnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Unt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Gnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Wnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Remove from OpenResearch",Knt=()=>"从 OpenResearch 移除",Qnt=()=>"حذف از OpenResearch",Ynt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,Znt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,Jnt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,ert=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Znt(e):t==="fa"?Jnt(e):Xnt(e)}),trt=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,nrt=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,rrt=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,srt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nrt(e):t==="fa"?rrt(e):trt(e)}),irt=e=>` + ${e==null?void 0:e.count} files`,art=e=>` + ${e==null?void 0:e.count} 个文件`,ort=e=>` + ${e==null?void 0:e.count} فایل`,lrt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?art(e):t==="fa"?ort(e):irt(e)}),crt=()=>"Could not load skills:",urt=()=>"无法加载技能:",drt=()=>"بارگیری مهارت‌ها ممکن نشد:",frt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?urt():t==="fa"?drt():crt()}),hrt=()=>"Could not load templates:",_rt=()=>"无法加载模板:",prt=()=>"بارگیری قالب‌ها ممکن نشد:",mrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"Customize",vrt=()=>"自定义",brt=()=>"سفارشی‌سازی",yrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"Delete skill",wrt=()=>"删除技能",Srt=()=>"حذف مهارت",krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Delete template",Ert=()=>"删除模板",Nrt=()=>"حذف قالب",zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"LaTeX templates",Trt=()=>"LaTeX 模板",Art=()=>"قالب‌های LaTeX",Rrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"Loading skills…",Drt=()=>"正在加载技能…",Lrt=()=>"در حال بارگیری مهارت‌ها…",Ort=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Loading templates…",Brt=()=>"正在加载模板…",$rt=()=>"در حال بارگیری قالب‌ها…",Prt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"No skills yet.",Hrt=()=>"尚无技能。",qrt=()=>"هنوز مهارتی وجود ندارد.",Urt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"No templates yet.",Wrt=()=>"尚无模板。",Vrt=()=>"هنوز قالبی وجود ندارد.",Krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"Skills",Yrt=()=>"技能",Xrt=()=>"مهارت‌ها",Zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Uploading…",est=()=>"正在上传…",tst=()=>"در حال بارگذاری…",nst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",sst=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",ist=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ast=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"Upload a SKILL.md file or a .zip of a skill folder.",lst=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",cst=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",ust=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Upload a .tex file or a .zip of a template folder.",fst=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",hst=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",_st=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),pst=()=>"Close SSH config",mst=()=>"关闭 SSH 配置",gst=()=>"بستن پیکربندی SSH",vst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mst():t==="fa"?gst():pst()}),bst=()=>"Discard your unsaved SSH config changes?",yst=()=>"要放弃未保存的 SSH 配置更改吗?",xst=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",wst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yst():t==="fa"?xst():bst()}),Sst=()=>"Loading SSH config…",kst=()=>"正在加载 SSH 配置…",Cst=()=>"در حال بارگیری پیکربندی SSH…",Est=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kst():t==="fa"?Cst():Sst()}),Nst=()=>"SSH config saved",zst=()=>"SSH 配置已保存",jst=()=>"پیکربندی SSH ذخیره شد",Tst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zst():t==="fa"?jst():Nst()}),Ast=()=>"SSH config",Rst=()=>"SSH 配置",Mst=()=>"پیکربندی SSH",Dst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rst():t==="fa"?Mst():Ast()}),Lst=()=>"Configure SSH hosts…",Ost=()=>"配置 SSH 主机…",Ist=()=>"پیکربندی میزبان‌های SSH…",TL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ost():t==="fa"?Ist():Lst()}),Bst=()=>"Cancelled",$st=()=>"已取消",Pst=()=>"لغوشده",Fst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$st():t==="fa"?Pst():Bst()}),Hst=()=>"Cancelling",qst=()=>"正在取消",Ust=()=>"در حال لغو",Gst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Done",Vst=()=>"已完成",Kst=()=>"انجام‌شده",Qst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Editing",Xst=()=>"正在编辑",Zst=()=>"در حال ویرایش",Jst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=()=>"Failed",tit=()=>"失败",nit=()=>"ناموفق",rit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tit():t==="fa"?nit():eit()}),sit=()=>"Idle",iit=()=>"空闲",ait=()=>"بی‌کار",oit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iit():t==="fa"?ait():sit()}),lit=()=>"Running",cit=()=>"运行中",uit=()=>"در حال اجرا",dit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Starting",hit=()=>"正在启动",_it=()=>"در حال آغاز",pit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Copying…",git=()=>"正在复制…",vit=()=>"در حال کپی…",bit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>"Finalizing…",xit=()=>"正在完成…",wit=()=>"در حال نهایی‌سازی…",Sit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=e=>`${e==null?void 0:e.size} free at target`,Cit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,Eit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,Nit=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Cit(e):t==="fa"?Eit(e):kit(e)}),zit=e=>`Move all orx data to: +رونوشت آن برای همیشه حذف خواهد شد.`,Qie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Xie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Zie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Jie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xie(e):t==="fa"?Zie(e):Yie(e)}),eae=()=>"Could not exit Plan mode. Try again.",tae=()=>"无法退出计划模式。请重试。",nae=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",rae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Expand tool activity",iae=()=>"展开工具活动",aae=()=>"باز کردن فعالیت ابزارها",oae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=()=>"experiments",cae=()=>"实验",uae=()=>"آزمایش‌ها",dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cae():t==="fa"?uae():lae()}),fae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,hae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,_ae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,pae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,gae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,vae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,bae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=e=>`Message not sent: ${e==null?void 0:e.error}`,xae=e=>`消息未发送:${e==null?void 0:e.error}`,wae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,Sae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xae(e):t==="fa"?wae(e):yae(e)}),kae=()=>"Model unavailable",Cae=()=>"模型不可用",Eae=()=>"مدل در دسترس نیست",Nae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),zae=()=>"New session",jae=()=>"新会话",Tae=()=>"نشست جدید",hE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jae():t==="fa"?Tae():zae()}),Aae=()=>"No active sessions",Rae=()=>"没有活跃会话",Mae=()=>"نشست فعالی وجود ندارد",Dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No activity",Oae=()=>"无活动",Iae=()=>"بدون فعالیت",Bae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No archived sessions",Pae=()=>"没有已归档的会话",Fae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"No sessions yet",Uae=()=>"还没有会话",Gae=()=>"هنوز نشستی وجود ندارد",Wae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"1 annotation",Kae=()=>"1 条批注",Qae=()=>"۱ یادداشت",Yae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"Open sub-agent transcript",Zae=()=>"打开子智能体记录",Jae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",eoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),toe=()=>"About this demo",noe=()=>"关于此演示",roe=()=>"دربارهٔ این نسخهٔ نمایشی",_E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?noe():t==="fa"?roe():toe()}),soe=()=>"Accept and auto mode",ioe=()=>"接受并使用自动模式",aoe=()=>"پذیرش و حالت خودکار",ooe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Accept and bypass all",coe=()=>"接受并跳过所有审批",uoe=()=>"پذیرش و عبور از همهٔ تأییدها",doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"Active",hoe=()=>"活跃",_oe=()=>"فعال",poe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"All",goe=()=>"全部",voe=()=>"همه",boe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Allow",xoe=()=>"允许",woe=()=>"اجازه دادن",Soe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Approval required",Coe=()=>"需要批准",Eoe=()=>"نیازمند تأیید",Noe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Archived",joe=()=>"已归档",Toe=()=>"بایگانی‌شده",pE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Aoe=()=>"Ask about this",Roe=()=>"询问此内容",Moe=()=>"دربارهٔ این بپرسید",Doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Loe=()=>"Attach a PDF or image",Ooe=()=>"附加 PDF 或图片",Ioe=()=>"پیوست PDF یا تصویر",mE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),Boe=()=>"Bash",$oe=()=>"Bash",Poe=()=>"Bash",xD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$oe():t==="fa"?Poe():Boe()}),Foe=()=>"Browsed the web",Hoe=()=>"已浏览网页",qoe=()=>"وب مرور شد",gE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hoe():t==="fa"?qoe():Foe()}),Uoe=()=>"Built the project",Goe=()=>"已构建项目",Woe=()=>"پروژه ساخته شد",Voe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancel",Qoe=()=>"取消",Yoe=()=>"لغو",Xoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Cancelled an experiment run",Joe=()=>"已取消实验运行",ele=()=>"اجرای آزمایش لغو شد",tle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked code style",rle=()=>"已检查代码风格",sle=()=>"سبک کد بررسی شد",ile=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked compute options",ole=()=>"已检查算力选项",lle=()=>"گزینه‌های رایانشی بررسی شد",cle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=()=>"Checked experiment status",dle=()=>"已检查实验状态",fle=()=>"وضعیت آزمایش بررسی شد",vE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dle():t==="fa"?fle():ule()}),hle=()=>"Checked Git status",_le=()=>"已检查 Git 状态",ple=()=>"وضعیت Git بررسی شد",mle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked local times",vle=()=>"已查询当地时间",ble=()=>"زمان‌های محلی بررسی شد",yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked market data",wle=()=>"已查询市场数据",Sle=()=>"داده‌های بازار بررسی شد",kle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked sports data",Ele=()=>"已查询体育数据",Nle=()=>"داده‌های ورزشی بررسی شد",zle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked the weather",Tle=()=>"已查询天气",Ale=()=>"آب‌وهوا بررسی شد",Rle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Checked types",Dle=()=>"已检查类型",Lle=()=>"نوع‌ها بررسی شد",Ole=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ile=()=>"Clear annotations",Ble=()=>"清除批注",$le=()=>"پاک کردن یادداشت‌ها",bE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Customize",Fle=()=>"自定义",Hle=()=>"سفارشی‌سازی",qle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),Ule=()=>"Data sources",Gle=()=>"数据源",Wle=()=>"منابع داده",S2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gle():t==="fa"?Wle():Ule()}),Vle=()=>"Delegated a task to a new agent",Kle=()=>"已将任务委派给新智能体",Qle=()=>"وظیفه به عامل جدید واگذار شد",Yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Xle=()=>"Delete",Zle=()=>"删除",Jle=()=>"حذف",wD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zle():t==="fa"?Jle():Xle()}),ece=()=>"Deny",tce=()=>"拒绝",nce=()=>"رد کردن",rce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),sce=()=>"Edit and re-send",ice=()=>"编辑并重新发送",ace=()=>"ویرایش و ارسال دوباره",yE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ice():t==="fa"?ace():sce()}),oce=()=>"Edit message",lce=()=>"编辑消息",cce=()=>"ویرایش پیام",uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),dce=()=>"Edited a file",fce=()=>"已编辑文件",hce=()=>"فایل ویرایش شد",xE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fce():t==="fa"?hce():dce()}),_ce=()=>"Exit Bash mode",pce=()=>"退出 Bash 模式",mce=()=>"خروج از حالت Bash",wE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pce():t==="fa"?mce():_ce()}),gce=()=>"Exit Plan mode",vce=()=>"退出计划模式",bce=()=>"خروج از حالت طرح",SE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vce():t==="fa"?bce():gce()}),yce=()=>"Failed:",xce=()=>"失败:",wce=()=>"ناموفق:",n6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xce():t==="fa"?wce():yce()}),Sce=()=>"Filter sessions",kce=()=>"筛选会话",Cce=()=>"فیلتر نشست‌ها",kE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"is unavailable.",Nce=()=>"不可用。",zce=()=>"در دسترس نیست.",jce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Later queued messages will wait until this is retried or removed.",Ace=()=>"后续排队的消息会等待此消息重试或移除。",Rce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Mce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Dce=()=>"Listed files",Lce=()=>"已列出文件",Oce=()=>"فایل‌ها فهرست شد",CE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lce():t==="fa"?Oce():Dce()}),Ice=()=>"Listed project runs",Bce=()=>"已列出项目运行",$ce=()=>"اجراهای پروژه فهرست شد",Pce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Listed projects",Hce=()=>"已列出项目",qce=()=>"پروژه‌ها فهرست شد",Uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"Loading conversation…",Wce=()=>"正在加载对话…",Vce=()=>"در حال بارگیری گفتگو…",Kce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"New Chat",Yce=()=>"新对话",Xce=()=>"گفتگوی جدید",Zce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Jce=()=>"Next version",eue=()=>"下一版本",tue=()=>"نسخهٔ بعدی",EE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),nue=()=>"Open the session this agent spawned",rue=()=>"打开此智能体创建的会话",sue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",iue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Opened web pages",oue=()=>"已打开网页",lue=()=>"صفحه‌های وب باز شد",cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan",due=()=>"计划",fue=()=>"طرح",hue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan approved",pue=()=>"计划已批准",mue=()=>"طرح تأیید شد",gue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan rejected",bue=()=>"计划已拒绝",yue=()=>"طرح رد شد",xue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan resolved",Sue=()=>"计划已处理",kue=()=>"طرح تعیین تکلیف شد",Cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Plan revision requested",Nue=()=>"已请求修改计划",zue=()=>"درخواست بازنگری طرح ثبت شد",jue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),Tue=()=>"Previous version",Aue=()=>"上一版本",Rue=()=>"نسخهٔ قبلی",NE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aue():t==="fa"?Rue():Tue()}),Mue=()=>"Ran a command",Due=()=>"已运行命令",Lue=()=>"فرمان اجرا شد",Oue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Ran tests",Bue=()=>"已运行测试",$ue=()=>"آزمون‌ها اجرا شد",Pue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read a file",Hue=()=>"已读取文件",que=()=>"فایل خوانده شد",Uue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read Git history",Wue=()=>"已读取 Git 历史",Vue=()=>"تاریخچهٔ Git خوانده شد",Kue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Read project details",Yue=()=>"已读取项目详情",Xue=()=>"جزئیات پروژه خوانده شد",Zue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Reject",ede=()=>"拒绝",tde=()=>"رد کردن",nde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove",sde=()=>"移除",ide=()=>"حذف",ade=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove annotation",lde=()=>"移除批注",cde=()=>"حذف یادداشت",ude=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),dde=()=>"Remove file",fde=()=>"移除文件",hde=()=>"حذف فایل",zE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),_de=()=>"Remove image",pde=()=>"移除图片",mde=()=>"حذف تصویر",jE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),gde=()=>"Remove queued message",vde=()=>"移除排队消息",bde=()=>"حذف پیام صف",TE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vde():t==="fa"?bde():gde()}),yde=()=>"Rename",xde=()=>"重命名",wde=()=>"تغییر نام",SD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xde():t==="fa"?wde():yde()}),Sde=()=>"Reviewed code changes",kde=()=>"已审查代码更改",Cde=()=>"تغییرات کد بازبینی شد",Ede=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Nde=()=>"Run",zde=()=>"运行",jde=()=>"اجرا",AE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zde():t==="fa"?jde():Nde()}),Tde=()=>"Selected chat text",Ade=()=>"已选聊天文本",Rde=()=>"متن انتخاب‌شدهٔ گفتگو",Mde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Selected text:",Lde=()=>"已选文本:",Ode=()=>"متن انتخاب‌شده:",Ide=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Send",$de=()=>"发送",Pde=()=>"ارسال",z4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"Session options",Hde=()=>"会话选项",qde=()=>"گزینه‌های نشست",RE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hde():t==="fa"?qde():Fde()}),Ude=()=>"Session title",Gde=()=>"会话标题",Wde=()=>"عنوان نشست",Vde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Kde=()=>"Show sidebar",Qde=()=>"显示侧边栏",Yde=()=>"نمایش نوار کناری",ME=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qde():t==="fa"?Yde():Kde()}),Xde=()=>"Started an experiment run",Zde=()=>"已启动实验运行",Jde=()=>"اجرای آزمایش آغاز شد",efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Reading the project to suggest where to start…",nfe=()=>"正在阅读项目以建议从哪里开始…",rfe=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",sfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Starter prompts",afe=()=>"入门提示",ofe=()=>"پیشنهادهای شروع",lfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),cfe=()=>"Stop",ufe=()=>"停止",dfe=()=>"توقف",DE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ufe():t==="fa"?dfe():cfe()}),ffe=()=>"Submit",hfe=()=>"提交",_fe=()=>"ارسال",pfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Tool failed",gfe=()=>"工具失败",vfe=()=>"ابزار ناموفق بود",bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),yfe=()=>"Used tools",xfe=()=>"已使用工具",wfe=()=>"ابزارها استفاده شد",kD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xfe():t==="fa"?wfe():yfe()}),Sfe=()=>"View full plan",kfe=()=>"查看完整计划",Cfe=()=>"مشاهدهٔ طرح کامل",Efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waited for an experiment run",zfe=()=>"已等待实验运行",jfe=()=>"برای اجرای آزمایش صبر شد",Tfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"Waiting for your input…",Rfe=()=>"正在等待你的输入…",Mfe=()=>"منتظر ورودی شما…",Dfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"What should we research?",Ofe=()=>"我们应该研究什么?",Ife=()=>"چه چیزی را پژوهش کنیم؟",Bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"You, mid-task",Pfe=()=>"你(任务进行中)",Ffe=()=>"شما، هنگام انجام وظیفه",Hfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Pasted image",Ufe=()=>"粘贴的图片",Gfe=()=>"تصویر جای‌گذاری‌شده",Wfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Vfe=()=>"Plan",Kfe=()=>"计划",Qfe=()=>"طرح",CD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kfe():t==="fa"?Qfe():Vfe()}),Yfe=()=>"Plan mode — ready to proceed?",Xfe=()=>"计划模式 — 准备好继续了吗?",Zfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Jfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),ehe=()=>"Proposed plan",the=()=>"提议的计划",nhe=()=>"طرح پیشنهادی",LE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),rhe=()=>"Question",she=()=>"问题",ihe=()=>"پرسش",ahe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Queued",lhe=()=>"已排队",che=()=>"در صف",uhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),dhe=()=>"Recents",fhe=()=>"最近",hhe=()=>"اخیر",ED=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fhe():t==="fa"?hhe():dhe()}),_he=()=>"Re-check its setup.",phe=()=>"请重新检查其设置。",mhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",ghe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not recover this turn. Try again.",bhe=()=>"无法恢复本轮。请重试。",yhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=()=>"Could not remove the queued message. Try again.",She=()=>"无法移除排队消息。请重试。",khe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Che=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?She():t==="fa"?khe():whe()}),Ehe=e=>`Could not re-send: ${e==null?void 0:e.error}`,Nhe=e=>`无法重新发送:${e==null?void 0:e.error}`,zhe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,jhe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),The=()=>"Resolved",Ahe=()=>"已处理",Rhe=()=>"رسیدگی شد",Mhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"Could not retry the queued message. Try again.",Lhe=()=>"无法重试排队消息。请重试。",Ohe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Ihe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"run logs",$he=()=>"运行日志",Phe=()=>"گزارش‌های اجرا",Fhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Hhe=()=>"Scroll to bottom",qhe=()=>"滚动到底部",Uhe=()=>"رفتن به پایین گفتگو",OE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qhe():t==="fa"?Uhe():Hhe()}),Ghe=()=>"The selected harness is unavailable",Whe=()=>"所选智能体工具不可用",Vhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",k2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Whe():t==="fa"?Vhe():Ghe()}),Khe=()=>"Session limit reached",Qhe=()=>"已达到会话使用限额",Yhe=()=>"به سقف مصرف نشست رسیده‌اید",Xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"The chat session was not created",Jhe=()=>"未能创建聊天会话",e_e=()=>"نشست گفت‌وگو ایجاد نشد",t_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>"Show full conversation",r_e=()=>"显示完整对话",s_e=()=>"نمایش کامل گفتگو",i_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>" · Spawned by another agent",o_e=()=>" · 由另一个智能体创建",l_e=()=>" · ساخته‌شده به‌دست عامل دیگر",c_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=()=>"Starting…",d_e=()=>"正在启动…",f_e=()=>"در حال شروع…",h_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d_e():t==="fa"?f_e():u_e()}),__e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,p_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,m_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,g_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p_e(e):t==="fa"?m_e(e):__e(e)}),v_e=()=>"Could not stop the turn. Try again.",b_e=()=>"无法停止本轮。请重试。",y_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",x_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b_e():t==="fa"?y_e():v_e()}),w_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,S_e=e=>`无法切换分支:${e==null?void 0:e.error}`,k_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,C_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S_e(e):t==="fa"?k_e(e):w_e(e)}),E_e=()=>"The agent",N_e=()=>"智能体",z_e=()=>"عامل",j_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Thinking",A_e=()=>"正在思考",R_e=()=>"در حال فکر کردن",M_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),D_e=()=>"Could not toggle Plan mode. Try again.",L_e=()=>"无法切换计划模式。请重试。",O_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",IE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=()=>"This turn did not finish.",B_e=()=>"本轮未完成。",$_e=()=>"این نوبت کامل نشد.",BE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),P_e=()=>"Type a custom answer…",F_e=()=>"输入自定义回答…",H_e=()=>"پاسخ دلخواه را بنویسید…",q_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Unarchive",G_e=()=>"取消归档",W_e=()=>"خارج کردن از بایگانی",V_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),K_e=()=>"Untitled",Q_e=()=>"未命名",Y_e=()=>"بدون عنوان",Ng=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q_e():t==="fa"?Y_e():K_e()}),X_e=()=>"Could not update permissions. Try again.",Z_e=()=>"无法更新权限。请重试。",J_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",e0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=()=>"Work details",n0e=()=>"工作详情",r0e=()=>"جزئیات کار",s0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),i0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,a0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,o0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,l0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=e=>`Worked for ${e==null?void 0:e.duration}`,u0e=e=>`已工作 ${e==null?void 0:e.duration}`,d0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,f0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u0e(e):t==="fa"?d0e(e):c0e(e)}),h0e=()=>"Working…",_0e=()=>"正在工作…",p0e=()=>"در حال کار…",r6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_0e():t==="fa"?p0e():h0e()}),m0e=()=>"Close tab",g0e=()=>"关闭标签页",v0e=()=>"بستن زبانه",b0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),y0e=()=>"Changes",x0e=()=>"更改",w0e=()=>"تغییرات",ND=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x0e():t==="fa"?w0e():y0e()}),S0e=()=>"Code browser view",k0e=()=>"代码浏览器视图",C0e=()=>"نمای مرورگر کد",E0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Files",z0e=()=>"文件",j0e=()=>"فایل‌ها",T0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Refresh",R0e=()=>"刷新",M0e=()=>"تازه‌سازی",$E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"listing truncated",L0e=()=>"列表已截断",O0e=()=>"فهرست کوتاه شده است",I0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"No files.",$0e=()=>"没有文件。",P0e=()=>"فایلی وجود ندارد.",F0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Refresh failed:",q0e=()=>"刷新失败:",U0e=()=>"تازه‌سازی ناموفق بود:",G0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Cancelling…",V0e=()=>"正在取消…",K0e=()=>"در حال لغو…",Q0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Y0e=()=>"Checking…",X0e=()=>"正在检查…",Z0e=()=>"در حال بررسی…",Xi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X0e():t==="fa"?Z0e():Y0e()}),J0e=()=>"Copied",epe=()=>"已复制",tpe=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),npe=e=>`Failed to load: ${e==null?void 0:e.error}`,rpe=e=>`加载失败:${e==null?void 0:e.error}`,spe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,zD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?rpe(e):t==="fa"?spe(e):npe(e)}),ipe=()=>"Loading…",ape=()=>"正在加载…",ope=()=>"در حال بارگیری…",jD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),lpe=e=>`+ ${e==null?void 0:e.count} more`,cpe=e=>`另有 ${e==null?void 0:e.count} 项`,upe=e=>`${e==null?void 0:e.count}+ مورد دیگر`,dpe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cpe(e):t==="fa"?upe(e):lpe(e)}),fpe=()=>"Rendered view",hpe=()=>"渲染视图",_pe=()=>"نمای رندرشده",rv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hpe():t==="fa"?_pe():fpe()}),ppe=()=>"Save",mpe=()=>"保存",gpe=()=>"ذخیره",no=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mpe():t==="fa"?gpe():ppe()}),vpe=()=>"Saving…",bpe=()=>"正在保存…",ype=()=>"در حال ذخیره…",Ei=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bpe():t==="fa"?ype():vpe()}),xpe=()=>"Show less",wpe=()=>"收起",Spe=()=>"نمایش کمتر",TD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wpe():t==="fa"?Spe():xpe()}),kpe=()=>"Show more",Cpe=()=>"展开",Epe=()=>"نمایش بیشتر",Npe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),zpe=()=>"Stop",jpe=()=>"停止",Tpe=()=>"توقف",AD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Ape=()=>"Stopping…",Rpe=()=>"正在停止…",Mpe=()=>"در حال توقف…",Dpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Lpe=()=>"View source",Ope=()=>"查看源代码",Ipe=()=>"نمایش متن منبع",rh=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ope():t==="fa"?Ipe():Lpe()}),Bpe=()=>"Runs as a remote Hugging Face Job",$pe=()=>"作为远程 Hugging Face Job 运行",Ppe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs as a Job on your Kubernetes cluster",qpe=()=>"作为 Kubernetes 集群上的 Job 运行",Upe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs directly on this computer",Vpe=()=>"直接在此计算机上运行",Kpe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs in a remote Modal sandbox",Xpe=()=>"在远程 Modal 沙箱中运行",Zpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on an ephemeral OpenResearch box",tme=()=>"在临时 OpenResearch 主机上运行",nme=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs on the connected Ray cluster",ime=()=>"在已连接的 Ray 集群上运行",ame=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs as a scheduled job on your Slurm cluster",cme=()=>"作为 Slurm 集群上的调度作业运行",ume=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs on a host from your SSH config",hme=()=>"在 SSH 配置中的主机上运行",_me=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"Runs through Tinker’s remote compute",gme=()=>"通过 Tinker 远程算力运行",vme=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"HF Jobs",xme=()=>"HF Jobs",wme=()=>"HF Jobs",Sme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"Kubernetes",Cme=()=>"Kubernetes",Eme=()=>"Kubernetes",Nme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"This machine",jme=()=>"此计算机",Tme=()=>"این رایانه",RD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jme():t==="fa"?Tme():zme()}),Ame=()=>"Modal",Rme=()=>"Modal",Mme=()=>"Modal",Dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"OpenResearch",Ome=()=>"OpenResearch",Ime=()=>"OpenResearch",Bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Ray",Pme=()=>"Ray",Fme=()=>"Ray",Hme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"Slurm",Ume=()=>"Slurm",Gme=()=>"Slurm",Wme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"SSH",Kme=()=>"SSH",Qme=()=>"SSH",Yme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"Tinker",Zme=()=>"Tinker",Jme=()=>"Tinker",ege=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",nge=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",rge=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",sge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",age=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",oge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",lge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",uge=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",dge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",fge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"This computer must stay awake and online while Tinker runs.",_ge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",pge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",mge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window",vge=()=>"上下文窗口",bge=()=>"پنجرهٔ زمینه",yge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=()=>"Context window used",wge=()=>"已使用的上下文窗口",Sge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",kge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wge():t==="fa"?Sge():xge()}),Cge=e=>`${e==null?void 0:e.value} tokens`,Ege=e=>`${e==null?void 0:e.value} 个 token`,Nge=e=>`${e==null?void 0:e.value} توکن`,zge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Age=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Rge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tge(e):t==="fa"?Age(e):jge(e)}),Mge=()=>"No runs yet — ask the agent to launch one.",Dge=()=>"尚无运行——让智能体启动一个。",Lge=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Oge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Ige=()=>"Run",Bge=()=>"运行",$ge=()=>"اجرا",PE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bge():t==="fa"?$ge():Ige()}),Pge=()=>"Switch run",Fge=()=>"切换运行",Hge=()=>"تغییر اجرا",qge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fge():t==="fa"?Hge():Pge()}),Uge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Gge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Wge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Qge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Yge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Xge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}m`,Jge=e=>`${e==null?void 0:e.value} 分钟`,e1e=e=>`${e==null?void 0:e.value} دقیقه`,t1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=e=>`${e==null?void 0:e.value}s`,r1e=e=>`${e==null?void 0:e.value} 秒`,s1e=e=>`${e==null?void 0:e.value} ثانیه`,i1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):n1e(e)}),a1e=()=>"Code",o1e=()=>"代码",l1e=()=>"کد",c1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"created",d1e=()=>"创建于",f1e=()=>"ایجادشده",h1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"from",p1e=()=>"来自",m1e=()=>"از",g1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Logs",b1e=()=>"日志",y1e=()=>"گزارش‌ها",x1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Latest run",S1e=()=>"最新运行",k1e=()=>"آخرین اجرا",C1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Code",N1e=()=>"代码",z1e=()=>"کد",j1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"Commit",A1e=()=>"提交",R1e=()=>"کامیت",M1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"created",L1e=()=>"创建于",O1e=()=>"ایجادشده",I1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Description",$1e=()=>"说明",P1e=()=>"توضیحات",F1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"Duration",q1e=()=>"时长",U1e=()=>"مدت",G1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"exit",V1e=()=>"退出码",K1e=()=>"خروج",Q1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"from",X1e=()=>"来自",Z1e=()=>"از",J1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Logs",tve=()=>"日志",nve=()=>"گزارش‌ها",rve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run",ive=()=>"运行",ave=()=>"اجرا",ove=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Run history",cve=()=>"运行历史",uve=()=>"تاریخچهٔ اجرا",dve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Started",hve=()=>"开始时间",_ve=()=>"آغاز",pve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Runs",gve=()=>"运行",vve=()=>"اجراها",bve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",xve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",wve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",Sve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No runs yet",Cve=()=>"还没有运行",Eve=()=>"هنوز اجرایی وجود ندارد",Nve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"No experiments yet.",jve=()=>"还没有实验。",Tve=()=>"هنوز آزمایشی وجود ندارد.",Ave=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Not run yet",Mve=()=>"尚未运行",Dve=()=>"هنوز اجرا نشده",Lve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"1 run",Ive=()=>"1 次运行",Bve=()=>"۱ اجرا",$ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"Open logs",Fve=()=>"打开日志",Hve=()=>"باز کردن گزارش‌ها",qve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fve():t==="fa"?Hve():Pve()}),Uve=e=>`${e==null?void 0:e.count} runs`,Gve=e=>`${e==null?void 0:e.count} 次运行`,Wve=e=>`${e==null?void 0:e.count} اجرا`,Vve=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gve(e):t==="fa"?Wve(e):Uve(e)}),Kve=()=>"Stop requested",Qve=()=>"已请求停止",Yve=()=>"درخواست توقف ثبت شد",Xve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Stop run",Jve=()=>"停止运行",ebe=()=>"توقف اجرا",tbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Code",rbe=()=>"代码",sbe=()=>"کد",ibe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Experiments",obe=()=>"实验",lbe=()=>"آزمایش‌ها",cbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Logs",dbe=()=>"日志",fbe=()=>"گزارش‌ها",hbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Stop failed:",pbe=()=>"停止失败:",mbe=()=>"توقف ناموفق بود:",gbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),vbe=()=>"Clipboard access is unavailable.",bbe=()=>"无法访问剪贴板。",ybe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",MD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bbe():t==="fa"?ybe():vbe()}),xbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,wbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,Sbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,kbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):xbe(e)}),Cbe=()=>"Duplicate",Ebe=()=>"创建副本",Nbe=()=>"ایجاد نسخهٔ تکراری",zbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),jbe=e=>`File actions for ${e==null?void 0:e.path}`,Tbe=e=>`${e==null?void 0:e.path} 的文件操作`,Abe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Rbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tbe(e):t==="fa"?Abe(e):jbe(e)}),Mbe=()=>"Open",Dbe=()=>"打开",Lbe=()=>"باز کردن",Obe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Mbe()}),Ibe=e=>`Rename ${e==null?void 0:e.path}`,Bbe=e=>`重命名 ${e==null?void 0:e.path}`,$be=e=>`تغییر نام ${e==null?void 0:e.path}`,Pbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Hbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,qbe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Ube=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Hbe(e):t==="fa"?qbe(e):Fbe(e)}),Gbe=()=>"Binary file — no inline preview.",Wbe=()=>"二进制文件——无法内嵌预览。",Vbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Kbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Qbe=()=>"This file changed on disk. Your edits have not been overwritten.",Ybe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Xbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",FE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Qbe()}),Zbe=()=>"Compile failed",Jbe=()=>"编译失败",eye=()=>"کامپایل ناموفق بود",tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),nye=()=>"Compile PDF",rye=()=>"编译 PDF",sye=()=>"کامپایل PDF",HE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rye():t==="fa"?sye():nye()}),iye=()=>"Compiled, but the engine reported errors — check the output below.",aye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",oye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",lye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy command",uye=()=>"复制命令",dye=()=>"کپی فرمان",fye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Copy install command",_ye=()=>"复制安装命令",pye=()=>"کپی فرمان نصب",mye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"This file was deleted on disk. Your edits have not been discarded.",vye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",bye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",qE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vye():t==="fa"?bye():gye()}),yye=()=>"Discard my edits and reload",xye=()=>"放弃我的编辑并重新加载",wye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Sye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),kye=()=>"Discard unsaved changes and close this file?",Cye=()=>"要丢弃未保存的更改并关闭此文件吗?",Eye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",UE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cye():t==="fa"?Eye():kye()}),Nye=()=>"Dismiss",zye=()=>"关闭",jye=()=>"بستن",Tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss compile message",Rye=()=>"关闭编译消息",Mye=()=>"بستن پیام کامپایل",Dye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Dismiss Overleaf message",Oye=()=>"关闭 Overleaf 消息",Iye=()=>"بستن پیام Overleaf",Bye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),$ye=()=>"Download",Pye=()=>"下载",Fye=()=>"بارگیری",DD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pye():t==="fa"?Fye():$ye()}),Hye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,qye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Uye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Gye=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qye(e):t==="fa"?Uye(e):Hye(e)}),Wye=()=>"Failed to load file:",Vye=()=>"加载文件失败:",Kye=()=>"بارگیری فایل ناموفق بود:",GE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vye():t==="fa"?Kye():Wye()}),Qye=()=>"File truncated — showing the first 512 KB.",Yye=()=>"文件已截断——仅显示前 512 KB。",Xye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Zye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=()=>"The page below stops partway — the full file could not be loaded.",exe=()=>"下方页面在中途结束——无法加载完整文件。",txe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",nxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?exe():t==="fa"?txe():Jye()}),rxe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,sxe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ixe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,axe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sxe(e):t==="fa"?ixe(e):rxe(e)}),oxe=()=>"Loading…",lxe=()=>"正在加载…",cxe=()=>"در حال بارگیری…",LD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lxe():t==="fa"?cxe():oxe()}),uxe=()=>"File not found.",dxe=()=>"找不到文件。",fxe=()=>"فایل پیدا نشد.",hxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dxe():t==="fa"?fxe():uxe()}),_xe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pxe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mxe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pxe(e):t==="fa"?mxe(e):_xe(e)}),vxe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,bxe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,yxe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,xxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bxe(e):t==="fa"?yxe(e):vxe(e)}),wxe=()=>"File not found on disk.",Sxe=()=>"磁盘上找不到此文件。",kxe=()=>"فایل روی دیسک پیدا نشد.",Cxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Nxe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,zxe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,jxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nxe(e):t==="fa"?zxe(e):Exe(e)}),Txe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Axe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Rxe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Mxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Axe(e):t==="fa"?Rxe(e):Txe(e)}),Dxe=()=>"Open in default editor",Lxe=()=>"在默认编辑器中打开",Oxe=()=>"باز کردن در ویرایشگر پیش‌فرض",WE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Ixe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Bxe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",$xe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Pxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Fxe=()=>"Overwrite disk file",Hxe=()=>"覆盖磁盘文件",qxe=()=>"بازنویسی فایل روی دیسک",Uxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hxe():t==="fa"?qxe():Fxe()}),Gxe=()=>"Compiled PDF is out of date",Wxe=()=>"已编译的 PDF 不是最新版本",Vxe=()=>"PDF کامپایل‌شده به‌روز نیست",Kxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wxe():t==="fa"?Vxe():Gxe()}),Qxe=()=>"project clone",Yxe=()=>"项目克隆",Xxe=()=>"کلون پروژه",zg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yxe():t==="fa"?Xxe():Qxe()}),Zxe=()=>"Recompile PDF",Jxe=()=>"重新编译 PDF",e2e=()=>"کامپایل دوبارهٔ PDF",VE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jxe():t==="fa"?e2e():Zxe()}),t2e=()=>"Reload from disk",n2e=()=>"从磁盘重新加载",r2e=()=>"بارگذاری مجدد از دیسک",s2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Save failed",a2e=()=>"保存失败",o2e=()=>"ذخیره ناموفق بود",l2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Saving…",u2e=()=>"正在保存…",d2e=()=>"در حال ذخیره…",f2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Selected — press ⌘C",_2e=()=>"已选中 — 按 ⌘C 复制",p2e=()=>"انتخاب شد — برای کپی ⌘C را بزنید",m2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"session’s worktree",v2e=()=>"会话工作树",b2e=()=>"درخت کاری نشست",jg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v2e():t==="fa"?b2e():g2e()}),y2e=()=>"Show compiled PDF",x2e=()=>"显示已编译的 PDF",w2e=()=>"نمایش PDF کامپایل‌شده",KE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x2e():t==="fa"?w2e():y2e()}),S2e=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",k2e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",C2e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",E2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"This session's worktree isn't available — showing the project clone's copy.",z2e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",j2e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",T2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z2e():t==="fa"?j2e():N2e()}),A2e=()=>"Unsaved",R2e=()=>"未保存",M2e=()=>"ذخیره نشده",OD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R2e():t==="fa"?M2e():A2e()}),D2e=()=>"Unsaved — ⌘S to save",L2e=()=>"未保存 — 按 ⌘S 保存",O2e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",I2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L2e():t==="fa"?O2e():D2e()}),B2e=()=>"Update orx on the remote machine to edit this file safely.",$2e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",P2e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",F2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$2e():t==="fa"?P2e():B2e()}),H2e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",q2e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",U2e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",G2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q2e():t==="fa"?U2e():H2e()}),W2e=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",V2e=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",K2e=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Q2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V2e():t==="fa"?K2e():W2e()}),Y2e=()=>"Back to preview",X2e=()=>"返回预览",Z2e=()=>"بازگشت به پیش‌نمایش",J2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),ewe=e=>`${e==null?void 0:e.count} changed files`,twe=e=>`${e==null?void 0:e.count} 个已更改文件`,nwe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,ID=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?twe(e):t==="fa"?nwe(e):ewe(e)}),rwe=()=>"Changed files",swe=()=>"已更改文件",iwe=()=>"فایل‌های تغییرکرده",awe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Diff preview truncated",lwe=()=>"差异预览已截断",cwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),dwe=e=>`${e==null?void 0:e.count} files shown (partial)`,fwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,_we=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fwe(e):t==="fa"?hwe(e):dwe(e)}),pwe=()=>"No changes.",mwe=()=>"没有更改。",gwe=()=>"تغییری وجود ندارد.",vwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No complete file preview was available before the cutoff.",ywe=()=>"在截断位置之前没有完整的文件预览。",xwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",wwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"No textual diff for this file.",kwe=()=>"此文件没有文本差异。",Cwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Ewe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"1 changed file",zwe=()=>"1 个已更改文件",jwe=()=>"۱ فایل تغییرکرده",BD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zwe():t==="fa"?jwe():Nwe()}),Twe=()=>"1 file shown (partial)",Awe=()=>"显示 1 个文件(部分)",Rwe=()=>"۱ فایل نمایش داده شده (ناقص)",Mwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=()=>"Unable to parse this diff.",Lwe=()=>"无法解析此差异。",Owe=()=>"خواندن این تفاوت ممکن نبود.",Iwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lwe():t==="fa"?Owe():Dwe()}),Bwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$we=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Pwe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Fwe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$we(e):t==="fa"?Pwe(e):Bwe(e)}),Hwe=()=>"View full diff",qwe=()=>"查看完整差异",Uwe=()=>"نمایش تفاوت کامل",Gwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"Create a token ↗",Vwe=()=>"创建令牌 ↗",Kwe=()=>"ساخت توکن ↗",Qwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Ywe=()=>"All projects",Xwe=()=>"所有项目",Zwe=()=>"همهٔ پروژه‌ها",QE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xwe():t==="fa"?Zwe():Ywe()}),Jwe=()=>"Configure Repository",e4e=()=>"配置仓库",t4e=()=>"پیکربندی مخزن",n4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Create a new project",s4e=()=>"新建项目",i4e=()=>"ایجاد پروژهٔ جدید",a4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"Hide sidebar",l4e=()=>"隐藏侧边栏",c4e=()=>"پنهان کردن نوار کناری",YE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),u4e=()=>"Project",d4e=()=>"项目",f4e=()=>"پروژه",h4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d4e():t==="fa"?f4e():u4e()}),_4e=e=>`${e==null?void 0:e.count} cancelled`,p4e=e=>`${e==null?void 0:e.count} 次取消`,m4e=e=>`${e==null?void 0:e.count} لغوشده`,g4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} done`,b4e=e=>`${e==null?void 0:e.count} 次完成`,y4e=e=>`${e==null?void 0:e.count} تمام‌شده`,x4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} failed`,S4e=e=>`${e==null?void 0:e.count} 次失败`,k4e=e=>`${e==null?void 0:e.count} ناموفق`,C4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count} files`,N4e=e=>`${e==null?void 0:e.count} 个文件`,z4e=e=>`${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count}+ files`,A4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,R4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,M4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=e=>`${e==null?void 0:e.count} live`,L4e=e=>`${e==null?void 0:e.count} 次进行中`,O4e=e=>`${e==null?void 0:e.count} فعال`,I4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L4e(e):t==="fa"?O4e(e):D4e(e)}),B4e=()=>"1 file",$4e=()=>"1 个文件",P4e=()=>"۱ فایل",F4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=()=>"1 run",q4e=()=>"1 次运行",U4e=()=>"۱ اجرا",G4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q4e():t==="fa"?U4e():H4e()}),W4e=e=>`${e==null?void 0:e.count} runs`,V4e=e=>`${e==null?void 0:e.count} 次运行`,K4e=e=>`${e==null?void 0:e.count} اجرا`,Q4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V4e(e):t==="fa"?K4e(e):W4e(e)}),Y4e=()=>"No instances yet.",X4e=()=>"还没有实例。",Z4e=()=>"هنوز نمونه‌ای وجود ندارد.",J4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Nothing running right now.",t3e=()=>"当前没有运行中的实例。",n3e=()=>"اکنون چیزی در حال اجرا نیست.",r3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its history.",i3e=()=>"请选择一个项目以查看其历史记录。",a3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"Select a project to see its runs.",c3e=()=>"请选择一个项目以查看其运行。",u3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",d3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=()=>"View history",h3e=()=>"查看历史记录",_3e=()=>"مشاهدهٔ تاریخچه",p3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h3e():t==="fa"?_3e():f3e()}),m3e=e=>`View history (${e==null?void 0:e.count})`,g3e=e=>`查看历史记录(${e==null?void 0:e.count})`,v3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,b3e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?g3e(e):t==="fa"?v3e(e):m3e(e)}),y3e=()=>"The engine exited without producing a PDF or a log.",x3e=()=>"引擎已退出,但没有生成 PDF 或日志。",w3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",S3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Loading…",C3e=()=>"正在加载…",E3e=()=>"در حال بارگیری…",N3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),z3e=()=>"Add local model",j3e=()=>"添加本地模型",T3e=()=>"افزودن مدل محلی",$D=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?j3e():t==="fa"?T3e():z3e()}),A3e=()=>"Local server address",R3e=()=>"本地服务器地址",M3e=()=>"نشانی سرور محلی",D3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"Find models",O3e=()=>"查找模型",I3e=()=>"یافتن مدل‌ها",B3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),$3e=()=>"(OpenAI compatible)",P3e=()=>"(兼容 OpenAI)",F3e=()=>"(سازگار با OpenAI)",PD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P3e():t==="fa"?F3e():$3e()}),H3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",q3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",U3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",G3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Connected",V3e=()=>"已连接",K3e=()=>"متصل شد",Q3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Context window",X3e=()=>"上下文窗口",Z3e=()=>"پنجرهٔ زمینه",J3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",t5e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",n5e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",r5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),s5e=()=>"Custom Endpoint",i5e=()=>"自定义端点",a5e=()=>"نقطهٔ اتصال سفارشی",s6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),o5e=e=>`Disconnect ${e==null?void 0:e.name}`,l5e=e=>`断开 ${e==null?void 0:e.name}`,c5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,u5e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?l5e(e):t==="fa"?c5e(e):o5e(e)}),d5e=()=>"Get OpenCode",f5e=()=>"获取 OpenCode",h5e=()=>"دریافت OpenCode",_5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",m5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",g5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",v5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"API key (optional)",y5e=()=>"API 密钥(可选)",x5e=()=>"کلید API (اختیاری)",w5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Save model",k5e=()=>"保存模型",C5e=()=>"ذخیرهٔ مدل",E5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Model server",z5e=()=>"模型服务器",j5e=()=>"سرور مدل",XE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Local models",A5e=()=>"本地模型",R5e=()=>"مدل‌های محلی",ZE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A5e():t==="fa"?R5e():T5e()}),M5e=()=>"API token (optional)",D5e=()=>"API 令牌(可选)",L5e=()=>"توکن API (اختیاری)",O5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),I5e=()=>"Copy",B5e=()=>"复制",$5e=()=>"کپی",i6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B5e():t==="fa"?$5e():I5e()}),P5e=()=>"Copy code",F5e=()=>"复制代码",H5e=()=>"کپی کد",q5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),U5e=()=>"Download",G5e=()=>"下载",W5e=()=>"بارگیری",FD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G5e():t==="fa"?W5e():U5e()}),V5e=()=>"This browser can’t preview this media format.",K5e=()=>"此浏览器无法预览该媒体格式。",Q5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Y5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>"Add Local Model",Z5e=()=>"添加本地模型",J5e=()=>"افزودن مدل محلی",e6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),t6e=()=>" · CLI configuration",n6e=()=>" · CLI 配置",r6e=()=>" · پیکربندی CLI",HD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),s6e=()=>"· Default",i6e=()=>"· 默认",a6e=()=>"· پیش‌فرض",qD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i6e():t==="fa"?a6e():s6e()}),o6e=()=>"Default model",l6e=()=>"默认模型",c6e=()=>"مدل پیش‌فرض",JE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l6e():t==="fa"?c6e():o6e()}),u6e=()=>"Detecting harnesses…",d6e=()=>"正在检测智能体工具…",f6e=()=>"در حال شناسایی ابزارهای عامل…",h6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Effort",p6e=()=>"推理强度",m6e=()=>"میزان استدلال",g6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Fast speed ·",b6e=()=>"快速 ·",y6e=()=>"سرعت بالا ·",x6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),w6e=()=>"Mode",S6e=()=>"模式",k6e=()=>"حالت",eN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),C6e=()=>"Model",E6e=()=>"模型",N6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E6e():t==="fa"?N6e():C6e()}),z6e=e=>`${e==null?void 0:e.count} more — search to find`,j6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,T6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,A6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?j6e(e):t==="fa"?T6e(e):z6e(e)}),R6e=()=>"Not available",M6e=()=>"不可用",D6e=()=>"در دسترس نیست",L6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),O6e=()=>"Search models…",I6e=()=>"搜索模型…",B6e=()=>"جست‌وجوی مدل‌ها…",UD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Sessions keep their harness. Start a new chat to switch.",P6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",F6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",H6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),q6e=()=>"Speed",U6e=()=>"速度",G6e=()=>"سرعت",tN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?U6e():t==="fa"?G6e():q6e()}),W6e=()=>"Unavailable",V6e=()=>"不可用",K6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V6e():t==="fa"?K6e():W6e()}),Q6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Y6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,X6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Z6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Y6e(e):t==="fa"?X6e(e):Q6e(e)}),J6e=()=>"Variant",eSe=()=>"变体",tSe=()=>"گونه",nSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced",sSe=()=>"高级",iSe=()=>"پیشرفته",aSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · Connect GitHub",lSe=()=>"高级 · 连接 GitHub",cSe=()=>"پیشرفته · اتصال GitHub",uSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Advanced · GitHub sync on",fSe=()=>"高级 · GitHub 同步已开启",hSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",_Se=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",mSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",gSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",vSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mSe():t==="fa"?gSe():pSe()}),bSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,ySe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,xSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,wSe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ySe(e):t==="fa"?xSe(e):bSe(e)}),SSe=()=>"Choose an existing project folder",kSe=()=>"选择现有项目文件夹",CSe=()=>"انتخاب پوشهٔ موجود پروژه",nN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kSe():t==="fa"?CSe():SSe()}),ESe=()=>"Choosing…",NSe=()=>"正在选择…",zSe=()=>"در حال انتخاب…",jSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone destination",ASe=()=>"克隆位置",RSe=()=>"مقصد کلون",MSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Clone paper project",LSe=()=>"克隆论文项目",OSe=()=>"کلون پروژهٔ مقاله",ISe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),BSe=()=>"Create project",$Se=()=>"创建项目",PSe=()=>"ایجاد پروژه",rN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Creating…",HSe=()=>"正在创建…",qSe=()=>"در حال ایجاد…",USe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),GSe=()=>"Choose a different destination. This path is a file, not a folder.",WSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",VSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",C2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WSe():t==="fa"?VSe():GSe()}),KSe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",QSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",YSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",sN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QSe():t==="fa"?YSe():KSe()}),XSe=()=>"Auto-apply repository topics",ZSe=()=>"自动添加仓库 topic",JSe=()=>"اعمال خودکار موضوع‌های مخزن",eke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.",nke=()=>"自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",rke=()=>"موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",ske=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Blank project",ake=()=>"空白项目",oke=()=>"پروژهٔ خالی",lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Cancel",uke=()=>"取消",dke=()=>"لغو",fke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Change",_ke=()=>"更改",pke=()=>"تغییر",mke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Change selected paper",vke=()=>"更改所选论文",bke=()=>"تغییر مقالهٔ انتخاب‌شده",yke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vke():t==="fa"?bke():gke()}),xke=()=>"Check out a Git branch before using this folder.",wke=()=>"使用此文件夹前,请先检出一个 Git 分支。",Ske=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",kke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wke():t==="fa"?Ske():xke()}),Cke=()=>"Checking project location.",Eke=()=>"正在检查项目位置。",Nke=()=>"در حال بررسی محل پروژه.",iN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),zke=()=>"Existing folder",jke=()=>"现有文件夹",Tke=()=>"پوشهٔ موجود",Ake=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"Experiment branches will be pushed to the remote GitHub repository.",Mke=()=>"实验分支将推送到远程 GitHub 仓库。",Dke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Oke=()=>"Extra topics (comma-separated), e.g. llm, benchmark",Ike=()=>"附加 topic(逗号分隔),例如 llm, benchmark",Bke=()=>"موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark",GD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),$ke=()=>"From a paper",Pke=()=>"从论文创建",Fke=()=>"از یک مقاله",Hke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Uke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Gke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Wke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"my-research",Kke=()=>"my-research",Qke=()=>"my-research",aN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Yke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Xke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Zke=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Jke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xke():t==="fa"?Zke():Yke()}),e7e=()=>"No public repository found on alphaXiv",t7e=()=>"在 alphaXiv 上未找到公开仓库",n7e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",r7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),s7e=()=>"OpenResearch will start a blank project with this paper's PDF.",i7e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",a7e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",o7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i7e():t==="fa"?a7e():s7e()}),l7e=()=>"Paper",c7e=()=>"论文",u7e=()=>"مقاله",d7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c7e():t==="fa"?u7e():l7e()}),f7e=()=>"Project location",h7e=()=>"项目位置",_7e=()=>"محل پروژه",E2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h7e():t==="fa"?_7e():f7e()}),p7e=()=>"Project name",m7e=()=>"项目名称",g7e=()=>"نام پروژه",oN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),v7e=()=>"Search for a paper by arXiv ID, URL, or title",b7e=()=>"按 arXiv ID、网址或标题搜索论文",y7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",x7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b7e():t==="fa"?y7e():v7e()}),w7e=()=>"Sync experiments to GitHub",S7e=()=>"将实验同步到 GitHub",k7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",C7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"That folder no longer exists. Choose it again.",N7e=()=>"该文件夹已不存在。请重新选择。",z7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",j7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),T7e=()=>"The selected folder contains an invalid Git repository.",A7e=()=>"所选文件夹包含无效的 Git 仓库。",R7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",M7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A7e():t==="fa"?R7e():T7e()}),D7e=()=>"The selected path is not a folder.",L7e=()=>"所选路径不是文件夹。",O7e=()=>"مسیر انتخاب‌شده پوشه نیست.",I7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L7e():t==="fa"?O7e():D7e()}),B7e=e=>`Checking ${e==null?void 0:e.repository}.`,$7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,P7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,F7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$7e(e):t==="fa"?P7e(e):B7e(e)}),H7e=e=>`Creates ${e==null?void 0:e.repository}.`,q7e=e=>`将创建 ${e==null?void 0:e.repository}。`,U7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,G7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?q7e(e):t==="fa"?U7e(e):H7e(e)}),W7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,V7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,K7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Q7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V7e(e):t==="fa"?K7e(e):W7e(e)}),Y7e=()=>"Project location is required.",X7e=()=>"必须填写项目位置。",Z7e=()=>"محل پروژه الزامی است.",lN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),J7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",eCe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",tCe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",cN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eCe():t==="fa"?tCe():J7e()}),nCe=()=>"A linked public code repository is cloned without credentials.",rCe=()=>"关联的公开代码仓库无需凭据即可克隆。",sCe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",iCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,oCe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,lCe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,cCe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oCe(e):t==="fa"?lCe(e):aCe(e)}),uCe=()=>"Searching alphaXiv…",dCe=()=>"正在搜索 alphaXiv…",fCe=()=>"در حال جست‌وجوی alphaXiv…",hCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Use folder",pCe=()=>"使用文件夹",mCe=()=>"استفاده از پوشه",gCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Can’t reach OpenResearch. This page is no longer live.",bCe=()=>"无法连接 OpenResearch。此页面已不再实时同步。",yCe=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",j4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"A workspace for your research agents",wCe=()=>"面向研究智能体的工作空间",SCe=()=>"فضای کاری برای عامل‌های پژوهشی شما",kCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Add papers that represent your research interests, including papers by other authors.",ECe=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",NCe=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",zCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"API key",TCe=()=>"API 密钥",ACe=()=>"کلید API",a6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),RCe=()=>"AI/ML",MCe=()=>"人工智能与机器学习",DCe=()=>"هوش مصنوعی و یادگیری ماشین",LCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MCe():t==="fa"?DCe():RCe()}),OCe=()=>"Biology",ICe=()=>"生物学",BCe=()=>"زیست‌شناسی",$Ce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),PCe=()=>"Other",FCe=()=>"其他",HCe=()=>"سایر",qCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FCe():t==="fa"?HCe():PCe()}),UCe=()=>"Physics",GCe=()=>"物理学",WCe=()=>"فیزیک",VCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GCe():t==="fa"?WCe():UCe()}),KCe=()=>"Back",QCe=()=>"返回",YCe=()=>"بازگشت",uN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QCe():t==="fa"?YCe():KCe()}),XCe=()=>"Check failed",ZCe=()=>"检查失败",JCe=()=>"بررسی ناموفق بود",e8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZCe():t==="fa"?JCe():XCe()}),t8e=()=>"Checking",n8e=()=>"正在检查",r8e=()=>"در حال بررسی",s8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"Checking Git…",a8e=()=>"正在检查 Git…",o8e=()=>"در حال بررسی Git…",l8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Choose a coding agent",u8e=()=>"选择编程智能体",d8e=()=>"یک عامل کدنویسی انتخاب کنید",f8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Choose a coding agent to continue.",_8e=()=>"选择一个编程智能体以继续。",p8e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",m8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Choose at least one research area to continue.",v8e=()=>"请至少选择一个研究领域后再继续。",b8e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",y8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Choose one or more.",w8e=()=>"请选择一项或多项。",S8e=()=>"یک یا چند مورد را انتخاب کنید.",k8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Choose your preferred coding agent",E8e=()=>"请选择首选编程智能体",N8e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",z8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Consolidate your research",T8e=()=>"集中管理研究",A8e=()=>"پژوهش خود را یکپارچه کنید",R8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Continue",D8e=()=>"继续",L8e=()=>"ادامه",dN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Describe your research area to continue.",I8e=()=>"请描述你的研究领域后再继续。",B8e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",$8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",F8e=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",H8e=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",q8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G8e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",W8e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",V8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Everything stays local",Q8e=()=>"一切都保留在本地",Y8e=()=>"همه‌چیز محلی می‌ماند",X8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Get started",J8e=()=>"开始使用",e9e=()=>"شروع",t9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J8e():t==="fa"?e9e():Z8e()}),n9e=()=>"Git is required for local experiments. Install Git, then re-check.",r9e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",s9e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",i9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Ground your agents",o9e=()=>"为智能体提供可靠依据",l9e=()=>"عامل‌هایتان را به منابع متصل کنید",c9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),u9e=()=>"Install broken",d9e=()=>"安装损坏",f9e=()=>"نصب خراب است",h9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d9e():t==="fa"?f9e():u9e()}),_9e=()=>"Install Git to continue",p9e=()=>"请安装 Git 后再继续",m9e=()=>"برای ادامه Git را نصب کنید",g9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p9e():t==="fa"?m9e():_9e()}),v9e=()=>"Local Git",b9e=()=>"本地 Git",y9e=()=>"Git محلی",x9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b9e():t==="fa"?y9e():v9e()}),w9e=()=>", and ",S9e=()=>" 和 ",k9e=()=>" و ",C9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Compatible with",N9e=()=>"兼容",z9e=()=>"سازگار با",j9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),T9e=()=>"Use your own local models",A9e=()=>"使用你自己的本地模型",R9e=()=>"از مدل‌های محلی خود استفاده کنید",M9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),D9e=()=>"Not detected",L9e=()=>"未检测到",O9e=()=>"شناسایی نشد",fN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),I9e=()=>"Not found",B9e=()=>"未找到",$9e=()=>"پیدا نشد",WD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Not signed in",F9e=()=>"未登录",H9e=()=>"وارد نشده",q9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),U9e=()=>"OpenResearch uses a coding agent already installed on this machine.",G9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",W9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",V9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G9e():t==="fa"?W9e():U9e()}),K9e=()=>"Other research area",Q9e=()=>"其他研究领域",Y9e=()=>"حوزهٔ پژوهشی دیگر",X9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q9e():t==="fa"?Y9e():K9e()}),Z9e=()=>"Re-check",J9e=()=>"重新检查",eEe=()=>"بررسی دوباره",VD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J9e():t==="fa"?eEe():Z9e()}),tEe=()=>"Ready",nEe=()=>"已就绪",rEe=()=>"آماده",o6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Re-check Git before continuing",iEe=()=>"请重新检查 Git 后再继续",aEe=()=>"پیش از ادامه Git را دوباره بررسی کنید",oEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Representative papers",cEe=()=>"代表性论文",uEe=()=>"مقاله‌های شاخص",dEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Research background",hEe=()=>"研究背景",_Ee=()=>"پیشینهٔ پژوهشی",pEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",vEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",hN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Search alphaXiv by title to link a paper…",yEe=()=>"按标题搜索 alphaXiv 以关联论文…",xEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Searching alphaXiv…",kEe=()=>"正在搜索 alphaXiv…",CEe=()=>"در حال جست‌وجوی alphaXiv…",EEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Selected",zEe=()=>"已选择",jEe=()=>"انتخاب‌شده",TEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Local model unavailable",REe=()=>"本地模型不可用",MEe=()=>"مدل محلی در دسترس نیست",KD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),DEe=()=>"Setting things up…",LEe=()=>"正在设置…",OEe=()=>"در حال راه‌اندازی…",IEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LEe():t==="fa"?OEe():DEe()}),BEe=()=>"Connect a local model or sign in to a coding agent to continue",$Ee=()=>"连接本地模型或登录编码智能体以继续",PEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",FEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ee():t==="fa"?PEe():BEe()}),HEe=()=>"Connect a local model or sign in to an agent to continue.",qEe=()=>"连接本地模型或登录一个智能体以继续。",UEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",GEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qEe():t==="fa"?UEe():HEe()}),WEe=()=>"Signed in",VEe=()=>"已登录",KEe=()=>"وارد شده",QEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VEe():t==="fa"?KEe():WEe()}),YEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",XEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",ZEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",JEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XEe():t==="fa"?ZEe():YEe()}),eNe=()=>"· Step 1 of 2",tNe=()=>"· 第 1 步,共 2 步",nNe=()=>"· مرحلهٔ ۱ از ۲",rNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tNe():t==="fa"?nNe():eNe()}),sNe=()=>"· Step 2 of 2",iNe=()=>"· 第 2 步,共 2 步",aNe=()=>"· مرحلهٔ ۲ از ۲",oNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Tell us about your research",cNe=()=>"介绍一下你的研究",uNe=()=>"از پژوهش خود بگویید",dNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),fNe=()=>"Tell us your other research area",hNe=()=>"告诉我们你的其他研究领域",_Ne=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",pNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hNe():t==="fa"?_Ne():fNe()}),mNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",gNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",vNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",bNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gNe():t==="fa"?vNe():mNe()}),yNe=()=>"Unable to verify",xNe=()=>"无法验证",wNe=()=>"تأیید ممکن نیست",SNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xNe():t==="fa"?wNe():yNe()}),kNe=()=>"Update required",CNe=()=>"需要更新",ENe=()=>"نیازمند به‌روزرسانی",NNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Waiting for the Git check",jNe=()=>"正在等待 Git 检查",TNe=()=>"در انتظار بررسی Git",ANe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jNe():t==="fa"?TNe():zNe()}),RNe=()=>"Waiting for the local tool checks",MNe=()=>"正在等待本地工具检查",DNe=()=>"در انتظار بررسی ابزارهای محلی",LNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MNe():t==="fa"?DNe():RNe()}),ONe=()=>"What areas are you interested in?",INe=()=>"你对哪些领域感兴趣?",BNe=()=>"به چه حوزه‌هایی علاقه دارید؟",$Ne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),PNe=()=>"Your code, data, and experiment history stay on your machine.",FNe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",HNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",qNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FNe():t==="fa"?HNe():PNe()}),UNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",GNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",WNe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",VNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GNe():t==="fa"?WNe():UNe()}),KNe=()=>"Add cookie",QNe=()=>"添加 cookie",YNe=()=>"افزودن کوکی",XNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Changed here and on Overleaf — choose which copy to keep",JNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",eze=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",tze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"Create a token ↗",rze=()=>"创建令牌 ↗",sze=()=>"ساخت توکن ↗",ize=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),aze=()=>"Overleaf Git token",oze=()=>"Overleaf Git 令牌",lze=()=>"توکن Git در Overleaf",_N=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oze():t==="fa"?lze():aze()}),cze=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",uze=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",dze=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",fze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Import from browser",_ze=()=>"从浏览器导入",pze=()=>"وارد کردن از مرورگر",mze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"In step with Overleaf",vze=()=>"已与 Overleaf 同步",bze=()=>"با Overleaf همگام است",QD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),yze=()=>"The last sync did not finish.",xze=()=>"上次同步未完成。",wze=()=>"آخرین همگام‌سازی کامل نشد.",Sze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xze():t==="fa"?wze():yze()}),kze=()=>"Link and sync",Cze=()=>"关联并同步",Eze=()=>"پیوند و همگام‌سازی",Nze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"Connecting to Overleaf…",jze=()=>"正在连接 Overleaf…",Tze=()=>"در حال اتصال به Overleaf…",Aze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Edits are live on Overleaf",Mze=()=>"编辑已在 Overleaf 实时同步",Dze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Lze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mze():t==="fa"?Dze():Rze()}),Oze=()=>"Retry",Ize=()=>"重试",Bze=()=>"تلاش دوباره",$ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Live sync stopped.",Fze=()=>"实时同步已停止。",Hze=()=>"همگام‌سازی زنده متوقف شد.",qze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Live sync starts once the paper is in step with Overleaf.",Gze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Wze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Vze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Kze=()=>"My projects ↗",Qze=()=>"我的项目 ↗",Yze=()=>"پروژه‌های من ↗",pN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qze():t==="fa"?Yze():Kze()}),Xze=()=>"Nothing could be synced.",Zze=()=>"没有内容可以同步。",Jze=()=>"هیچ موردی قابل همگام‌سازی نبود.",eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open Overleaf ↗",nje=()=>"打开 Overleaf ↗",rje=()=>"باز کردن Overleaf ↗",sje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Cancel",aje=()=>"取消",oje=()=>"لغو",YD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",cje=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",uje=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",dje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Keep this copy",hje=()=>"保留此副本",_je=()=>"نگه داشتن این نسخه",pje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Open in Overleaf",gje=()=>"在 Overleaf 中打开",vje=()=>"باز کردن در Overleaf",bje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),yje=()=>"Replace the Overleaf token",xje=()=>"替换 Overleaf 令牌",wje=()=>"جایگزینی توکن Overleaf",mN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xje():t==="fa"?wje():yje()}),Sje=()=>"Sync files",kje=()=>"同步文件",Cje=()=>"همگام‌سازی فایل‌ها",Eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Unlink",zje=()=>"取消关联",jje=()=>"قطع پیوند",Tje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=()=>"Upload a copy as a new project ↗",Rje=()=>"上传副本作为新项目 ↗",Mje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",XD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rje():t==="fa"?Mje():Aje()}),Dje=()=>"Use Overleaf's",Lje=()=>"使用 Overleaf 的副本",Oje=()=>"استفاده از نسخهٔ Overleaf",Ije=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"This paper stays in step with Overleaf.",$je=()=>"此论文将与 Overleaf 保持同步。",Pje=()=>"این مقاله با Overleaf همگام می‌ماند.",Fje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$je():t==="fa"?Pje():Bje()}),Hje=()=>"Paste it instead",qje=()=>"改为粘贴",Uje=()=>"به‌جایش بچسبانید",Gje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qje():t==="fa"?Uje():Hje()}),Wje=e=>`Pulled ${e==null?void 0:e.paths}.`,Vje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Kje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Qje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vje(e):t==="fa"?Kje(e):Wje(e)}),Yje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Xje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Zje=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Jje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),eTe=e=>`Pushed ${e==null?void 0:e.paths}.`,tTe=e=>`已推送 ${e==null?void 0:e.paths}。`,nTe=e=>`${e==null?void 0:e.paths} ارسال شد.`,rTe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tTe(e):t==="fa"?nTe(e):eTe(e)}),sTe=()=>"Add a fresh Overleaf session cookie to start following again.",iTe=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",aTe=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",oTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Save the file first",cTe=()=>"请先保存文件",uTe=()=>"ابتدا فایل را ذخیره کنید",dTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),fTe=()=>"Save this file to sync it with Overleaf",hTe=()=>"保存此文件以与 Overleaf 同步",_Te=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",ZD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),pTe=()=>"Save token",mTe=()=>"保存令牌",gTe=()=>"ذخیرهٔ توکن",vTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),bTe=()=>"Send this paper to Overleaf",yTe=()=>"将此论文发送到 Overleaf",xTe=()=>"ارسال مقاله به Overleaf",wTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yTe():t==="fa"?xTe():bTe()}),STe=()=>"Overleaf session cookie",kTe=()=>"Overleaf 会话 cookie",CTe=()=>"کوکی نشست Overleaf",T4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kTe():t==="fa"?CTe():STe()}),ETe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",NTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",zTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",jTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=()=>"Overleaf sync failed",ATe=()=>"Overleaf 同步失败",RTe=()=>"همگام‌سازی با Overleaf ناموفق بود",A4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ATe():t==="fa"?RTe():TTe()}),MTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",DTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",LTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",OTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Syncing with Overleaf…",BTe=()=>"正在与 Overleaf 同步…",$Te=()=>"در حال همگام‌سازی با Overleaf…",JD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),PTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",FTe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",HTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",qTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FTe():t==="fa"?HTe():PTe()}),UTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",GTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",WTe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",VTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GTe():t==="fa"?WTe():UTe()}),KTe=()=>"Toggle Plan mode for this chat",QTe=()=>"切换此聊天的计划模式",YTe=()=>"تغییر حالت طرح این گفت‌وگو",XTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QTe():t==="fa"?YTe():KTe()}),ZTe=()=>"Accept and auto mode",JTe=()=>"接受并使用自动模式",eAe=()=>"پذیرش و حالت خودکار",tAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JTe():t==="fa"?eAe():ZTe()}),nAe=()=>"Accept and bypass all",rAe=()=>"接受并跳过所有审批",sAe=()=>"پذیرش و عبور از همهٔ تأییدها",iAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rAe():t==="fa"?sAe():nAe()}),aAe=()=>"Accept plan",oAe=()=>"接受计划",lAe=()=>"پذیرش طرح",cAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oAe():t==="fa"?lAe():aAe()}),uAe=e=>`${e==null?void 0:e.agent} proposed a plan`,dAe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,fAe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,hAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dAe(e):t==="fa"?fAe(e):uAe(e)}),_Ae=e=>`${e==null?void 0:e.agent} is ready to proceed`,pAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,mAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,gAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pAe(e):t==="fa"?mAe(e):_Ae(e)}),vAe=()=>"Back",bAe=()=>"返回",yAe=()=>"بازگشت",xAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bAe():t==="fa"?yAe():vAe()}),wAe=()=>"More approval options",SAe=()=>"更多批准选项",kAe=()=>"گزینه‌های تأیید بیشتر",CAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Open plan",NAe=()=>"打开计划",zAe=()=>"باز کردن طرح",jAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),TAe=()=>"Reject",AAe=()=>"拒绝",RAe=()=>"رد کردن",MAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),DAe=()=>"Revise",LAe=()=>"修改",OAe=()=>"بازنگری",IAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LAe():t==="fa"?OAe():DAe()}),BAe=()=>"Revise…",$Ae=()=>"修改…",PAe=()=>"بازنگری…",FAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ae():t==="fa"?PAe():BAe()}),HAe=()=>"What should change? (optional)",qAe=()=>"需要更改什么?(可选)",UAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",GAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qAe():t==="fa"?UAe():HAe()}),WAe=e=>`${e==null?void 0:e.count} active`,VAe=e=>`${e==null?void 0:e.count} 个活跃`,KAe=e=>`${e==null?void 0:e.count} فعال`,QAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?VAe(e):t==="fa"?KAe(e):WAe(e)}),YAe=e=>`${e==null?void 0:e.count} total agents`,XAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,ZAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,JAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?XAe(e):t==="fa"?ZAe(e):YAe(e)}),eRe=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,tRe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,nRe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,rRe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tRe(e):t==="fa"?nRe(e):eRe(e)}),sRe=()=>"Agents",iRe=()=>"智能体",aRe=()=>"عامل‌ها",gN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),oRe=()=>"arXiv paper ID:",lRe=()=>"arXiv 论文 ID:",cRe=()=>"شناسهٔ مقالهٔ arXiv:",uRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Cancel",fRe=()=>"取消",hRe=()=>"لغو",_Re=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),pRe=()=>"Created",mRe=()=>"创建时间",gRe=()=>"ایجادشده",vRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mRe():t==="fa"?gRe():pRe()}),bRe=()=>"Delete project?",yRe=()=>"删除项目?",xRe=()=>"پروژه حذف شود؟",wRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"Delete project",kRe=()=>"删除项目",CRe=()=>"حذف پروژه",ERe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"Deleting…",zRe=()=>"正在删除…",jRe=()=>"در حال حذف…",TRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),ARe=()=>"Experiments",RRe=()=>"实验",MRe=()=>"آزمایش‌ها",vN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RRe():t==="fa"?MRe():ARe()}),DRe=()=>"The local folder and linked GitHub repository are kept.",LRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",ORe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",IRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"The local folder is kept.",$Re=()=>"本地文件夹会保留。",PRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",FRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"New project",qRe=()=>"新建项目",URe=()=>"پروژهٔ جدید",eL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"No projects yet — create one to get started.",WRe=()=>"尚无项目——新建一个即可开始。",VRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",KRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Project",YRe=()=>"项目",XRe=()=>"پروژه",ZRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),JRe=()=>"Projects",eMe=()=>"项目",tMe=()=>"پروژه‌ها",nMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eMe():t==="fa"?tMe():JRe()}),rMe=()=>"Repository",sMe=()=>"仓库",iMe=()=>"مخزن",bN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),aMe=()=>"Idle",oMe=()=>"空闲",lMe=()=>"بیکار",cMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Local",dMe=()=>"本地",fMe=()=>"محلی",l6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dMe():t==="fa"?fMe():uMe()}),hMe=()=>"1 total agent",_Me=()=>"共 1 个智能体",pMe=()=>"در مجموع ۱ عامل",mMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=e=>`${e==null?void 0:e.count} running`,vMe=e=>`${e==null?void 0:e.count} 个运行中`,bMe=e=>`${e==null?void 0:e.count} در حال اجرا`,yMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vMe(e):t==="fa"?bMe(e):gMe(e)}),xMe=e=>`${e==null?void 0:e.count} total`,wMe=e=>`共 ${e==null?void 0:e.count} 个`,SMe=e=>`در مجموع ${e==null?void 0:e.count}`,yN=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wMe(e):t==="fa"?SMe(e):xMe(e)}),kMe=()=>"Installing the compatible binary. This may take a few minutes.",CMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",EMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",NMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),zMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,jMe=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,TMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,AMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jMe(e):t==="fa"?TMe(e):zMe(e)}),RMe=()=>"Check again",MMe=()=>"再次检查",DMe=()=>"بررسی دوباره",xN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MMe():t==="fa"?DMe():RMe()}),LMe=()=>"Closing…",OMe=()=>"正在关闭…",IMe=()=>"در حال بستن…",BMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OMe():t==="fa"?IMe():LMe()}),$Me=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,PMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,FMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,HMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PMe(e):t==="fa"?FMe(e):$Me(e)}),qMe=()=>"Preparing your remote workspace…",UMe=()=>"正在准备远程工作区…",GMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",WMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UMe():t==="fa"?GMe():qMe()}),VMe=e=>`Connecting to ${e==null?void 0:e.host}`,KMe=e=>`正在连接到 ${e==null?void 0:e.host}`,QMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,YMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KMe(e):t==="fa"?QMe(e):VMe(e)}),XMe=()=>"Close remote host picker",ZMe=()=>"关闭远程主机选择器",JMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",eDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZMe():t==="fa"?JMe():XMe()}),tDe=()=>"Choose a configured SSH host.",nDe=()=>"选择已配置的 SSH 主机。",rDe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",sDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nDe():t==="fa"?rDe():tDe()}),iDe=()=>"Connect to remote",aDe=()=>"连接到远程主机",oDe=()=>"اتصال به میزبان راه‌دور",tL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aDe():t==="fa"?oDe():iDe()}),lDe=()=>"Disconnect",cDe=()=>"断开连接",uDe=()=>"قطع اتصال",R4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Your remote work is still running. Reconnect when you’re ready.",fDe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",hDe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",_De=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`Disconnected from ${e==null?void 0:e.host}`,mDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,gDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,nL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),vDe=e=>`Could not connect to ${e==null?void 0:e.host}`,bDe=e=>`无法连接到 ${e==null?void 0:e.host}`,yDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,xDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bDe(e):t==="fa"?yDe(e):vDe(e)}),wDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",SDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",kDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",CDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SDe():t==="fa"?kDe():wDe()}),EDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",NDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",zDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",jDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),TDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ADe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,RDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,MDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ADe(e):t==="fa"?RDe(e):TDe(e)}),DDe=()=>"OpenResearch binary",LDe=()=>"OpenResearch 二进制文件",ODe=()=>"فایل اجرایی OpenResearch",IDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LDe():t==="fa"?ODe():DDe()}),BDe=()=>"OpenResearch Database",$De=()=>"OpenResearch 数据库",PDe=()=>"پایگاه دادهٔ OpenResearch",FDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",qDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",UDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",GDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qDe():t==="fa"?UDe():HDe()}),WDe=()=>"Install OpenResearch?",VDe=()=>"安装 OpenResearch?",KDe=()=>"OpenResearch نصب شود؟",QDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VDe():t==="fa"?KDe():WDe()}),YDe=()=>"Installing…",XDe=()=>"正在安装…",ZDe=()=>"در حال نصب…",JDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),eLe=()=>"No matching SSH hosts",tLe=()=>"没有匹配的 SSH 主机",nLe=()=>"میزبان SSH منطبقی پیدا نشد",rLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iLe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aLe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=()=>"Open remote",cLe=()=>"打开远程工作区",uLe=()=>"باز کردن راه‌دور",dLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),fLe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",hLe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",_Le=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",pLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",gLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",vLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",bLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gLe():t==="fa"?vLe():mLe()}),yLe=()=>"Preparing remote workspace…",xLe=()=>"正在准备远程工作区…",wLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",SLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),kLe=()=>"Reconnect",CLe=()=>"重新连接",ELe=()=>"اتصال دوباره",wN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),NLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",zLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",jLe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",TLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zLe():t==="fa"?jLe():NLe()}),ALe=e=>`Reconnecting to ${e==null?void 0:e.host}`,RLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,MLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,DLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RLe(e):t==="fa"?MLe(e):ALe(e)}),LLe=()=>"Search SSH hosts",OLe=()=>"搜索 SSH 主机",ILe=()=>"جستجوی میزبان‌های SSH",SN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),BLe=e=>`SSH: ${e==null?void 0:e.host}`,$Le=e=>`SSH:${e==null?void 0:e.host}`,PLe=e=>`SSH: ${e==null?void 0:e.host}`,N2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),FLe=()=>"Start a new OpenResearch host",HLe=()=>"启动新的 OpenResearch 主机",qLe=()=>"راه‌اندازی میزبان جدید OpenResearch",ULe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HLe():t==="fa"?qLe():FLe()}),GLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,WLe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,VLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,KLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WLe(e):t==="fa"?VLe(e):GLe(e)}),QLe=()=>"Stop OpenResearch",YLe=()=>"停止 OpenResearch",XLe=()=>"توقف OpenResearch",ZLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,eOe=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,tOe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,nOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eOe(e):t==="fa"?tOe(e):JLe(e)}),rOe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,sOe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,iOe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,aOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sOe(e):t==="fa"?iOe(e):rOe(e)}),oOe=()=>"Stop OpenResearch on host",lOe=()=>"停止主机上的 OpenResearch",cOe=()=>"توقف OpenResearch روی میزبان",rL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>"This will also:",dOe=()=>"这还将:",fOe=()=>"این کار همچنین:",hOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"End 1 pending approval.",pOe=()=>"结束 1 个待审批请求。",mOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",gOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),vOe=()=>"Leave 1 submitted experiment running.",bOe=()=>"让 1 个已提交实验继续运行。",yOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bOe():t==="fa"?yOe():vOe()}),wOe=()=>"Disconnect 1 other client.",SOe=()=>"断开 1 个其他客户端。",kOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",COe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Keep 1 queued message saved.",NOe=()=>"保留 1 条排队消息。",zOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",jOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),TOe=()=>"Interrupt 1 active agent turn.",AOe=()=>"中断 1 个活动代理任务。",ROe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",MOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AOe():t==="fa"?ROe():TOe()}),DOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,LOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,OOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,IOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LOe(e):t==="fa"?OOe(e):DOe(e)}),BOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,$Oe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,POe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,FOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,qOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,UOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,GOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qOe(e):t==="fa"?UOe(e):HOe(e)}),WOe=()=>"Stopping host…",VOe=()=>"正在停止主机…",KOe=()=>"در حال توقف میزبان…",QOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Update",XOe=()=>"更新",ZOe=()=>"به‌روزرسانی",kN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,eIe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,tIe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,nIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eIe(e):t==="fa"?tIe(e):JOe(e)}),rIe=()=>"Update OpenResearch?",sIe=()=>"更新 OpenResearch?",iIe=()=>"OpenResearch به‌روزرسانی شود؟",aIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Updating…",lIe=()=>"正在更新…",cIe=()=>"در حال به‌روزرسانی…",uIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),dIe=()=>"Disable syncing",fIe=()=>"关闭同步",hIe=()=>"غیرفعال کردن همگام‌سازی",_Ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fIe():t==="fa"?hIe():dIe()}),pIe=()=>"Enable GitHub syncing",mIe=()=>"启用 GitHub 同步",gIe=()=>"فعال‌سازی همگام‌سازی GitHub",vIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mIe():t==="fa"?gIe():pIe()}),bIe=()=>"Enabling…",yIe=()=>"正在启用…",xIe=()=>"در حال فعال‌سازی…",wIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yIe():t==="fa"?xIe():bIe()}),SIe=()=>"Updating…",kIe=()=>"正在更新…",CIe=()=>"در حال به‌روزرسانی…",EIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,zIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,jIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,TIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zIe(e):t==="fa"?jIe(e):NIe(e)}),AIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,RIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,MIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,DIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RIe(e):t==="fa"?MIe(e):AIe(e)}),LIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,OIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,IIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,BIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OIe(e):t==="fa"?IIe(e):LIe(e)}),$Ie=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,PIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,FIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,HIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PIe(e):t==="fa"?FIe(e):$Ie(e)}),qIe=()=>"CLI is retrying…",UIe=()=>"CLI 正在重试…",GIe=()=>"CLI در حال تلاش دوباره است…",WIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UIe():t==="fa"?GIe():qIe()}),VIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,KIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,QIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,YIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KIe(e):t==="fa"?QIe(e):VIe(e)}),XIe=()=>"Sending again…",ZIe=()=>"正在重新发送…",JIe=()=>"در حال ارسال دوباره…",eBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,nBe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,rBe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,sBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Retrying…",aBe=()=>"正在重试…",oBe=()=>"در حال تلاش دوباره…",sL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),lBe=()=>"Default speed",cBe=()=>"默认速度",uBe=()=>"سرعت پیش‌فرض",dBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cBe():t==="fa"?uBe():lBe()}),fBe=()=>"Standard",hBe=()=>"标准",_Be=()=>"استاندارد",pBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hBe():t==="fa"?_Be():fBe()}),mBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,gBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,vBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,bBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gBe(e):t==="fa"?vBe(e):mBe(e)}),yBe=()=>"Appearance",xBe=()=>"外观",wBe=()=>"ظاهر",SBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check",CBe=()=>"检查",EBe=()=>"بررسی",NBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"Check again",jBe=()=>"再次检查",TBe=()=>"بررسی دوباره",Qp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),ABe=()=>"Check for updates",RBe=()=>"检查更新",MBe=()=>"بررسی به‌روزرسانی",DBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RBe():t==="fa"?MBe():ABe()}),LBe=()=>"Check now",OBe=()=>"立即检查",IBe=()=>"اکنون بررسی کن",BBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Check setup",PBe=()=>"检查设置",FBe=()=>"بررسی راه‌اندازی",HBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PBe():t==="fa"?FBe():$Be()}),qBe=()=>"orx checks a few times a day on its own.",UBe=()=>"orx 每天会自动检查几次。",GBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",WBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UBe():t==="fa"?GBe():qBe()}),VBe=()=>"Choose a flavor",KBe=()=>"选择配置",QBe=()=>"انتخاب پیکربندی",YBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KBe():t==="fa"?QBe():VBe()}),XBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,ZBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,JBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZBe(e):t==="fa"?JBe(e):XBe(e)}),t$e=()=>"clean",n$e=()=>"无更改",r$e=()=>"بدون تغییر",s$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>`Already linked at ${e==null?void 0:e.link}.`,a$e=e=>`已链接到 ${e==null?void 0:e.link}。`,o$e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=e=>`Linked ${e==null?void 0:e.link}.`,u$e=e=>`已链接 ${e==null?void 0:e.link}。`,d$e=e=>`${e==null?void 0:e.link} پیوند شد.`,f$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u$e(e):t==="fa"?d$e(e):c$e(e)}),h$e=()=>"Connect",_$e=()=>"连接",p$e=()=>"اتصال",c6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_$e():t==="fa"?p$e():h$e()}),m$e=()=>"Connected via GitHub CLI",g$e=()=>"已通过 GitHub CLI 连接",v$e=()=>"از طریق GitHub CLI متصل است",iL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g$e():t==="fa"?v$e():m$e()}),b$e=()=>"Connecting…",y$e=()=>"正在连接…",x$e=()=>"در حال اتصال…",aL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y$e():t==="fa"?x$e():b$e()}),w$e=e=>`CPU cores: ${e==null?void 0:e.count}`,S$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,k$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,C$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S$e(e):t==="fa"?k$e(e):w$e(e)}),E$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",N$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",z$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",j$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"the current project",A$e=()=>"当前项目",R$e=()=>"پروژهٔ فعلی",M$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),D$e=e=>`${e==null?void 0:e.value} (custom)`,L$e=e=>`${e==null?void 0:e.value}(自定义)`,O$e=e=>`${e==null?void 0:e.value} (سفارشی)`,I$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L$e(e):t==="fa"?O$e(e):D$e(e)}),B$e=()=>"detached",$$e=()=>"分离头指针",P$e=()=>"جدا از شاخه",u6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Disconnected",H$e=()=>"已断开连接",q$e=()=>"قطع اتصال",oL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),U$e=()=>"Environment tab",G$e=()=>"环境标签页",W$e=()=>"زبانهٔ محیط",V$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G$e():t==="fa"?W$e():U$e()}),K$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Y$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,X$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Q$e(e):t==="fa"?Y$e(e):K$e(e)}),Z$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",J$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",ePe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",tPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J$e():t==="fa"?ePe():Z$e()}),nPe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",rPe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",sPe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",iPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",oPe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",lPe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",cPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=e=>`GPU × ${e==null?void 0:e.count}`,dPe=e=>`${e==null?void 0:e.count} 个 GPU`,fPe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,hPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dPe(e):t==="fa"?fPe(e):uPe(e)}),_Pe=()=>"has changes",pPe=()=>"有更改",mPe=()=>"دارای تغییر",gPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),vPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,bPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,yPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,xPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bPe(e):t==="fa"?yPe(e):vPe(e)}),wPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",SPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",kPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",CPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"Install",NPe=()=>"安装",zPe=()=>"نصب",jPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),TPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,APe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,RPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,MPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?APe(e):t==="fa"?RPe(e):TPe(e)}),DPe=e=>`Install the ${e==null?void 0:e.command} command`,LPe=e=>`安装 ${e==null?void 0:e.command} 命令`,OPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,IPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LPe(e):t==="fa"?OPe(e):DPe(e)}),BPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",$Pe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",PPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",FPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Pe():t==="fa"?PPe():BPe()}),HPe=()=>"Install the new release now instead of waiting for the background update.",qPe=()=>"立即安装新版本,无需等待后台更新。",UPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qPe():t==="fa"?UPe():HPe()}),WPe=()=>"Discard your unsaved Kubernetes changes?",VPe=()=>"要放弃未保存的 Kubernetes 更改吗?",KPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",QPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VPe():t==="fa"?KPe():WPe()}),YPe=()=>"Key from",XPe=()=>"密钥来自",ZPe=()=>"کلید از",JPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XPe():t==="fa"?ZPe():YPe()}),eFe=()=>"Use current kubectl context",tFe=()=>"使用当前 kubectl 上下文",nFe=()=>"استفاده از کانتکست فعلی kubectl",rFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=e=>`Use current context (${e==null?void 0:e.context})`,iFe=e=>`使用当前上下文(${e==null?void 0:e.context})`,aFe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,oFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iFe(e):t==="fa"?aFe(e):sFe(e)}),lFe=()=>"Language",cFe=()=>"语言",uFe=()=>"زبان",dFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),fFe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,hFe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,_Fe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,pFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hFe(e):t==="fa"?_Fe(e):fFe(e)}),mFe=()=>"Make default",gFe=()=>"设为默认值",vFe=()=>"پیش‌فرض شود",bFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gFe():t==="fa"?vFe():mFe()}),yFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",xFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",wFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",SFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xFe():t==="fa"?wFe():yFe()}),kFe=()=>"Replace token ID",CFe=()=>"替换令牌 ID",EFe=()=>"جایگزینی شناسهٔ توکن",NFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Replace token secret",jFe=()=>"替换令牌密钥",TFe=()=>"جایگزینی رمز توکن",AFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jFe():t==="fa"?TFe():zFe()}),RFe=()=>"How to get a Modal token",MFe=()=>"如何获取 Modal 令牌",DFe=()=>"روش دریافت توکن Modal",LFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MFe():t==="fa"?DFe():RFe()}),OFe=()=>"Token ID",IFe=()=>"令牌 ID",BFe=()=>"شناسهٔ توکن",$Fe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Token secret",FFe=()=>"令牌密钥",HFe=()=>"رمز توکن",qFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FFe():t==="fa"?HFe():PFe()}),UFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,GFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,WFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,lL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?GFe(e):t==="fa"?WFe(e):UFe(e)}),VFe=e=>`Needs ${e==null?void 0:e.tool}`,KFe=e=>`需要 ${e==null?void 0:e.tool}`,QFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,YFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KFe(e):t==="fa"?QFe(e):VFe(e)}),XFe=()=>"Needs tools",ZFe=()=>"缺少工具",JFe=()=>"به ابزارها نیاز دارد",eHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZFe():t==="fa"?JFe():XFe()}),tHe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,nHe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,rHe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,sHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nHe(e):t==="fa"?rHe(e):tHe(e)}),iHe=()=>"New runs use SSH; choose a host when launching.",aHe=()=>"新运行将使用 SSH;启动时请选择主机。",oHe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"New token",uHe=()=>"新令牌",dHe=()=>"توکن جدید",fHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"No default flavor",_He=()=>"不设默认配置",pHe=()=>"بدون پیکربندی پیش‌فرض",mHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"none",vHe=()=>"无",bHe=()=>"هیچ‌کدام",d6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vHe():t==="fa"?bHe():gHe()}),yHe=()=>"Not connected",xHe=()=>"未连接",wHe=()=>"متصل نیست",cL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"not found on PATH",kHe=()=>"在 PATH 中未找到",CHe=()=>"در PATH پیدا نشد",EHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,zHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,jHe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,THe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"not initialized",RHe=()=>"尚未初始化",MHe=()=>"راه‌اندازی نشده",DHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Not set",OHe=()=>"未设置",IHe=()=>"تنظیم نشده",M4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"OAuth (subscription login)",$He=()=>"OAuth(订阅登录)",PHe=()=>"OAuth (ورود با اشتراک)",FHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,qHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,UHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,GHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):HHe(e)}),WHe=()=>"Setting up…",VHe=()=>"正在设置…",KHe=()=>"در حال راه‌اندازی…",QHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Account",XHe=()=>"账户",ZHe=()=>"حساب",f6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Add one with",eqe=()=>"使用以下命令添加:",tqe=()=>"یکی با این فرمان اضافه کنید:",nqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Add variable",sqe=()=>"添加变量",iqe=()=>"افزودن متغیر",aqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"Agent models",lqe=()=>"智能体模型",cqe=()=>"مدل‌های عامل",uqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),dqe=()=>"Anonymous usage analytics",fqe=()=>"匿名使用情况分析",hqe=()=>"تحلیل ناشناس استفاده",CN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fqe():t==="fa"?hqe():dqe()}),_qe=()=>"Auth",pqe=()=>"身份验证",mqe=()=>"احراز هویت",gqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),vqe=()=>"Authentication",bqe=()=>"身份验证",yqe=()=>"احراز هویت",uL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bqe():t==="fa"?yqe():vqe()}),xqe=()=>"Auto-apply GitHub topics for new projects",wqe=()=>"为新项目自动添加 GitHub topic",Sqe=()=>"اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید",EN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wqe():t==="fa"?Sqe():xqe()}),kqe=()=>"Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.",Cqe=()=>"为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",Eqe=()=>"مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",dL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cqe():t==="fa"?Eqe():kqe()}),Nqe=()=>"Back to Compute",zqe=()=>"返回算力设置",jqe=()=>"بازگشت به رایانش",fL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zqe():t==="fa"?jqe():Nqe()}),Tqe=()=>"Backend",Aqe=()=>"后端",Rqe=()=>"بک‌اند",Mqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aqe():t==="fa"?Rqe():Tqe()}),Dqe=()=>"Baseline",Lqe=()=>"基线",Oqe=()=>"خط مبنا",Iqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"Binary",$qe=()=>"可执行文件",Pqe=()=>"فایل اجرایی",Fqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Cancel",qqe=()=>"取消",Uqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qqe():t==="fa"?Uqe():Hqe()}),Gqe=()=>"Cancel new variable",Wqe=()=>"取消新变量",Vqe=()=>"لغو متغیر جدید",Kqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wqe():t==="fa"?Vqe():Gqe()}),Qqe=()=>"Checking compute targets…",Yqe=()=>"正在检查算力目标…",Xqe=()=>"در حال بررسی مقصدهای رایانشی…",Zqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Qqe()}),Jqe=()=>"Checking kubectl…",eUe=()=>"正在检查 kubectl…",tUe=()=>"در حال بررسی kubectl…",nUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eUe():t==="fa"?tUe():Jqe()}),rUe=()=>"Checking Modal…",sUe=()=>"正在检查 Modal…",iUe=()=>"در حال بررسی Modal…",aUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Choose a preset flavor",lUe=()=>"选择预设规格",cUe=()=>"یک پیکربندی آماده انتخاب کنید",NN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),uUe=()=>"cluster default",dUe=()=>"集群默认值",fUe=()=>"پیش‌فرض خوشه",zN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dUe():t==="fa"?fUe():uUe()}),hUe=()=>"cluster default (e.g. 4h, 30m)",_Ue=()=>"集群默认值(例如 4h、30m)",pUe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",mUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ue():t==="fa"?pUe():hUe()}),gUe=()=>"Cluster unreachable",vUe=()=>"无法连接集群",bUe=()=>"خوشه در دسترس نیست",yUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vUe():t==="fa"?bUe():gUe()}),xUe=()=>"Compute",wUe=()=>"算力",SUe=()=>"رایانش",hL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wUe():t==="fa"?SUe():xUe()}),kUe=()=>"Connect compute backends and choose where new runs execute.",CUe=()=>"连接算力后端,并选择新运行的执行位置。",EUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",NUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"Connected",jUe=()=>"已连接",TUe=()=>"متصل",AUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jUe():t==="fa"?TUe():zUe()}),RUe=()=>"Context",MUe=()=>"上下文",DUe=()=>"زمینه",LUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MUe():t==="fa"?DUe():RUe()}),OUe=()=>"Current",IUe=()=>"当前",BUe=()=>"فعلی",$Ue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),PUe=()=>"Currently off:",FUe=()=>"当前已关闭:",HUe=()=>"اکنون خاموش است:",qUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FUe():t==="fa"?HUe():PUe()}),UUe=()=>"Custom flavor",GUe=()=>"自定义规格",WUe=()=>"پیکربندی سفارشی",VUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GUe():t==="fa"?WUe():UUe()}),KUe=()=>"Custom flavor…",QUe=()=>"自定义规格…",YUe=()=>"پیکربندی سفارشی…",XUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QUe():t==="fa"?YUe():KUe()}),ZUe=()=>"Data directory",JUe=()=>"数据目录",eGe=()=>"پوشهٔ داده",tGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JUe():t==="fa"?eGe():ZUe()}),nGe=()=>"default",rGe=()=>"默认",sGe=()=>"پیش‌فرض",iGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rGe():t==="fa"?sGe():nGe()}),aGe=()=>"Default",oGe=()=>"默认",lGe=()=>"پیش‌فرض",_L=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oGe():t==="fa"?lGe():aGe()}),cGe=()=>"Default destination",uGe=()=>"默认目标",dGe=()=>"مقصد پیش‌فرض",fGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uGe():t==="fa"?dGe():cGe()}),hGe=()=>"Detecting hardware…",_Ge=()=>"正在检测硬件…",pGe=()=>"در حال شناسایی سخت‌افزار…",mGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Detecting harnesses…",vGe=()=>"正在检测智能体工具…",bGe=()=>"در حال شناسایی ابزارهای عامل…",yGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",wGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",SGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",kGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Effective URL",EGe=()=>"实际使用的网址",NGe=()=>"نشانی مؤثر",zGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Enable GitHub syncing for new projects",TGe=()=>"为新项目启用 GitHub 同步",AGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",jN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),RGe=()=>"Environment",MGe=()=>"环境",DGe=()=>"محیط",pL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MGe():t==="fa"?DGe():RGe()}),LGe=()=>"Failed",OGe=()=>"失败",IGe=()=>"ناموفق",h6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OGe():t==="fa"?IGe():LGe()}),BGe=()=>"General",$Ge=()=>"常规",PGe=()=>"عمومی",FGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ge():t==="fa"?PGe():BGe()}),HGe=()=>"GitHub publishing",qGe=()=>"GitHub 发布",UGe=()=>"انتشار در GitHub",GGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qGe():t==="fa"?UGe():HGe()}),WGe=()=>"Git token",VGe=()=>"Git 令牌",KGe=()=>"توکن Git",QGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VGe():t==="fa"?KGe():WGe()}),YGe=()=>"Harnesses",XGe=()=>"智能体工具",ZGe=()=>"ابزارهای عامل",JGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XGe():t==="fa"?ZGe():YGe()}),eWe=()=>"hf_…",tWe=()=>"hf_…",nWe=()=>"hf_…",rWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",iWe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",aWe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",oWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"Initialize Git",cWe=()=>"初始化 Git",uWe=()=>"راه‌اندازی Git",dWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),fWe=()=>"Install",hWe=()=>"安装",_We=()=>"نصب",mL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hWe():t==="fa"?_We():fWe()}),pWe=()=>"Install broken",mWe=()=>"安装损坏",gWe=()=>"نصب خراب است",vWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mWe():t==="fa"?gWe():pWe()}),bWe=()=>"Install GitHub CLI",yWe=()=>"安装 GitHub CLI",xWe=()=>"نصب GitHub CLI",wWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yWe():t==="fa"?xWe():bWe()}),SWe=()=>"Install updates automatically",kWe=()=>"自动安装更新",CWe=()=>"نصب خودکار به‌روزرسانی‌ها",TN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),EWe=()=>"Instance history",NWe=()=>"实例历史",zWe=()=>"تاریخچهٔ نمونه‌ها",jWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NWe():t==="fa"?zWe():EWe()}),TWe=()=>"Invalid Token",AWe=()=>"令牌无效",RWe=()=>"توکن نامعتبر",MWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AWe():t==="fa"?RWe():TWe()}),DWe=()=>"Jobs / Dashboard URL",LWe=()=>"Jobs / 控制台网址",OWe=()=>"نشانی Jobs / داشبورد",IWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"kubectl not found",$We=()=>"未找到 kubectl",PWe=()=>"kubectl پیدا نشد",FWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$We():t==="fa"?PWe():BWe()}),HWe=()=>"Latest",qWe=()=>"最新版本",UWe=()=>"جدیدترین",GWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qWe():t==="fa"?UWe():HWe()}),WWe=()=>"Loading…",VWe=()=>"正在加载…",KWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VWe():t==="fa"?KWe():WWe()}),QWe=()=>"Loading Ray settings…",YWe=()=>"正在加载 Ray 设置…",XWe=()=>"در حال بارگیری تنظیمات Ray…",ZWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YWe():t==="fa"?XWe():QWe()}),JWe=()=>"Loading slurm settings…",eVe=()=>"正在加载 Slurm 设置…",tVe=()=>"در حال بارگیری تنظیمات Slurm…",nVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eVe():t==="fa"?tVe():JWe()}),rVe=()=>"Loading status…",sVe=()=>"正在加载状态…",iVe=()=>"در حال بارگیری وضعیت…",aVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sVe():t==="fa"?iVe():rVe()}),oVe=()=>"Local only",lVe=()=>"仅本地",cVe=()=>"فقط محلی",uVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lVe():t==="fa"?cVe():oVe()}),dVe=()=>"Local repository",fVe=()=>"本地仓库",hVe=()=>"مخزن محلی",_Ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fVe():t==="fa"?hVe():dVe()}),pVe=()=>"Login node",mVe=()=>"登录节点",gVe=()=>"گرهٔ ورود",vVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mVe():t==="fa"?gVe():pVe()}),bVe=()=>"Make GitHub syncing the default?",yVe=()=>"将 GitHub 同步设为默认值?",xVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",wVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yVe():t==="fa"?xVe():bVe()}),SVe=()=>"Missing bash/tar",kVe=()=>"缺少 bash/tar",CVe=()=>"bash/tar موجود نیست",EVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kVe():t==="fa"?CVe():SVe()}),NVe=()=>"More compute options",zVe=()=>"更多算力选项",jVe=()=>"گزینه‌های رایانشی بیشتر",TVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zVe():t==="fa"?jVe():NVe()}),AVe=()=>"Move failed:",RVe=()=>"移动失败:",MVe=()=>"انتقال ناموفق بود:",DVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RVe():t==="fa"?MVe():AVe()}),LVe=()=>"Moved. orx is now using the new location.",OVe=()=>"已移动。orx 现在使用新位置。",IVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",BVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OVe():t==="fa"?IVe():LVe()}),$Ve=()=>"Namespace",PVe=()=>"命名空间",FVe=()=>"فضای نام",HVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PVe():t==="fa"?FVe():$Ve()}),qVe=()=>"New location",UVe=()=>"新位置",GVe=()=>"محل جدید",WVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UVe():t==="fa"?GVe():qVe()}),VVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",KVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",QVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",YVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KVe():t==="fa"?QVe():VVe()}),XVe=()=>"New variable key",ZVe=()=>"新变量键名",JVe=()=>"کلید متغیر جدید",eKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZVe():t==="fa"?JVe():XVe()}),tKe=()=>"New variable value",nKe=()=>"新变量值",rKe=()=>"مقدار متغیر جدید",sKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nKe():t==="fa"?rKe():tKe()}),iKe=()=>"No code, prompts, file contents, or account identifiers are sent.",aKe=()=>"不会发送代码、提示词、文件内容或账户标识符。",oKe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",lKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aKe():t==="fa"?oKe():iKe()}),cKe=()=>"No hosts found in ~/.ssh/config.",uKe=()=>"在 ~/.ssh/config 中未找到主机。",dKe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",fKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uKe():t==="fa"?dKe():cKe()}),hKe=()=>"No job-create permission",_Ke=()=>"没有创建 Job 的权限",pKe=()=>"مجوز ساخت Job وجود ندارد",mKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ke():t==="fa"?pKe():hKe()}),gKe=()=>"No Write Permissions",vKe=()=>"无写入权限",bKe=()=>"بدون مجوز نوشتن",yKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vKe():t==="fa"?bKe():gKe()}),xKe=()=>"No key on this computer to register — load a registered key with",wKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",SKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",kKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wKe():t==="fa"?SKe():xKe()}),CKe=()=>"No key on this computer yet — create one with",EKe=()=>"此计算机上还没有密钥——使用以下命令创建:",NKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",zKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EKe():t==="fa"?NKe():CKe()}),jKe=()=>"No Slurm CLI",TKe=()=>"无 Slurm CLI",AKe=()=>"بدون CLI اسلورم",RKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TKe():t==="fa"?AKe():jKe()}),MKe=()=>"None registered",DKe=()=>"未注册任何密钥",LKe=()=>"هیچ‌کدام ثبت نشده",OKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DKe():t==="fa"?LKe():MKe()}),IKe=()=>"Not checked",BKe=()=>"未检查",$Ke=()=>"بررسی نشده",gL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BKe():t==="fa"?$Ke():IKe()}),PKe=()=>"Not configured",FKe=()=>"未配置",HKe=()=>"پیکربندی نشده",nb=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FKe():t==="fa"?HKe():PKe()}),qKe=()=>"Not installed",UKe=()=>"未安装",GKe=()=>"نصب نیست",WKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UKe():t==="fa"?GKe():qKe()}),VKe=()=>"Not now",KKe=()=>"暂不",QKe=()=>"اکنون نه",YKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KKe():t==="fa"?QKe():VKe()}),XKe=()=>"Not on this computer",ZKe=()=>"不在此计算机上",JKe=()=>"روی این رایانه نیست",eQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZKe():t==="fa"?JKe():XKe()}),tQe=()=>"Not set (pass --host per launch)",nQe=()=>"未设置(每次启动时传入 --host)",rQe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",sQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Not signed in",aQe=()=>"未登录",oQe=()=>"وارد نشده",vL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),lQe=()=>"On this computer",cQe=()=>"在此计算机上",uQe=()=>"روی این رایانه",dQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cQe():t==="fa"?uQe():lQe()}),fQe=()=>"Open a project to inspect its repository and GitHub publication state.",hQe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",_Qe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",pQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hQe():t==="fa"?_Qe():fQe()}),mQe=()=>"Open job page",gQe=()=>"打开作业页面",vQe=()=>"باز کردن صفحهٔ کار",AN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gQe():t==="fa"?vQe():mQe()}),bQe=()=>"Open on GitHub",yQe=()=>"在 GitHub 上打开",xQe=()=>"باز کردن در GitHub",RN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yQe():t==="fa"?xQe():bQe()}),wQe=()=>", or create one with",SQe=()=>",或使用以下命令创建:",kQe=()=>"، یا با این فرمان یکی بسازید:",CQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SQe():t==="fa"?kQe():wQe()}),EQe=()=>"Org",NQe=()=>"组织",zQe=()=>"سازمان",jQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"Orgs",AQe=()=>"组织",RQe=()=>"سازمان‌ها",MQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),DQe=()=>"orx can't update this install",LQe=()=>"orx 无法更新此安装",OQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",IQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LQe():t==="fa"?OQe():DQe()}),BQe=()=>"Overleaf",$Qe=()=>"Overleaf",PQe=()=>"Overleaf",bL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),FQe=()=>"Overleaf Git authentication token",HQe=()=>"Overleaf Git 身份验证令牌",qQe=()=>"توکن احراز هویت Git در Overleaf",UQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HQe():t==="fa"?qQe():FQe()}),GQe=()=>"Overridden by env",WQe=()=>"已被环境变量覆盖",VQe=()=>"بازنویسی‌شده توسط محیط",KQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WQe():t==="fa"?VQe():GQe()}),QQe=()=>"Partition",YQe=()=>"分区",XQe=()=>"پارتیشن",ZQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YQe():t==="fa"?XQe():QQe()}),JQe=()=>"Path",eYe=()=>"路径",tYe=()=>"مسیر",nYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eYe():t==="fa"?tYe():JQe()}),rYe=()=>"Plan",sYe=()=>"方案",iYe=()=>"سطح اشتراک",aYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sYe():t==="fa"?iYe():rYe()}),oYe=()=>"Project",lYe=()=>"项目",cYe=()=>"پروژه",uYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lYe():t==="fa"?cYe():oYe()}),dYe=()=>"Ray version",fYe=()=>"Ray 版本",hYe=()=>"نسخهٔ Ray",_Ye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),pYe=()=>"Reachable",mYe=()=>"可访问",gYe=()=>"در دسترس",vYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mYe():t==="fa"?gYe():pYe()}),bYe=()=>"Reading ~/.ssh/config…",yYe=()=>"正在读取 ~/.ssh/config…",xYe=()=>"در حال خواندن ‎~/.ssh/config…",yL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yYe():t==="fa"?xYe():bYe()}),wYe=()=>"Ready",SYe=()=>"就绪",kYe=()=>"آماده",Yp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),CYe=()=>"Ready to move",EYe=()=>"可以移动",NYe=()=>"آمادهٔ انتقال",zYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EYe():t==="fa"?NYe():CYe()}),jYe=()=>"Configured",TYe=()=>"已配置",AYe=()=>"پیکربندی‌شده",_6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),RYe=()=>"Refresh",MYe=()=>"刷新",DYe=()=>"تازه‌سازی",Xp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MYe():t==="fa"?DYe():RYe()}),LYe=()=>"Remotes",OYe=()=>"远程仓库",IYe=()=>"مخزن‌های دوردست",BYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OYe():t==="fa"?IYe():LYe()}),$Ye=()=>"Repository",PYe=()=>"仓库",FYe=()=>"مخزن",HYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PYe():t==="fa"?FYe():$Ye()}),qYe=()=>"Repository topics",UYe=()=>"仓库 topic",GYe=()=>"موضوع‌های مخزن",S1=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UYe():t==="fa"?GYe():qYe()}),WYe=()=>"Restart to finish updating",VYe=()=>"重新启动以完成更新",KYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",QYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VYe():t==="fa"?KYe():WYe()}),YYe=()=>"Running instances",XYe=()=>"正在运行的实例",ZYe=()=>"نمونه‌های در حال اجرا",JYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),eXe=()=>"Runtime",tXe=()=>"运行时间",nXe=()=>"زمان اجرا",rXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>". Save it under that key if it's meant for HF Jobs.",iXe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",aXe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",oXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>"Session cookie",cXe=()=>"会话 cookie",uXe=()=>"کوکی نشست",dXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),fXe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",hXe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",_Xe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",pXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hXe():t==="fa"?_Xe():fXe()}),mXe=()=>"Settings",gXe=()=>"设置",vXe=()=>"تنظیمات",p6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gXe():t==="fa"?vXe():mXe()}),bXe=()=>"Signed in",yXe=()=>"已登录",xXe=()=>"وارد شده",wXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yXe():t==="fa"?xXe():bXe()}),SXe=()=>"Source",kXe=()=>"来源",CXe=()=>"منبع",xL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kXe():t==="fa"?CXe():SXe()}),EXe=()=>"SSH Key",NXe=()=>"SSH 密钥",zXe=()=>"کلید SSH",jXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NXe():t==="fa"?zXe():EXe()}),TXe=()=>"Started",AXe=()=>"开始时间",RXe=()=>"آغاز",MXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),DXe=()=>"State",LXe=()=>"状态",OXe=()=>"وضعیت",IXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LXe():t==="fa"?OXe():DXe()}),BXe=()=>"Status",$Xe=()=>"状态",PXe=()=>"وضعیت",l_=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),FXe=()=>"Storage",HXe=()=>"存储",qXe=()=>"ذخیره‌سازی",UXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HXe():t==="fa"?qXe():FXe()}),GXe=()=>"Sync",WXe=()=>"同步",VXe=()=>"همگام‌سازی",KXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"Syncing off",YXe=()=>"同步已关闭",XXe=()=>"همگام‌سازی خاموش",ZXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Test connection",eZe=()=>"测试连接",tZe=()=>"آزمایش اتصال",nZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Testing…",sZe=()=>"正在测试…",iZe=()=>"در حال آزمایش…",aZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),oZe=()=>", then add it with",lZe=()=>",然后使用以下命令添加:",cZe=()=>"، سپس با این فرمان اضافه‌اش کنید:",uZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lZe():t==="fa"?cZe():oZe()}),dZe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",fZe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",hZe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",_Ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fZe():t==="fa"?hZe():dZe()}),pZe=()=>"This saved destination is not configured. Set it up below or choose another backend.",mZe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",gZe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",vZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mZe():t==="fa"?gZe():pZe()}),bZe=()=>"This value looks like a Hugging Face token — compute runs only read it from",yZe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",xZe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",wZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yZe():t==="fa"?xZe():bZe()}),SZe=()=>"Time limit",kZe=()=>"时间限制",CZe=()=>"محدودیت زمانی",EZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Unable to verify",zZe=()=>"无法验证",jZe=()=>"تأیید ممکن نیست",D4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),TZe=()=>"Unknown",AZe=()=>"未知",RZe=()=>"نامشخص",wL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AZe():t==="fa"?RZe():TZe()}),MZe=()=>"Update required",DZe=()=>"需要更新",LZe=()=>"نیازمند به‌روزرسانی",OZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DZe():t==="fa"?LZe():MZe()}),IZe=()=>"Updates",BZe=()=>"更新",$Ze=()=>"به‌روزرسانی‌ها",MN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BZe():t==="fa"?$Ze():IZe()}),PZe=()=>"Usage analytics",FZe=()=>"使用情况分析",HZe=()=>"تحلیل استفاده",qZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FZe():t==="fa"?HZe():PZe()}),UZe=()=>"value",GZe=()=>"值",WZe=()=>"مقدار",SL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GZe():t==="fa"?WZe():UZe()}),VZe=()=>"Variables available to runs and the research agent (API keys, tokens).",KZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",QZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",YZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZe():t==="fa"?QZe():VZe()}),XZe=()=>"Version",ZZe=()=>"版本",JZe=()=>"نسخه",kL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZe():t==="fa"?JZe():XZe()}),eJe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",tJe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",nJe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",rJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tJe():t==="fa"?nJe():eJe()}),sJe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",iJe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",aJe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",oJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iJe():t==="fa"?aJe():sJe()}),lJe=()=>"Pick a login node first",cJe=()=>"请先选择登录节点",uJe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",dJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cJe():t==="fa"?uJe():lJe()}),fJe=()=>"Providers",hJe=()=>"提供商",_Je=()=>"ارائه‌دهندگان",pJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hJe():t==="fa"?_Je():fJe()}),mJe=()=>"Reconnect",gJe=()=>"重新连接",vJe=()=>"اتصال دوباره",CL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gJe():t==="fa"?vJe():mJe()}),bJe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yJe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,xJe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,wJe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yJe(e):t==="fa"?xJe(e):bJe(e)}),SJe=()=>"Reinstall with the orx installer to get automatic updates.",kJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",CJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",EJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kJe():t==="fa"?CJe():SJe()}),NJe=()=>"Re-link",zJe=()=>"重新链接",jJe=()=>"پیوند دوباره",TJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zJe():t==="fa"?jJe():NJe()}),AJe=()=>"Remove cookie",RJe=()=>"移除 cookie",MJe=()=>"حذف کوکی",DJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RJe():t==="fa"?MJe():AJe()}),LJe=()=>"Remove token",OJe=()=>"移除令牌",IJe=()=>"حذف توکن",BJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OJe():t==="fa"?IJe():LJe()}),$Je=()=>"Removing…",PJe=()=>"正在移除…",FJe=()=>"در حال حذف…",DN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PJe():t==="fa"?FJe():$Je()}),HJe=()=>"Replace anyway",qJe=()=>"仍要替换",UJe=()=>"به‌هرحال جایگزین کن",GJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qJe():t==="fa"?UJe():HJe()}),WJe=()=>"Replace key",VJe=()=>"替换密钥",KJe=()=>"جایگزینی کلید",QJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJe():t==="fa"?KJe():WJe()}),YJe=()=>"Replace token",XJe=()=>"替换令牌",ZJe=()=>"جایگزینی توکن",JJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XJe():t==="fa"?ZJe():YJe()}),eet=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,tet=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,net=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,ret=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tet(e):t==="fa"?net(e):eet(e)}),set=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,iet=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,aet=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,oet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iet(e):t==="fa"?aet(e):set(e)}),cet=()=>"Run `gh auth login` in your terminal.",uet=()=>"请在终端中运行 `gh auth login`。",det=()=>"در پایانه `gh auth login` را اجرا کنید.",fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uet():t==="fa"?det():cet()}),het=()=>"Saved",_et=()=>"已保存",pet=()=>"ذخیره شده",LN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_et():t==="fa"?pet():het()}),met=()=>"Set up",get=()=>"设置",vet=()=>"راه‌اندازی",bet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?get():t==="fa"?vet():met()}),yet=()=>"Set up SSH key",xet=()=>"设置 SSH 密钥",wet=()=>"راه‌اندازی کلید SSH",ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"Sign in",Eet=()=>"登录",Net=()=>"ورود",EL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),zet=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,jet=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Tet=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,NL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jet(e):t==="fa"?Tet(e):zet(e)}),Aet=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Ret=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Met=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Det=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ret():t==="fa"?Met():Aet()}),Let=()=>"The terminal disconnected before setup completed. Try again.",Oet=()=>"设置完成前终端连接已断开。请重试。",Iet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",ON=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oet():t==="fa"?Iet():Let()}),Bet=()=>"Dark",$et=()=>"深色",Pet=()=>"تیره",Fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$et():t==="fa"?Pet():Bet()}),Het=()=>"Theme",qet=()=>"主题",Uet=()=>"پوسته",IN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qet():t==="fa"?Uet():Het()}),Get=()=>"Light",Wet=()=>"浅色",Vet=()=>"روشن",Ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wet():t==="fa"?Vet():Get()}),Qet=()=>"System",Yet=()=>"系统",Xet=()=>"سیستم",Zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=()=>"Set up billing in the Tinker console",ett=()=>"在 Tinker 控制台设置账单",ttt=()=>"تنظیم پرداخت در کنسول Tinker",ntt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ett():t==="fa"?ttt():Jet()}),rtt=()=>"Billing setup required",stt=()=>"需要设置账单",itt=()=>"تنظیم پرداخت لازم است",att=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",ltt=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",ctt=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",utt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"Invalid Key",ftt=()=>"密钥无效",htt=()=>"کلید نامعتبر",_tt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Token from",mtt=()=>"令牌来自",gtt=()=>"توکن از",vtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),btt=()=>"Update now",ytt=()=>"立即更新",xtt=()=>"اکنون به‌روزرسانی کن",wtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ytt():t==="fa"?xtt():btt()}),Stt=e=>`Update to ${e==null?void 0:e.version}`,ktt=e=>`更新到 ${e==null?void 0:e.version}`,Ctt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Ett=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ktt(e):t==="fa"?Ctt(e):Stt(e)}),Ntt=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",ztt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",jtt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Ttt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ztt():t==="fa"?jtt():Ntt()}),Att=()=>"Updating default destination…",Rtt=()=>"正在更新默认运行位置…",Mtt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Dtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rtt():t==="fa"?Mtt():Att()}),Ltt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",Ott=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Itt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Btt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ott():t==="fa"?Itt():Ltt()}),$tt=()=>"Validating…",Ptt=()=>"正在验证…",Ftt=()=>"در حال اعتبارسنجی…",zL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ptt():t==="fa"?Ftt():$tt()}),Htt=()=>"View settings",qtt=()=>"查看设置",Utt=()=>"مشاهدهٔ تنظیمات",Gtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qtt():t==="fa"?Utt():Htt()}),Wtt=()=>"Skill",Vtt=()=>"技能",Ktt=()=>"مهارت",Qtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vtt():t==="fa"?Ktt():Wtt()}),Ytt=()=>"Loading skill…",Xtt=()=>"正在加载技能…",Ztt=()=>"در حال بارگیری مهارت…",Jtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xtt():t==="fa"?Ztt():Ytt()}),ent=()=>"Personal",tnt=()=>"个人",nnt=()=>"شخصی",rnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Alternatively, tell your agent to save a reusable skill for you.",int=()=>"或者,请你的智能体为你保存可重复使用的技能。",ant=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",ont=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,cnt=e=>`删除技能“${e==null?void 0:e.name}”?`,unt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,dnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cnt(e):t==="fa"?unt(e):lnt(e)}),fnt=e=>`Delete skill ${e==null?void 0:e.name}`,hnt=e=>`删除技能 ${e==null?void 0:e.name}`,_nt=e=>`حذف مهارت ${e==null?void 0:e.name}`,pnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hnt(e):t==="fa"?_nt(e):fnt(e)}),mnt=e=>`Delete the “${e==null?void 0:e.name}” template?`,gnt=e=>`删除模板“${e==null?void 0:e.name}”?`,vnt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,bnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gnt(e):t==="fa"?vnt(e):mnt(e)}),ynt=e=>`Delete template ${e==null?void 0:e.name}`,xnt=e=>`删除模板 ${e==null?void 0:e.name}`,wnt=e=>`حذف قالب ${e==null?void 0:e.name}`,Snt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xnt(e):t==="fa"?wnt(e):ynt(e)}),knt=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",Cnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Ent=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Nnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cnt():t==="fa"?Ent():knt()}),znt=()=>"Drop a SKILL.md or .zip here, or click to choose",jnt=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Tnt=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Ant=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jnt():t==="fa"?Tnt():znt()}),Rnt=()=>"Drop a .tex or .zip here, or click to choose",Mnt=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Dnt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Lnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mnt():t==="fa"?Dnt():Rnt()}),Ont=()=>"File too large (max 20 MB).",Int=()=>"文件过大(最大 20 MB)。",Bnt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",jL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Int():t==="fa"?Bnt():Ont()}),$nt=()=>" + 1 file",Pnt=()=>" + 1 个文件",Fnt=()=>" + ۱ فایل",Hnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pnt():t==="fa"?Fnt():$nt()}),qnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Unt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Gnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Wnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Remove from OpenResearch",Knt=()=>"从 OpenResearch 移除",Qnt=()=>"حذف از OpenResearch",Ynt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,Znt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,Jnt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,ert=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Znt(e):t==="fa"?Jnt(e):Xnt(e)}),trt=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,nrt=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,rrt=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,srt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nrt(e):t==="fa"?rrt(e):trt(e)}),irt=e=>` + ${e==null?void 0:e.count} files`,art=e=>` + ${e==null?void 0:e.count} 个文件`,ort=e=>` + ${e==null?void 0:e.count} فایل`,lrt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?art(e):t==="fa"?ort(e):irt(e)}),crt=()=>"Could not load skills:",urt=()=>"无法加载技能:",drt=()=>"بارگیری مهارت‌ها ممکن نشد:",frt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?urt():t==="fa"?drt():crt()}),hrt=()=>"Could not load templates:",_rt=()=>"无法加载模板:",prt=()=>"بارگیری قالب‌ها ممکن نشد:",mrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"Customize",vrt=()=>"自定义",brt=()=>"سفارشی‌سازی",yrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"Delete skill",wrt=()=>"删除技能",Srt=()=>"حذف مهارت",krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Delete template",Ert=()=>"删除模板",Nrt=()=>"حذف قالب",zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"LaTeX templates",Trt=()=>"LaTeX 模板",Art=()=>"قالب‌های LaTeX",Rrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"Loading skills…",Drt=()=>"正在加载技能…",Lrt=()=>"در حال بارگیری مهارت‌ها…",Ort=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Loading templates…",Brt=()=>"正在加载模板…",$rt=()=>"در حال بارگیری قالب‌ها…",Prt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"No skills yet.",Hrt=()=>"尚无技能。",qrt=()=>"هنوز مهارتی وجود ندارد.",Urt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"No templates yet.",Wrt=()=>"尚无模板。",Vrt=()=>"هنوز قالبی وجود ندارد.",Krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"Skills",Yrt=()=>"技能",Xrt=()=>"مهارت‌ها",Zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Uploading…",est=()=>"正在上传…",tst=()=>"در حال بارگذاری…",nst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",sst=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",ist=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ast=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"Upload a SKILL.md file or a .zip of a skill folder.",lst=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",cst=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",ust=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Upload a .tex file or a .zip of a template folder.",fst=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",hst=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",_st=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),pst=()=>"Close SSH config",mst=()=>"关闭 SSH 配置",gst=()=>"بستن پیکربندی SSH",vst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mst():t==="fa"?gst():pst()}),bst=()=>"Discard your unsaved SSH config changes?",yst=()=>"要放弃未保存的 SSH 配置更改吗?",xst=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",wst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yst():t==="fa"?xst():bst()}),Sst=()=>"Loading SSH config…",kst=()=>"正在加载 SSH 配置…",Cst=()=>"در حال بارگیری پیکربندی SSH…",Est=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kst():t==="fa"?Cst():Sst()}),Nst=()=>"SSH config saved",zst=()=>"SSH 配置已保存",jst=()=>"پیکربندی SSH ذخیره شد",Tst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zst():t==="fa"?jst():Nst()}),Ast=()=>"SSH config",Rst=()=>"SSH 配置",Mst=()=>"پیکربندی SSH",Dst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rst():t==="fa"?Mst():Ast()}),Lst=()=>"Configure SSH hosts…",Ost=()=>"配置 SSH 主机…",Ist=()=>"پیکربندی میزبان‌های SSH…",TL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ost():t==="fa"?Ist():Lst()}),Bst=()=>"Cancelled",$st=()=>"已取消",Pst=()=>"لغوشده",Fst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$st():t==="fa"?Pst():Bst()}),Hst=()=>"Cancelling",qst=()=>"正在取消",Ust=()=>"در حال لغو",Gst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Done",Vst=()=>"已完成",Kst=()=>"انجام‌شده",Qst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Editing",Xst=()=>"正在编辑",Zst=()=>"در حال ویرایش",Jst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=()=>"Failed",tit=()=>"失败",nit=()=>"ناموفق",rit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tit():t==="fa"?nit():eit()}),sit=()=>"Idle",iit=()=>"空闲",ait=()=>"بی‌کار",oit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iit():t==="fa"?ait():sit()}),lit=()=>"Running",cit=()=>"运行中",uit=()=>"در حال اجرا",dit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Starting",hit=()=>"正在启动",_it=()=>"در حال آغاز",pit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Copying…",git=()=>"正在复制…",vit=()=>"در حال کپی…",bit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>"Finalizing…",xit=()=>"正在完成…",wit=()=>"در حال نهایی‌سازی…",Sit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=e=>`${e==null?void 0:e.size} free at target`,Cit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,Eit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,Nit=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Cit(e):t==="fa"?Eit(e):kit(e)}),zit=e=>`Move all orx data to: ${e==null?void 0:e.path} The store is copied to the new location and activated there. Active runs or chats will block the move.`,jit=e=>`将所有 orx 数据移动到: @@ -77,7 +77,7 @@ ${e==null?void 0:e.path} 存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,Tit=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ ${e==null?void 0:e.path} -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",N2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),z2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",p6="chat_demo_nanochat_figures_v1",m6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[p6]:"figures",[m6]:"literature"},k1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class D4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new D4(s,a,i.exists)}}catch(i){if(i instanceof D4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),nb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??O4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?r6():n,r=O4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const sv="default";function rb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===sv)?sv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const L4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:L4,label:pBe(),description:dBe()},...t]:[]}function iv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?L4:t!=null&&s.some(a=>a.id===t)?t:L4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=rb(e,n);return r.length===0?sv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function O4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(eb(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),av=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),v6=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function sb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const C1=new Map;function kht(e,n){let t=C1.get(e);return t||(t=new Set,C1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&C1.delete(e)}}function Cht(e){var n;(n=C1.get(e.runId))==null||n.forEach(t=>t(e))}const I4=new Set;function ov(e){return I4.add(e),()=>{I4.delete(e)}}function bl(e){I4.forEach(n=>n(e))}const B4=new Set;function Eht(e){return B4.add(e),()=>{B4.delete(e)}}function yl(){B4.forEach(e=>e())}const $4=new Set;function Nht(e){return $4.add(e),()=>{$4.delete(e)}}function WN(e){$4.forEach(n=>n(e))}const P4=new Set;function tO(e){return P4.add(e),()=>{P4.delete(e)}}function j2(e){P4.forEach(n=>n(e))}const F4=new Set;function zht(e){return F4.add(e),()=>{F4.delete(e)}}function VN(e){F4.forEach(n=>n(e))}const H4=new Set;function jht(e){return H4.add(e),()=>{H4.delete(e)}}function Tht(e){H4.forEach(n=>n(e))}let q4=!0;const U4=new Set;function Aht(e){return U4.add(e),()=>{U4.delete(e)}}function KN(){return q4}function QN(e){e!==q4&&(q4=e,U4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&j2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&j2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&j2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const lv=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return lv.add(t),()=>{lv.delete(t)}},[])}const YN={onRun:e=>lv.forEach(n=>n.onRun(e)),onReconnect:()=>lv.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),G4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),W4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,W4(n.projectId).queryKey,n.id),nt.setQueryData(W4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(X5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=ov(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?eb(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&sb(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,av().queryKey),nt.setQueryData(av().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const V4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of V4)n()}}function Pht(e){return V4.add(e),()=>V4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const K4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of K4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return K4.add(e),()=>K4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),cv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(cv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(cv):e.slice(n).join(cv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(cv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Q4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Q4)?(p=d.slice(0,-1),m=!0):d.startsWith(Q4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Q4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),T2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],H=()=>["auto","min","max","fr",pt,ht],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],F=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],Z=()=>[T2,c0,Qu],ce=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,T2,iz,sz],oe=()=>["","none",x,pt,ht],ue=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",T2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Y4(e,s,"postfixLookupClassGroups"),Y4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)Y4(e,n,t)},Y4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function ib({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Gr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ab({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:H,gap:q,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,W]=Je.useState(null),[U,Z]=Je.useState(!1),[ce,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ue,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=H.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(H)},[e.swipeDirections,H]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*q+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{Z(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!U)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ue,"data-removed":ce,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&U),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${ce?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(Z=>Z.toasterId===r):T.filter(Z=>!Z.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(Z=>Z.position).map(Z=>Z.position)))),[M,i]),[B,$]=Je.useState([]),[H,q]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),W=Je.useRef(!1),U=Je.useCallback(Z=>{j(ce=>{var re;return(re=ce.find(ne=>ne.id===Z.id))!=null&&re.delete||wi.dismiss(Z.id),ce.filter(({id:ne})=>ne!==Z.id)})},[]);return Je.useEffect(()=>wi.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{j(ce=>ce.map(re=>re.id===Z.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(ce=>{const re=ce.findIndex(ne=>ne.id===Z.id);return re!==-1?[...ce.slice(0,re),{...ce[re],...Z},...ce.slice(re+1)]:[Z,...ce]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:ce})=>{te(ce?"dark":"light")})}catch{Z.addListener(({matches:re})=>{try{te(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&q(!1)},[T]),Je.useEffect(()=>{const Z=ce=>{var re;if(a.length>0&&a.every(le=>ce[le]||ce.code===le)){var Q;q(!0),(Q=I.current)==null||Q.focus()}ce.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((Z,ce)=>{var re;const[ne,Q]=Z.split("-");return M.length?Je.createElement("ol",{key:Z,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Y||q(!1)},onDragEnd:()=>q(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&ce===0||le.position===Z).map((le,oe)=>{var ue,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ue=b==null?void 0:b.duration)!=null?ue:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:Z,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:H,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ob(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),ob(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var A2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(A2)),A2.exports}var N0t=E0t(),R2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(R2)),R2.exports}var j0t=z0t(),M2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",z2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),j2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",m6="chat_demo_nanochat_figures_v1",g6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[m6]:"figures",[g6]:"literature"},k1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class L4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new L4(s,a,i.exists)}}catch(i){if(i instanceof L4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),rb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??I4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?s6():n,r=I4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const sv="default";function sb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===sv)?sv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const O4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:O4,label:pBe(),description:dBe()},...t]:[]}function iv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?O4:t!=null&&s.some(a=>a.id===t)?t:O4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=sb(e,n);return r.length===0?sv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function I4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(tb(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),av=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),ov=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function ib(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const C1=new Map;function kht(e,n){let t=C1.get(e);return t||(t=new Set,C1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&C1.delete(e)}}function Cht(e){var n;(n=C1.get(e.runId))==null||n.forEach(t=>t(e))}const B4=new Set;function lv(e){return B4.add(e),()=>{B4.delete(e)}}function bl(e){B4.forEach(n=>n(e))}const $4=new Set;function Eht(e){return $4.add(e),()=>{$4.delete(e)}}function yl(){$4.forEach(e=>e())}const P4=new Set;function Nht(e){return P4.add(e),()=>{P4.delete(e)}}function WN(e){P4.forEach(n=>n(e))}const F4=new Set;function tO(e){return F4.add(e),()=>{F4.delete(e)}}function T2(e){F4.forEach(n=>n(e))}const H4=new Set;function zht(e){return H4.add(e),()=>{H4.delete(e)}}function VN(e){H4.forEach(n=>n(e))}const q4=new Set;function jht(e){return q4.add(e),()=>{q4.delete(e)}}function Tht(e){q4.forEach(n=>n(e))}let U4=!0;const G4=new Set;function Aht(e){return G4.add(e),()=>{G4.delete(e)}}function KN(){return U4}function QN(e){e!==U4&&(U4=e,G4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&T2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&T2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&T2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const cv=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return cv.add(t),()=>{cv.delete(t)}},[])}const YN={onRun:e=>cv.forEach(n=>n.onRun(e)),onReconnect:()=>cv.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),W4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),V4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,V4(n.projectId).queryKey,n.id),nt.setQueryData(V4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(Z5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=lv(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?tb(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&ib(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,av().queryKey),nt.setQueryData(av().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const K4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of K4)n()}}function Pht(e){return K4.add(e),()=>K4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const Q4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of Q4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return Q4.add(e),()=>Q4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),uv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(uv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(uv):e.slice(n).join(uv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(uv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Y4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Y4)?(p=d.slice(0,-1),m=!0):d.startsWith(Y4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Y4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),A2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],H=()=>["auto","min","max","fr",pt,ht],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],F=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],Z=()=>[A2,c0,Qu],ce=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,A2,iz,sz],oe=()=>["","none",x,pt,ht],ue=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",A2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),X4(e,s,"postfixLookupClassGroups"),X4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)X4(e,n,t)},X4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function ab({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Wr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ob({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:H,gap:q,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,W]=Je.useState(null),[U,Z]=Je.useState(!1),[ce,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ue,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=H.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(H)},[e.swipeDirections,H]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*q+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{Z(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!U)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ue,"data-removed":ce,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&U),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${ce?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(Z=>Z.toasterId===r):T.filter(Z=>!Z.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(Z=>Z.position).map(Z=>Z.position)))),[M,i]),[B,$]=Je.useState([]),[H,q]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),W=Je.useRef(!1),U=Je.useCallback(Z=>{j(ce=>{var re;return(re=ce.find(ne=>ne.id===Z.id))!=null&&re.delete||wi.dismiss(Z.id),ce.filter(({id:ne})=>ne!==Z.id)})},[]);return Je.useEffect(()=>wi.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{j(ce=>ce.map(re=>re.id===Z.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(ce=>{const re=ce.findIndex(ne=>ne.id===Z.id);return re!==-1?[...ce.slice(0,re),{...ce[re],...Z},...ce.slice(re+1)]:[Z,...ce]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:ce})=>{te(ce?"dark":"light")})}catch{Z.addListener(({matches:re})=>{try{te(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&q(!1)},[T]),Je.useEffect(()=>{const Z=ce=>{var re;if(a.length>0&&a.every(le=>ce[le]||ce.code===le)){var Q;q(!0),(Q=I.current)==null||Q.focus()}ce.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((Z,ce)=>{var re;const[ne,Q]=Z.split("-");return M.length?Je.createElement("ol",{key:Z,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Y||q(!1)},onDragEnd:()=>q(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&ce===0||le.position===Z).map((le,oe)=>{var ue,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ue=b==null?void 0:b.duration)!=null?ue:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:Z,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:H,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function lb(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),lb(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var R2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(R2)),R2.exports}var N0t=E0t(),M2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(M2)),M2.exports}var j0t=z0t(),D2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let H=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const q=this._rowColumns.get($);if(!q)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++H,Y=0),{row:H,column:Y}},T=N(y),j=N(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var O,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=j;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let O=0;Oy?y.activate(q,Y,$):x(0,Y),hover:(q,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,q,Y,$)},leave:(q,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,q,Y,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? @@ -85,7 +85,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) `:` `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(j){const M=this._getMouseBufferCoords(j),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(j,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([j,M],O,B)}_areCoordsInSelection(j,M,O){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,H;const O=(H=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:H.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(j);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);O?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,O)}_fireOnSelectionChange(j,M,O){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let O=M;for(let B=0;M>=B;B++){const $=j.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(j,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,O=!0,B=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,H=$.lines.get(j[1]);if(!H)return;const q=$.translateBufferLineToString(j[1],!1);let Y=this._convertViewportColToCharacterIndex(H,j[0]),G=Y;const X=j[0]-Y;let te=0,I=0,L=0,F=0;if(q.charAt(Y)===" "){for(;Y>0&&q.charAt(Y-1)===" ";)Y--;for(;G1&&(F+=re-1,G+=re-1);Z>0&&Y>0&&!this._isCharWordSeparator(H.loadCell(Z-1,this._workCell));){H.loadCell(Z-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,Z--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,Z--}for(;ce1&&(F+=ne-1,G+=ne-1),G++,ce++}}G++;let W=Y+X-te+L,U=Math.min(this._bufferService.cols,G-Y+te+I-L-F);if(M||q.slice(Y,G).trim()!==""){if(O&&W===0&&H.getCodePoint(0)!==32){const Z=$.lines.get(j[1]-1);if(Z&&H.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ce){const re=this._bufferService.cols-ce.start;W-=re,U+=re}}}if(B&&W+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const Z=$.lines.get(j[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const ce=this._getWordAt([0,j[1]+1],!1,!1,!0);ce&&(U+=ce.length)}}return{start:W,length:U}}}_selectWordAt(j,M){const O=this._getWordAt(j,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[O.start,j[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let O=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,j,M,O){var B,$=arguments.length,H=$<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(T,j,M,O);else for(var q=T.length-1;q>=0;q--)(B=T[q])&&(H=($<3?B(H):$>3?B(j,M,H):B(j,M))||H);return $>3&&H&&Object.defineProperty(j,M,H),H},_=this&&this.__param||function(T,j){return function(M,O){j(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=j[M/36%6|0],B=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((j-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const j=v.ensureContrastRatio(E.rgba,N.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const j=E/255,M=N/255,O=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y0||H>0||q>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),q-=Math.max(0,Math.ceil(.1*q)),Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));return($<<24|H<<16|q<<8|255)>>>0}function E(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,H=N>>8&255;return l=B+Math.round((j-B)*d),u=$+Math.round((M-$)*d),_=H+Math.round((O-H)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,j){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(qw(M,S.relativeLuminance(Y>>8))?H:Y}return H}const B=E(N,T,j),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(H>>8))?B:H}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,H)=>this._inputHandler.parse($,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,H){this._bufferService.scrollLines(B,$,H)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(te,I,L,F){var W,U=arguments.length,Z=U<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(te,I,L,F);else for(var ce=te.length-1;ce>=0;ce--)(W=te[ce])&&(Z=(U<3?W(Z):U>3?W(I,L,Z):W(I,L))||Z);return U>3&&Z&&Object.defineProperty(I,L,Z),Z},_=this&&this.__param||function(te,I){return function(L,F){I(L,F,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),j=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var H;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let q=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,F,W,U,Z,ce,re,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=F,this._logService=W,this._optionsService=U,this._oscLinkService=Z,this._coreMouseService=ce,this._unicodeService=re,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:oe})})),this._parser.setDcsHandlerFallback(((Q,le,oe)=>{le==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:oe})})),this._parser.setPrintHandler(((Q,le,oe)=>this.print(Q,le,oe))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,F,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=W}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let F,W=this._activeBuffer.x,U=this._activeBuffer.y,Z=0;const ce=this._parseStack.paused;if(ce){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;W=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(Z=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=Z;Q0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ue=this._parser.precedingJoinState;for(let pe=L;pere){if(ne){const Ie=oe;let Te=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(Ie,Te,0,qe,!1);Te=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(oe.insertCells(this._activeBuffer.x,U-qe,this._activeBuffer.getNullCell(le)),oe.getWidth(re-1)===2&&oe.setCellFromCodepoint(re-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,U,le),U>0)for(;--U;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ue,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new j.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,F,W=!1,U=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),U),W&&(Z.isWrapped=!1)}_resetBufferLine(I,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),F.isWrapped=!1)}eraseInDisplay(I,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=re;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ue=I.params[0];return pe=ue,Se=L?ue===2?4:ue===4?oe(Z.modes.insertMode):ue===12?3:ue===20?oe(le.convertEol):0:ue===1?oe(F.applicationCursorKeys):ue===3?le.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ue===6?oe(F.origin):ue===7?oe(F.wraparound):ue===8?3:ue===9?oe(W==="X10"):ue===12?oe(le.cursorBlink):ue===25?oe(!Z.isCursorHidden):ue===45?oe(F.reverseWraparound):ue===66?oe(F.applicationKeypad):ue===67?4:ue===1e3?oe(W==="VT200"):ue===1002?oe(W==="DRAG"):ue===1003?oe(W==="ANY"):ue===1004?oe(F.sendFocus):ue===1005?4:ue===1006?oe(U==="SGR"):ue===1015?4:ue===1016?oe(U==="SGR_PIXELS"):ue===1048?1:ue===47||ue===1047||ue===1049?oe(ne===Q):ue===2004?oe(F.bracketedPasteMode):0,Z.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,F,W,U){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([F,W,U])):L===5&&(I&=-50331904,I|=33554432|255&F),I}_extractColor(I,L,F){const W=[0,0,-1,0,0,0];let U=0,Z=0;do{if(W[Z+U]=I.params[L+Z],I.hasSubParams(L+Z)){const ce=I.getSubParams(L+Z);let re=0;do W[1]===5&&(U=1),W[Z+re+1+U]=ce[re];while(++re=2||W[1]===2&&Z+U>=5)break;W[1]&&(U=1)}while(++Z+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let F;const W=this._curAttrData;for(let U=0;U=30&&F<=37?(W.fg&=-50331904,W.fg|=16777216|F-30):F>=40&&F<=47?(W.bg&=-50331904,W.bg|=16777216|F-40):F>=90&&F<=97?(W.fg&=-50331904,W.fg|=16777224|F-90):F>=100&&F<=107?(W.bg&=-50331904,W.bg|=16777224|F-100):F===0?this._processSGR0(W):F===1?W.fg|=134217728:F===3?W.bg|=67108864:F===4?(W.fg|=268435456,this._processUnderline(I.hasSubParams(U)?I.getSubParams(U)[0]:1,W)):F===5?W.fg|=536870912:F===7?W.fg|=67108864:F===8?W.fg|=1073741824:F===9?W.fg|=2147483648:F===2?W.bg|=134217728:F===21?this._processUnderline(2,W):F===22?(W.fg&=-134217729,W.bg&=-134217729):F===23?W.bg&=-67108865:F===24?(W.fg&=-268435457,this._processUnderline(0,W)):F===25?W.fg&=-536870913:F===27?W.fg&=-67108865:F===28?W.fg&=-1073741825:F===29?W.fg&=2147483647:F===39?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?U+=this._extractColor(I,U,W):F===53?W.bg|=1073741824:F===55?W.bg&=-1073741825:F===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):F===100?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${F}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(I){const L=I.params[0]||1;let F;return(I.length<2||(F=I.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],F=I.split(";");for(;F.length>1;){const W=F.shift(),U=F.shift();if(/^\d+$/.exec(W)){const Z=parseInt(W);if(X(Z))if(U==="?")L.push({type:0,index:Z});else{const ce=(0,M.parseColor)(U);ce&&L.push({type:1,index:Z,color:ce})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=I.split(":");let W;const U=F.findIndex((Z=>Z.startsWith("id=")));return U!==-1&&(W=F[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const F=I.split(";");for(let W=0;W=this._specialColors.length);++W,++L)if(F[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const U=(0,M.parseColor)(F[W]);U&&this._onColor.fire([{type:1,index:this._specialColors[L],color:U}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],F=I.split(";");for(let W=0;W=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${U}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let G=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(q=te,te=I,I=q),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(te){return 0<=te&&te<256}G=u([_(0,E.IBufferService)],G)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let G=$.length-1,X=$[G];X===0&&(G--,X=$[G]);let te=M.length-H-1,I=B;for(;te>=0;){const F=Math.min(I,X);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[te],I-F,X-F,F,!0),X-=F,X===0&&(G--,X=$[G]),I-=F,I===0){te--;const W=Math.max(te,0);I=(0,m.getWrappedLineTrimmedLength)(M,W,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],j=[];for(let G=0;G=0;G--)if($&&$.start>O+H){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(G--,$.newLines[X]);G++,T.push({index:O+1,amount:$.newLines.length}),H+=$.newLines.length,$=E[++B]}else this.lines.set(G,j[O--]);let q=0;for(let G=T.length-1;G>=0;G--)T[G].index+=q,this.lines.onInsertEmitter.fire(T[G]),q+=T[G].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=E[3*(b+T)+j];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(j===2?E<128?b--:u[S++]=E:j===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ej)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let H=j+1;;++H){if(H>=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,j),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++j47&&E<60);j--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,j),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let H=j+1;;++H)if(H>=w||(E=b[H])===24||E===26||E===27||E>127&&E=w||(E=b[H])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r -`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(M2)),M2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function lb(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function E1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let uv=null,C0=0;const N6=()=>uv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void cb.retry()}})})}let N1=TO();function F0t(){C0++,uv=null,N1=TO()}const cb={flush:(e=!1)=>N1.flush(e),retry:()=>N1.retry(),queue(e,n=0){const t=uv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(uv=e,N1.queue(e,n))}};window.addEventListener("pagehide",()=>void cb.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const D2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:k1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===p6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,dv=new Map,X4=new Set,Z4=()=>{for(const e of X4)e()},U0t=e=>(X4.add(e),()=>{X4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),dv.clear(),Z4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&dv.delete(e)&&Z4()},r=>{t===Va&&(dv.set(e,r instanceof Error?r.message:String(r)),Z4())}),ip.set(e,n)}return n}function L2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=lb(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?dv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const q=j.current;if(!q)return;const Y=_z({...M.current,state:q.state,pane:q.pane},cu(Ka.get(q.projectId),q.taskKey),q.projectId,q.taskKey);L2(q.projectId,q.location,q.taskKey,Y)},[]);R.useEffect(()=>{let q=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!q||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{q&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{q=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const q=Ka.get(n);if(!q)return;if(p.current=q,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(q,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(L2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(q,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):L2(n,r),p.current=Ka.get(n)??q},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const q=Va,Y=X=>{if(q===Va){$();for(const te of ip.values())te.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const H=R.useCallback(()=>{var q;n&&(x?b(Y=>Y+1):(q=ip.get(n))==null||q.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:H,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),J4=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(J4);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:z4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(H){Qn(H instanceof Error?H.message:String(H),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,H])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[H,f.jsx(Gr,{value:i[$],onChange:q=>a({...i,[$]:q.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:A4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:A4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(J4,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const ub=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=lb((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=lb(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return E1(e,(a==null?void 0:a.id)??null,u)}/** +`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(D2)),D2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function cb(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function E1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let dv=null,C0=0;const N6=()=>dv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void ub.retry()}})})}let N1=TO();function F0t(){C0++,dv=null,N1=TO()}const ub={flush:(e=!1)=>N1.flush(e),retry:()=>N1.retry(),queue(e,n=0){const t=dv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(dv=e,N1.queue(e,n))}};window.addEventListener("pagehide",()=>void ub.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const L2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:k1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===g6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,fv=new Map,Z4=new Set,J4=()=>{for(const e of Z4)e()},U0t=e=>(Z4.add(e),()=>{Z4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),fv.clear(),J4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&fv.delete(e)&&J4()},r=>{t===Va&&(fv.set(e,r instanceof Error?r.message:String(r)),J4())}),ip.set(e,n)}return n}function O2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=cb(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?fv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const q=j.current;if(!q)return;const Y=_z({...M.current,state:q.state,pane:q.pane},cu(Ka.get(q.projectId),q.taskKey),q.projectId,q.taskKey);O2(q.projectId,q.location,q.taskKey,Y)},[]);R.useEffect(()=>{let q=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!q||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{q&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{q=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const q=Ka.get(n);if(!q)return;if(p.current=q,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(q,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(O2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(q,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):O2(n,r),p.current=Ka.get(n)??q},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const q=Va,Y=X=>{if(q===Va){$();for(const te of ip.values())te.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const H=R.useCallback(()=>{var q;n&&(x?b(Y=>Y+1):(q=ip.get(n))==null||q.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:H,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),e3=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(e3);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(H){Qn(H instanceof Error?H.message:String(H),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,H])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[H,f.jsx(Wr,{value:i[$],onChange:q=>a({...i,[$]:q.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:R4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:R4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(e3,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(e3,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const db=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=cb((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=cb(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return E1(e,(a==null?void 0:a.id)??null,u)}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -110,12 +110,12 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var O2={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"};/** + */var I2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lpt=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cpt=R.createContext({}),upt=()=>R.useContext(cpt),dpt=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=upt()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...O2,width:n??u??O2.width,height:n??u??O2.height,stroke:e??p,strokeWidth:x,className:BO("lucide",m,s),...!i&&!lpt(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** + */const lpt=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cpt=R.createContext({}),upt=()=>R.useContext(cpt),dpt=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=upt()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...I2,width:n??u??I2.width,height:n??u??I2.height,stroke:e??p,strokeWidth:x,className:BO("lucide",m,s),...!i&&!lpt(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -220,12 +220,12 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $pt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],e3=it("code",$pt);/** + */const $pt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],t3=it("code",$pt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ppt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],db=it("copy",Ppt);/** + */const Ppt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],fb=it("copy",Ppt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -265,12 +265,12 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ypt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],fb=it("file-text",Ypt);/** + */const Ypt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],hb=it("file-text",Ypt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xpt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],hb=it("flask-conical",Xpt);/** + */const Xpt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],_b=it("flask-conical",Xpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -290,7 +290,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nmt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],_b=it("folder-tree",nmt);/** + */const nmt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],pb=it("folder-tree",nmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -495,38 +495,38 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const agt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ur=it("x",agt);/** + */const agt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gr=it("x",agt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function I2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():s6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(db,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function t3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),U=(oe,ue=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([sb(oe,ue),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&oe.some(ye=>ye.id===ue))return ue;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ue=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const Z=oe=>{const ue=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ue||nt.fetchQuery(G4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=oe=>j(ue=>ue.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ue=>ue.includes(oe)?ue.filter(pe=>pe!==oe):[...ue,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ue=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(I2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(z1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(I2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(z1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(I2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>Z(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>ce(oe.paperId),disabled:u,children:f.jsx(Ur,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(z1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?a6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:rb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(t3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ab,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??i6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ab,{tone:e?"success":n||e===null?"danger":"warning",children:e?a6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function pb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=g6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function B2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?F:r==="paper"&&H&&!d?W:u,Z=B2(U.trim(),200),ce=ct({...B0(Z),enabled:!!Z&&Z===U.trim()}),re=Z===U.trim()?ce.data??null:null,ne=Z===U.trim()?((rr=ce.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(Z!==U.trim()||ce.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ue=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(v6()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=B2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=B2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...G4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(G4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(k2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?k2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?k2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ue=="string"&&!Te&&!Dt),un=Ut??`github.com/${ue??"you"}/${Ie}`,Mn=ue===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():C2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:C2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:C2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ue===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ue===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),"aria-label":S1(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ue===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):o6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?u6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":C4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":tv({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(pb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":z4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:z4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},j1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=j1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:j1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?r6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=j1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Gr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Gr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Gr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await sb(!0)}}}),l=j1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?r6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ob(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:iv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:rb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ue,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:iv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):O4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ue=t.find(ye=>ye.id===q))==null?void 0:ue.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=iv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},Z=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(t3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[Z(L0(),B,"models"),i.length>0&&Z(G,H,"reasoning"),te.length>0&&Z(tN(),L,"speed"),t.length>0&&Z(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(t3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(tN()),re(te,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,U=F.top-12,Z=Math.min(380,X.scrollHeight),ce=i?W>=Z||W>=U:UU;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?W:U))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===sv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function n3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function fv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():A4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(n3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:E2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":E2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:E2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=av(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Vr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=av(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Ur,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Zv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Zv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=Y5({from:"__root__"}),t=Xv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Xv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&cb.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Vr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),hv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),_v=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(hv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(hv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[hv(e,n,{sessionId:r,ref:s}).queryKey,hv(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ab,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||mb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||mb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return s3(n)})(e)||SI(e)||mb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mb(e,n){if(e){if(typeof e=="string")return s3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s3(e,n):void 0}}function s3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. + */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function B2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():i6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(fb,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function n3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),U=(oe,ue=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([ib(oe,ue),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&oe.some(ye=>ye.id===ue))return ue;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ue=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const Z=oe=>{const ue=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ue||nt.fetchQuery(W4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=oe=>j(ue=>ue.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ue=>ue.includes(oe)?ue.filter(pe=>pe!==oe):[...ue,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ue=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(B2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(z1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(z1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>Z(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>ce(oe.paperId),disabled:u,children:f.jsx(Gr,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(z1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?o6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:sb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(n3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ob,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??a6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ob,{tone:e?"success":n||e===null?"danger":"warning",children:e?o6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function mb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=v6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function $2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?F:r==="paper"&&H&&!d?W:u,Z=$2(U.trim(),200),ce=ct({...B0(Z),enabled:!!Z&&Z===U.trim()}),re=Z===U.trim()?ce.data??null:null,ne=Z===U.trim()?((rr=ce.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(Z!==U.trim()||ce.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ue=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(ov()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=$2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=$2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...W4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(W4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(C2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?C2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?C2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ue=="string"&&!Te&&!Dt),un=Ut??`github.com/${ue??"you"}/${Ie}`,Mn=ue===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ue===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ue===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),"aria-label":S1(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ue===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):l6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?d6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":E4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":tv({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(mb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":j4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:j4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},j1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=j1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:j1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?s6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=j1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Wr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Wr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Wr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await ib(!0)}}}),l=j1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?s6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return lb(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:iv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:sb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ue,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:iv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):I4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ue=t.find(ye=>ye.id===q))==null?void 0:ue.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=iv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},Z=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(n3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[Z(L0(),B,"models"),i.length>0&&Z(G,H,"reasoning"),te.length>0&&Z(tN(),L,"speed"),t.length>0&&Z(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(n3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(tN()),re(te,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,U=F.top-12,Z=Math.min(380,X.scrollHeight),ce=i?W>=Z||W>=U:UU;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?W:U))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===sv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function r3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function hv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():R4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(r3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:N2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":N2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:N2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=av(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Pr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=av(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Gr,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=X5({from:"__root__"}),t=Zv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Zv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&ub.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Pr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),_v=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),pv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(_v(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(_v(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[_v(e,n,{sessionId:r,ref:s}).queryKey,_v(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ob,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||gb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||gb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return i3(n)})(e)||SI(e)||gb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gb(e,n){if(e){if(typeof e=="string")return i3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i3(e,n):void 0}}function i3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,i=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var Pg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rm(e,n){return e(n={exports:{}},n.exports),n.exports}var Ui=rm((function(e){/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),H={content:v.slice(1)};switch($){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=u,u++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=l,l++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=l,H.newLineNumber=u,l++,u++;break;case"\\":var q=o.changes[o.changes.length-1];q.isDelete||(a.newEndingNewLine=!1),q.isInsert||(a.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function i3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` +`),x=m.length,S=0;S-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),H={content:v.slice(1)};switch($){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=u,u++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=l,l++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=l,H.newLineNumber=u,l++,u++;break;case"\\":var q=o.changes[o.changes.length-1];q.isDelete||(a.newEndingNewLine=!1),q.isInsert||(a.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function a3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` `),i=r.indexOf(` `,s+1),a=r.slice(0,s),o=r.slice(s+1,i),l=a.split(" ").slice(1,-3).join(" "),u=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(l," b/").concat(u),"index 1111111..2222222 100644","--- a/".concat(l),"+++ b/".concat(u),r.slice(i+1)].join(` -`)})(e.trimStart());return c1t.parse(t).map((function(r){return(function(s,i){var a=s.hunks.map((function(o){return u1t(o,i)}));return Hn(Hn({},s),{},{hunks:a})})(r,n)}))}function d1t(e){return e[0]}function f1t(e){return e[e.length-1]}function a3(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function up(e){return e==="old"?function(n){return ku(n)?-1:Hl(n)?n.oldLineNumber:n.lineNumber}:function(n){return Ki(n)?-1:Hl(n)?n.newLineNumber:n.lineNumber}}function EI(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=gb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&xb(e),s=!t&&!r&&pv(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},wb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return wb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?Nb(e):zb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function mv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=mv(t,s.onMouseEnter),s.onMouseLeave=mv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),H=S(s),q=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:H,className:Ui("diff-line",q),children:[!m&&Gz(Y,s,C,"old",x,H,B,T,b),!m&&Gz(Y,s,C,"new",x,H,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?Nb(p):zb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=mv(s,a.onMouseEnter),a.onMouseLeave=mv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function F2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),r3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),r3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),H={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},q=Hn(Hn({},H),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},H),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:F2(t?q:Y)});var G=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[F2(q),F2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=vb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&wb(e),s=!t&&!r&&mv(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},Sb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return Sb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?zb(e):jb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function gv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=gv(t,s.onMouseEnter),s.onMouseLeave=gv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),H=S(s),q=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:H,className:Ui("diff-line",q),children:[!m&&Gz(Y,s,C,"old",x,H,B,T,b),!m&&Gz(Y,s,C,"new",x,H,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?zb(p):jb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=gv(s,a.onMouseEnter),a.onMouseLeave=gv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function H2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),s3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),s3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),H={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},q=Hn(Hn({},H),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},H),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:H2(t?q:Y)});var G=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[H2(q),H2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=(i==null?void 0:i.value.length))return[e];var o=function(d,p){var m=i.value.slice(d,p);return[].concat(Vi(s),[Hn(Hn({},i),{},{value:m})])};if(n>0){var l=o(0,n);a.push(sh(l))}var u=o(Math.max(n,0),t);if(a.push(r?(function(d,p){return[p].concat(Vi(sh(d)))})(u,r):sh(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=_u(e,Vbt);t.push(s);var i,a=W6(r);try{for(a.s();!(i=a.n()).done;)ZI(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(sh([].concat(Vi(t.slice(1)),[e])));return n}function Kbt(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(l){var u=tS(l);return u.value.includes(` `)?u.value.split(` -`).map((function(_){return Ubt(l,Hn(Hn({},u),{},{value:_}))})):[l]})(t),i=xI(s),a=i[0],o=i.slice(1);return[].concat(Vi(n.slice(0,-1)),[[].concat(Vi(r),[a])],Vi(o.map((function(l){return[l]}))))}),[[]])}function Qz(e){return Kbt(ZI(e))}var Qbt=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?Sb(e,n,void 0,t):!!r},Ybt=function(e,n){return Sb(e,n)},Xbt=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function Zbt(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=Xbt(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&Qbt(t,r,(function(i,a,o){return o==="chlidren"||Ybt(i,a)}))))?e.children[e.children.length-1]=(function(i,a){return"value"in i&&"value"in a?Hn(Hn({},i),{},{value:"".concat(i.value).concat(a.value)}):i})(s,n):e.children.push(n),e.children[e.children.length-1]}function Yz(e){var n,t={type:"root",children:[]},r=W6(e);try{var s=function(){var i=n.value;i.reduce((function(a,o,l){return Zbt(a,l===i.length-1?Hn({},o):Hn(Hn({},o),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(i){r.e(i)}finally{r.f()}return t}var Jbt=Object.prototype.hasOwnProperty,eyt=YI((function(e,n,t){Jbt.call(e,t)?e[t].push(n):J6(e,t,[n])})),tyt=Object.prototype.hasOwnProperty,nyt=function(e){if(e==null)return!0;if(wb(e)&&(Zi(e)||typeof e=="string"||typeof e.splice=="function"||pv(e)||Q6(e)||xb(e)))return!e.length;var n=d3(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(OI(e))return!II(e).length;for(var t in e)if(tyt.call(e,t))return!1;return!0},ryt=function(e,n){var t=n.start,r=n.length,s=t+r,i=e.reduce((function(a,o){var l=kn(a,2),u=l[0],_=l[1],d=_+tS(o).value.length;if(_>s||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(j=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=l+T,O=(j=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(j=i-j))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;ps||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(j=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=l+T,O=(j=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(j=i-j))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=S.length?[w,y,C,E,j]:null}var l,u,_,d,p,m=o(s,i,Math.ceil(s.length/4)),x=o(s,i,Math.ceil(s.length/2));return m||x?(l=x?m&&m[4].length>x[4].length?m:x:m,t.length>r.length?(u=l[0],_=l[1],d=l[2],p=l[3]):(d=l[0],p=l[1],u=l[2],_=l[3]),[u,_,d,p,l[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=0,u=0,_=0,d=0;o0?s[i-1]:-1,l=0,u=0,_=0,d=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=S?(x>=p.length/2||x>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,x))),t[o-1][1]=p.substring(0,p.length-x),t[o+1][1]=m.substring(x),o++):(S>=p.length/2||S>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,S))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-S),t[o+1][0]=-1,t[o+1][1]=p.substring(S),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(S,v){if(!S||!v)return 6;var b=S.charAt(S.length-1),w=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=w.match(n.nonAlphaNumericRegex_),E=y&&b.match(n.whitespaceRegex_),N=C&&w.match(n.whitespaceRegex_),T=E&&b.match(n.linebreakRegex_),j=N&&w.match(n.linebreakRegex_),M=T&&S.match(n.blanklineEndRegex_),O=j&&v.match(n.blanklineStartRegex_);return M||O?5:T||j?4:y&&!E&&N?3:E||N?2:y||C?1:0}for(var s=1;s=m&&(m=x,_=i,d=a,p=o)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=d,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=!1,u=!1,_=!1,d=!1;o0?s[i-1]:-1,_=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",l="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(l,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=l.substring(0,r):(t.splice(0,0,new n.Diff(0,l.substring(0,r))),s++),l=l.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(l,o))!==0&&(t[s][1]=l.substring(l.length-r)+t[s][1],l=l.substring(0,l.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),l.length&&(t.splice(s,0,new n.Diff(1,l)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",l=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,l=a;return t.length!=s&&t[s][0]===-1?l:l+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,l=0;l");switch(u){case 1:r[l]=''+_+"";break;case-1:r[l]=''+_+"";break;case 0:r[l]=""+_+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(N,T){var j=N/r.length,M=Math.abs(s-T);return a.Match_Distance?j+M/a.Match_Distance:M?1:j}var l=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(l=Math.min(o(0,u),l),(u=t.lastIndexOf(r,s+r.length))!=-1&&(l=Math.min(o(0,u),l)));var _,d,p=1<=v;y--){var C=i[t.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(m[y+1]|m[y])<<1|1|m[y+1],w[y]&p){var E=o(S,y-1);if(E<=l){if(l=E,!((u=y-1)>s))break;v=Math.max(1,2*s-u)}}}if(o(S+1,s)>l)break;m=w}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],l=new n.patch_obj,u=0,_=0,d=0,p=i,m=i,x=0;x=2*this.Patch_Margin&&u&&(this.patch_addContext_(l,p),o.push(l),l=new n.patch_obj,u=0,p=m,_=d)}S!==1&&(_+=v.length),S!==-1&&(d+=v.length)}return u&&(this.patch_addContext_(l,p),o.push(l)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(l=this.match_main(r,d.substring(0,this.Match_MaxBits),_))!=-1&&((p=this.match_main(r,d.substring(d.length-this.Match_MaxBits),_+d.length-this.Match_MaxBits))==-1||l>=p)&&(l=-1):l=this.match_main(r,d,_),l==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=l-_,d==(u=p==-1?r.substring(l,l+d.length):r.substring(l,p+this.Match_MaxBits)))r=r.substring(0,l)+this.diff_text2(t[o].diffs)+r.substring(l+d.length);else{var m=this.diff_main(d,u,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(m)/d.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var x,S=0,v=0;vo[0][1].length){var l=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=l,a.start2-=l,a.length1+=l,a.length2+=l}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(l=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,l),a.length1+=l,a.length2+=l),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,_=!1,u.diffs.push(new n.Diff(d,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,d===0?(u.length2+=p.length,o+=p.length):_=!1,u.diffs.push(new n.Diff(d,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(u.diffs)).substring(l.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),_||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Tb.displayName="cpp";Tb.aliases=[];function Tb(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(Tb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,U){return"(?:"+F[+U]+")"})}function r(L,F,W){return RegExp(t(L,F),"")}function s(L,F){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var q=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,q]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,q]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,q]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`:"")+_.content]}),["",""]),t=kn(n,2),r=kn(eB(t[0],t[1]),2),s=r[0],i=r[1];if(s.length===0&&i.length===0)return[[],[]];var a=function(u){if(u&&!Hl(u))return u.lineNumber},o=a(e.find(Ki)),l=a(e.find(ku));if(o===void 0||l===void 0)throw new Error("Could not find start line number for edit");return[tj(ej(s),o),tj(ej(i),l)]}function uyt(e){var n=e.reduce((function(r,s){var i=kn(r,3),a=i[0],o=i[1],l=i[2];if(!l||!Ki(l)||!ku(s))return[a,o,s];var u=kn(eB(l.content,s.content),2),_=u[0],d=u[1];return[a.concat(h3(_,l.lineNumber)),o.concat(h3(d,s.lineNumber)),s]}),[[],[],null]),t=kn(n,2);return[t[0],t[1]]}function dyt(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Ab.displayName="cpp";Ab.aliases=[];function Ab(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(Ab),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,U){return"(?:"+F[+U]+")"})}function r(L,F,W){return RegExp(t(L,F),"")}function s(L,F){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var q=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,q]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,q]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,q]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}aS.displayName="go";aS.aliases=[];function aS(e){e.register(Go),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Rb.displayName="markup-templating";Rb.aliases=[];function Rb(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Rb),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Ab),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Mb.displayName="basic";Mb.aliases=[];function Mb(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Mb),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),h3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const _3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:h3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),H2=Object.keys(_3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Db=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const H=e.charCodeAt(C);H===88||H===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const H=e.charCodeAt(C);if(!M(H))break;j+=String.fromCharCode(H),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const H=E==="named"?pp(j):!1;H&&(N=j,T=H)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const H=N?1:3;if(t.attribute){const q=e.charCodeAt(C);q===61?(S(H,B),T=""):uj(q)?T="":S(H,B)}else S(H,B)}$=T}else{O||S(2,B);let H=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(H))S(7,B),$="�";else if(H in cj)S(6,B),$=cj[H];else{let q="";Oyt(H)&&S(6,B),H>65535&&(H-=65536,q+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),$=q+String.fromCharCode(H)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const H=x();H.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:H},e.slice(w-1,C)),p=H}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return R1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var H=v.prev;O&&(H=R1(n,H,O),b+=O.length),$yt(n,H,y);var q=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=R1(n,H,q),B&&R1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function R1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Lb(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function b3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:i3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:i3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Lb(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:b3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${v3} ${n}`:v3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Lb(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:b3(m.file),children:b3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${v3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():R4(),w=[{id:"files",label:E4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:hb,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":N2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:N2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),E4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ab,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":N2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({..._v(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Lb).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??c6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const q2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},gv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,gv),i&&r.addEventListener("scrollend",_,gv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!q2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,gv),i.addEventListener("touchend",o,gv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(q2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let H=1;Hthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(q2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const U2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),U2(()=>u._didMount(),[]),U2(()=>(a(u),u._willUpdate())),U2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function y3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Mb.displayName="markup-templating";Mb.aliases=[];function Mb(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Mb),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Rb),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Db.displayName="basic";Db.aliases=[];function Db(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Db),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),_3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const p3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:_3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),q2=Object.keys(p3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Lb=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const H=e.charCodeAt(C);H===88||H===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const H=e.charCodeAt(C);if(!M(H))break;j+=String.fromCharCode(H),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const H=E==="named"?pp(j):!1;H&&(N=j,T=H)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const H=N?1:3;if(t.attribute){const q=e.charCodeAt(C);q===61?(S(H,B),T=""):uj(q)?T="":S(H,B)}else S(H,B)}$=T}else{O||S(2,B);let H=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(H))S(7,B),$="�";else if(H in cj)S(6,B),$=cj[H];else{let q="";Oyt(H)&&S(6,B),H>65535&&(H-=65536,q+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),$=q+String.fromCharCode(H)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const H=x();H.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:H},e.slice(w-1,C)),p=H}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return R1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var H=v.prev;O&&(H=R1(n,H,O),b+=O.length),$yt(n,H,y);var q=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=R1(n,H,q),B&&R1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function R1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Ob(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function y3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:a3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:a3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Ob(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:y3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${b3} ${n}`:b3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Ob(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:y3(m.file),children:y3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${b3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():M4(),w=[{id:"files",label:N4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:_b,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":z2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:z2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),N4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ob,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":z2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({...pv(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Ob).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??u6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const U2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},vv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,vv),i&&r.addEventListener("scrollend",_,vv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!U2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,vv),i.addEventListener("touchend",o,vv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(U2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let H=1;Hthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(U2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const G2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),G2(()=>u._didMount(),[]),G2(()=>(a(u),u._willUpdate())),G2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function x3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Mxt(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=RS(e);if(t.length===1)return t[0]}return e}function Dxt(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function Vh(e){return Dxt(typeof e=="string"?RS(e):e)}function Lxt(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function Oxt(e,n){const t=Vh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function Ixt(e){var l;const n=Vh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u @@ -675,25 +675,25 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho Z" /> -`,EB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},Fxt={alphaxiv:Bxt,openalex:Pxt,biorxiv:$xt};function NB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":EB[e]},dangerouslySetInnerHTML:{__html:Fxt[e]}})}function Hxt(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function qxt(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=Hxt(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const Uxt=["alphaxiv","openalex","biorxiv"];function Gxt(){const e=dht(),{data:n}=ct(e),t=mn({mutationFn:mft,onSuccess:i=>Vr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:Uxt.map(i=>{const a=n[i];return f.jsxs(or,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(NB,{source:i,size:16,decorative:!0}),EB[i]]}),f.jsx(W_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:N3e()})}function G2(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Wxt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Vxt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` +`,EB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},Fxt={alphaxiv:Bxt,openalex:Pxt,biorxiv:$xt};function NB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":EB[e]},dangerouslySetInnerHTML:{__html:Fxt[e]}})}function Hxt(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function qxt(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=Hxt(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const Uxt=["alphaxiv","openalex","biorxiv"];function Gxt(){const e=dht(),{data:n}=ct(e),t=mn({mutationFn:mft,onSuccess:i=>Pr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:Uxt.map(i=>{const a=n[i];return f.jsxs(or,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(NB,{source:i,size:16,decorative:!0}),EB[i]]}),f.jsx(W_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:N3e()})}function W2(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Wxt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Vxt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` `}]}function Kxt(e,n){const t=n.value?n.value+` -`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Qxt(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Yxt(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),Xxt=Cu(/[#-'*+\--9=?A-Z^-~]/);function vv(e){return e!==null&&(e<32||e===127)}const x3=Cu(/\d/),Zxt=Cu(/[\dA-Fa-f]/),Jxt=Cu(/[!-/:-@[-`{-~]/);function St(e){return e!==null&&e<-2}function lr(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const Ob=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function e2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function t2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function n2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function zB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function r2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function s2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function i2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function a2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function o2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function l2t(e,n,t){const r=e.all(n),s=t?c2t(t):jB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Qxt(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Yxt(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),Xxt=Cu(/[#-'*+\--9=?A-Z^-~]/);function bv(e){return e!==null&&(e<32||e===127)}const w3=Cu(/\d/),Zxt=Cu(/[\dA-Fa-f]/),Jxt=Cu(/[!-/:-@[-`{-~]/);function St(e){return e!==null&&e<-2}function lr(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const Ib=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function e2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function t2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function n2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function zB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function r2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function s2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function i2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function a2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function o2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function l2t(e,n,t){const r=e.all(n),s=t?c2t(t):jB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function u2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _2t(e){const n=MS(e),t=TB(e);if(n&&t)return{start:n,end:t}}function p2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=MS(n.children[1]),l=TB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function m2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(vj(n.slice(s),s>0,!1)),i.join("")}function vj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===mj||i===gj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===mj||i===gj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function b2t(e,n){const t={type:"text",value:v2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function y2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const x2t={blockquote:Wxt,break:Vxt,code:Kxt,delete:Qxt,emphasis:Yxt,footnoteReference:e2t,heading:t2t,html:n2t,imageReference:r2t,image:s2t,inlineCode:i2t,linkReference:a2t,link:o2t,listItem:l2t,list:u2t,paragraph:d2t,root:f2t,strong:h2t,table:p2t,tableCell:g2t,tableRow:m2t,text:b2t,thematicBreak:y2t,toml:Wg,yaml:Wg,definition:Wg,footnoteDefinition:Wg};function Wg(){}const RB=-1,Ib=0,P0=1,bv=2,DS=3,LS=4,OS=5,IS=6,MB=7,DB=8,w2t=typeof self=="object"?self:globalThis,bj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new w2t[e](n)},S2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Ib:case RB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case bv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case DS:return t(new Date(a),s);case LS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case OS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case IS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case MB:{const{name:o,message:l}=a;return t(bj(o,l),s)}case DB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(bj(i,a),s)};return r},yj=e=>S2t(new Map,e)(0),nd="",{toString:k2t}={},{keys:C2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Ib,n];const t=k2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[bv,nd];case"Date":return[DS,nd];case"RegExp":return[LS,nd];case"Map":return[OS,nd];case"Set":return[IS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[MB,t]:[bv,t]},Vg=([e,n])=>e===Ib&&(n==="function"||n==="symbol"),E2t=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Ib:{let _=a;switch(l){case"bigint":o=DB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([RB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case bv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of C2t(a))(e||!Vg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case DS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case LS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case OS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Vg(h0(p))||Vg(h0(m))))&&_.push([i(p),i(m)]);return d}case IS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Vg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xj=(e,{json:n,lossy:t}={})=>{const r=[];return E2t(!(n||t),!!n,new Map,r)(e),r},yv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?yj(xj(e,n)):structuredClone(e):(e,n)=>yj(xj(e,n));function N2t(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function z2t(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function j2t(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||N2t,r=e.options.footnoteBackLabel||z2t,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...yv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(n,u),e.applyData(n,u)}function c2t(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r1}function u2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _2t(e){const n=MS(e),t=TB(e);if(n&&t)return{start:n,end:t}}function p2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=MS(n.children[1]),l=TB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function m2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(vj(n.slice(s),s>0,!1)),i.join("")}function vj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===mj||i===gj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===mj||i===gj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function b2t(e,n){const t={type:"text",value:v2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function y2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const x2t={blockquote:Wxt,break:Vxt,code:Kxt,delete:Qxt,emphasis:Yxt,footnoteReference:e2t,heading:t2t,html:n2t,imageReference:r2t,image:s2t,inlineCode:i2t,linkReference:a2t,link:o2t,listItem:l2t,list:u2t,paragraph:d2t,root:f2t,strong:h2t,table:p2t,tableCell:g2t,tableRow:m2t,text:b2t,thematicBreak:y2t,toml:Wg,yaml:Wg,definition:Wg,footnoteDefinition:Wg};function Wg(){}const RB=-1,Bb=0,P0=1,yv=2,DS=3,LS=4,OS=5,IS=6,MB=7,DB=8,w2t=typeof self=="object"?self:globalThis,bj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new w2t[e](n)},S2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Bb:case RB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case yv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case DS:return t(new Date(a),s);case LS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case OS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case IS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case MB:{const{name:o,message:l}=a;return t(bj(o,l),s)}case DB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(bj(i,a),s)};return r},yj=e=>S2t(new Map,e)(0),nd="",{toString:k2t}={},{keys:C2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Bb,n];const t=k2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[yv,nd];case"Date":return[DS,nd];case"RegExp":return[LS,nd];case"Map":return[OS,nd];case"Set":return[IS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[MB,t]:[yv,t]},Vg=([e,n])=>e===Bb&&(n==="function"||n==="symbol"),E2t=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Bb:{let _=a;switch(l){case"bigint":o=DB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([RB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case yv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of C2t(a))(e||!Vg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case DS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case LS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case OS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Vg(h0(p))||Vg(h0(m))))&&_.push([i(p),i(m)]);return d}case IS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Vg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xj=(e,{json:n,lossy:t}={})=>{const r=[];return E2t(!(n||t),!!n,new Map,r)(e),r},xv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?yj(xj(e,n)):structuredClone(e):(e,n)=>yj(xj(e,n));function N2t(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function z2t(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function j2t(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||N2t,r=e.options.footnoteBackLabel||z2t,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...xv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const lm=(function(e){if(e==null)return M2t;if(typeof e=="function")return Bb(e);if(typeof e=="object")return Array.isArray(e)?T2t(e):A2t(e);if(typeof e=="string")return R2t(e);throw new Error("Expected function, string, or object as test")});function T2t(e){const n=[];let t=-1;for(;++t":""))+")"})}return p;function p(){let m=LB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=O2t(t(l,_)),m[0]===w3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==OB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S":""))+")"})}return p;function p(){let m=LB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=O2t(t(l,_)),m[0]===S3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==OB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S0&&t.push({type:"text",value:` `}),t}function wj(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Sj(e,n){const t=B2t(e,n),r=t.one(e,void 0),s=j2t(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function xv(e,n){return e&&"run"in e?async function(t,r){const s=Sj(t,{file:r,...n});await e.run(s,r)}:function(t,r){return Sj(t,{file:r,...e||n})}}function kj(e){if(e)throw e}var W2,Cj;function q2t(){if(Cj)return W2;Cj=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},i=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var _=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!_&&!d)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return W2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ej(e.position):"start"in e||"end"in e?Ej(e):"line"in e||"column"in e?C3(e):""}function C3(e){return Nj(e&&e.line)+":"+Nj(e&&e.column)}function Ej(e){return C3(e&&e.start)+"-"+C3(e&&e.end)}function Nj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:V2t,dirname:K2t,extname:Q2t,join:Y2t,sep:"/"};function V2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function K2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Q2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Y2t(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Z2t(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J2t={cwd:ewt};function ewt(){return"/"}function E3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function twt(e){if(typeof e=="string")e=new URL(e);else if(!E3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nwt(e)}function nwt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];k3(S)&&k3(m)&&(m=V2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function X2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Z2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function J2(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jj(e){if(!k3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return awt(e)?e:new IB(e)}function awt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function owt(e){return typeof e=="string"||lwt(e)}function lwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Aj=Object.prototype.hasOwnProperty;function Rj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Rj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Rj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Aj.call(e,t)&&++r&&!Aj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const cwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uwt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dwt={};function Mj(e,n){return(dwt.jsx?uwt:cwt).test(e)}const fwt=/[ \t\n\f\r]/g;function hwt(e){return typeof e=="object"?e.type==="text"?Dj(e.value):!1:Dj(e)}function Dj(e){return e.replace(fwt,"")===""}var Gf={},ew,Lj;function _wt(){if(Lj)return ew;Lj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` -`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(q){var Y=q.match(n);Y&&(w+=Y.length);var G=q.lastIndexOf(l);y=~G?q.length-G:y+q.length}function E(){var q={line:w,column:y};return function(Y){return Y.position=new N(q),M(),Y}}function N(q){this.start=q,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(q){var Y=new Error(b.source+":"+w+":"+y+": "+q);if(Y.reason=q,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(q){var Y=q.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(q){var Y;for(q=q||[];Y=B();)Y!==!1&&q.push(Y);return q}function B(){var q=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,q({type:p,comment:G})}}function $(){var q=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=q({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function H(){var q=[];O(q);for(var Y;Y=$();)Y!==!1&&(q.push(Y),O(q));return q}return M(),H()}function S(v){return v?v.replace(o,d):d}return ew=x,ew}var Oj;function pwt(){if(Oj)return Gf;Oj=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(_wt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Db:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Db,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Db,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Ob(e))return 2}function $b(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,$b(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),H(Y)):j(Y)}function H(Y){return Y===o?(M++,N.consume(Y),H):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,q,"whitespace")(Y):q(Y)):j(Y)}function q(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const tw={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||vv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(U){return _(U)}function _(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),p):U===47?(e.consume(U),i=!0,S):U===63?(e.consume(U),s=3,r.interrupt?n:L):ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function p(U){return U===45?(e.consume(U),s=2,m):U===91?(e.consume(U),s=5,o=0,x):ai(U)?(e.consume(U),s=4,r.interrupt?n:L):t(U)}function m(U){return U===45?(e.consume(U),r.interrupt?n:L):t(U)}function x(U){const Z="CDATA[";return U===Z.charCodeAt(o++)?(e.consume(U),o===Z.length?r.interrupt?n:$:x):t(U)}function S(U){return ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function v(U){if(U===null||U===47||U===62||lr(U)){const Z=U===47,ce=a.toLowerCase();return!Z&&!i&&Gj.includes(ce)?(s=1,r.interrupt?n(U):$(U)):M4t.includes(a.toLowerCase())?(s=6,Z?(e.consume(U),b):r.interrupt?n(U):$(U)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(U):i?w(U):y(U))}return U===45||Vs(U)?(e.consume(U),a+=String.fromCharCode(U),v):t(U)}function b(U){return U===62?(e.consume(U),r.interrupt?n:$):t(U)}function w(U){return gn(U)?(e.consume(U),w):O(U)}function y(U){return U===47?(e.consume(U),O):U===58||U===95||ai(U)?(e.consume(U),C):gn(U)?(e.consume(U),y):O(U)}function C(U){return U===45||U===46||U===58||U===95||Vs(U)?(e.consume(U),C):E(U)}function E(U){return U===61?(e.consume(U),N):gn(U)?(e.consume(U),E):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(e.consume(U),l=U,T):gn(U)?(e.consume(U),N):j(U)}function T(U){return U===l?(e.consume(U),l=null,M):U===null||St(U)?t(U):(e.consume(U),T)}function j(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||lr(U)?E(U):(e.consume(U),j)}function M(U){return U===47||U===62||gn(U)?y(U):t(U)}function O(U){return U===62?(e.consume(U),B):t(U)}function B(U){return U===null||St(U)?$(U):gn(U)?(e.consume(U),B):t(U)}function $(U){return U===45&&s===2?(e.consume(U),G):U===60&&s===1?(e.consume(U),X):U===62&&s===4?(e.consume(U),F):U===63&&s===3?(e.consume(U),L):U===93&&s===5?(e.consume(U),I):St(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,H)(U)):U===null||St(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),$)}function H(U){return e.check(O4t,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),Y}function Y(U){return U===null||St(U)?H(U):(e.enter("htmlFlowData"),$(U))}function G(U){return U===45?(e.consume(U),L):$(U)}function X(U){return U===47?(e.consume(U),a="",te):$(U)}function te(U){if(U===62){const Z=a.toLowerCase();return Gj.includes(Z)?(e.consume(U),F):$(U)}return ai(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),te):$(U)}function I(U){return U===93?(e.consume(U),L):$(U)}function L(U){return U===62?(e.consume(U),F):U===45&&s===2?(e.consume(U),L):$(U)}function F(U){return U===null||St(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),F)}function W(U){return e.exit("htmlFlow"),n(U)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,H):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),q)}function H(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=H,X(L)):(e.consume(L),H)}function q(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),q)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:x3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(M1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return x3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return V2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ej(e.position):"start"in e||"end"in e?Ej(e):"line"in e||"column"in e?E3(e):""}function E3(e){return Nj(e&&e.line)+":"+Nj(e&&e.column)}function Ej(e){return E3(e&&e.start)+"-"+E3(e&&e.end)}function Nj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:V2t,dirname:K2t,extname:Q2t,join:Y2t,sep:"/"};function V2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function K2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Q2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Y2t(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Z2t(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J2t={cwd:ewt};function ewt(){return"/"}function N3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function twt(e){if(typeof e=="string")e=new URL(e);else if(!N3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nwt(e)}function nwt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];C3(S)&&C3(m)&&(m=K2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function Z2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function J2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ew(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jj(e){if(!C3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return awt(e)?e:new IB(e)}function awt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function owt(e){return typeof e=="string"||lwt(e)}function lwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Aj=Object.prototype.hasOwnProperty;function Rj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Rj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Rj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Aj.call(e,t)&&++r&&!Aj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const cwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uwt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dwt={};function Mj(e,n){return(dwt.jsx?uwt:cwt).test(e)}const fwt=/[ \t\n\f\r]/g;function hwt(e){return typeof e=="object"?e.type==="text"?Dj(e.value):!1:Dj(e)}function Dj(e){return e.replace(fwt,"")===""}var Gf={},tw,Lj;function _wt(){if(Lj)return tw;Lj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` +`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(q){var Y=q.match(n);Y&&(w+=Y.length);var G=q.lastIndexOf(l);y=~G?q.length-G:y+q.length}function E(){var q={line:w,column:y};return function(Y){return Y.position=new N(q),M(),Y}}function N(q){this.start=q,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(q){var Y=new Error(b.source+":"+w+":"+y+": "+q);if(Y.reason=q,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(q){var Y=q.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(q){var Y;for(q=q||[];Y=B();)Y!==!1&&q.push(Y);return q}function B(){var q=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,q({type:p,comment:G})}}function $(){var q=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=q({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function H(){var q=[];O(q);for(var Y;Y=$();)Y!==!1&&(q.push(Y),O(q));return q}return M(),H()}function S(v){return v?v.replace(o,d):d}return tw=x,tw}var Oj;function pwt(){if(Oj)return Gf;Oj=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(_wt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Lb:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Lb,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Lb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Ib(e))return 2}function Pb(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,Pb(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),H(Y)):j(Y)}function H(Y){return Y===o?(M++,N.consume(Y),H):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,q,"whitespace")(Y):q(Y)):j(Y)}function q(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const nw={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||bv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(U){return _(U)}function _(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),p):U===47?(e.consume(U),i=!0,S):U===63?(e.consume(U),s=3,r.interrupt?n:L):ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function p(U){return U===45?(e.consume(U),s=2,m):U===91?(e.consume(U),s=5,o=0,x):ai(U)?(e.consume(U),s=4,r.interrupt?n:L):t(U)}function m(U){return U===45?(e.consume(U),r.interrupt?n:L):t(U)}function x(U){const Z="CDATA[";return U===Z.charCodeAt(o++)?(e.consume(U),o===Z.length?r.interrupt?n:$:x):t(U)}function S(U){return ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function v(U){if(U===null||U===47||U===62||lr(U)){const Z=U===47,ce=a.toLowerCase();return!Z&&!i&&Gj.includes(ce)?(s=1,r.interrupt?n(U):$(U)):M4t.includes(a.toLowerCase())?(s=6,Z?(e.consume(U),b):r.interrupt?n(U):$(U)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(U):i?w(U):y(U))}return U===45||Vs(U)?(e.consume(U),a+=String.fromCharCode(U),v):t(U)}function b(U){return U===62?(e.consume(U),r.interrupt?n:$):t(U)}function w(U){return gn(U)?(e.consume(U),w):O(U)}function y(U){return U===47?(e.consume(U),O):U===58||U===95||ai(U)?(e.consume(U),C):gn(U)?(e.consume(U),y):O(U)}function C(U){return U===45||U===46||U===58||U===95||Vs(U)?(e.consume(U),C):E(U)}function E(U){return U===61?(e.consume(U),N):gn(U)?(e.consume(U),E):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(e.consume(U),l=U,T):gn(U)?(e.consume(U),N):j(U)}function T(U){return U===l?(e.consume(U),l=null,M):U===null||St(U)?t(U):(e.consume(U),T)}function j(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||lr(U)?E(U):(e.consume(U),j)}function M(U){return U===47||U===62||gn(U)?y(U):t(U)}function O(U){return U===62?(e.consume(U),B):t(U)}function B(U){return U===null||St(U)?$(U):gn(U)?(e.consume(U),B):t(U)}function $(U){return U===45&&s===2?(e.consume(U),G):U===60&&s===1?(e.consume(U),X):U===62&&s===4?(e.consume(U),F):U===63&&s===3?(e.consume(U),L):U===93&&s===5?(e.consume(U),I):St(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,H)(U)):U===null||St(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),$)}function H(U){return e.check(O4t,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),Y}function Y(U){return U===null||St(U)?H(U):(e.enter("htmlFlowData"),$(U))}function G(U){return U===45?(e.consume(U),L):$(U)}function X(U){return U===47?(e.consume(U),a="",te):$(U)}function te(U){if(U===62){const Z=a.toLowerCase();return Gj.includes(Z)?(e.consume(U),F):$(U)}return ai(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),te):$(U)}function I(U){return U===93?(e.consume(U),L):$(U)}function L(U){return U===62?(e.consume(U),F):U===45&&s===2?(e.consume(U),L):$(U)}function F(U){return U===null||St(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),F)}function W(U){return e.exit("htmlFlow"),n(U)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,H):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),q)}function H(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=H,X(L)):(e.consume(L),H)}function q(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),q)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:w3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(M1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return w3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Kj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,de(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Qj(t)),de(this,ru)+J3t(t,r)}}ru=new WeakMap;const H3t=new Set(["*","**","_","__"]);function Qj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(Z3t(n)){Yj(n,t,r);continue}const i=V3t(n,e,t);if(i>t){t=i-1;continue}const a=K3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Yj(n,t,r)}return n}function q3t(e,n,t){const r=n[t];return r==="`"?U3t(e,n,t):r==="$"?G3t(e,n,t):r==="~"?W3t(e,n,t):t}function U3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&wv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&wv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function G3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function W3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(wv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!wv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function V3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` -`)return e.pendingHtml=null,s+1;return n.length}function K3t(e,n,t){const r=Q3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Y3t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Q3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Y3t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Jj(s)||!Jj(r)}function Yj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function X3t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Z3t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function J3t(e,n){n.pendingHtml!==null&&(e=e.slice(0,n5t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return xo(e5t(e,t));const r=t5t(n);if(r)return xo(ih(e,r));const s=i5t(n);return s?s.kind==="delim"?xo(z3(e,s.start,s.token.length)?s$(e,s.token):e.slice(0,s.start)):z3(e,s.start,s.token.length)?s.kind==="fence"?xo(e):s.kind==="code"?xo(ih(e,s.token)):s.token==="$$"?xo(ih(e,(e.endsWith(` +`){X3t(n),n.exclusive||(n.commitIndex=t+1);continue}const s=q3t(n,e,t);if(s>t){t=s-1;continue}if(n.exclusive)continue;if(Z3t(n)){Yj(n,t,r);continue}const i=V3t(n,e,t);if(i>t){t=i-1;continue}const a=K3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Yj(n,t,r)}return n}function q3t(e,n,t){const r=n[t];return r==="`"?U3t(e,n,t):r==="$"?G3t(e,n,t):r==="~"?W3t(e,n,t):t}function U3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&Sv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&Sv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function G3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function W3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(Sv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!Sv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function V3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` +`)return e.pendingHtml=null,s+1;return n.length}function K3t(e,n,t){const r=Q3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Y3t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Q3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Y3t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Jj(s)||!Jj(r)}function Yj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function X3t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Z3t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function J3t(e,n){n.pendingHtml!==null&&(e=e.slice(0,n5t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return xo(e5t(e,t));const r=t5t(n);if(r)return xo(ih(e,r));const s=i5t(n);return s?s.kind==="delim"?xo(j3(e,s.start,s.token.length)?s$(e,s.token):e.slice(0,s.start)):j3(e,s.start,s.token.length)?s.kind==="fence"?xo(e):s.kind==="code"?xo(ih(e,s.token)):s.token==="$$"?xo(ih(e,(e.endsWith(` `)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?xo(e):xo(ih(e,"$")):xo(s.kind==="fence"?e:e.slice(0,s.start)):xo(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function e5t(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return z3(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function t5t(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!H3t.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function n5t(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!r5t(e,s,r))break;t=s,r=s}return t}function r5t(e,n,t){if(e[t-1]!==">"||eo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!a$(r))return!1;for(let s=n+1;s"||i===` +`)+"$$")):/\s/.test(e[e.length-1]??"")?xo(e):xo(ih(e,"$")):xo(s.kind==="fence"?e:e.slice(0,s.start)):xo(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function e5t(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return j3(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function t5t(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!H3t.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function n5t(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!r5t(e,s,r))break;t=s,r=s}return t}function r5t(e,n,t){if(e[t-1]!==">"||eo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!a$(r))return!1;for(let s=n+1;s"||i===` `)return!1}return!0}function xo(e){var v;const n=e.lastIndexOf(` `),t=n===-1?0:n+2,r=e.slice(0,t),s=e.slice(t),i=s.indexOf(` @@ -702,10 +702,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `),x=m===-1?d:d.slice(0,m),S=m===-1?"":d.slice(m);if(o5t(x,o,_))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const b=i$(x,o).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let E=0;E1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+l+` `+Zj(o,b)+S}return r+l+` `+p+` -`+d}function ih(e,n){return e+n.slice(s5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function s5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function i5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Xj(e){let n=0;for(let t=0;t0}function Zj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function o5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function wv(e,n){return n===0||e[n-1]===` -`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){de(this,Dh)!==null&&de(this,Fp)===n&&l$(de(this,Lh),r)&&!!de(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===xv)||(n=n(),n.use(xv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){de(this,xd)&&(n=de(this,xd).update(n));let t=de(this,Oh);if(n===t)return de(this,Sd);const r=de(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(de(this,Dh)),l=de(this,qp),u=l.slice(i).some(N=>N.some(j3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),G2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=rw(_,d,a);G2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||j3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=rw(_,d,a);G2(N.length===d.length),l.splice(0,l.length,...N)}const p=rw(o.runSync(_),d,a),m=de(this,Up),x=de(this,Gp),S=de(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(de(this,wd)),Fe(this,wd,de(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const iw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===iw.svg?jyt:dB,s=t===iw.html?e.tagName.toLowerCase():e.tagName,i=t===iw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` -`.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function h$(e,n,t){return e.type==="element"?I5t(e,n,t):e.type==="text"?t.whitespace==="normal"?_$(e,t):B5t(e):[]}function I5t(e,n,t){const r=p$(e,t),s=e.children||[];let i=-1,a=[];if(L5t(e))return a;let o,l;for(T3(e)||lT(e)&&sT(n,e,lT)?l=` -`:D5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(q5t,"-$1").toLowerCase(),G5t={"&":"&",">":">","<":"<",'"':""","'":"'"},W5t=/[&><"']/g,Ks=e=>String(e).replace(W5t,n=>G5t[n]),D1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?D1(e.body[0]):e:e.type==="font"?D1(e.body):e,V5t=new Set(["mathord","textord","atom"]),Wl=e=>V5t.has(D1(e).type),K5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},A3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Q5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Y5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Q5t(n)}function X5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Y5t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(A3)){var r=A3[t];r&&X5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=K5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[Z5t[this.id]]}sub(){return jo[J5t[this.id]]}fracNum(){return jo[e6t[this.id]]}fracDen(){return jo[t6t[this.id]]}cramp(){return jo[n6t[this.id]]}text(){return jo[r6t[this.id]]}isTight(){return this.size>=2}}var XS=0,Sv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(Sv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],Z5t=[gp,ka,gp,ka,Qh,oi,Qh,oi],J5t=[ka,ka,ka,ka,oi,oi,oi,oi],e6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],t6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],n6t=[Sv,Sv,Pl,Pl,ka,ka,oi,oi],r6t=[XS,Sv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},R3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function s6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var L1=[];R3.forEach(e=>e.blocks.forEach(n=>L1.push(...n)));function m$(e){for(var n=0;n=L1[n]&&e<=L1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,i6t=function(n,t){return"M95,"+(622+n+t)+` +`+d}function ih(e,n){return e+n.slice(s5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function s5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function i5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Xj(e){let n=0;for(let t=0;t0}function Zj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function o5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function Sv(e,n){return n===0||e[n-1]===` +`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){de(this,Dh)!==null&&de(this,Fp)===n&&l$(de(this,Lh),r)&&!!de(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===wv)||(n=n(),n.use(wv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){de(this,xd)&&(n=de(this,xd).update(n));let t=de(this,Oh);if(n===t)return de(this,Sd);const r=de(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(de(this,Dh)),l=de(this,qp),u=l.slice(i).some(N=>N.some(T3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),W2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=sw(_,d,a);W2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||T3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=sw(_,d,a);W2(N.length===d.length),l.splice(0,l.length,...N)}const p=sw(o.runSync(_),d,a),m=de(this,Up),x=de(this,Gp),S=de(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(de(this,wd)),Fe(this,wd,de(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const aw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===aw.svg?jyt:dB,s=t===aw.html?e.tagName.toLowerCase():e.tagName,i=t===aw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` +`.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function h$(e,n,t){return e.type==="element"?I5t(e,n,t):e.type==="text"?t.whitespace==="normal"?_$(e,t):B5t(e):[]}function I5t(e,n,t){const r=p$(e,t),s=e.children||[];let i=-1,a=[];if(L5t(e))return a;let o,l;for(A3(e)||lT(e)&&sT(n,e,lT)?l=` +`:D5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(q5t,"-$1").toLowerCase(),G5t={"&":"&",">":">","<":"<",'"':""","'":"'"},W5t=/[&><"']/g,Ks=e=>String(e).replace(W5t,n=>G5t[n]),D1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?D1(e.body[0]):e:e.type==="font"?D1(e.body):e,V5t=new Set(["mathord","textord","atom"]),Wl=e=>V5t.has(D1(e).type),K5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},R3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Q5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Y5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Q5t(n)}function X5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Y5t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(R3)){var r=R3[t];r&&X5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=K5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[Z5t[this.id]]}sub(){return jo[J5t[this.id]]}fracNum(){return jo[e6t[this.id]]}fracDen(){return jo[t6t[this.id]]}cramp(){return jo[n6t[this.id]]}text(){return jo[r6t[this.id]]}isTight(){return this.size>=2}}var XS=0,kv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(kv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],Z5t=[gp,ka,gp,ka,Qh,oi,Qh,oi],J5t=[ka,ka,ka,ka,oi,oi,oi,oi],e6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],t6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],n6t=[kv,kv,Pl,Pl,ka,ka,oi,oi],r6t=[XS,kv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},M3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function s6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var L1=[];M3.forEach(e=>e.blocks.forEach(n=>L1.push(...n)));function m$(e){for(var n=0;n=L1[n]&&e<=L1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,i6t=function(n,t){return"M95,"+(622+n+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -955,13 +955,13 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var M3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in M3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in M3)r=M3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class Pb{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class D3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof Pb||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var aw={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!aw[n]){var t=aw[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return aw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",ee="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";P(V,ee,he,"≡","\\equiv",!0);P(V,ee,he,"≺","\\prec",!0);P(V,ee,he,"≻","\\succ",!0);P(V,ee,he,"∼","\\sim",!0);P(V,ee,he,"⊥","\\perp");P(V,ee,he,"⪯","\\preceq",!0);P(V,ee,he,"⪰","\\succeq",!0);P(V,ee,he,"≃","\\simeq",!0);P(V,ee,he,"∣","\\mid",!0);P(V,ee,he,"≪","\\ll",!0);P(V,ee,he,"≫","\\gg",!0);P(V,ee,he,"≍","\\asymp",!0);P(V,ee,he,"∥","\\parallel");P(V,ee,he,"⋈","\\bowtie",!0);P(V,ee,he,"⌣","\\smile",!0);P(V,ee,he,"⊑","\\sqsubseteq",!0);P(V,ee,he,"⊒","\\sqsupseteq",!0);P(V,ee,he,"≐","\\doteq",!0);P(V,ee,he,"⌢","\\frown",!0);P(V,ee,he,"∋","\\ni",!0);P(V,ee,he,"∝","\\propto",!0);P(V,ee,he,"⊢","\\vdash",!0);P(V,ee,he,"⊣","\\dashv",!0);P(V,ee,he,"∋","\\owns");P(V,ee,dm,".","\\ldotp");P(V,ee,dm,"⋅","\\cdotp");P(V,ee,dm,"⋅","·");P(He,ee,ve,"⋅","·");P(V,ee,ve,"#","\\#");P(He,ee,ve,"#","\\#");P(V,ee,ve,"&","\\&");P(He,ee,ve,"&","\\&");P(V,ee,ve,"ℵ","\\aleph",!0);P(V,ee,ve,"∀","\\forall",!0);P(V,ee,ve,"ℏ","\\hbar",!0);P(V,ee,ve,"∃","\\exists",!0);P(V,ee,ve,"∇","\\nabla",!0);P(V,ee,ve,"♭","\\flat",!0);P(V,ee,ve,"ℓ","\\ell",!0);P(V,ee,ve,"♮","\\natural",!0);P(V,ee,ve,"♣","\\clubsuit",!0);P(V,ee,ve,"℘","\\wp",!0);P(V,ee,ve,"♯","\\sharp",!0);P(V,ee,ve,"♢","\\diamondsuit",!0);P(V,ee,ve,"ℜ","\\Re",!0);P(V,ee,ve,"♡","\\heartsuit",!0);P(V,ee,ve,"ℑ","\\Im",!0);P(V,ee,ve,"♠","\\spadesuit",!0);P(V,ee,ve,"§","\\S",!0);P(He,ee,ve,"§","\\S");P(V,ee,ve,"¶","\\P",!0);P(He,ee,ve,"¶","\\P");P(V,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\textdagger");P(V,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\textdaggerdbl");P(V,ee,ui,"⎱","\\rmoustache",!0);P(V,ee,na,"⎰","\\lmoustache",!0);P(V,ee,ui,"⟯","\\rgroup",!0);P(V,ee,na,"⟮","\\lgroup",!0);P(V,ee,dt,"∓","\\mp",!0);P(V,ee,dt,"⊖","\\ominus",!0);P(V,ee,dt,"⊎","\\uplus",!0);P(V,ee,dt,"⊓","\\sqcap",!0);P(V,ee,dt,"∗","\\ast");P(V,ee,dt,"⊔","\\sqcup",!0);P(V,ee,dt,"◯","\\bigcirc",!0);P(V,ee,dt,"∙","\\bullet",!0);P(V,ee,dt,"‡","\\ddagger");P(V,ee,dt,"≀","\\wr",!0);P(V,ee,dt,"⨿","\\amalg");P(V,ee,dt,"&","\\And");P(V,ee,he,"⟵","\\longleftarrow",!0);P(V,ee,he,"⇐","\\Leftarrow",!0);P(V,ee,he,"⟸","\\Longleftarrow",!0);P(V,ee,he,"⟶","\\longrightarrow",!0);P(V,ee,he,"⇒","\\Rightarrow",!0);P(V,ee,he,"⟹","\\Longrightarrow",!0);P(V,ee,he,"↔","\\leftrightarrow",!0);P(V,ee,he,"⟷","\\longleftrightarrow",!0);P(V,ee,he,"⇔","\\Leftrightarrow",!0);P(V,ee,he,"⟺","\\Longleftrightarrow",!0);P(V,ee,he,"↦","\\mapsto",!0);P(V,ee,he,"⟼","\\longmapsto",!0);P(V,ee,he,"↗","\\nearrow",!0);P(V,ee,he,"↩","\\hookleftarrow",!0);P(V,ee,he,"↪","\\hookrightarrow",!0);P(V,ee,he,"↘","\\searrow",!0);P(V,ee,he,"↼","\\leftharpoonup",!0);P(V,ee,he,"⇀","\\rightharpoonup",!0);P(V,ee,he,"↙","\\swarrow",!0);P(V,ee,he,"↽","\\leftharpoondown",!0);P(V,ee,he,"⇁","\\rightharpoondown",!0);P(V,ee,he,"↖","\\nwarrow",!0);P(V,ee,he,"⇌","\\rightleftharpoons",!0);P(V,fe,he,"≮","\\nless",!0);P(V,fe,he,"","\\@nleqslant");P(V,fe,he,"","\\@nleqq");P(V,fe,he,"⪇","\\lneq",!0);P(V,fe,he,"≨","\\lneqq",!0);P(V,fe,he,"","\\@lvertneqq");P(V,fe,he,"⋦","\\lnsim",!0);P(V,fe,he,"⪉","\\lnapprox",!0);P(V,fe,he,"⊀","\\nprec",!0);P(V,fe,he,"⋠","\\npreceq",!0);P(V,fe,he,"⋨","\\precnsim",!0);P(V,fe,he,"⪹","\\precnapprox",!0);P(V,fe,he,"≁","\\nsim",!0);P(V,fe,he,"","\\@nshortmid");P(V,fe,he,"∤","\\nmid",!0);P(V,fe,he,"⊬","\\nvdash",!0);P(V,fe,he,"⊭","\\nvDash",!0);P(V,fe,he,"⋪","\\ntriangleleft");P(V,fe,he,"⋬","\\ntrianglelefteq",!0);P(V,fe,he,"⊊","\\subsetneq",!0);P(V,fe,he,"","\\@varsubsetneq");P(V,fe,he,"⫋","\\subsetneqq",!0);P(V,fe,he,"","\\@varsubsetneqq");P(V,fe,he,"≯","\\ngtr",!0);P(V,fe,he,"","\\@ngeqslant");P(V,fe,he,"","\\@ngeqq");P(V,fe,he,"⪈","\\gneq",!0);P(V,fe,he,"≩","\\gneqq",!0);P(V,fe,he,"","\\@gvertneqq");P(V,fe,he,"⋧","\\gnsim",!0);P(V,fe,he,"⪊","\\gnapprox",!0);P(V,fe,he,"⊁","\\nsucc",!0);P(V,fe,he,"⋡","\\nsucceq",!0);P(V,fe,he,"⋩","\\succnsim",!0);P(V,fe,he,"⪺","\\succnapprox",!0);P(V,fe,he,"≆","\\ncong",!0);P(V,fe,he,"","\\@nshortparallel");P(V,fe,he,"∦","\\nparallel",!0);P(V,fe,he,"⊯","\\nVDash",!0);P(V,fe,he,"⋫","\\ntriangleright");P(V,fe,he,"⋭","\\ntrianglerighteq",!0);P(V,fe,he,"","\\@nsupseteqq");P(V,fe,he,"⊋","\\supsetneq",!0);P(V,fe,he,"","\\@varsupsetneq");P(V,fe,he,"⫌","\\supsetneqq",!0);P(V,fe,he,"","\\@varsupsetneqq");P(V,fe,he,"⊮","\\nVdash",!0);P(V,fe,he,"⪵","\\precneqq",!0);P(V,fe,he,"⪶","\\succneqq",!0);P(V,fe,he,"","\\@nsubseteqq");P(V,fe,dt,"⊴","\\unlhd");P(V,fe,dt,"⊵","\\unrhd");P(V,fe,he,"↚","\\nleftarrow",!0);P(V,fe,he,"↛","\\nrightarrow",!0);P(V,fe,he,"⇍","\\nLeftarrow",!0);P(V,fe,he,"⇏","\\nRightarrow",!0);P(V,fe,he,"↮","\\nleftrightarrow",!0);P(V,fe,he,"⇎","\\nLeftrightarrow",!0);P(V,fe,he,"△","\\vartriangle");P(V,fe,ve,"ℏ","\\hslash");P(V,fe,ve,"▽","\\triangledown");P(V,fe,ve,"◊","\\lozenge");P(V,fe,ve,"Ⓢ","\\circledS");P(V,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(V,fe,ve,"∡","\\measuredangle",!0);P(V,fe,ve,"∄","\\nexists");P(V,fe,ve,"℧","\\mho");P(V,fe,ve,"Ⅎ","\\Finv",!0);P(V,fe,ve,"⅁","\\Game",!0);P(V,fe,ve,"‵","\\backprime");P(V,fe,ve,"▲","\\blacktriangle");P(V,fe,ve,"▼","\\blacktriangledown");P(V,fe,ve,"■","\\blacksquare");P(V,fe,ve,"⧫","\\blacklozenge");P(V,fe,ve,"★","\\bigstar");P(V,fe,ve,"∢","\\sphericalangle",!0);P(V,fe,ve,"∁","\\complement",!0);P(V,fe,ve,"ð","\\eth",!0);P(He,ee,ve,"ð","ð");P(V,fe,ve,"╱","\\diagup");P(V,fe,ve,"╲","\\diagdown");P(V,fe,ve,"□","\\square");P(V,fe,ve,"□","\\Box");P(V,fe,ve,"◊","\\Diamond");P(V,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(V,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(V,fe,ve,"ℶ","\\beth",!0);P(V,fe,ve,"ℸ","\\daleth",!0);P(V,fe,ve,"ℷ","\\gimel",!0);P(V,fe,ve,"ϝ","\\digamma",!0);P(V,fe,ve,"ϰ","\\varkappa");P(V,fe,na,"┌","\\@ulcorner",!0);P(V,fe,ui,"┐","\\@urcorner",!0);P(V,fe,na,"└","\\@llcorner",!0);P(V,fe,ui,"┘","\\@lrcorner",!0);P(V,fe,he,"≦","\\leqq",!0);P(V,fe,he,"⩽","\\leqslant",!0);P(V,fe,he,"⪕","\\eqslantless",!0);P(V,fe,he,"≲","\\lesssim",!0);P(V,fe,he,"⪅","\\lessapprox",!0);P(V,fe,he,"≊","\\approxeq",!0);P(V,fe,dt,"⋖","\\lessdot");P(V,fe,he,"⋘","\\lll",!0);P(V,fe,he,"≶","\\lessgtr",!0);P(V,fe,he,"⋚","\\lesseqgtr",!0);P(V,fe,he,"⪋","\\lesseqqgtr",!0);P(V,fe,he,"≑","\\doteqdot");P(V,fe,he,"≓","\\risingdotseq",!0);P(V,fe,he,"≒","\\fallingdotseq",!0);P(V,fe,he,"∽","\\backsim",!0);P(V,fe,he,"⋍","\\backsimeq",!0);P(V,fe,he,"⫅","\\subseteqq",!0);P(V,fe,he,"⋐","\\Subset",!0);P(V,fe,he,"⊏","\\sqsubset",!0);P(V,fe,he,"≼","\\preccurlyeq",!0);P(V,fe,he,"⋞","\\curlyeqprec",!0);P(V,fe,he,"≾","\\precsim",!0);P(V,fe,he,"⪷","\\precapprox",!0);P(V,fe,he,"⊲","\\vartriangleleft");P(V,fe,he,"⊴","\\trianglelefteq");P(V,fe,he,"⊨","\\vDash",!0);P(V,fe,he,"⊪","\\Vvdash",!0);P(V,fe,he,"⌣","\\smallsmile");P(V,fe,he,"⌢","\\smallfrown");P(V,fe,he,"≏","\\bumpeq",!0);P(V,fe,he,"≎","\\Bumpeq",!0);P(V,fe,he,"≧","\\geqq",!0);P(V,fe,he,"⩾","\\geqslant",!0);P(V,fe,he,"⪖","\\eqslantgtr",!0);P(V,fe,he,"≳","\\gtrsim",!0);P(V,fe,he,"⪆","\\gtrapprox",!0);P(V,fe,dt,"⋗","\\gtrdot");P(V,fe,he,"⋙","\\ggg",!0);P(V,fe,he,"≷","\\gtrless",!0);P(V,fe,he,"⋛","\\gtreqless",!0);P(V,fe,he,"⪌","\\gtreqqless",!0);P(V,fe,he,"≖","\\eqcirc",!0);P(V,fe,he,"≗","\\circeq",!0);P(V,fe,he,"≜","\\triangleq",!0);P(V,fe,he,"∼","\\thicksim");P(V,fe,he,"≈","\\thickapprox");P(V,fe,he,"⫆","\\supseteqq",!0);P(V,fe,he,"⋑","\\Supset",!0);P(V,fe,he,"⊐","\\sqsupset",!0);P(V,fe,he,"≽","\\succcurlyeq",!0);P(V,fe,he,"⋟","\\curlyeqsucc",!0);P(V,fe,he,"≿","\\succsim",!0);P(V,fe,he,"⪸","\\succapprox",!0);P(V,fe,he,"⊳","\\vartriangleright");P(V,fe,he,"⊵","\\trianglerighteq");P(V,fe,he,"⊩","\\Vdash",!0);P(V,fe,he,"∣","\\shortmid");P(V,fe,he,"∥","\\shortparallel");P(V,fe,he,"≬","\\between",!0);P(V,fe,he,"⋔","\\pitchfork",!0);P(V,fe,he,"∝","\\varpropto");P(V,fe,he,"◀","\\blacktriangleleft");P(V,fe,he,"∴","\\therefore",!0);P(V,fe,he,"∍","\\backepsilon");P(V,fe,he,"▶","\\blacktriangleright");P(V,fe,he,"∵","\\because",!0);P(V,fe,he,"⋘","\\llless");P(V,fe,he,"⋙","\\gggtr");P(V,fe,dt,"⊲","\\lhd");P(V,fe,dt,"⊳","\\rhd");P(V,fe,he,"≂","\\eqsim",!0);P(V,ee,he,"⋈","\\Join");P(V,fe,he,"≑","\\Doteq",!0);P(V,fe,dt,"∔","\\dotplus",!0);P(V,fe,dt,"∖","\\smallsetminus");P(V,fe,dt,"⋒","\\Cap",!0);P(V,fe,dt,"⋓","\\Cup",!0);P(V,fe,dt,"⩞","\\doublebarwedge",!0);P(V,fe,dt,"⊟","\\boxminus",!0);P(V,fe,dt,"⊞","\\boxplus",!0);P(V,fe,dt,"⋇","\\divideontimes",!0);P(V,fe,dt,"⋉","\\ltimes",!0);P(V,fe,dt,"⋊","\\rtimes",!0);P(V,fe,dt,"⋋","\\leftthreetimes",!0);P(V,fe,dt,"⋌","\\rightthreetimes",!0);P(V,fe,dt,"⋏","\\curlywedge",!0);P(V,fe,dt,"⋎","\\curlyvee",!0);P(V,fe,dt,"⊝","\\circleddash",!0);P(V,fe,dt,"⊛","\\circledast",!0);P(V,fe,dt,"⋅","\\centerdot");P(V,fe,dt,"⊺","\\intercal",!0);P(V,fe,dt,"⋒","\\doublecap");P(V,fe,dt,"⋓","\\doublecup");P(V,fe,dt,"⊠","\\boxtimes",!0);P(V,fe,he,"⇢","\\dashrightarrow",!0);P(V,fe,he,"⇠","\\dashleftarrow",!0);P(V,fe,he,"⇇","\\leftleftarrows",!0);P(V,fe,he,"⇆","\\leftrightarrows",!0);P(V,fe,he,"⇚","\\Lleftarrow",!0);P(V,fe,he,"↞","\\twoheadleftarrow",!0);P(V,fe,he,"↢","\\leftarrowtail",!0);P(V,fe,he,"↫","\\looparrowleft",!0);P(V,fe,he,"⇋","\\leftrightharpoons",!0);P(V,fe,he,"↶","\\curvearrowleft",!0);P(V,fe,he,"↺","\\circlearrowleft",!0);P(V,fe,he,"↰","\\Lsh",!0);P(V,fe,he,"⇈","\\upuparrows",!0);P(V,fe,he,"↿","\\upharpoonleft",!0);P(V,fe,he,"⇃","\\downharpoonleft",!0);P(V,ee,he,"⊶","\\origof",!0);P(V,ee,he,"⊷","\\imageof",!0);P(V,fe,he,"⊸","\\multimap",!0);P(V,fe,he,"↭","\\leftrightsquigarrow",!0);P(V,fe,he,"⇉","\\rightrightarrows",!0);P(V,fe,he,"⇄","\\rightleftarrows",!0);P(V,fe,he,"↠","\\twoheadrightarrow",!0);P(V,fe,he,"↣","\\rightarrowtail",!0);P(V,fe,he,"↬","\\looparrowright",!0);P(V,fe,he,"↷","\\curvearrowright",!0);P(V,fe,he,"↻","\\circlearrowright",!0);P(V,fe,he,"↱","\\Rsh",!0);P(V,fe,he,"⇊","\\downdownarrows",!0);P(V,fe,he,"↾","\\upharpoonright",!0);P(V,fe,he,"⇂","\\downharpoonright",!0);P(V,fe,he,"⇝","\\rightsquigarrow",!0);P(V,fe,he,"⇝","\\leadsto");P(V,fe,he,"⇛","\\Rrightarrow",!0);P(V,fe,he,"↾","\\restriction");P(V,ee,ve,"‘","`");P(V,ee,ve,"$","\\$");P(He,ee,ve,"$","\\$");P(He,ee,ve,"$","\\textdollar");P(V,ee,ve,"%","\\%");P(He,ee,ve,"%","\\%");P(V,ee,ve,"_","\\_");P(He,ee,ve,"_","\\_");P(He,ee,ve,"_","\\textunderscore");P(V,ee,ve,"∠","\\angle",!0);P(V,ee,ve,"∞","\\infty",!0);P(V,ee,ve,"′","\\prime");P(V,ee,ve,"△","\\triangle");P(V,ee,ve,"Γ","\\Gamma",!0);P(V,ee,ve,"Δ","\\Delta",!0);P(V,ee,ve,"Θ","\\Theta",!0);P(V,ee,ve,"Λ","\\Lambda",!0);P(V,ee,ve,"Ξ","\\Xi",!0);P(V,ee,ve,"Π","\\Pi",!0);P(V,ee,ve,"Σ","\\Sigma",!0);P(V,ee,ve,"Υ","\\Upsilon",!0);P(V,ee,ve,"Φ","\\Phi",!0);P(V,ee,ve,"Ψ","\\Psi",!0);P(V,ee,ve,"Ω","\\Omega",!0);P(V,ee,ve,"A","Α");P(V,ee,ve,"B","Β");P(V,ee,ve,"E","Ε");P(V,ee,ve,"Z","Ζ");P(V,ee,ve,"H","Η");P(V,ee,ve,"I","Ι");P(V,ee,ve,"K","Κ");P(V,ee,ve,"M","Μ");P(V,ee,ve,"N","Ν");P(V,ee,ve,"O","Ο");P(V,ee,ve,"P","Ρ");P(V,ee,ve,"T","Τ");P(V,ee,ve,"X","Χ");P(V,ee,ve,"¬","\\neg",!0);P(V,ee,ve,"¬","\\lnot");P(V,ee,ve,"⊤","\\top");P(V,ee,ve,"⊥","\\bot");P(V,ee,ve,"∅","\\emptyset");P(V,fe,ve,"∅","\\varnothing");P(V,ee,Bt,"α","\\alpha",!0);P(V,ee,Bt,"β","\\beta",!0);P(V,ee,Bt,"γ","\\gamma",!0);P(V,ee,Bt,"δ","\\delta",!0);P(V,ee,Bt,"ϵ","\\epsilon",!0);P(V,ee,Bt,"ζ","\\zeta",!0);P(V,ee,Bt,"η","\\eta",!0);P(V,ee,Bt,"θ","\\theta",!0);P(V,ee,Bt,"ι","\\iota",!0);P(V,ee,Bt,"κ","\\kappa",!0);P(V,ee,Bt,"λ","\\lambda",!0);P(V,ee,Bt,"μ","\\mu",!0);P(V,ee,Bt,"ν","\\nu",!0);P(V,ee,Bt,"ξ","\\xi",!0);P(V,ee,Bt,"ο","\\omicron",!0);P(V,ee,Bt,"π","\\pi",!0);P(V,ee,Bt,"ρ","\\rho",!0);P(V,ee,Bt,"σ","\\sigma",!0);P(V,ee,Bt,"τ","\\tau",!0);P(V,ee,Bt,"υ","\\upsilon",!0);P(V,ee,Bt,"ϕ","\\phi",!0);P(V,ee,Bt,"χ","\\chi",!0);P(V,ee,Bt,"ψ","\\psi",!0);P(V,ee,Bt,"ω","\\omega",!0);P(V,ee,Bt,"ε","\\varepsilon",!0);P(V,ee,Bt,"ϑ","\\vartheta",!0);P(V,ee,Bt,"ϖ","\\varpi",!0);P(V,ee,Bt,"ϱ","\\varrho",!0);P(V,ee,Bt,"ς","\\varsigma",!0);P(V,ee,Bt,"φ","\\varphi",!0);P(V,ee,dt,"∗","*",!0);P(V,ee,dt,"+","+");P(V,ee,dt,"−","-",!0);P(V,ee,dt,"⋅","\\cdot",!0);P(V,ee,dt,"∘","\\circ",!0);P(V,ee,dt,"÷","\\div",!0);P(V,ee,dt,"±","\\pm",!0);P(V,ee,dt,"×","\\times",!0);P(V,ee,dt,"∩","\\cap",!0);P(V,ee,dt,"∪","\\cup",!0);P(V,ee,dt,"∖","\\setminus",!0);P(V,ee,dt,"∧","\\land");P(V,ee,dt,"∨","\\lor");P(V,ee,dt,"∧","\\wedge",!0);P(V,ee,dt,"∨","\\vee",!0);P(V,ee,ve,"√","\\surd");P(V,ee,na,"⟨","\\langle",!0);P(V,ee,na,"∣","\\lvert");P(V,ee,na,"∥","\\lVert");P(V,ee,ui,"?","?");P(V,ee,ui,"!","!");P(V,ee,ui,"⟩","\\rangle",!0);P(V,ee,ui,"∣","\\rvert");P(V,ee,ui,"∥","\\rVert");P(V,ee,he,"=","=");P(V,ee,he,":",":");P(V,ee,he,"≈","\\approx",!0);P(V,ee,he,"≅","\\cong",!0);P(V,ee,he,"≥","\\ge");P(V,ee,he,"≥","\\geq",!0);P(V,ee,he,"←","\\gets");P(V,ee,he,">","\\gt",!0);P(V,ee,he,"∈","\\in",!0);P(V,ee,he,"","\\@not");P(V,ee,he,"⊂","\\subset",!0);P(V,ee,he,"⊃","\\supset",!0);P(V,ee,he,"⊆","\\subseteq",!0);P(V,ee,he,"⊇","\\supseteq",!0);P(V,fe,he,"⊈","\\nsubseteq",!0);P(V,fe,he,"⊉","\\nsupseteq",!0);P(V,ee,he,"⊨","\\models");P(V,ee,he,"←","\\leftarrow",!0);P(V,ee,he,"≤","\\le");P(V,ee,he,"≤","\\leq",!0);P(V,ee,he,"<","\\lt",!0);P(V,ee,he,"→","\\rightarrow",!0);P(V,ee,he,"→","\\to");P(V,fe,he,"≱","\\ngeq",!0);P(V,fe,he,"≰","\\nleq",!0);P(V,ee,Vl," ","\\ ");P(V,ee,Vl," ","\\space");P(V,ee,Vl," ","\\nobreakspace");P(He,ee,Vl," ","\\ ");P(He,ee,Vl," "," ");P(He,ee,Vl," ","\\space");P(He,ee,Vl," ","\\nobreakspace");P(V,ee,Vl,"","\\nobreak");P(V,ee,Vl,"","\\allowbreak");P(V,ee,dm,",",",");P(V,ee,dm,";",";");P(V,fe,dt,"⊼","\\barwedge",!0);P(V,fe,dt,"⊻","\\veebar",!0);P(V,ee,dt,"⊙","\\odot",!0);P(V,ee,dt,"⊕","\\oplus",!0);P(V,ee,dt,"⊗","\\otimes",!0);P(V,ee,ve,"∂","\\partial",!0);P(V,ee,dt,"⊘","\\oslash",!0);P(V,fe,dt,"⊚","\\circledcirc",!0);P(V,fe,dt,"⊡","\\boxdot",!0);P(V,ee,dt,"△","\\bigtriangleup");P(V,ee,dt,"▽","\\bigtriangledown");P(V,ee,dt,"†","\\dagger");P(V,ee,dt,"⋄","\\diamond");P(V,ee,dt,"⋆","\\star");P(V,ee,dt,"◃","\\triangleleft");P(V,ee,dt,"▹","\\triangleright");P(V,ee,na,"{","\\{");P(He,ee,ve,"{","\\{");P(He,ee,ve,"{","\\textbraceleft");P(V,ee,ui,"}","\\}");P(He,ee,ve,"}","\\}");P(He,ee,ve,"}","\\textbraceright");P(V,ee,na,"{","\\lbrace");P(V,ee,ui,"}","\\rbrace");P(V,ee,na,"[","\\lbrack",!0);P(He,ee,ve,"[","\\lbrack",!0);P(V,ee,ui,"]","\\rbrack",!0);P(He,ee,ve,"]","\\rbrack",!0);P(V,ee,na,"(","\\lparen",!0);P(V,ee,ui,")","\\rparen",!0);P(He,ee,ve,"<","\\textless",!0);P(He,ee,ve,">","\\textgreater",!0);P(V,ee,na,"⌊","\\lfloor",!0);P(V,ee,ui,"⌋","\\rfloor",!0);P(V,ee,na,"⌈","\\lceil",!0);P(V,ee,ui,"⌉","\\rceil",!0);P(V,ee,ve,"\\","\\backslash");P(V,ee,ve,"∣","|");P(V,ee,ve,"∣","\\vert");P(He,ee,ve,"|","\\textbar",!0);P(V,ee,ve,"∥","\\|");P(V,ee,ve,"∥","\\Vert");P(He,ee,ve,"∥","\\textbardbl");P(He,ee,ve,"~","\\textasciitilde");P(He,ee,ve,"\\","\\textbackslash");P(He,ee,ve,"^","\\textasciicircum");P(V,ee,he,"↑","\\uparrow",!0);P(V,ee,he,"⇑","\\Uparrow",!0);P(V,ee,he,"↓","\\downarrow",!0);P(V,ee,he,"⇓","\\Downarrow",!0);P(V,ee,he,"↕","\\updownarrow",!0);P(V,ee,he,"⇕","\\Updownarrow",!0);P(V,ee,is,"∐","\\coprod");P(V,ee,is,"⋁","\\bigvee");P(V,ee,is,"⋀","\\bigwedge");P(V,ee,is,"⨄","\\biguplus");P(V,ee,is,"⋂","\\bigcap");P(V,ee,is,"⋃","\\bigcup");P(V,ee,is,"∫","\\int");P(V,ee,is,"∫","\\intop");P(V,ee,is,"∬","\\iint");P(V,ee,is,"∭","\\iiint");P(V,ee,is,"∏","\\prod");P(V,ee,is,"∑","\\sum");P(V,ee,is,"⨂","\\bigotimes");P(V,ee,is,"⨁","\\bigoplus");P(V,ee,is,"⨀","\\bigodot");P(V,ee,is,"∮","\\oint");P(V,ee,is,"∯","\\oiint");P(V,ee,is,"∰","\\oiiint");P(V,ee,is,"⨆","\\bigsqcup");P(V,ee,is,"∫","\\smallint");P(He,ee,g_,"…","\\textellipsis");P(V,ee,g_,"…","\\mathellipsis");P(He,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"⋯","\\@cdots",!0);P(V,ee,g_,"⋱","\\ddots",!0);P(V,ee,ve,"⋮","\\varvdots");P(He,ee,ve,"⋮","\\varvdots");P(V,ee,Cr,"ˊ","\\acute");P(V,ee,Cr,"ˋ","\\grave");P(V,ee,Cr,"¨","\\ddot");P(V,ee,Cr,"~","\\tilde");P(V,ee,Cr,"ˉ","\\bar");P(V,ee,Cr,"˘","\\breve");P(V,ee,Cr,"ˇ","\\check");P(V,ee,Cr,"^","\\hat");P(V,ee,Cr,"⃗","\\vec");P(V,ee,Cr,"˙","\\dot");P(V,ee,Cr,"˚","\\mathring");P(V,ee,Bt,"","\\@imath");P(V,ee,Bt,"","\\@jmath");P(V,ee,ve,"ı","ı");P(V,ee,ve,"ȷ","ȷ");P(He,ee,ve,"ı","\\i",!0);P(He,ee,ve,"ȷ","\\j",!0);P(He,ee,ve,"ß","\\ss",!0);P(He,ee,ve,"æ","\\ae",!0);P(He,ee,ve,"œ","\\oe",!0);P(He,ee,ve,"ø","\\o",!0);P(He,ee,ve,"Æ","\\AE",!0);P(He,ee,ve,"Œ","\\OE",!0);P(He,ee,ve,"Ø","\\O",!0);P(He,ee,Cr,"ˊ","\\'");P(He,ee,Cr,"ˋ","\\`");P(He,ee,Cr,"ˆ","\\^");P(He,ee,Cr,"˜","\\~");P(He,ee,Cr,"ˉ","\\=");P(He,ee,Cr,"˘","\\u");P(He,ee,Cr,"˙","\\.");P(He,ee,Cr,"¸","\\c");P(He,ee,Cr,"˚","\\r");P(He,ee,Cr,"ˇ","\\v");P(He,ee,Cr,"¨",'\\"');P(He,ee,Cr,"˝","\\H");P(He,ee,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,ee,ve,"–","--",!0);P(He,ee,ve,"–","\\textendash");P(He,ee,ve,"—","---",!0);P(He,ee,ve,"—","\\textemdash");P(He,ee,ve,"‘","`",!0);P(He,ee,ve,"‘","\\textquoteleft");P(He,ee,ve,"’","'",!0);P(He,ee,ve,"’","\\textquoteright");P(He,ee,ve,"“","``",!0);P(He,ee,ve,"“","\\textquotedblleft");P(He,ee,ve,"”","''",!0);P(He,ee,ve,"”","\\textquotedblright");P(V,ee,ve,"°","\\degree",!0);P(He,ee,ve,"°","\\degree");P(He,ee,ve,"°","\\textdegree",!0);P(V,ee,ve,"£","\\pounds");P(V,ee,ve,"£","\\mathsterling",!0);P(He,ee,ve,"£","\\pounds");P(He,ee,ve,"£","\\textsterling",!0);P(V,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var ow=0;ow{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new Pb(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},P3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},Cv={},Ev={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),F3(i,(x,S)=>{var v,b,w=q3(S),y=q3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},F3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof Pb||n instanceof m_&&n.hasClass("enclosing")?n:null},H3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return H3(s[s.length-1],"right");if(t==="left")return H3(s[0],"left")}}return n},q3=function(n,t){if(!n)return null;t&&(n=H3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(Cv[n.type]){var s=Cv[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function U3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=P3[t].fontName;return JS(i,o,r)?P3[t].variant:null};function dw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||dw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Ev[n.type])return Ev[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=U3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=U3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=U3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},qb=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),Ub=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new D3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Gb(e){var n=Wb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Wb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=Ub(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=Hb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?qb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Nv(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=Ub(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=qb(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=Ub(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=qb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Vb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Vb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Vb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Vb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var G3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(G3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=G3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===G3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},fw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},hw=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},W3=.008,t1={type:"kern",size:-1*W3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var H=M-S-y,q=Math.round(M*1e3),Y=_6t(d,Math.round(H*1e3)),G=new mu(d,Y),X=et(p/1e3),te=et(q/1e3),I=new ql([G],{width:X,height:te,viewBox:"0 0 "+p+" "+q}),L=gu([],[I],s);L.height=q/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(fw(_,m,i)),$.push(t1),l===null){var F=M-S-y+2*W3;$.push(hw(u,F,s))}else{var W=(M-S-y-C)/2+2*W3;$.push(hw(u,W,s)),$.push(t1),$.push(fw(l,m,i)),$.push(t1),$.push(hw(u,W,s))}$.push(t1),$.push(fw(o,m,i))}var U=s.havingBaseStyle(Yt.TEXT),Z=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[Z],U),Yt.TEXT,s,a)},_w=80,pw=.08,mw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+_w,n<1?i=1:n<1.4&&(i=.7),l=(1+a+pw)/i,u=(1+a)/i,o=mw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+_w)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+pw)/i,o=mw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+pw,u=n+a,_=Math.floor(1e3*n+a)+_w,o=mw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},V3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},gw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return V3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Kb(e,n){var t=Wb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Kb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Kb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Kb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Kb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Qb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Yb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ue;le=(oe=(ue=U)==null?void 0:ue.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),q.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Wb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Gb(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Wb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Gb(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Xb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Xb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Xb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Nv(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Vb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Nv(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=Nv(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=Ub(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=qb(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var vw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var K3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in K3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=K3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=q3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return Hb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return Hb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var bw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(yw.hasOwnProperty(e.text)){var t=yw[e.text].className||"";if(e.mode==="text"){var r=Hb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(bw.hasOwnProperty(e.text))return Ge(["mspace",bw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(yw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(bw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var D3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in D3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in D3)r=D3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class Fb{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class L3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof Fb||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var ow={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!ow[n]){var t=ow[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return ow[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",ee="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";P(V,ee,he,"≡","\\equiv",!0);P(V,ee,he,"≺","\\prec",!0);P(V,ee,he,"≻","\\succ",!0);P(V,ee,he,"∼","\\sim",!0);P(V,ee,he,"⊥","\\perp");P(V,ee,he,"⪯","\\preceq",!0);P(V,ee,he,"⪰","\\succeq",!0);P(V,ee,he,"≃","\\simeq",!0);P(V,ee,he,"∣","\\mid",!0);P(V,ee,he,"≪","\\ll",!0);P(V,ee,he,"≫","\\gg",!0);P(V,ee,he,"≍","\\asymp",!0);P(V,ee,he,"∥","\\parallel");P(V,ee,he,"⋈","\\bowtie",!0);P(V,ee,he,"⌣","\\smile",!0);P(V,ee,he,"⊑","\\sqsubseteq",!0);P(V,ee,he,"⊒","\\sqsupseteq",!0);P(V,ee,he,"≐","\\doteq",!0);P(V,ee,he,"⌢","\\frown",!0);P(V,ee,he,"∋","\\ni",!0);P(V,ee,he,"∝","\\propto",!0);P(V,ee,he,"⊢","\\vdash",!0);P(V,ee,he,"⊣","\\dashv",!0);P(V,ee,he,"∋","\\owns");P(V,ee,dm,".","\\ldotp");P(V,ee,dm,"⋅","\\cdotp");P(V,ee,dm,"⋅","·");P(He,ee,ve,"⋅","·");P(V,ee,ve,"#","\\#");P(He,ee,ve,"#","\\#");P(V,ee,ve,"&","\\&");P(He,ee,ve,"&","\\&");P(V,ee,ve,"ℵ","\\aleph",!0);P(V,ee,ve,"∀","\\forall",!0);P(V,ee,ve,"ℏ","\\hbar",!0);P(V,ee,ve,"∃","\\exists",!0);P(V,ee,ve,"∇","\\nabla",!0);P(V,ee,ve,"♭","\\flat",!0);P(V,ee,ve,"ℓ","\\ell",!0);P(V,ee,ve,"♮","\\natural",!0);P(V,ee,ve,"♣","\\clubsuit",!0);P(V,ee,ve,"℘","\\wp",!0);P(V,ee,ve,"♯","\\sharp",!0);P(V,ee,ve,"♢","\\diamondsuit",!0);P(V,ee,ve,"ℜ","\\Re",!0);P(V,ee,ve,"♡","\\heartsuit",!0);P(V,ee,ve,"ℑ","\\Im",!0);P(V,ee,ve,"♠","\\spadesuit",!0);P(V,ee,ve,"§","\\S",!0);P(He,ee,ve,"§","\\S");P(V,ee,ve,"¶","\\P",!0);P(He,ee,ve,"¶","\\P");P(V,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\textdagger");P(V,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\textdaggerdbl");P(V,ee,ui,"⎱","\\rmoustache",!0);P(V,ee,na,"⎰","\\lmoustache",!0);P(V,ee,ui,"⟯","\\rgroup",!0);P(V,ee,na,"⟮","\\lgroup",!0);P(V,ee,dt,"∓","\\mp",!0);P(V,ee,dt,"⊖","\\ominus",!0);P(V,ee,dt,"⊎","\\uplus",!0);P(V,ee,dt,"⊓","\\sqcap",!0);P(V,ee,dt,"∗","\\ast");P(V,ee,dt,"⊔","\\sqcup",!0);P(V,ee,dt,"◯","\\bigcirc",!0);P(V,ee,dt,"∙","\\bullet",!0);P(V,ee,dt,"‡","\\ddagger");P(V,ee,dt,"≀","\\wr",!0);P(V,ee,dt,"⨿","\\amalg");P(V,ee,dt,"&","\\And");P(V,ee,he,"⟵","\\longleftarrow",!0);P(V,ee,he,"⇐","\\Leftarrow",!0);P(V,ee,he,"⟸","\\Longleftarrow",!0);P(V,ee,he,"⟶","\\longrightarrow",!0);P(V,ee,he,"⇒","\\Rightarrow",!0);P(V,ee,he,"⟹","\\Longrightarrow",!0);P(V,ee,he,"↔","\\leftrightarrow",!0);P(V,ee,he,"⟷","\\longleftrightarrow",!0);P(V,ee,he,"⇔","\\Leftrightarrow",!0);P(V,ee,he,"⟺","\\Longleftrightarrow",!0);P(V,ee,he,"↦","\\mapsto",!0);P(V,ee,he,"⟼","\\longmapsto",!0);P(V,ee,he,"↗","\\nearrow",!0);P(V,ee,he,"↩","\\hookleftarrow",!0);P(V,ee,he,"↪","\\hookrightarrow",!0);P(V,ee,he,"↘","\\searrow",!0);P(V,ee,he,"↼","\\leftharpoonup",!0);P(V,ee,he,"⇀","\\rightharpoonup",!0);P(V,ee,he,"↙","\\swarrow",!0);P(V,ee,he,"↽","\\leftharpoondown",!0);P(V,ee,he,"⇁","\\rightharpoondown",!0);P(V,ee,he,"↖","\\nwarrow",!0);P(V,ee,he,"⇌","\\rightleftharpoons",!0);P(V,fe,he,"≮","\\nless",!0);P(V,fe,he,"","\\@nleqslant");P(V,fe,he,"","\\@nleqq");P(V,fe,he,"⪇","\\lneq",!0);P(V,fe,he,"≨","\\lneqq",!0);P(V,fe,he,"","\\@lvertneqq");P(V,fe,he,"⋦","\\lnsim",!0);P(V,fe,he,"⪉","\\lnapprox",!0);P(V,fe,he,"⊀","\\nprec",!0);P(V,fe,he,"⋠","\\npreceq",!0);P(V,fe,he,"⋨","\\precnsim",!0);P(V,fe,he,"⪹","\\precnapprox",!0);P(V,fe,he,"≁","\\nsim",!0);P(V,fe,he,"","\\@nshortmid");P(V,fe,he,"∤","\\nmid",!0);P(V,fe,he,"⊬","\\nvdash",!0);P(V,fe,he,"⊭","\\nvDash",!0);P(V,fe,he,"⋪","\\ntriangleleft");P(V,fe,he,"⋬","\\ntrianglelefteq",!0);P(V,fe,he,"⊊","\\subsetneq",!0);P(V,fe,he,"","\\@varsubsetneq");P(V,fe,he,"⫋","\\subsetneqq",!0);P(V,fe,he,"","\\@varsubsetneqq");P(V,fe,he,"≯","\\ngtr",!0);P(V,fe,he,"","\\@ngeqslant");P(V,fe,he,"","\\@ngeqq");P(V,fe,he,"⪈","\\gneq",!0);P(V,fe,he,"≩","\\gneqq",!0);P(V,fe,he,"","\\@gvertneqq");P(V,fe,he,"⋧","\\gnsim",!0);P(V,fe,he,"⪊","\\gnapprox",!0);P(V,fe,he,"⊁","\\nsucc",!0);P(V,fe,he,"⋡","\\nsucceq",!0);P(V,fe,he,"⋩","\\succnsim",!0);P(V,fe,he,"⪺","\\succnapprox",!0);P(V,fe,he,"≆","\\ncong",!0);P(V,fe,he,"","\\@nshortparallel");P(V,fe,he,"∦","\\nparallel",!0);P(V,fe,he,"⊯","\\nVDash",!0);P(V,fe,he,"⋫","\\ntriangleright");P(V,fe,he,"⋭","\\ntrianglerighteq",!0);P(V,fe,he,"","\\@nsupseteqq");P(V,fe,he,"⊋","\\supsetneq",!0);P(V,fe,he,"","\\@varsupsetneq");P(V,fe,he,"⫌","\\supsetneqq",!0);P(V,fe,he,"","\\@varsupsetneqq");P(V,fe,he,"⊮","\\nVdash",!0);P(V,fe,he,"⪵","\\precneqq",!0);P(V,fe,he,"⪶","\\succneqq",!0);P(V,fe,he,"","\\@nsubseteqq");P(V,fe,dt,"⊴","\\unlhd");P(V,fe,dt,"⊵","\\unrhd");P(V,fe,he,"↚","\\nleftarrow",!0);P(V,fe,he,"↛","\\nrightarrow",!0);P(V,fe,he,"⇍","\\nLeftarrow",!0);P(V,fe,he,"⇏","\\nRightarrow",!0);P(V,fe,he,"↮","\\nleftrightarrow",!0);P(V,fe,he,"⇎","\\nLeftrightarrow",!0);P(V,fe,he,"△","\\vartriangle");P(V,fe,ve,"ℏ","\\hslash");P(V,fe,ve,"▽","\\triangledown");P(V,fe,ve,"◊","\\lozenge");P(V,fe,ve,"Ⓢ","\\circledS");P(V,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(V,fe,ve,"∡","\\measuredangle",!0);P(V,fe,ve,"∄","\\nexists");P(V,fe,ve,"℧","\\mho");P(V,fe,ve,"Ⅎ","\\Finv",!0);P(V,fe,ve,"⅁","\\Game",!0);P(V,fe,ve,"‵","\\backprime");P(V,fe,ve,"▲","\\blacktriangle");P(V,fe,ve,"▼","\\blacktriangledown");P(V,fe,ve,"■","\\blacksquare");P(V,fe,ve,"⧫","\\blacklozenge");P(V,fe,ve,"★","\\bigstar");P(V,fe,ve,"∢","\\sphericalangle",!0);P(V,fe,ve,"∁","\\complement",!0);P(V,fe,ve,"ð","\\eth",!0);P(He,ee,ve,"ð","ð");P(V,fe,ve,"╱","\\diagup");P(V,fe,ve,"╲","\\diagdown");P(V,fe,ve,"□","\\square");P(V,fe,ve,"□","\\Box");P(V,fe,ve,"◊","\\Diamond");P(V,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(V,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(V,fe,ve,"ℶ","\\beth",!0);P(V,fe,ve,"ℸ","\\daleth",!0);P(V,fe,ve,"ℷ","\\gimel",!0);P(V,fe,ve,"ϝ","\\digamma",!0);P(V,fe,ve,"ϰ","\\varkappa");P(V,fe,na,"┌","\\@ulcorner",!0);P(V,fe,ui,"┐","\\@urcorner",!0);P(V,fe,na,"└","\\@llcorner",!0);P(V,fe,ui,"┘","\\@lrcorner",!0);P(V,fe,he,"≦","\\leqq",!0);P(V,fe,he,"⩽","\\leqslant",!0);P(V,fe,he,"⪕","\\eqslantless",!0);P(V,fe,he,"≲","\\lesssim",!0);P(V,fe,he,"⪅","\\lessapprox",!0);P(V,fe,he,"≊","\\approxeq",!0);P(V,fe,dt,"⋖","\\lessdot");P(V,fe,he,"⋘","\\lll",!0);P(V,fe,he,"≶","\\lessgtr",!0);P(V,fe,he,"⋚","\\lesseqgtr",!0);P(V,fe,he,"⪋","\\lesseqqgtr",!0);P(V,fe,he,"≑","\\doteqdot");P(V,fe,he,"≓","\\risingdotseq",!0);P(V,fe,he,"≒","\\fallingdotseq",!0);P(V,fe,he,"∽","\\backsim",!0);P(V,fe,he,"⋍","\\backsimeq",!0);P(V,fe,he,"⫅","\\subseteqq",!0);P(V,fe,he,"⋐","\\Subset",!0);P(V,fe,he,"⊏","\\sqsubset",!0);P(V,fe,he,"≼","\\preccurlyeq",!0);P(V,fe,he,"⋞","\\curlyeqprec",!0);P(V,fe,he,"≾","\\precsim",!0);P(V,fe,he,"⪷","\\precapprox",!0);P(V,fe,he,"⊲","\\vartriangleleft");P(V,fe,he,"⊴","\\trianglelefteq");P(V,fe,he,"⊨","\\vDash",!0);P(V,fe,he,"⊪","\\Vvdash",!0);P(V,fe,he,"⌣","\\smallsmile");P(V,fe,he,"⌢","\\smallfrown");P(V,fe,he,"≏","\\bumpeq",!0);P(V,fe,he,"≎","\\Bumpeq",!0);P(V,fe,he,"≧","\\geqq",!0);P(V,fe,he,"⩾","\\geqslant",!0);P(V,fe,he,"⪖","\\eqslantgtr",!0);P(V,fe,he,"≳","\\gtrsim",!0);P(V,fe,he,"⪆","\\gtrapprox",!0);P(V,fe,dt,"⋗","\\gtrdot");P(V,fe,he,"⋙","\\ggg",!0);P(V,fe,he,"≷","\\gtrless",!0);P(V,fe,he,"⋛","\\gtreqless",!0);P(V,fe,he,"⪌","\\gtreqqless",!0);P(V,fe,he,"≖","\\eqcirc",!0);P(V,fe,he,"≗","\\circeq",!0);P(V,fe,he,"≜","\\triangleq",!0);P(V,fe,he,"∼","\\thicksim");P(V,fe,he,"≈","\\thickapprox");P(V,fe,he,"⫆","\\supseteqq",!0);P(V,fe,he,"⋑","\\Supset",!0);P(V,fe,he,"⊐","\\sqsupset",!0);P(V,fe,he,"≽","\\succcurlyeq",!0);P(V,fe,he,"⋟","\\curlyeqsucc",!0);P(V,fe,he,"≿","\\succsim",!0);P(V,fe,he,"⪸","\\succapprox",!0);P(V,fe,he,"⊳","\\vartriangleright");P(V,fe,he,"⊵","\\trianglerighteq");P(V,fe,he,"⊩","\\Vdash",!0);P(V,fe,he,"∣","\\shortmid");P(V,fe,he,"∥","\\shortparallel");P(V,fe,he,"≬","\\between",!0);P(V,fe,he,"⋔","\\pitchfork",!0);P(V,fe,he,"∝","\\varpropto");P(V,fe,he,"◀","\\blacktriangleleft");P(V,fe,he,"∴","\\therefore",!0);P(V,fe,he,"∍","\\backepsilon");P(V,fe,he,"▶","\\blacktriangleright");P(V,fe,he,"∵","\\because",!0);P(V,fe,he,"⋘","\\llless");P(V,fe,he,"⋙","\\gggtr");P(V,fe,dt,"⊲","\\lhd");P(V,fe,dt,"⊳","\\rhd");P(V,fe,he,"≂","\\eqsim",!0);P(V,ee,he,"⋈","\\Join");P(V,fe,he,"≑","\\Doteq",!0);P(V,fe,dt,"∔","\\dotplus",!0);P(V,fe,dt,"∖","\\smallsetminus");P(V,fe,dt,"⋒","\\Cap",!0);P(V,fe,dt,"⋓","\\Cup",!0);P(V,fe,dt,"⩞","\\doublebarwedge",!0);P(V,fe,dt,"⊟","\\boxminus",!0);P(V,fe,dt,"⊞","\\boxplus",!0);P(V,fe,dt,"⋇","\\divideontimes",!0);P(V,fe,dt,"⋉","\\ltimes",!0);P(V,fe,dt,"⋊","\\rtimes",!0);P(V,fe,dt,"⋋","\\leftthreetimes",!0);P(V,fe,dt,"⋌","\\rightthreetimes",!0);P(V,fe,dt,"⋏","\\curlywedge",!0);P(V,fe,dt,"⋎","\\curlyvee",!0);P(V,fe,dt,"⊝","\\circleddash",!0);P(V,fe,dt,"⊛","\\circledast",!0);P(V,fe,dt,"⋅","\\centerdot");P(V,fe,dt,"⊺","\\intercal",!0);P(V,fe,dt,"⋒","\\doublecap");P(V,fe,dt,"⋓","\\doublecup");P(V,fe,dt,"⊠","\\boxtimes",!0);P(V,fe,he,"⇢","\\dashrightarrow",!0);P(V,fe,he,"⇠","\\dashleftarrow",!0);P(V,fe,he,"⇇","\\leftleftarrows",!0);P(V,fe,he,"⇆","\\leftrightarrows",!0);P(V,fe,he,"⇚","\\Lleftarrow",!0);P(V,fe,he,"↞","\\twoheadleftarrow",!0);P(V,fe,he,"↢","\\leftarrowtail",!0);P(V,fe,he,"↫","\\looparrowleft",!0);P(V,fe,he,"⇋","\\leftrightharpoons",!0);P(V,fe,he,"↶","\\curvearrowleft",!0);P(V,fe,he,"↺","\\circlearrowleft",!0);P(V,fe,he,"↰","\\Lsh",!0);P(V,fe,he,"⇈","\\upuparrows",!0);P(V,fe,he,"↿","\\upharpoonleft",!0);P(V,fe,he,"⇃","\\downharpoonleft",!0);P(V,ee,he,"⊶","\\origof",!0);P(V,ee,he,"⊷","\\imageof",!0);P(V,fe,he,"⊸","\\multimap",!0);P(V,fe,he,"↭","\\leftrightsquigarrow",!0);P(V,fe,he,"⇉","\\rightrightarrows",!0);P(V,fe,he,"⇄","\\rightleftarrows",!0);P(V,fe,he,"↠","\\twoheadrightarrow",!0);P(V,fe,he,"↣","\\rightarrowtail",!0);P(V,fe,he,"↬","\\looparrowright",!0);P(V,fe,he,"↷","\\curvearrowright",!0);P(V,fe,he,"↻","\\circlearrowright",!0);P(V,fe,he,"↱","\\Rsh",!0);P(V,fe,he,"⇊","\\downdownarrows",!0);P(V,fe,he,"↾","\\upharpoonright",!0);P(V,fe,he,"⇂","\\downharpoonright",!0);P(V,fe,he,"⇝","\\rightsquigarrow",!0);P(V,fe,he,"⇝","\\leadsto");P(V,fe,he,"⇛","\\Rrightarrow",!0);P(V,fe,he,"↾","\\restriction");P(V,ee,ve,"‘","`");P(V,ee,ve,"$","\\$");P(He,ee,ve,"$","\\$");P(He,ee,ve,"$","\\textdollar");P(V,ee,ve,"%","\\%");P(He,ee,ve,"%","\\%");P(V,ee,ve,"_","\\_");P(He,ee,ve,"_","\\_");P(He,ee,ve,"_","\\textunderscore");P(V,ee,ve,"∠","\\angle",!0);P(V,ee,ve,"∞","\\infty",!0);P(V,ee,ve,"′","\\prime");P(V,ee,ve,"△","\\triangle");P(V,ee,ve,"Γ","\\Gamma",!0);P(V,ee,ve,"Δ","\\Delta",!0);P(V,ee,ve,"Θ","\\Theta",!0);P(V,ee,ve,"Λ","\\Lambda",!0);P(V,ee,ve,"Ξ","\\Xi",!0);P(V,ee,ve,"Π","\\Pi",!0);P(V,ee,ve,"Σ","\\Sigma",!0);P(V,ee,ve,"Υ","\\Upsilon",!0);P(V,ee,ve,"Φ","\\Phi",!0);P(V,ee,ve,"Ψ","\\Psi",!0);P(V,ee,ve,"Ω","\\Omega",!0);P(V,ee,ve,"A","Α");P(V,ee,ve,"B","Β");P(V,ee,ve,"E","Ε");P(V,ee,ve,"Z","Ζ");P(V,ee,ve,"H","Η");P(V,ee,ve,"I","Ι");P(V,ee,ve,"K","Κ");P(V,ee,ve,"M","Μ");P(V,ee,ve,"N","Ν");P(V,ee,ve,"O","Ο");P(V,ee,ve,"P","Ρ");P(V,ee,ve,"T","Τ");P(V,ee,ve,"X","Χ");P(V,ee,ve,"¬","\\neg",!0);P(V,ee,ve,"¬","\\lnot");P(V,ee,ve,"⊤","\\top");P(V,ee,ve,"⊥","\\bot");P(V,ee,ve,"∅","\\emptyset");P(V,fe,ve,"∅","\\varnothing");P(V,ee,Bt,"α","\\alpha",!0);P(V,ee,Bt,"β","\\beta",!0);P(V,ee,Bt,"γ","\\gamma",!0);P(V,ee,Bt,"δ","\\delta",!0);P(V,ee,Bt,"ϵ","\\epsilon",!0);P(V,ee,Bt,"ζ","\\zeta",!0);P(V,ee,Bt,"η","\\eta",!0);P(V,ee,Bt,"θ","\\theta",!0);P(V,ee,Bt,"ι","\\iota",!0);P(V,ee,Bt,"κ","\\kappa",!0);P(V,ee,Bt,"λ","\\lambda",!0);P(V,ee,Bt,"μ","\\mu",!0);P(V,ee,Bt,"ν","\\nu",!0);P(V,ee,Bt,"ξ","\\xi",!0);P(V,ee,Bt,"ο","\\omicron",!0);P(V,ee,Bt,"π","\\pi",!0);P(V,ee,Bt,"ρ","\\rho",!0);P(V,ee,Bt,"σ","\\sigma",!0);P(V,ee,Bt,"τ","\\tau",!0);P(V,ee,Bt,"υ","\\upsilon",!0);P(V,ee,Bt,"ϕ","\\phi",!0);P(V,ee,Bt,"χ","\\chi",!0);P(V,ee,Bt,"ψ","\\psi",!0);P(V,ee,Bt,"ω","\\omega",!0);P(V,ee,Bt,"ε","\\varepsilon",!0);P(V,ee,Bt,"ϑ","\\vartheta",!0);P(V,ee,Bt,"ϖ","\\varpi",!0);P(V,ee,Bt,"ϱ","\\varrho",!0);P(V,ee,Bt,"ς","\\varsigma",!0);P(V,ee,Bt,"φ","\\varphi",!0);P(V,ee,dt,"∗","*",!0);P(V,ee,dt,"+","+");P(V,ee,dt,"−","-",!0);P(V,ee,dt,"⋅","\\cdot",!0);P(V,ee,dt,"∘","\\circ",!0);P(V,ee,dt,"÷","\\div",!0);P(V,ee,dt,"±","\\pm",!0);P(V,ee,dt,"×","\\times",!0);P(V,ee,dt,"∩","\\cap",!0);P(V,ee,dt,"∪","\\cup",!0);P(V,ee,dt,"∖","\\setminus",!0);P(V,ee,dt,"∧","\\land");P(V,ee,dt,"∨","\\lor");P(V,ee,dt,"∧","\\wedge",!0);P(V,ee,dt,"∨","\\vee",!0);P(V,ee,ve,"√","\\surd");P(V,ee,na,"⟨","\\langle",!0);P(V,ee,na,"∣","\\lvert");P(V,ee,na,"∥","\\lVert");P(V,ee,ui,"?","?");P(V,ee,ui,"!","!");P(V,ee,ui,"⟩","\\rangle",!0);P(V,ee,ui,"∣","\\rvert");P(V,ee,ui,"∥","\\rVert");P(V,ee,he,"=","=");P(V,ee,he,":",":");P(V,ee,he,"≈","\\approx",!0);P(V,ee,he,"≅","\\cong",!0);P(V,ee,he,"≥","\\ge");P(V,ee,he,"≥","\\geq",!0);P(V,ee,he,"←","\\gets");P(V,ee,he,">","\\gt",!0);P(V,ee,he,"∈","\\in",!0);P(V,ee,he,"","\\@not");P(V,ee,he,"⊂","\\subset",!0);P(V,ee,he,"⊃","\\supset",!0);P(V,ee,he,"⊆","\\subseteq",!0);P(V,ee,he,"⊇","\\supseteq",!0);P(V,fe,he,"⊈","\\nsubseteq",!0);P(V,fe,he,"⊉","\\nsupseteq",!0);P(V,ee,he,"⊨","\\models");P(V,ee,he,"←","\\leftarrow",!0);P(V,ee,he,"≤","\\le");P(V,ee,he,"≤","\\leq",!0);P(V,ee,he,"<","\\lt",!0);P(V,ee,he,"→","\\rightarrow",!0);P(V,ee,he,"→","\\to");P(V,fe,he,"≱","\\ngeq",!0);P(V,fe,he,"≰","\\nleq",!0);P(V,ee,Vl," ","\\ ");P(V,ee,Vl," ","\\space");P(V,ee,Vl," ","\\nobreakspace");P(He,ee,Vl," ","\\ ");P(He,ee,Vl," "," ");P(He,ee,Vl," ","\\space");P(He,ee,Vl," ","\\nobreakspace");P(V,ee,Vl,"","\\nobreak");P(V,ee,Vl,"","\\allowbreak");P(V,ee,dm,",",",");P(V,ee,dm,";",";");P(V,fe,dt,"⊼","\\barwedge",!0);P(V,fe,dt,"⊻","\\veebar",!0);P(V,ee,dt,"⊙","\\odot",!0);P(V,ee,dt,"⊕","\\oplus",!0);P(V,ee,dt,"⊗","\\otimes",!0);P(V,ee,ve,"∂","\\partial",!0);P(V,ee,dt,"⊘","\\oslash",!0);P(V,fe,dt,"⊚","\\circledcirc",!0);P(V,fe,dt,"⊡","\\boxdot",!0);P(V,ee,dt,"△","\\bigtriangleup");P(V,ee,dt,"▽","\\bigtriangledown");P(V,ee,dt,"†","\\dagger");P(V,ee,dt,"⋄","\\diamond");P(V,ee,dt,"⋆","\\star");P(V,ee,dt,"◃","\\triangleleft");P(V,ee,dt,"▹","\\triangleright");P(V,ee,na,"{","\\{");P(He,ee,ve,"{","\\{");P(He,ee,ve,"{","\\textbraceleft");P(V,ee,ui,"}","\\}");P(He,ee,ve,"}","\\}");P(He,ee,ve,"}","\\textbraceright");P(V,ee,na,"{","\\lbrace");P(V,ee,ui,"}","\\rbrace");P(V,ee,na,"[","\\lbrack",!0);P(He,ee,ve,"[","\\lbrack",!0);P(V,ee,ui,"]","\\rbrack",!0);P(He,ee,ve,"]","\\rbrack",!0);P(V,ee,na,"(","\\lparen",!0);P(V,ee,ui,")","\\rparen",!0);P(He,ee,ve,"<","\\textless",!0);P(He,ee,ve,">","\\textgreater",!0);P(V,ee,na,"⌊","\\lfloor",!0);P(V,ee,ui,"⌋","\\rfloor",!0);P(V,ee,na,"⌈","\\lceil",!0);P(V,ee,ui,"⌉","\\rceil",!0);P(V,ee,ve,"\\","\\backslash");P(V,ee,ve,"∣","|");P(V,ee,ve,"∣","\\vert");P(He,ee,ve,"|","\\textbar",!0);P(V,ee,ve,"∥","\\|");P(V,ee,ve,"∥","\\Vert");P(He,ee,ve,"∥","\\textbardbl");P(He,ee,ve,"~","\\textasciitilde");P(He,ee,ve,"\\","\\textbackslash");P(He,ee,ve,"^","\\textasciicircum");P(V,ee,he,"↑","\\uparrow",!0);P(V,ee,he,"⇑","\\Uparrow",!0);P(V,ee,he,"↓","\\downarrow",!0);P(V,ee,he,"⇓","\\Downarrow",!0);P(V,ee,he,"↕","\\updownarrow",!0);P(V,ee,he,"⇕","\\Updownarrow",!0);P(V,ee,is,"∐","\\coprod");P(V,ee,is,"⋁","\\bigvee");P(V,ee,is,"⋀","\\bigwedge");P(V,ee,is,"⨄","\\biguplus");P(V,ee,is,"⋂","\\bigcap");P(V,ee,is,"⋃","\\bigcup");P(V,ee,is,"∫","\\int");P(V,ee,is,"∫","\\intop");P(V,ee,is,"∬","\\iint");P(V,ee,is,"∭","\\iiint");P(V,ee,is,"∏","\\prod");P(V,ee,is,"∑","\\sum");P(V,ee,is,"⨂","\\bigotimes");P(V,ee,is,"⨁","\\bigoplus");P(V,ee,is,"⨀","\\bigodot");P(V,ee,is,"∮","\\oint");P(V,ee,is,"∯","\\oiint");P(V,ee,is,"∰","\\oiiint");P(V,ee,is,"⨆","\\bigsqcup");P(V,ee,is,"∫","\\smallint");P(He,ee,g_,"…","\\textellipsis");P(V,ee,g_,"…","\\mathellipsis");P(He,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"⋯","\\@cdots",!0);P(V,ee,g_,"⋱","\\ddots",!0);P(V,ee,ve,"⋮","\\varvdots");P(He,ee,ve,"⋮","\\varvdots");P(V,ee,Cr,"ˊ","\\acute");P(V,ee,Cr,"ˋ","\\grave");P(V,ee,Cr,"¨","\\ddot");P(V,ee,Cr,"~","\\tilde");P(V,ee,Cr,"ˉ","\\bar");P(V,ee,Cr,"˘","\\breve");P(V,ee,Cr,"ˇ","\\check");P(V,ee,Cr,"^","\\hat");P(V,ee,Cr,"⃗","\\vec");P(V,ee,Cr,"˙","\\dot");P(V,ee,Cr,"˚","\\mathring");P(V,ee,Bt,"","\\@imath");P(V,ee,Bt,"","\\@jmath");P(V,ee,ve,"ı","ı");P(V,ee,ve,"ȷ","ȷ");P(He,ee,ve,"ı","\\i",!0);P(He,ee,ve,"ȷ","\\j",!0);P(He,ee,ve,"ß","\\ss",!0);P(He,ee,ve,"æ","\\ae",!0);P(He,ee,ve,"œ","\\oe",!0);P(He,ee,ve,"ø","\\o",!0);P(He,ee,ve,"Æ","\\AE",!0);P(He,ee,ve,"Œ","\\OE",!0);P(He,ee,ve,"Ø","\\O",!0);P(He,ee,Cr,"ˊ","\\'");P(He,ee,Cr,"ˋ","\\`");P(He,ee,Cr,"ˆ","\\^");P(He,ee,Cr,"˜","\\~");P(He,ee,Cr,"ˉ","\\=");P(He,ee,Cr,"˘","\\u");P(He,ee,Cr,"˙","\\.");P(He,ee,Cr,"¸","\\c");P(He,ee,Cr,"˚","\\r");P(He,ee,Cr,"ˇ","\\v");P(He,ee,Cr,"¨",'\\"');P(He,ee,Cr,"˝","\\H");P(He,ee,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,ee,ve,"–","--",!0);P(He,ee,ve,"–","\\textendash");P(He,ee,ve,"—","---",!0);P(He,ee,ve,"—","\\textemdash");P(He,ee,ve,"‘","`",!0);P(He,ee,ve,"‘","\\textquoteleft");P(He,ee,ve,"’","'",!0);P(He,ee,ve,"’","\\textquoteright");P(He,ee,ve,"“","``",!0);P(He,ee,ve,"“","\\textquotedblleft");P(He,ee,ve,"”","''",!0);P(He,ee,ve,"”","\\textquotedblright");P(V,ee,ve,"°","\\degree",!0);P(He,ee,ve,"°","\\degree");P(He,ee,ve,"°","\\textdegree",!0);P(V,ee,ve,"£","\\pounds");P(V,ee,ve,"£","\\mathsterling",!0);P(He,ee,ve,"£","\\pounds");P(He,ee,ve,"£","\\textsterling",!0);P(V,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var lw=0;lw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new Fb(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},F3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},Ev={},Nv={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),H3(i,(x,S)=>{var v,b,w=U3(S),y=U3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},H3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof Fb||n instanceof m_&&n.hasClass("enclosing")?n:null},q3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return q3(s[s.length-1],"right");if(t==="left")return q3(s[0],"left")}}return n},U3=function(n,t){if(!n)return null;t&&(n=q3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(Ev[n.type]){var s=Ev[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function G3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=F3[t].fontName;return JS(i,o,r)?F3[t].variant:null};function fw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||fw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Nv[n.type])return Nv[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=G3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=G3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=G3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ub=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),Gb=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new L3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new L3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Wb(e){var n=Vb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Vb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=Gb(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=qb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?Ub(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=zv(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=Gb(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=Ub(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=Gb(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=Ub(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Kb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Kb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Kb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Kb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var W3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(W3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=W3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===W3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},hw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},_w=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},V3=.008,t1={type:"kern",size:-1*V3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var H=M-S-y,q=Math.round(M*1e3),Y=_6t(d,Math.round(H*1e3)),G=new mu(d,Y),X=et(p/1e3),te=et(q/1e3),I=new ql([G],{width:X,height:te,viewBox:"0 0 "+p+" "+q}),L=gu([],[I],s);L.height=q/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(hw(_,m,i)),$.push(t1),l===null){var F=M-S-y+2*V3;$.push(_w(u,F,s))}else{var W=(M-S-y-C)/2+2*V3;$.push(_w(u,W,s)),$.push(t1),$.push(hw(l,m,i)),$.push(t1),$.push(_w(u,W,s))}$.push(t1),$.push(hw(o,m,i))}var U=s.havingBaseStyle(Yt.TEXT),Z=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[Z],U),Yt.TEXT,s,a)},pw=80,mw=.08,gw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+pw,n<1?i=1:n<1.4&&(i=.7),l=(1+a+mw)/i,u=(1+a)/i,o=gw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+pw)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+mw)/i,o=gw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+mw,u=n+a,_=Math.floor(1e3*n+a)+pw,o=gw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},K3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},vw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return K3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Qb(e,n){var t=Vb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Qb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Qb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Qb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Qb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Yb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Xb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ue;le=(oe=(ue=U)==null?void 0:ue.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),q.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Vb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Wb(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Vb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Wb(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Zb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Zb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Zb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=zv(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Kb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=zv(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=zv(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=Gb(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=Ub(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var bw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var Q3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in Q3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=Q3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=Q3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=U3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return qb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return qb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var yw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},xw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(xw.hasOwnProperty(e.text)){var t=xw[e.text].className||"";if(e.mode==="text"){var r=qb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(yw.hasOwnProperty(e.text))return Ge(["mspace",yw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(xw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(yw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r ]`,CSt="\\\\[a-zA-Z@]+",ESt="\\\\[^\uD800-\uDFFF]",NSt="("+CSt+")"+aP+"*",zSt=`\\\\( |[ \r ]+ -?)[ \r ]*`,Q3="[̀-ͯ]",jSt=new RegExp(Q3+"+$"),TSt="("+aP+"+)|"+(zSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Q3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Q3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+NSt)+("|"+ESt+")");class HT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(TSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Yi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Yi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class ASt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var RSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var qT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=qT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=qT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},MSt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in UT?n=UT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&MSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new ASt(RSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new HT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new HT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var GT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),xw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Zb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new DSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Zb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Ob(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` +?)[ \r ]*`,Y3="[̀-ͯ]",jSt=new RegExp(Y3+"+$"),TSt="("+aP+"+)|"+(zSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Y3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Y3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+NSt)+("|"+ESt+")");class HT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(TSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Yi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Yi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class ASt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var RSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var qT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=qT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=qT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},MSt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in UT?n=UT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&MSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new ASt(RSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new HT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new HT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var GT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ww={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Jb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new DSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Jb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Ib(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` `:" ")+i.indentLines(i.containerFlow(r,o.current()),n?pP:mkt))),u(),l}}function mkt(e,n,t){return n===0?e:pP(e,n,t)}function pP(e,n,t){return(t?"":" ")+e}const gkt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mP.peek=wkt;function vkt(){return{canContainEols:["delete"],enter:{strikethrough:ykt},exit:{strikethrough:xkt}}}function bkt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gkt}],handlers:{delete:mP}}}function ykt(e){this.enter({type:"delete",children:[]},e)}function xkt(e){this.exit(e)}function mP(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function wkt(){return"~"}function Skt(e){return e.length}function kkt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||Skt,i=[],a=[],o=[],l=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++bl[b])&&(l[b]=y)}S.push(w)}a[_]=S,o[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dl[d]&&(l[d]=w),m[d]=w),p[d]=y}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),Nkt);return s(),a}function Nkt(e,n,t){return">"+(t?"":" ")+e}function zkt(e,n){return YT(e,n.inConstruct,!0)&&!YT(e,n.notInConstruct,!1)}function YT(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":` -`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function Dkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function bp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zv(e,n,t){const r=Kh(e),s=Kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vP.peek=Lkt;function vP(e,n,t,r){const s=Dkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=zv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Lkt(e,n,t){return t.options.emphasis||"*"}function Okt(e,n){let t=!1;return $S(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,w3}),!!((!e.depth||e.depth<3)&&GS(e)&&(n.options.setext||t))}function Ikt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Okt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` +`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function Dkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function bp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function jv(e,n,t){const r=Kh(e),s=Kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vP.peek=Lkt;function vP(e,n,t,r){const s=Dkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=jv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=jv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Lkt(e,n,t){return t.options.emphasis||"*"}function Okt(e,n){let t=!1;return $S(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,S3}),!!((!e.depth||e.depth<3)&&GS(e)&&(n.options.setext||t))}function Ikt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Okt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` `,after:` `});return d(),_(),p+` `+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` `))+1))}const a="#".repeat(s),o=t.enter("headingAtx"),l=t.enter("phrasing");i.move(a+" ");let u=t.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=bp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}bP.peek=Bkt;function bP(e){return e.value||""}function Bkt(){return"<"}yP.peek=$kt;function yP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function $kt(){return"!"}xP.peek=Pkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pkt(){return"!"}wP.peek=Fkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Hkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Hkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=qkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function qkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ukt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Wkt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Gkt(t):hk(t);const o=e.ordered?a==="."?")":".":Ukt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Qkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Ykt=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xkt(e,n,t,r){return(e.children.some(function(a){return Ykt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zkt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=Jkt;function NP(e,n,t,r){const s=Zkt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=zv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Jkt(e,n,t){return t.options.strong||"*"}function e7t(e,n,t,r){return t.safe(e.value,r)}function t7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(t7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Ekt,break:XT,code:Akt,definition:Mkt,emphasis:vP,hardBreak:XT,heading:Ikt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Wkt,listItem:Kkt,paragraph:Qkt,root:Xkt,strong:NP,text:e7t,thematicBreak:n7t};function r7t(){return{enter:{table:s7t,tableData:ZT,tableHeader:ZT,tableRow:a7t},exit:{codeText:o7t,table:i7t,tableData:Cw,tableHeader:Cw,tableRow:Cw}}}function s7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function i7t(e){this.exit(e),this.data.inTable=void 0}function a7t(e){this.enter({type:"tableRow",children:[]},e)}function Cw(e){this.exit(e)}function ZT(e){this.enter({type:"tableCell",children:[]},e)}function o7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function l7t(e,n){return n==="|"?n:e}function c7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=bp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}bP.peek=Bkt;function bP(e){return e.value||""}function Bkt(){return"<"}yP.peek=$kt;function yP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function $kt(){return"!"}xP.peek=Pkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pkt(){return"!"}wP.peek=Fkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Hkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Hkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=qkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function qkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ukt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Wkt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Gkt(t):hk(t);const o=e.ordered?a==="."?")":".":Ukt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Qkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Ykt=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xkt(e,n,t,r){return(e.children.some(function(a){return Ykt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zkt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=Jkt;function NP(e,n,t,r){const s=Zkt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=jv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=jv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Jkt(e,n,t){return t.options.strong||"*"}function e7t(e,n,t,r){return t.safe(e.value,r)}function t7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(t7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Ekt,break:XT,code:Akt,definition:Mkt,emphasis:vP,hardBreak:XT,heading:Ikt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Wkt,listItem:Kkt,paragraph:Qkt,root:Xkt,strong:NP,text:e7t,thematicBreak:n7t};function r7t(){return{enter:{table:s7t,tableData:ZT,tableHeader:ZT,tableRow:a7t},exit:{codeText:o7t,table:i7t,tableData:Ew,tableHeader:Ew,tableRow:Ew}}}function s7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function i7t(e){this.exit(e),this.data.inTable=void 0}function a7t(e){this.enter({type:"tableRow",children:[]},e)}function Ew(e){this.exit(e)}function ZT(e){this.enter({type:"tableCell",children:[]},e)}function o7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function l7t(e,n){return n==="|"?n:e}function c7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:o}};function a(m,x,S,v){return u(_(m,S,v),m.align)}function o(m,x,S,v){const b=d(m,S,v),w=u([b]);return w.slice(0,w.indexOf(` -`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,H=$==="tableHead"||$==="tableRow"?N:l;return H===N&&r.parser.lazy[r.now().line]?t(O):H(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,H=$==="tableHead"||$==="tableRow"?N:l;return H===N&&r.parser.lazy[r.now().line]?t(O):H(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,l){const u=i.value||"",_=o.createTracker(l),d="$".repeat(Math.max(gP(u,"$")+1,2)),p=o.enter("mathFlow");let m=_.move(d);if(i.meta){const x=o.enter("mathFlowMeta");m+=_.move(o.safe(i.meta,{after:` `,before:m,encode:["$"],..._.current()})),x()}return m+=_.move(` `),u&&(m+=_.move(u+` `)),m+=_.move(d),p(),m}function r(i,a,o){let l=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const _="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++dt)return null;try{return Tt.highlight(e,n).children}catch{return null}}function PP(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(PP)},n)}function iCt(e,n,t=3e5){var r;return((r=$P(e,n,t))==null?void 0:r.map(PP))??e}function FP(e,n,t=3e5){const r=$P(e,n,t);if(!r)return e.split(` `);const s=[];let i=[];const a=[];let o=0;const l=_=>{let d=_;for(let p=a.length-1;p>=0;p--)d=f.jsx("span",{className:a[p],children:d},o++);i.push(d)},u=_=>{var d;if(_.type==="text"){(_.value??"").split(` -`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&l(p)});return}_.type==="element"&&(a.push((((d=_.properties)==null?void 0:d.className)??[]).join(" ")),(_.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function HP(e){return Array.isArray(e)?e.length===0:e===""}const nA=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Zh(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function yp(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function X3(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const l=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!l)break;r+=l[0].length,t+=l[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function aCt(e,n){const t=e[n];if(t!=="`"&&t!=="~"||yp(e,n)||Zh(e,n,t)<3)return!1;const r=e.lastIndexOf(` +`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&l(p)});return}_.type==="element"&&(a.push((((d=_.properties)==null?void 0:d.className)??[]).join(" ")),(_.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function HP(e){return Array.isArray(e)?e.length===0:e===""}const nA=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Zh(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function yp(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function Z3(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const l=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!l)break;r+=l[0].length,t+=l[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function aCt(e,n){const t=e[n];if(t!=="`"&&t!=="~"||yp(e,n)||Zh(e,n,t)<3)return!1;const r=e.lastIndexOf(` `,n-1)+1,s=e.indexOf(` -`,n),i=e.slice(r,s===-1?e.length:s),a=X3(i);return a.indentation<=3&&r+a.offset===n}function oCt(e,n){const t=e[n],r=Zh(e,n,t),s=e.lastIndexOf(` +`,n),i=e.slice(r,s===-1?e.length:s),a=Z3(i);return a.indentation<=3&&r+a.offset===n}function oCt(e,n){const t=e[n],r=Zh(e,n,t),s=e.lastIndexOf(` `,n-1)+1,i=e.indexOf(` -`,n),a=X3(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` +`,n),a=Z3(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` `,n+r);if(o===-1)return e.length;for(o+=1;o=a.listIndent&&d.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return l===-1?e.length:l+1;if(l===-1)return e.length;o=l+1}return e.length}function lCt(e,n,t){const r=Zh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function uCt(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function fCt(e,{predictMath:n=!1}={}){const t=uCt(e),r=new Set,s=new Set;for(let u=0;u=a.listIndent&&d.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return l===-1?e.length:l+1;if(l===-1)return e.length;o=l+1}return e.length}function lCt(e,n,t){const r=Zh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function uCt(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function fCt(e,{predictMath:n=!1}={}){const t=uCt(e),r=new Set,s=new Set;for(let u=0;u`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Wr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:s6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(db,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Ew(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Ew(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Wr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Wr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(xv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const l=i?g3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Wr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const jv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` -`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${jv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${jv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};ob(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Vr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Ur,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Jb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),Z3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Nw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?a6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:M4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:o6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():i6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),sb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Nw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Nw(o).variant,children:Nw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():d6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):u6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Vr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Jb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Gr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Vr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?h6():tb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Gr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Gr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Vr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():l6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:f6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Vr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Jb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():l6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Gr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[d6(),f.jsx(Gr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Gr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Vr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Jb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Gr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:f6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:M4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:M4()}):f.jsx(Pt,{variant:"warning",children:tb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ey={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],zw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},J3=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=zw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||zw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),zw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ey[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?l6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":J3.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ey[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||J3.includes(e.id)?h6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ey[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ey[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Ur,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Vr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!J3.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:h6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Vr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():tb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():i6(),f.jsx(Gr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:tb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Vr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:d6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Jb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Gr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function e5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){e5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){e5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:C4({name:Ne(e)}),"aria-label":C4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){e5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Gr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Ur,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Vr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},jw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?n6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=jw[n.channel])==null?void 0:d.call(jw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Vr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?n6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=v6(),t=ct(n),r=t.data??null,s=x=>{Vr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Vr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():R4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:j4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Vr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(v6()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(()=>m(!1)).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??c6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):u6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:Z3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Gr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Tw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Tw[e])==null?void 0:n.call(Tw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const t5=e=>e==="running"||e==="starting";function d8t(e){return t5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ib,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>t5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!t5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:_6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:_6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Tv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function n5(e){return`${e.plugin?`${Tv(e.plugin)}: `:""}${Tv(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Aw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||n5(r).localeCompare(n5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:n5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function r5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(Tv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),Tv(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` -`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const s5=6.5,pA=2*Math.PI*s5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:s5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Av="!";function mA(e){return e.startsWith(Av)?e.slice(Av.length).trim():null}function T8t(e){return e.startsWith(Av)?e.slice(Av.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` +`,u+3),p=d===-1?e.length:d;/^[ \t]*$/.test(e.slice(_,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Vr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:i6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(fb,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Nw(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Nw(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Vr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Vr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(wv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` +`)))return f.jsx("code",{className:s,...r,children:t});const l=i?v3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Vr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const Tv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` +`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${Tv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Tv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};lb(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Pr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),ey="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),J3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function zw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?o6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:D4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:l6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():a6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),ib(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${zw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:zw(o).variant,children:zw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():f6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):d6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Pr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${ey} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Wr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Pr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?_6():nb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Wr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Wr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Pr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():c6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Pr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:ey,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():c6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Wr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[f6(),f.jsx(Wr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Wr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Pr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:ey,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Wr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:h6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:D4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:D4()}):f.jsx(Pt,{variant:"warning",children:nb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ty={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],jw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},e5=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=jw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||jw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),jw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ty[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?c6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":e5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ty[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||e5.includes(e.id)?_6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ty[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ty[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Gr,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Pr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!e5.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:_6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Pr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():nb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():a6(),f.jsx(Wr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:nb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Pr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:f6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:ey,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Wr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function t5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){t5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){t5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:E4({name:Ne(e)}),"aria-label":E4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){t5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Gr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Pr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},Tw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?r6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=Tw[n.channel])==null?void 0:d.call(Tw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Pr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?r6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=ov(),t=ct(n),r=t.data??null,s=x=>{Pr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Pr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:T4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Pr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(ov()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(ce=>{Pr(ov().queryKey,ce),m(!1)}).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??u6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):d6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Wr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Aw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Aw[e])==null?void 0:n.call(Aw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const n5=e=>e==="running"||e==="starting";function d8t(e){return n5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ab,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>n5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!n5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:p6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:p6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Av(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function r5(e){return`${e.plugin?`${Av(e.plugin)}: `:""}${Av(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Rw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||r5(r).localeCompare(r5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:r5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function s5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(Av(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),Av(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` +`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const i5=6.5,pA=2*Math.PI*i5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Rv="!";function mA(e){return e.startsWith(Rv)?e.slice(Rv.length).trim():null}function T8t(e){return e.startsWith(Rv)?e.slice(Rv.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` ${t} ${e.replace(/^\n|\n$/g,"")} ${t} -`}function i5(e,n){return n?` +`}function a5(e,n){return n?` \\[ ${e} @@ -1010,7 +1010,7 @@ ${e} `:`\\(${e}\\)`}function D8t(e,n){const t=n.trim().split(` `),r=" ".repeat(e.length+1);return[`${e} ${t[0]??""}`,...t.slice(1).map(s=>s?`${r}${s}`:"")].join(` `)}function L8t(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,l)=>a[l]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` -`)}function O8t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function I8t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function B8t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const uF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",gk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,dF=1024,fF=2e4,Rw=8,s1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function gA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Mw(e,n){return gA(e).compareBoundaryPoints(Range.START_TO_START,gA(n))<0}function vA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const $8t=new Set(["A","B","CODE","EM","I","STRONG"]);function P8t(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if($8t.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function F8t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function H8t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Mw(s,u)&&t.append(vA(s,u)),t.append(o.cloneNode(!0)),s=_,!Mw(s,r))break}return i.length===0?t.append(e.cloneContents()):Mw(s,r)&&t.append(vA(s,r)),P8t(e,t),F8t(t),t}function q8t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>xp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` +`)}function O8t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function I8t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function B8t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const uF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",gk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,dF=1024,fF=2e4,Mw=8,s1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function gA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Dw(e,n){return gA(e).compareBoundaryPoints(Range.START_TO_START,gA(n))<0}function vA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const $8t=new Set(["A","B","CODE","EM","I","STRONG"]);function P8t(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if($8t.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function F8t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function H8t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Dw(s,u)&&t.append(vA(s,u)),t.append(o.cloneNode(!0)),s=_,!Dw(s,r))break}return i.length===0?t.append(e.cloneContents()):Dw(s,r)&&t.append(vA(s,r)),P8t(e,t),F8t(t),t}function q8t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>xp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` ${L8t(n,!!e.querySelector("tr:first-child th"))} @@ -1021,7 +1021,7 @@ ${hF(d).trim()} ${i.join(` `)} -`}function xp(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return A8t(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(xp).join("");if(e.matches(".katex-display")){const l=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return l?i5(l,!0):""}if(e.matches(".katex")){const l=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return l?i5(l,!1):""}if(e.tagName==="BR")return` +`}function xp(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return A8t(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(xp).join("");if(e.matches(".katex-display")){const l=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return l?a5(l,!0):""}if(e.matches(".katex")){const l=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return l?a5(l,!1):""}if(e.tagName==="BR")return` `;if(e.tagName==="TABLE")return q8t(e);if(e.matches("UL, OL"))return hF(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return R8t(e.textContent??"");if(e.tagName==="PRE")return M8t(e.textContent??"");const n=Array.from(e.childNodes).map(xp).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const l=e.getAttribute("href");return l?`[${n}](${l})`:n}if(e.tagName==="LI")return`${n.trim()} `;if(e.matches("TH, TD"))return`${n.trim()} | `;if(e.tagName==="TR")return`${n.replace(/ \| $/,"")} `;if(e.tagName==="BLOCKQUOTE")return` @@ -1042,31 +1042,31 @@ ${n.trim()} `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim()||n}function bA(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function G8t(e,n){var s,i,a,o;if(!I8t(e))return;const t=bA(e);if(t.length<8)return;let r;for(const l of n.querySelectorAll(".msg-assistant > .md .katex")){const _=[(s=l.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=l.querySelector(".katex-html"))==null?void 0:i.textContent,l.textContent].filter(x=>!!x).map(bA).find(x=>B8t(x,t));if(!_)continue;const d=(o=(a=l.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!d)continue;const p=!!l.closest(".katex-display"),m={markdown:i5(d,p).trim(),delta:Math.abs(_.length-t.length)};(!r||m.delta .md .katex")){const _=[(s=l.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=l.querySelector(".katex-html"))==null?void 0:i.textContent,l.textContent].filter(x=>!!x).map(bA).find(x=>B8t(x,t));if(!_)continue;const d=(o=(a=l.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!d)continue;const p=!!l.closest(".katex-display"),m={markdown:a5(d,p).trim(),delta:Math.abs(_.length-t.length)};(!r||m.deltaj.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(j=>j.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),E=34,N=74,T=y>=E+Rw?y-E-Rw:C+Rw;return{text:U8t(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function V8t(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?W8t(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function K8t(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(s1);return}const t=new Highlight(...n);return CSS.highlights.set(s1,t),()=>{CSS.highlights.get(s1)===t&&CSS.highlights.delete(s1)}},[e])}function Q8t({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?G8t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Fo,{text:t??e.text})})}function Y8t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Ide()}),f.jsx(Q8t,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ude(),"aria-label":eY({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Ur,{size:13})})]},t.id))}function vk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=so(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(XO,{size:l?13:14,className:"text-muted"}),e.length===1?Yae():nie({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:bE(),"aria-label":bE(),onClick:t,children:f.jsx(Ur,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Mde(),children:f.jsx(Y8t,{annotations:e,onRemove:r?m:void 0})})]})}function X8t(e){return f.jsx(vk,{...e,variant:"composer"})}const Z8t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),yA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),J8t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),e9t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),a5="prompt-actions flex flex-wrap gap-2",xA=[],t9t=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Dw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function n9t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Lw(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Ow(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function r9t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function _h(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=dF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function ty(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!d)return null;const p=H8t(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(j=>j.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),E=34,N=74,T=y>=E+Mw?y-E-Mw:C+Mw;return{text:U8t(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function V8t(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?W8t(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function K8t(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(s1);return}const t=new Highlight(...n);return CSS.highlights.set(s1,t),()=>{CSS.highlights.get(s1)===t&&CSS.highlights.delete(s1)}},[e])}function Q8t({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?G8t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Fo,{text:t??e.text})})}function Y8t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Ide()}),f.jsx(Q8t,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ude(),"aria-label":eY({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Gr,{size:13})})]},t.id))}function vk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=so(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(XO,{size:l?13:14,className:"text-muted"}),e.length===1?Yae():nie({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:bE(),"aria-label":bE(),onClick:t,children:f.jsx(Gr,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Mde(),children:f.jsx(Y8t,{annotations:e,onRemove:r?m:void 0})})]})}function X8t(e){return f.jsx(vk,{...e,variant:"composer"})}const Z8t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),yA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),J8t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),e9t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),o5="prompt-actions flex flex-wrap gap-2",xA=[],t9t=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Lw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function n9t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Ow(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Iw(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function r9t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function _h(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=dF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function ny(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` `).trim()}function s9t(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function i9t(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Mxt(r),_F(r)}function _F(e){return o9t(e).replace(/[\t\r ]+/g," ").trim()}function a9t(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&mF(s)?{ref:r,path:s}:null}function u9t(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function wA(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function d9t(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const l=wA(s,o);if(!l)return null;s=l}return s?wA(s,e):e}const ko="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",f9t=new RegExp(`\\bchat_(${ko})\\b`,"gi"),Nd=`(?:${ko}|[0-9a-f]{8})`;function ph(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,d=null,p=!1;for(let m=u;m{let _=!1;for(let d=u;dOxt(t.raw,n))}function ya(e,n){return ny(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function o5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ny(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:o5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ny(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:o5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Ow(i,"targetIds")),_=_h(Ow(i,"runTargetIds")),d=_h(Ow(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Lw(i,"search_query","q"),N=Lw(i,"image_query","q"),T=Lw(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),H=ny(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),q=H?Iee():kZ(),Y=H?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Dw(X.path);return{kind:re?"skill":"read",label:re?b2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const te=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=te>=0?O[te]:null,L=I?l9t(I):null,F=L?d9t(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const re=Dw(F);return{kind:re?"skill":"read",label:re?b2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?x2({pattern:Ne(re)}):y2(),searchPattern:re??void 0}}const U=O.find(re=>(re==null?void 0:re.name)==="git"),Z=U==null?void 0:U.args[0];if(Z==="grep"){const re=U==null?void 0:U.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?x2({pattern:Ne(re)}):y2(),searchPattern:re}}if(Z==="status")return{kind:"command",label:mle()};if(Z==="diff")return{kind:"command",label:Ede()};if(Z==="log")return{kind:"command",label:Kue()};const ce=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return ce("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||ce("typecheck")?{kind:"command",label:Ole()}:ce("lint")?{kind:"command",label:ile()}:ce("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Dw(p):null;return N?{kind:"skill",label:b2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?x2({pattern:Ne(E)}):y2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Rv({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Iw({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Wr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function l5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Wr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Wr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Wr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ty(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ty((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:y3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Rv,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(l5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Rv,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Rv,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(l5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:H,activity:q})=>f.jsx(kA,{part:$,repeatCount:H,activity:q,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Ur,iconClass:"text-accent-red"}:{label:Cue(),icon:fb,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Wr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:a5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:a5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":s6(),disabled:!e,onClick:p,children:f.jsx(db,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const te=n.parts.filter(Z=>Z.type==="text").map(Z=>Z.text??"").join(` -`),I=Z=>!!(v!=null&&v.some(ce=>ce.name===Z)),L=n.parts.filter(Z=>Z.type==="image"&&Z.text).map(N9t),F=L.filter(Z=>!Z.isPdf),W=L.filter(Z=>Z.isPdf),U=n.parts.filter(Z=>Z.type==="annotation"&&Z.text).map(Z=>({id:Z.id,text:Z.text??""}));if(O!==null){const Z=()=>{const ce=O.trim();!ce||N||(B(null),j(n.id,ce))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:ce=>B(ce.target.value),onKeyDown:ce=>{ce.key==="Escape"?(ce.preventDefault(),B(null)):ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),Z())}}),f.jsxs("div",{className:`${a5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:Z,disabled:N||!O.trim(),children:N4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[U.length>0&&f.jsx(vk,{annotations:U,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((Z,ce)=>f.jsx("a",{href:Z.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:Z.src,alt:vie()})},ce))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((Z,ce)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:Z.src,target:"_blank",rel:"noreferrer",children:[f.jsx(fb,{size:15}),f.jsx("span",{children:Z.name})]},ce))})]}),w!==void 0&&f.jsx(z9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const H=n.parts.find(te=>te.type==="tool"&&y3(te)),q=n.parts.find(om)??H,Y=n.parts.filter(te=>te!==q&&!(H&&y3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),q&&f.jsx(SF,{part:q,usageLimited:!!H,busy:m,recovering:x===((X=(G=q.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:O1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:O1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:O1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function O1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Mv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Mv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ty(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=O1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?n6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ty(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[t6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Rv,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Wr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(U=>U.role==="user"&&!U.id.startsWith(Cd));return kxt(a,n,W,U=>U.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),H=R.useCallback(W=>j[W].id,[j]),q=R.useCallback(W=>{if(B)return j.map((Z,ce)=>ce);const U=new Set(yB(W));return j.forEach((Z,ce)=>{O.current.has(Z.id)&&U.add(ce)}),[...U].sort((Z,ce)=>Z-ce)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:H,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:q});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var ce;const U=window.getSelection();if(!U||U.isCollapsed||!U.rangeCount)return;const Z=U.getRangeAt(0);for(const re of((ce=t.current)==null?void 0:ce.querySelectorAll("[data-message-id]"))??[])Z.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),te=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ue,pe;const U=j[W.index],Z=U.parts.find(om),ce=(Q=(ne=Z==null?void 0:Z.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=Z?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":U.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(U.id),onFocusCapture:()=>O.current.add(U.id),children:f.jsx(j9t,{message:U,forkCount:(le=M.get(U.id))==null?void 0:le.count,forkIndex:(oe=M.get(U.id))==null?void 0:oe.index,forkPrevId:(ue=M.get(U.id))==null?void 0:ue.prevId,forkNextId:(pe=M.get(U.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===U.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:ce===C?C:null,onRecover:E,skills:N,predictTextTail:_&&U===G&&U.role==="assistant"})},U.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,hb],Bw=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ob(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Gr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:H=t9t}=ct($),q=R.useCallback(ie=>{Vr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[W,U]=R.useState(new Set),[Z,ce]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ue=R.useRef({projectId:e,activeId:I,mainView:i});(ue.current.projectId!==e||ue.current.activeId!==I||ue.current.mainView!==i)&&(ue.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=r5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Aw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==r5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=H.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Aw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:iv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=rb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Pr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Pr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(S2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=F.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(F.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{F.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();U(e===z2?new Set([p6,m6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>ov(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>ov(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&U(be=>Ext(be,ie.ids,we.busySessions,H,i==="chat"?I:null))},[e,we.busySessions,H,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Fr=I?we.queuedBySession[I]??[]:[],oa=Fr.some(ie=>ie.dispatchState==="retrying"),Jl=Fr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Fr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Fr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Fr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===z2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Pr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ue.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(S2())}catch{Te(IE()),ho()}return}const J=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!J){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(J,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&Z==="archived"&&ce("active");const Tn=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ue.current,Oe=F.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return F.current===Oe&&(q(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Oe&&ue.current===Ae&&(L.current(Ue.id,{replace:!0}),ue.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ue.current;let Oe=I;const Ue=()=>{const Ln=ue.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(S2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&Z==="archived"&&ce("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){eb(ie),ue.current.projectId===e&&ue.current.activeId===ie&&ue.current.mainView==="chat"&&L.current(null,{replace:!0}),U(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=H.filter(ie=>P9t(Z,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{ce("active"),w(null)},[w]),Ru=R.useCallback(ie=>{ce("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===Z))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:Z,onChange:ce})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===z2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:Z==="archived"?Hae():H.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(fv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(n3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:o6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),te(!0)}}),X&&f.jsx(ZP,{onClose:()=>{te(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Bw[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Bw[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=Bw[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Fr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Fr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} +`){a();continue}t+=_,r+=_}return a(),n}function ry(e,n){return ph(e).filter(t=>Oxt(t.raw,n))}function ya(e,n){return ry(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function l5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ry(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:l5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:l5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ry(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:l5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Iw(i,"targetIds")),_=_h(Iw(i,"runTargetIds")),d=_h(Iw(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Ow(i,"search_query","q"),N=Ow(i,"image_query","q"),T=Ow(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),H=ry(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),q=H?Iee():kZ(),Y=H?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Lw(X.path);return{kind:re?"skill":"read",label:re?y2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const te=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=te>=0?O[te]:null,L=I?l9t(I):null,F=L?d9t(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const re=Lw(F);return{kind:re?"skill":"read",label:re?y2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?w2({pattern:Ne(re)}):x2(),searchPattern:re??void 0}}const U=O.find(re=>(re==null?void 0:re.name)==="git"),Z=U==null?void 0:U.args[0];if(Z==="grep"){const re=U==null?void 0:U.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?w2({pattern:Ne(re)}):x2(),searchPattern:re}}if(Z==="status")return{kind:"command",label:mle()};if(Z==="diff")return{kind:"command",label:Ede()};if(Z==="log")return{kind:"command",label:Kue()};const ce=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return ce("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||ce("typecheck")?{kind:"command",label:Ole()}:ce("lint")?{kind:"command",label:ile()}:ce("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Lw(p):null;return N?{kind:"skill",label:y2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?w2({pattern:Ne(E)}):x2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Mv({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Bw({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Vr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function c5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Vr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Bw,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Vr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Bw,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Vr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Bw,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ny(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ny((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:x3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Mv,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(c5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Mv,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(c5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Mv,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(c5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:H,activity:q})=>f.jsx(kA,{part:$,repeatCount:H,activity:q,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Gr,iconClass:"text-accent-red"}:{label:Cue(),icon:hb,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Vr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:o5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:o5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":i6(),disabled:!e,onClick:p,children:f.jsx(fb,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const te=n.parts.filter(Z=>Z.type==="text").map(Z=>Z.text??"").join(` +`),I=Z=>!!(v!=null&&v.some(ce=>ce.name===Z)),L=n.parts.filter(Z=>Z.type==="image"&&Z.text).map(N9t),F=L.filter(Z=>!Z.isPdf),W=L.filter(Z=>Z.isPdf),U=n.parts.filter(Z=>Z.type==="annotation"&&Z.text).map(Z=>({id:Z.id,text:Z.text??""}));if(O!==null){const Z=()=>{const ce=O.trim();!ce||N||(B(null),j(n.id,ce))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:ce=>B(ce.target.value),onKeyDown:ce=>{ce.key==="Escape"?(ce.preventDefault(),B(null)):ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),Z())}}),f.jsxs("div",{className:`${o5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:Z,disabled:N||!O.trim(),children:z4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[U.length>0&&f.jsx(vk,{annotations:U,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((Z,ce)=>f.jsx("a",{href:Z.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:Z.src,alt:vie()})},ce))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((Z,ce)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:Z.src,target:"_blank",rel:"noreferrer",children:[f.jsx(hb,{size:15}),f.jsx("span",{children:Z.name})]},ce))})]}),w!==void 0&&f.jsx(z9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const H=n.parts.find(te=>te.type==="tool"&&x3(te)),q=n.parts.find(om)??H,Y=n.parts.filter(te=>te!==q&&!(H&&x3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),q&&f.jsx(SF,{part:q,usageLimited:!!H,busy:m,recovering:x===((X=(G=q.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:O1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:O1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:O1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function O1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Dv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Dv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ny(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=O1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?r6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ny(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Mv,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Vr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(U=>U.role==="user"&&!U.id.startsWith(Cd));return kxt(a,n,W,U=>U.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),H=R.useCallback(W=>j[W].id,[j]),q=R.useCallback(W=>{if(B)return j.map((Z,ce)=>ce);const U=new Set(yB(W));return j.forEach((Z,ce)=>{O.current.has(Z.id)&&U.add(ce)}),[...U].sort((Z,ce)=>Z-ce)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:H,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:q});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var ce;const U=window.getSelection();if(!U||U.isCollapsed||!U.rangeCount)return;const Z=U.getRangeAt(0);for(const re of((ce=t.current)==null?void 0:ce.querySelectorAll("[data-message-id]"))??[])Z.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),te=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ue,pe;const U=j[W.index],Z=U.parts.find(om),ce=(Q=(ne=Z==null?void 0:Z.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=Z?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":U.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(U.id),onFocusCapture:()=>O.current.add(U.id),children:f.jsx(j9t,{message:U,forkCount:(le=M.get(U.id))==null?void 0:le.count,forkIndex:(oe=M.get(U.id))==null?void 0:oe.index,forkPrevId:(ue=M.get(U.id))==null?void 0:ue.prevId,forkNextId:(pe=M.get(U.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===U.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:ce===C?C:null,onRecover:E,skills:N,predictTextTail:_&&U===G&&U.role==="assistant"})},U.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,_b],$w=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);lb(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Gr,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Wr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:H=t9t}=ct($),q=R.useCallback(ie=>{Pr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[W,U]=R.useState(new Set),[Z,ce]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ue=R.useRef({projectId:e,activeId:I,mainView:i});(ue.current.projectId!==e||ue.current.activeId!==I||ue.current.mainView!==i)&&(ue.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=s5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Rw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==s5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=H.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Rw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:iv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=sb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Fr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Fr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(k2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=F.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(F.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{F.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();U(e===j2?new Set([m6,g6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>lv(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>lv(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&U(be=>Ext(be,ie.ids,we.busySessions,H,i==="chat"?I:null))},[e,we.busySessions,H,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Hr=I?we.queuedBySession[I]??[]:[],oa=Hr.some(ie=>ie.dispatchState==="retrying"),Jl=Hr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Hr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Hr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Hr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===j2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Fr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ue.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(k2())}catch{Te(IE()),ho()}return}const J=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!J){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(J,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&Z==="archived"&&ce("active");const Tn=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ue.current,Oe=F.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return F.current===Oe&&(q(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Oe&&ue.current===Ae&&(L.current(Ue.id,{replace:!0}),ue.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ue.current;let Oe=I;const Ue=()=>{const Ln=ue.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(k2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&Z==="archived"&&ce("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){tb(ie),ue.current.projectId===e&&ue.current.activeId===ie&&ue.current.mainView==="chat"&&L.current(null,{replace:!0}),U(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=H.filter(ie=>P9t(Z,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{ce("active"),w(null)},[w]),Ru=R.useCallback(ie=>{ce("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===Z))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:Z,onChange:ce})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===j2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:Z==="archived"?Hae():H.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(hv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:l6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),te(!0)}}),X&&f.jsx(ZP,{onClose:()=>{te(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${$w[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${$w[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=$w[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Hr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Hr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} -${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Ur,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(fb,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Ur,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Aw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:w2(),"aria-label":w2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:w2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Pr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Ur,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Ur,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():N4(),"aria-label":xs?AE():N4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Mv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(ib,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(pb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Gr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const c5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:c5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Wr(S=>i(m,S));return f.jsxs("button",{type:"button",className:c5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({..._v(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?nb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({..._v(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(_v(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const U=new Set(r);U.has(W)?U.delete(W):U.add(W),i(U)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):c6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,H=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),q=O?O.branch:n.baselineBranch,Y=(W,U)=>O?a(W,e,void 0,U):a(W,void 0,n.baselineBranch,U),G=(S==null?void 0:S.root)==="worktree",X=async(W,U)=>{try{await adt(l,W,U,{sessionId:e}),N()}catch(Z){Qn(Z instanceof Error?Z.message:String(Z),"error")}},te=W=>{const U=(S==null?void 0:S.path)??n.repoPath;jF(U,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&q?nb(n.githubOwner,n.githubRepo,q):void 0,githubTitle:q?pD({branch:Ne(q)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,U)=>{y(AF(W,U))},onRename:(W,U)=>{E(null),X(W,{action:"rename",newName:U})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` +${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Gr,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(hb,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Gr,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Gr,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Rw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:S2(),"aria-label":S2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:S2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Fr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Gr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Gr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Gr,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():z4(),"aria-label":xs?AE():z4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Dv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(ab,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(mb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const u5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:u5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Vr(S=>i(m,S));return f.jsxs("button",{type:"button",className:u5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({...pv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?rb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({...pv(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(pv(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const U=new Set(r);U.has(W)?U.delete(W):U.add(W),i(U)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):u6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,H=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),q=O?O.branch:n.baselineBranch,Y=(W,U)=>O?a(W,e,void 0,U):a(W,void 0,n.baselineBranch,U),G=(S==null?void 0:S.root)==="worktree",X=async(W,U)=>{try{await adt(l,W,U,{sessionId:e}),N()}catch(Z){Qn(Z instanceof Error?Z.message:String(Z),"error")}},te=W=>{const U=(S==null?void 0:S.path)??n.repoPath;jF(U,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&q?rb(n.githubOwner,n.githubRepo,q):void 0,githubTitle:q?pD({branch:Ne(q)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,U)=>{y(AF(W,U))},onRename:(W,U)=>{E(null),X(W,{action:"rename",newName:U})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` `),d=FP(_,AS(n));return _.endsWith(` -`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${jv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${jv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function TA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[FD()," ",Ne(n)]})]})}function u5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(TA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(TA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[FD()," ",t]})})]})}const fEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...fEt(e),enabled:n,subscribed:n}).data??null}function hEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function _Et(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function pEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(u5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?rv():rh(),"data-tip-align":"end","aria-label":d?rv():rh(),onClick:()=>p(b=>!b),children:f.jsx(e3,{size:13})}),f.jsx(ib,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(e6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(e6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const H=Math.round($.clientX-((T==null?void 0:T.left)??0)),q=Math.min(Math.max(H,$F),PF);u(q);try{localStorage.setItem(IF,String(q))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(e6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Ur,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:nb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:tv({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(pb,{size:12})]})}const $w=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Wr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Wr(i),children:[f.jsx(_b,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Wr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let d5=!1;function OA(e){d5=!0;try{return window.confirm(e)}finally{d5=!1}}const f5=e=>e.replace(/\r\n/g,` -`),IA=(e,n,t)=>{const r=f5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r +`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Tv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Tv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function TA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[FD()," ",Ne(n)]})]})}function d5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(TA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(TA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[FD()," ",t]})})]})}const fEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...fEt(e),enabled:n,subscribed:n}).data??null}function hEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function _Et(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function pEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(d5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?rv():rh(),"data-tip-align":"end","aria-label":d?rv():rh(),onClick:()=>p(b=>!b),children:f.jsx(t3,{size:13})}),f.jsx(ab,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(t6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(t6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const H=Math.round($.clientX-((T==null?void 0:T.left)??0)),q=Math.min(Math.max(H,$F),PF);u(q);try{localStorage.setItem(IF,String(q))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(t6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Gr,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:rb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:tv({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(mb,{size:12})]})}const Pw=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Vr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Vr(i),children:[f.jsx(pb,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:Pw,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:Pw,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Pw,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Vr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let f5=!1;function OA(e){f5=!0;try{return window.confirm(e)}finally{f5=!1}}const h5=e=>e.replace(/\r\n/g,` +`),IA=(e,n,t)=>{const r=h5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r `),conflict:null}},Cl=e=>e.draft!==e.baseline,$Et=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),PEt=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),H=R.useRef(o);H.current=o;const q=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(q.current)return;Y.current=n,q.current=!0,m(!0);const L=H.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(F=>{var U,Z;const W=F.pdfPath;if(F.ok&&W){S(ce=>({path:W,version:((ce==null?void 0:ce.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((U=F.log)==null?void 0:U.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((Z=F.log)==null?void 0:Z.trim())||S3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{q.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ue=>ue&&{...ue,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const H=R.useRef(!1),q=R.useRef(l);q.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||H.current||Y.current?!1:(H.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ue=>{G.current=!1,N(ue),ue.pulled.includes(n)&&(Y.current?O(!0):q.current(ue.pulled))}).catch(ue=>{G.current=!0,N(null),j(ue instanceof Error?ue.message:String(ue))}).finally(()=>{H.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;te.current!==oe&&X()&&(te.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),U=R.useRef(Promise.resolve()),Z=R.useRef(!1);Z.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const ce=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let oe=!1;const ue=()=>{const Se=ce.current;ce.current=!1,!(!Se&&Z.current)&&(U.current=U.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ue();const pe=setInterval(ue,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),U.current=U.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):q.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{H.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ue=>{ue.remoteChanged&&X()}).catch(ue=>{G.current=!0,j(ue instanceof Error?ue.message:String(ue))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{ce.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ue=await BL(oe);te.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ue.hasToken})},saveSession:async oe=>{const ue=await $L(oe,{host:m==null?void 0:m.host});B(ue.hasSession),ce.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),ce.current=!0,w(ue=>ue+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,te.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),te.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?T4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(T4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Ur,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Gr,{className:"basis-full min-w-0","aria-label":j4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:j4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?T4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:_6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Gr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(db,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Vr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",H=t==="abs",q=xk(n),Y=zF(n),G=lEt(n),X=q||G,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),U=S.set,Z=S.saving,ce=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ue=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,H))==null?void 0:xt.path)??null},[H,Se]),Ie=R.useCallback(Ve=>H?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,H,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,H);return xt?KEt(Ie(xt.path),xt):null},[H,Se,Ie]),vt=LF(ue==null?void 0:ue.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ue!=null&&!ue.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ue!=null&&!ue.binary&&!ue.truncated&&!vt&&!mt,ut=rt&&ue.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ue.version=="string"||Ct),Re=(W==null?void 0:W.draft)??f5((ue==null?void 0:ue.content)??""),Ze=(W==null?void 0:W.baseline)??f5((ue==null?void 0:ue.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);ce(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof D4){const xn=S.getSnapshot();return!xn||!Cl(xn)||U({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{ce(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,ready:ue!=null&&!ue.notFound,source:we?Re:(ue==null?void 0:ue.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{U(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!Z);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?U({...xt,conflict:On}):!On&&xt.conflict&&U({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(U(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,Z,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ue||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ue]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(Z||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(Z?Ei():I2e()),children:Z?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(e3,{size:13}):f.jsx(fb,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(ib,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?rv():rh(),"data-tip-align":"end","aria-label":y?rv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(e3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ue!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Ur,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ue===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ue===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ue&&typeof ue.version=="string"?IA(ue.path,ue.content,ue.version):null);xt&&U($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{d5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ue.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(u5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ue.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(u5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):q&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ue.content,entries:x}):f.jsx(Fo,{text:ue.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ue.content,truncated:ue.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ue.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ue.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const Pw=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:Pw,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:Pw,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:Pw,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:hb,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Wr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Wr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Wr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(_b,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Ur,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ry(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}I1.prototype=ry.prototype={constructor:I1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===h5&&n.documentElement.namespaceURI===h5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=sy(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function _5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}_5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=ry("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Fw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function p5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,p5,dH(_m,{brighter(e){return e=e==null?Lv:Math.pow(Lv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Ov(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Ov(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Ov(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Lv:Math.pow(Lv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Hw(e>=240?e-240:e+120,s,r),Hw(e,s,r),Hw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Ov(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ov(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function Hw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Iv=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=p5(s)).r,(i=p5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=qw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=($v=Ep.now())+iy,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-$v;n>gH&&(iy-=n,$v=e)}function Rjt(){for(var e,n=Bv,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Bv=t);j0=e,v5(r)}function v5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-iy)),y0&&(y0=clearInterval(y0))):(y0||($v=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new Pv;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=ry("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,b5=2,$1=3,sR=4,y5=5,P1=6;function ay(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>$1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===$1)return nR(a);m.state===sR?(m.state=P1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_b5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var oy=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return oy;return e.__zoom}function Uw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||oy}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=B1,u=ry("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(q){q.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,Y,G,X){var te=q.selection?q.selection():q;te.property("__zoom",iR),q!==te?E(q,Y,G,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(q,Y,G,X){b.scaleTo(q,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},G,X)},b.scaleTo=function(q,Y,G,X){b.transform(q,function(){var te=n.apply(this,arguments),I=this.__zoom,L=G==null?C(te):typeof G=="function"?G.apply(this,arguments):G,F=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,F),te,a)},G,X)},b.translateBy=function(q,Y,G,X){b.transform(q,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(q,Y,G,X,te){b.transform(q,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(oy.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,te)};function w(q,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===q.k?q:new Ol(Y,q.x,q.y)}function y(q,Y,G){var X=Y[0]-G[0]*q.k,te=Y[1]-G[1]*q.k;return X===q.x&&te===q.y?q:new Ol(q.k,X,te)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function E(q,Y,G,X){q.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),W=G==null?C(F):typeof G=="function"?G.apply(te,I):G,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=te.__zoom,ce=typeof Y=="function"?Y.apply(te,I):Y,re=l(Z.invert(W).concat(U/Z.k),ce.invert(W).concat(U/ce.k));return function(ne){if(ne===1)ne=ce;else{var Q=re(ne),le=U/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(q,Y,G){return!G&&q.__zooming||new T(q,Y)}function T(q,Y){this.that=q,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,Y),this.taps=0}T.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Y){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Y=Hi(this.that).datum();u.call(q,this.that,new PTt(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(q,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(q),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(q);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===te)return;G.mouse=[I,X.invert(I)],F1(this),G.start()}x0(q),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,te),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(q,...Y){if(p||!e.apply(this,arguments))return;var G=q.currentTarget,X=N(this,Y,!0).event(q),te=Hi(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",U,!0),I=Ua(q,G),L=q.clientX,F=q.clientY;lH(q.view),Uw(q),X.mouse=[I,this.__zoom.invert(I)],F1(this),X.start();function W(Z){if(x0(Z),!X.moved){var ce=Z.clientX-L,re=Z.clientY-F;X.moved=ce*ce+re*re>S}X.event(Z).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(Z,G),X.mouse[1]),X.extent,a))}function U(Z){te.on("mousemove.zoom mouseup.zoom",null),cH(Z.view,X.moved),x0(Z),X.event(Z).end()}}function O(q,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(q.changedTouches?q.changedTouches[0]:q,this),te=G.invert(X),I=G.k*(q.shiftKey?.5:2),L=t(y(w(G,I),X,te),n.apply(this,Y),a);x0(q),o>0?Hi(this).transition().duration(o).call(E,L,X,q):Hi(this).call(b.transform,L,X,q)}}function B(q,...Y){if(e.apply(this,arguments)){var G=q.touches,X=G.length,te=N(this,Y,q.changedTouches.length===X).event(q),I,L,F,W;for(Uw(q),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Fv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fv||(Fv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?Hv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ly(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return cy(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=ly(t,Hv(s)),r=!0)}),r?cy(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},ly=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),x5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),cy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Hv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>cy(ly(x5(e),x5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},qv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const q=Math.abs(e[p]-t[p]);if(q<=i){const Y=Math.min(i-1,i-q);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const q=p==="x"?"y":"x",Y=o[p]===l[q],G=u[q]>_[q],X=u[q]<_[q];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),H=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=H?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function S5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=S5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function k5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Gw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:H}){const{nodeLookup:q,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:W}=n();i={x:$,y:H};let U=!1;const Z=o.size>1,ce=Z&&Y?x5(mm(o)):null,re=Z&&X?wAt({dragItems:o,snapGrid:G,x:$,y:H}):null;for(const[ne,Q]of o){if(!q.has(ne))continue;let le={x:$-Q.distance.x,y:H-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(Z&&Y&&!Q.extent&&ce){const{positionAbsolute:Se}=Q.internals,ye=Se.x-ce.x+Y[0][0],qe=Se.x+Q.measured.width-ce.x2+Y[1][0],Ie=Se.y-ce.y+Y[0][1],Te=Se.y+Q.measured.height-ce.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ue,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:q,nodeExtent:oe||Y,nodeOrigin:te,onError:F});U=U||Q.position.x!==ue.x||Q.position.y!==ue.y,Q.position=ue,Q.internals.positionAbsolute=pe}if(x=x||U,!!U&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Gw({nodeId:N,dragItems:o,nodeLookup:q});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:H,autoPanSpeed:q,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,q);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await H({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var Z;const{nodeLookup:H,multiSelectionActive:q,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!q&&N&&((Z=H.get(N))!=null&&Z.selected||W()),E&&I&&N&&(e==null||e(N));const U=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=U,o=xAt(H,Y,U,N),o.size>0&&(t||L||!N&&F)){const[ce,re]=Gw({nodeId:N,dragItems:o,nodeLookup:H});t==null||t($.sourceEvent,o,ce,re),L==null||L($.sourceEvent,ce,re),N||F==null||F($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:H,nodeDragThreshold:q,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,q===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:q,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&H&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,W=L.y-u.y;Math.sqrt(F*F+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:H,updateNodePositions:q,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(q(o,!1),x=!1),s||Y||!N&&G){const[X,te]=Gw({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||G==null||G($.sourceEvent,te)}}}).filter($=>{const H=$.target;return!$.button&&(!w||!vR(H,`.${w}`,C))&&(!y||vR(H,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())qv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:H}=Za(e),q=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!q)return;const X=QH(s,q,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,W=null;function U(){if(!_||!Y)return;const[ue,pe]=Mk(te,Y,N);p({x:ue,y:pe}),O=requestAnimationFrame(U)}const Z={...X,nodeId:s,type:q,position:X.position},ce=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(ce,Z,Nt.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ce,to:te,toHandle:null,toPosition:aR[Z.position],toNode:null,pointer:te};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:q})}T===0&&Q();function le(ue){if(!G){const{x:Te,y:vt}=Za(ue),Dt=Te-$,Ut=vt-H;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!Z){oe(ue);return}const pe=C();te=Za(ue,Y),B=EAt(vm(te,pe,!1,[1,1]),t,l,Z),I||(U(),I=!0);const Se=ZH(ue,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,F=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,Z,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:aR[Z.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function oe(ue){if(!("touches"in ue&&ue.touches.length>0)){if(G){(B||W)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ue,ye),i&&(w==null||w(ue,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const C5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const uy=e=>({x:e.x,y:e.y,zoom:e.k}),Ww=({x:e,y:n,zoom:t})=>oy.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Vw=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=uy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=uy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,uy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=uy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).transform(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:q,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:W,zoomActivationKeyPressed:U,lib:Z,onTransformChange:ce,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){q&&!u.isZoomingOrPanning&&b();const le=Y&&!U&&!q;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ue=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ue);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:ce});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:U,panOnDrag:G,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:q,noPanClassName:$,noWheelClassName:B,lib:Z,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,H){const q=Ww(B),Y=d==null?void 0:d.constrain()(q,$,H);return Y&&await S(Y),Y}async function y(B,$){const H=Ww(B);return await S(H,$),H}function C(B){if(p){const $=Ww(B),H=p.property("__zoom");(H.k!==B.zoom||H.x!==B.x||H.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleTo(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}async function T(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleBy(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,H=-i[1]*N;let q=f1(O,S,v),Y=f1(B,b,w);if(a){let te=0,I=0;l&&j<0?te=Hc(y+j+$,a[0][0]):!l&&j>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+H,a[0][1]):!u&&M>0&&(I=qc(C+B+H,a[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&j>0?te=qc(y+j,o[0][0]):!l&&j<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(s){if(_){const te=f1(O/T,b,w)*T;if(q=Math.max(q,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+H+O/T,a[1][1])*T:I=Hc(C+H+(l?j:-j)/T,a[0][1])*T,q=Math.max(q,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,q=Math.max(q,I)}}if(d){const te=f1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?q:-q),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:H,snapGrid:q,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:H,snapGrid:q,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const W=FAt(F,y,F.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:H,snapToGrid:q,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,W={},U=y.origin??Y,{width:Z,height:ce,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,U,T,j),Q=Z!==L,le=ce!==F,oe=re!==te&&Q,ue=ne!==I&≤if(!oe&&!ue&&!Q&&!le)return;if((oe||ue||U[0]===1||U[1]===1)&&(W.x=oe?re:b.x,W.y=ue?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-te,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+U[0]*(Z-L),y:Te.position.y-Ie+U[1]*(ce-F)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=U[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const dy=R.createContext(null),QAt=dy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(dy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(dy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const fy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});fy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(fy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` +`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),H=R.useRef(o);H.current=o;const q=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(q.current)return;Y.current=n,q.current=!0,m(!0);const L=H.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(F=>{var U,Z;const W=F.pdfPath;if(F.ok&&W){S(ce=>({path:W,version:((ce==null?void 0:ce.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((U=F.log)==null?void 0:U.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((Z=F.log)==null?void 0:Z.trim())||S3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{q.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ue=>ue&&{...ue,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const H=R.useRef(!1),q=R.useRef(l);q.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||H.current||Y.current?!1:(H.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ue=>{G.current=!1,N(ue),ue.pulled.includes(n)&&(Y.current?O(!0):q.current(ue.pulled))}).catch(ue=>{G.current=!0,N(null),j(ue instanceof Error?ue.message:String(ue))}).finally(()=>{H.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;te.current!==oe&&X()&&(te.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),U=R.useRef(Promise.resolve()),Z=R.useRef(!1);Z.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const ce=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let oe=!1;const ue=()=>{const Se=ce.current;ce.current=!1,!(!Se&&Z.current)&&(U.current=U.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ue();const pe=setInterval(ue,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),U.current=U.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):q.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{H.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ue=>{ue.remoteChanged&&X()}).catch(ue=>{G.current=!0,j(ue instanceof Error?ue.message:String(ue))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{ce.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ue=await BL(oe);te.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ue.hasToken})},saveSession:async oe=>{const ue=await $L(oe,{host:m==null?void 0:m.host});B(ue.hasSession),ce.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),ce.current=!0,w(ue=>ue+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,te.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),te.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?A4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(A4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Gr,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Wr,{className:"basis-full min-w-0","aria-label":T4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:T4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?A4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:p6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Wr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(fb,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Pr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",H=t==="abs",q=xk(n),Y=zF(n),G=lEt(n),X=q||G,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),U=S.set,Z=S.saving,ce=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ue=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,H))==null?void 0:xt.path)??null},[H,Se]),Ie=R.useCallback(Ve=>H?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,H,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,H);return xt?KEt(Ie(xt.path),xt):null},[H,Se,Ie]),vt=LF(ue==null?void 0:ue.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ue!=null&&!ue.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ue!=null&&!ue.binary&&!ue.truncated&&!vt&&!mt,ut=rt&&ue.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ue.version=="string"||Ct),Re=(W==null?void 0:W.draft)??h5((ue==null?void 0:ue.content)??""),Ze=(W==null?void 0:W.baseline)??h5((ue==null?void 0:ue.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);ce(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof L4){const xn=S.getSnapshot();return!xn||!Cl(xn)||U({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{ce(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,ready:ue!=null&&!ue.notFound,source:we?Re:(ue==null?void 0:ue.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{U(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!Z);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?U({...xt,conflict:On}):!On&&xt.conflict&&U({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(U(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,Z,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ue||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ue]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(Z||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(Z?Ei():I2e()),children:Z?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(t3,{size:13}):f.jsx(hb,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(ab,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?rv():rh(),"data-tip-align":"end","aria-label":y?rv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(t3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ue!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Gr,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ue===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ue===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ue&&typeof ue.version=="string"?IA(ue.path,ue.content,ue.version):null);xt&&U($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{f5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ue.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(d5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ue.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(d5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):q&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ue.content,entries:x}):f.jsx(Fo,{text:ue.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ue.content,truncated:ue.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ue.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ue.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const Fw=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:Fw,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:Fw,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:Fw,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:_b,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Vr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Vr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Vr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(pb,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Gr,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function sy(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}I1.prototype=sy.prototype={constructor:I1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===_5&&n.documentElement.namespaceURI===_5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=iy(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function p5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}p5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=sy("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Hw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function m5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,m5,dH(_m,{brighter(e){return e=e==null?Ov:Math.pow(Ov,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Iv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Iv(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Iv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Ov:Math.pow(Ov,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(qw(e>=240?e-240:e+120,s,r),qw(e,s,r),qw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Iv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Iv(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function qw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Bv=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=m5(s)).r,(i=m5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=Uw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=(Pv=Ep.now())+ay,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-Pv;n>gH&&(ay-=n,Pv=e)}function Rjt(){for(var e,n=$v,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:$v=t);j0=e,b5(r)}function b5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-ay)),y0&&(y0=clearInterval(y0))):(y0||(Pv=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new Fv;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=sy("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,y5=2,$1=3,sR=4,x5=5,P1=6;function oy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>$1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===$1)return nR(a);m.state===sR?(m.state=P1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_y5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ly=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ly;return e.__zoom}function Gw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||ly}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=B1,u=sy("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(q){q.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,Y,G,X){var te=q.selection?q.selection():q;te.property("__zoom",iR),q!==te?E(q,Y,G,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(q,Y,G,X){b.scaleTo(q,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},G,X)},b.scaleTo=function(q,Y,G,X){b.transform(q,function(){var te=n.apply(this,arguments),I=this.__zoom,L=G==null?C(te):typeof G=="function"?G.apply(this,arguments):G,F=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,F),te,a)},G,X)},b.translateBy=function(q,Y,G,X){b.transform(q,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(q,Y,G,X,te){b.transform(q,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(ly.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,te)};function w(q,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===q.k?q:new Ol(Y,q.x,q.y)}function y(q,Y,G){var X=Y[0]-G[0]*q.k,te=Y[1]-G[1]*q.k;return X===q.x&&te===q.y?q:new Ol(q.k,X,te)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function E(q,Y,G,X){q.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),W=G==null?C(F):typeof G=="function"?G.apply(te,I):G,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=te.__zoom,ce=typeof Y=="function"?Y.apply(te,I):Y,re=l(Z.invert(W).concat(U/Z.k),ce.invert(W).concat(U/ce.k));return function(ne){if(ne===1)ne=ce;else{var Q=re(ne),le=U/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(q,Y,G){return!G&&q.__zooming||new T(q,Y)}function T(q,Y){this.that=q,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,Y),this.taps=0}T.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Y){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Y=Hi(this.that).datum();u.call(q,this.that,new PTt(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(q,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(q),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(q);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===te)return;G.mouse=[I,X.invert(I)],F1(this),G.start()}x0(q),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,te),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(q,...Y){if(p||!e.apply(this,arguments))return;var G=q.currentTarget,X=N(this,Y,!0).event(q),te=Hi(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",U,!0),I=Ua(q,G),L=q.clientX,F=q.clientY;lH(q.view),Gw(q),X.mouse=[I,this.__zoom.invert(I)],F1(this),X.start();function W(Z){if(x0(Z),!X.moved){var ce=Z.clientX-L,re=Z.clientY-F;X.moved=ce*ce+re*re>S}X.event(Z).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(Z,G),X.mouse[1]),X.extent,a))}function U(Z){te.on("mousemove.zoom mouseup.zoom",null),cH(Z.view,X.moved),x0(Z),X.event(Z).end()}}function O(q,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(q.changedTouches?q.changedTouches[0]:q,this),te=G.invert(X),I=G.k*(q.shiftKey?.5:2),L=t(y(w(G,I),X,te),n.apply(this,Y),a);x0(q),o>0?Hi(this).transition().duration(o).call(E,L,X,q):Hi(this).call(b.transform,L,X,q)}}function B(q,...Y){if(e.apply(this,arguments)){var G=q.touches,X=G.length,te=N(this,Y,q.changedTouches.length===X).event(q),I,L,F,W;for(Gw(q),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Hv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Hv||(Hv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?qv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return cy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return uy(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=cy(t,qv(s)),r=!0)}),r?uy(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},cy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),w5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),uy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},qv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>uy(cy(w5(e),w5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},Uv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const q=Math.abs(e[p]-t[p]);if(q<=i){const Y=Math.min(i-1,i-q);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const q=p==="x"?"y":"x",Y=o[p]===l[q],G=u[q]>_[q],X=u[q]<_[q];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),H=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=H?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function k5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=k5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function C5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Ww({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:H}){const{nodeLookup:q,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:W}=n();i={x:$,y:H};let U=!1;const Z=o.size>1,ce=Z&&Y?w5(mm(o)):null,re=Z&&X?wAt({dragItems:o,snapGrid:G,x:$,y:H}):null;for(const[ne,Q]of o){if(!q.has(ne))continue;let le={x:$-Q.distance.x,y:H-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(Z&&Y&&!Q.extent&&ce){const{positionAbsolute:Se}=Q.internals,ye=Se.x-ce.x+Y[0][0],qe=Se.x+Q.measured.width-ce.x2+Y[1][0],Ie=Se.y-ce.y+Y[0][1],Te=Se.y+Q.measured.height-ce.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ue,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:q,nodeExtent:oe||Y,nodeOrigin:te,onError:F});U=U||Q.position.x!==ue.x||Q.position.y!==ue.y,Q.position=ue,Q.internals.positionAbsolute=pe}if(x=x||U,!!U&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Ww({nodeId:N,dragItems:o,nodeLookup:q});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:H,autoPanSpeed:q,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,q);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await H({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var Z;const{nodeLookup:H,multiSelectionActive:q,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!q&&N&&((Z=H.get(N))!=null&&Z.selected||W()),E&&I&&N&&(e==null||e(N));const U=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=U,o=xAt(H,Y,U,N),o.size>0&&(t||L||!N&&F)){const[ce,re]=Ww({nodeId:N,dragItems:o,nodeLookup:H});t==null||t($.sourceEvent,o,ce,re),L==null||L($.sourceEvent,ce,re),N||F==null||F($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:H,nodeDragThreshold:q,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,q===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:q,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&H&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,W=L.y-u.y;Math.sqrt(F*F+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:H,updateNodePositions:q,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(q(o,!1),x=!1),s||Y||!N&&G){const[X,te]=Ww({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||G==null||G($.sourceEvent,te)}}}).filter($=>{const H=$.target;return!$.button&&(!w||!vR(H,`.${w}`,C))&&(!y||vR(H,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Uv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:H}=Za(e),q=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!q)return;const X=QH(s,q,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,W=null;function U(){if(!_||!Y)return;const[ue,pe]=Mk(te,Y,N);p({x:ue,y:pe}),O=requestAnimationFrame(U)}const Z={...X,nodeId:s,type:q,position:X.position},ce=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(ce,Z,Nt.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ce,to:te,toHandle:null,toPosition:aR[Z.position],toNode:null,pointer:te};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:q})}T===0&&Q();function le(ue){if(!G){const{x:Te,y:vt}=Za(ue),Dt=Te-$,Ut=vt-H;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!Z){oe(ue);return}const pe=C();te=Za(ue,Y),B=EAt(vm(te,pe,!1,[1,1]),t,l,Z),I||(U(),I=!0);const Se=ZH(ue,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,F=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,Z,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:aR[Z.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function oe(ue){if(!("touches"in ue&&ue.touches.length>0)){if(G){(B||W)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ue,ye),i&&(w==null||w(ue,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const E5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const dy=e=>({x:e.x,y:e.y,zoom:e.k}),Vw=({x:e,y:n,zoom:t})=>ly.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Kw=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=dy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=dy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,dy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=dy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).transform(Kw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:q,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:W,zoomActivationKeyPressed:U,lib:Z,onTransformChange:ce,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){q&&!u.isZoomingOrPanning&&b();const le=Y&&!U&&!q;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ue=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ue);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:ce});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:U,panOnDrag:G,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:q,noPanClassName:$,noWheelClassName:B,lib:Z,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,H){const q=Vw(B),Y=d==null?void 0:d.constrain()(q,$,H);return Y&&await S(Y),Y}async function y(B,$){const H=Vw(B);return await S(H,$),H}function C(B){if(p){const $=Vw(B),H=p.property("__zoom");(H.k!==B.zoom||H.x!==B.x||H.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleTo(Kw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}async function T(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleBy(Kw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,H=-i[1]*N;let q=f1(O,S,v),Y=f1(B,b,w);if(a){let te=0,I=0;l&&j<0?te=Hc(y+j+$,a[0][0]):!l&&j>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+H,a[0][1]):!u&&M>0&&(I=qc(C+B+H,a[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&j>0?te=qc(y+j,o[0][0]):!l&&j<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(s){if(_){const te=f1(O/T,b,w)*T;if(q=Math.max(q,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+H+O/T,a[1][1])*T:I=Hc(C+H+(l?j:-j)/T,a[0][1])*T,q=Math.max(q,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,q=Math.max(q,I)}}if(d){const te=f1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?q:-q),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:H,snapGrid:q,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:H,snapGrid:q,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const W=FAt(F,y,F.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:H,snapToGrid:q,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,W={},U=y.origin??Y,{width:Z,height:ce,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,U,T,j),Q=Z!==L,le=ce!==F,oe=re!==te&&Q,ue=ne!==I&≤if(!oe&&!ue&&!Q&&!le)return;if((oe||ue||U[0]===1||U[1]===1)&&(W.x=oe?re:b.x,W.y=ue?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-te,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+U[0]*(Z-L),y:Te.position.y-Ie+U[1]*(ce-F)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=U[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const fy=R.createContext(null),QAt=fy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(fy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(fy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const hy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});hy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(hy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=qv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=qv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const hy={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(H=>{b==null||b({x:H[0],y:H[1],zoom:H[2]}),w||E.setState({transform:H})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoom:(G,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(G,X),te==null||te(X)}});const{x:H,y:q,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[H,q,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:hy,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Kw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),H=R.useRef(!1),q=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(H.current||$.current||b.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{H.current&&(Q.stopPropagation(),H.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ue=Q.target===j.current;if(!ue&&!!Q.target.closest(".nokey")||!e||!(a&&ue||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),H.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ue||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ue,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ue),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(q.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!H.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ue,y:pe}=q.current;F(ue,pe),v.current=requestAnimationFrame(W)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>U(),[]);const Z=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ue}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);q.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!H.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ue(),o==null||o(Q)}H.current=!0,Y.current||(W(),Y.current=!0),F(pe,Se)},ce=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),U())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),U()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Kw(G,j),onContextMenu:Kw(X,j),onWheel:Kw(te,j),onPointerEnter:T?void 0:p,onPointerMove:T?Z:m,onPointerUp:ce,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:hy,children:[S,f.jsx(ARt,{})]})}function E5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{E5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:W,setEdges:U,onError:Z}=v.getState();U(vRt(F,W,{onError:Z}))}I==null||I(F),o==null||o(F)},H=X=>{if(!b)return;const te=PH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();C5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},q=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:W,lib:U,rfId:Z,nodeLookup:ce,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=C5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:Z,doc:ne,lib:U,nodeLookup:ce});oe&&le&&$(le);const ue=structuredClone(re);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,I==null||I(X,ue),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:w?q:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const Uv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Uv,m.key)&&(m.preventDefault(),l({direction:Uv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,preventScrolling:q,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:W}=An(QRt,kr),U=Ap(u,{target:IR}),Z=Ap(S,{target:IR}),ce=Z||j,re=Z||C,ne=_&&ce!==!0,Q=U||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!U&&ce,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,zoomActivationKeyCode:v,preventScrolling:q,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ce,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),H=OH(y),q=tMt({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),Y=uq({nodeRef:q,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),te=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,U=i?Q=>i(Q,{...C.userNode}):void 0,Z=a?Q=>a(Q,{...C.userNode}):void 0,ce=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&E5({id:e,store:$,nodeRef:q}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";E5({id:e,store:$,unselect:le,nodeRef:q})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(Uv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:Uv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=q.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ue,setCenter:pe}=$.getState();if(!ue)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:H?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:W,onContextMenu:U,onClick:ce,onDoubleClick:Z,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:hy,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Fv.Arrow]:oMt,[Fv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function _y({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(_y,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=w5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(_y,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(_y,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(_y,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:H,rfId:q,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",te=(F,W)=>{p(!1),d==null||d(F,t,E.type,W)},I=F=>u==null?void 0:u(t,F),L=(F,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,W)};C5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:q,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var W,U;return((U=(W=x.getState()).isValidConnection)==null?void 0:U.call(W,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var W,U;return(U=(W=x.getState()).onConnectEnd)==null?void 0:U.call(W,...F)},onReconnectEnd:te,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[H,q]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),U=R.useMemo(()=>y.markerStart?`url('#${S5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),Z=R.useMemo(()=>y.markerEnd?`url('#${S5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const ce=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ue=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:ce,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ue:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!H&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,setUpdateHover:$,setReconnecting:q})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=w5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=w5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ue,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ue,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=k5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=k5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),H={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const q=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:q})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(H)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(k5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(dy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:H,onSelectionDragStart:q,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:W=Kc.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ue=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Pr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Pr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:q,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ue,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:H}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...hy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(fy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Qw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Qw(n),u=Qw(e),_=Qw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:H,ariaLabelConfig:q}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,te=T.height/G,I=Math.max(X,te),L=I*Y,F=I*G,W=C*I,U=T.x-(L-T.width)/2-W,Z=T.y-(F-T.height)/2-W,ce=L+W*2,re=F+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:H,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,H]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ue=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??q["minimap.ariaLabel"];return f.jsx(fy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${U} ${Z} ${ce} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ue,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-W},${Z-W}h${ce+W*2}v${re+W*2}h${-ce-W*2}z - M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:H,nodeLookup:q,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],te={x:B.x,y:B.y},I=q.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,F=B.width??I.measured.width??0,W=B.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:F,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:W},I.parentId,q,L)}},Z=Pk([U],q,Y,G);X.push(...Z),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*W,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}H(X)},onEnd:({width:B,height:$})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Yw=380,Xw=12,vDt=350,bDt=150,N5=new EventTarget;function yDt(){N5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return N5.addEventListener("move",u),()=>{N5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Xw+Yw<=window.innerWidth,d=s.x-Xw-Yw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Xw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` +`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=Uv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=Uv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const _y={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(H=>{b==null||b({x:H[0],y:H[1],zoom:H[2]}),w||E.setState({transform:H})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoom:(G,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(G,X),te==null||te(X)}});const{x:H,y:q,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[H,q,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:_y,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Qw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),H=R.useRef(!1),q=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(H.current||$.current||b.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{H.current&&(Q.stopPropagation(),H.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ue=Q.target===j.current;if(!ue&&!!Q.target.closest(".nokey")||!e||!(a&&ue||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),H.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ue||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ue,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ue),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(q.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!H.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ue,y:pe}=q.current;F(ue,pe),v.current=requestAnimationFrame(W)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>U(),[]);const Z=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ue}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);q.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!H.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ue(),o==null||o(Q)}H.current=!0,Y.current||(W(),Y.current=!0),F(pe,Se)},ce=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),U())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),U()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Qw(G,j),onContextMenu:Qw(X,j),onWheel:Qw(te,j),onPointerEnter:T?void 0:p,onPointerMove:T?Z:m,onPointerUp:ce,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:_y,children:[S,f.jsx(ARt,{})]})}function N5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{N5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:W,setEdges:U,onError:Z}=v.getState();U(vRt(F,W,{onError:Z}))}I==null||I(F),o==null||o(F)},H=X=>{if(!b)return;const te=PH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();E5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},q=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:W,lib:U,rfId:Z,nodeLookup:ce,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=E5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:Z,doc:ne,lib:U,nodeLookup:ce});oe&&le&&$(le);const ue=structuredClone(re);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,I==null||I(X,ue),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:w?q:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const Gv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Gv,m.key)&&(m.preventDefault(),l({direction:Gv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,preventScrolling:q,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:W}=An(QRt,kr),U=Ap(u,{target:IR}),Z=Ap(S,{target:IR}),ce=Z||j,re=Z||C,ne=_&&ce!==!0,Q=U||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!U&&ce,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,zoomActivationKeyCode:v,preventScrolling:q,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ce,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),H=OH(y),q=tMt({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),Y=uq({nodeRef:q,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),te=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,U=i?Q=>i(Q,{...C.userNode}):void 0,Z=a?Q=>a(Q,{...C.userNode}):void 0,ce=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&N5({id:e,store:$,nodeRef:q}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";N5({id:e,store:$,unselect:le,nodeRef:q})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(Gv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:Gv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=q.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ue,setCenter:pe}=$.getState();if(!ue)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:H?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:W,onContextMenu:U,onClick:ce,onDoubleClick:Z,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:_y,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Hv.Arrow]:oMt,[Hv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function py({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(py,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=S5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(py,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(py,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(py,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:H,rfId:q,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",te=(F,W)=>{p(!1),d==null||d(F,t,E.type,W)},I=F=>u==null?void 0:u(t,F),L=(F,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,W)};E5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:q,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var W,U;return((U=(W=x.getState()).isValidConnection)==null?void 0:U.call(W,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var W,U;return(U=(W=x.getState()).onConnectEnd)==null?void 0:U.call(W,...F)},onReconnectEnd:te,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[H,q]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),U=R.useMemo(()=>y.markerStart?`url('#${k5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),Z=R.useMemo(()=>y.markerEnd?`url('#${k5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const ce=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ue=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:ce,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ue:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!H&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,setUpdateHover:$,setReconnecting:q})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=S5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=S5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ue,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ue,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=C5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=C5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),H={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const q=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:q})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(H)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(C5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(fy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:H,onSelectionDragStart:q,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:W=Kc.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ue=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Fr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Fr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:q,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ue,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:H}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,..._y,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(hy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Yw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Yw(n),u=Yw(e),_=Yw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:H,ariaLabelConfig:q}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,te=T.height/G,I=Math.max(X,te),L=I*Y,F=I*G,W=C*I,U=T.x-(L-T.width)/2-W,Z=T.y-(F-T.height)/2-W,ce=L+W*2,re=F+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:H,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,H]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ue=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??q["minimap.ariaLabel"];return f.jsx(hy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${U} ${Z} ${ce} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ue,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-W},${Z-W}h${ce+W*2}v${re+W*2}h${-ce-W*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:H,nodeLookup:q,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],te={x:B.x,y:B.y},I=q.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,F=B.width??I.measured.width??0,W=B.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:F,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:W},I.parentId,q,L)}},Z=Pk([U],q,Y,G);X.push(...Z),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*W,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}H(X)},onEnd:({width:B,height:$})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Xw=380,Zw=12,vDt=350,bDt=150,z5=new EventTarget;function yDt(){z5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return z5.addEventListener("move",u),()=>{z5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Zw+Xw<=window.innerWidth,d=s.x-Zw-Xw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Zw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` diff --git `);$=G!==-1?$.slice(0,G+1):$.slice(0,$.lastIndexOf(` -`)+1)}let H=[];try{H=$.trim()?i3($):[]}catch{return null}if(B.truncated&&H.every(G=>G.hunks.length===0))return null;let q=0,Y=0;for(const G of H){const X=Lb(G);q+=X.additions,Y+=X.deletions}return{fileCount:H.length,additions:q,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Yw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Wr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Wr(a),children:[f.jsx(_b,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&g6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,H1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function z5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function q1(e){if(e.children.length===0)return z5(e);const n=e.children.reduce((t,r)=>t+q1(r),0)+H1*(e.children.length-1);return Math.max(z5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Wr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Wr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Wr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(_b,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:tv({name:Ne(t.branchName)}),"aria-label":tv({name:Ne(t.branchName)}),href:nb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(pb,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-z5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+q1(O),0)+H1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=q1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+H1}}let w=0;for(const y of S){const C=q1(y);b(y,w+C/2,0),w+=C+H1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Gv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Gv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Gv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:J=>J.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const J=t?Wa(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var J;return((J=w.data)==null?void 0:J.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((J,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:E1(je.projectId,je.activeSessionId,J),replace:ge})},[s]),B=R.useCallback(J=>{const ge=Ll(J);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),H=R.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:J??void 0})},[t,O]),q=R.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Y=R.useCallback(J=>{var ge;if(n)if(J==="chat"){const je=l.current;s.navigate({href:E1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(J=>{Vr(te.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[te]),W=R.useMemo(()=>Zp(),[n]),U=ct(W),Z=U.data??null,ce=R.useCallback(J=>{Vr(W.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[W]),re=R.useRef(void 0);re.current=Z==null?void 0:Z.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!U.data&&U.error?Bne():null].filter(J=>J!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(W4(n)),ue=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ue);Ct.current=ue;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ue.every(J=>J.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ue:ue.filter(J=>J.chatSessionId===u),[ue,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const J=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>J.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=J=>{let ge=En.current.get(J);return ge||(ge=new HEt,En.current.set(J,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(J=>{const ge=[...J];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(J=>{dr.current=J,zi(J)},[]),Pr=R.useCallback(J=>{const ge=Et(J);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in J){const Me=Ms(je,en.current,J);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(J=>{const ge=Et(J),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(J)];vs.current=je,Rn(je),B(J)},[B]),cs=R.useCallback((J,ge,je)=>{const $e=Et(J),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Pr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(J));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(J)];vs.current=tt,Rn(tt),O(Ll(J,je))},[Pr,ls,Ls,O]),bs=R.useCallback(J=>{const ge=dr.current;ge&&Et(ge)===Et(J)&&Ls(null)},[Ls]);R.useEffect(()=>{let J=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),J=!0;return}if(J&&$e.key==="Enter"){$e.preventDefault(),J=!1;const Lt=dr.current;Lt&&bs(Lt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((J,ge)=>{const je=Et(J),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(J=>J+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((J,ge,je)=>{if(Rn(J.tabHistory),vs.current=J.tabHistory,Nr(J.experimentsTabOpen),fn(J.filesTabOpen),tn(J.artifactsTabOpen),un(J.expTabs),on(J.fileTabs),lt(Me=>Me===J.planTabs?Me:J.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(J.subagentTabs),On(J.codeTabs),ls(J.contentTabOrder),Ls(J.previewTab),Jt(J.filesView),ur(J.filesToggled),Zt(J.scope),Ke(J.panelMax),ji(J.treeViewport),Yn(M.current.activeSessionId===O0&&J.fileTabs.some(Me=>Yu(Me,{path:k1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of J.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Fr,workspace:oa}=K0t({projectId:Z&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(Z==null?void 0:Z.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const J=Jl.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((J,ge)=>{var at;if(!n)return;J&&ge!=null&&ge.replace&&u===null&&(Fr(),W0t(n,J));const je=cu(DO(n),J??"new"),$e=je?je.active:Wc(n)?(at=T6(J??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&J&&u===null?M.current.pane:$e;s.navigate({href:E1(n,J,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Fr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(J=>J+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:J})=>{var ge;return((ge=Rd(J.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(J=>J.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const J=lb(i.href);!Z||!$n||!J||(cb.queue({lastLocation:J,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===J?250:0),La.current=J)},[i.href,Z,$n,oo,os,Ze]);const ec=(Z==null?void 0:Z.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async J=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:J}),ce($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||Z!=null&&Z.tourCompleted||Ai()},[n,ec,Ai,Z==null?void 0:Z.tourCompleted]);const Mt=(L==null?void 0:L.find(J=>J.id===n))??null;R.useEffect(()=>{const J=Q||Z===null?null:Mt==null?void 0:Mt.name;document.title=J?`${Oo(J)} — OpenResearch`:"OpenResearch"},[Q,Z,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(J=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:J})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},J))},[O,xs]),Ri=()=>{I.refetch(),U.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!Z||lo.current)return;lo.current=!0,le.current=Z.preferredAgent;const J=N6()??Z.workspace;J&&(Cs(J.railOpen),ks(Math.min(J.panelWidth,T0())),_t(J.experimentsView))},[Z]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(J=>{const ge=++sc.current;ce($e=>$e&&{...$e,preferredAgent:J});const je=co.current.then(()=>r.mutateAsync({preferredAgent:J})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const J=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Os=R.useCallback(J=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(J)).then(je=>{if(hr.current!==J||Ut.current!==J||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const J=hr.current;J&&(Ut.current=J,vt.current.clear(),Dt.current.clear(),Os(J))},onRun:J=>{if(J.projectId!==hr.current||J.projectId!==Ut.current)return;const ge=vt.current.get(J.id),je=Dt.current.has(J.id);if(ge&&ge.updatedAt>J.updatedAt||(vt.current.set(J.id,J),Dt.current.add(J.id),J.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(J.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=J.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(J.id,J)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((J,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:J,view:ge};un(at=>at.some(tt=>D2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((J,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ue.map(J=>{var ge;return[J.id,((ge=J.title)==null?void 0:ge.trim())||J.slug||El()]})),[ue,G]),Zs=YR(zu),el=R.useMemo(()=>{const J=new Map;for(const ge of Ie)J.set(ge.id,Zs.get(ge.experimentId)??El());return J},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(J=>{const ge=tl.get(J);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(J=>{const ge=Zs.get(J);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((J,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===J||$e.id.startsWith(J));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(J=>{const ge=nr.findIndex(je=>D2(je,J));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[nr,yr,b]),uo=R.useCallback((J,ge="preview")=>{J.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,J);Dr.current.fileTabs.some(at=>Yu(at,J))||C.current.delete(Me),E.current.add(Me)}const $e=RO(J);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,J));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(J,ge)},[cs]),fi=R.useCallback((J,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(J,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((J,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(J,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(J=>uo({path:J,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((J,ge,je,$e,Me,at="preview")=>{const tt=fi(J,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((J,ge)=>{bs(J),ge()},[bs]),of=R.useCallback(J=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,J));if(ge===-1)return;const je=n?Ms(n,u,J):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(J,{path:k1,source:"artifacts"})&&Yn(!1),yr(J,Et(b)===Et(J)))},[u,Mn,yr,n,b]),lf=R.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),x_=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:J};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(J=>{const ge=xt.findIndex(je=>je.promptId===J.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,xt,b]),lc=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(J=>{const ge=ft.findIndex(je=>je.spawnPartId===J.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let J=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Mv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{J&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=ov(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{J=!1,at()}},[ft]);const uc=R.useCallback((J,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:J,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:J,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((J,ge)=>{On(je=>je.map($e=>qf($e,J)?{...$e,...ge}:$e)),ge.view&&O(Ll({...J,...ge}))},[]),S_=R.useCallback(J=>{const ge=xn.findIndex(je=>qf(je,J));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(J=>{J==="experiments"?Nr(!1):J==="files"?fn(!1):tn(!1),yr(J,b===J)},[yr,b]),ff=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=J.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Gv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(J,ge)=>{F(je=>je?QR(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(J=>Yu(J,{path:k1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const J=nl.data.messages.flatMap(je=>{const $e=Mv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=J==null?void 0:J.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(J=>qf(J,Ae))??null:null,Ue=new Map;for(const J of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(J),J);const zn=ca?Et(ca):null,jn=di.filter(J=>J!==zn).map(J=>Ue.get(J)).filter(q0t),fr=J=>ao!==null&&Et(ao)===Et(J),Ln=J=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>of(J)},`file:${z6(J)}`),_r=Bs?ue.find(J=>J.id===Bs.id)??null:null,da=Oe?ue.find(J=>J.id===Oe.experimentId&&J.branchName===Oe.branch)??null:null,_f=J=>{var je,$e;if("path"in J)return Ln(J);if("id"in J){const Me=ue.find(at=>at.id===J.id);return f.jsx(Fc,{active:Bs!==null&&D2(Bs,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>Tu(J)},Et(J))}if("kind"in J&&J.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===J.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>w_(J)},Et(J));if("kind"in J)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===J.spawnPartId,label:((je=uf[J.spawnPartId])==null?void 0:je.label)??J.label??Wne(),shimmer:(($e=uf[J.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>cf(J)},Et(J));const ge=ue.find(Me=>Me.id===J.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,J),label:(ge==null?void 0:ge.slug)??J.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>S_(J)},Et(J))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||Z===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(J=>J.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(Z==null?void 0:Z.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:Z.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:J=>{F(ge=>ge?QR(ge,J):[J])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ue,runs:Ie,onOpenExperiment:(J,ge)=>Is(J,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:E4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(hb,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(J=>!J),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Ur,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(J=>J.id===d&&J.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(J=>!J),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ue,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ue.length>0?gne():void 0,experiments:br,onOpen:(J,ge)=>{Is(J.id,"overview",ge)},onOpenLogs:(J,ge,je)=>{Is(J,"terminal",je,ge)},onOpenCode:(J,ge)=>{const je=ue.find($e=>$e.id===J);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(J,ge,je,$e)=>oc(J,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const J=Ms(n,u,Dn);C.current.delete(J),E.current.add(J)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:J=>{N.current[Ms(n,u,Dn)]=J,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(J,ge,je,$e)=>hi(Dn,()=>oc(J,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:J=>{rr.current.set(Ms(n,u,Dn),J),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(J=>J.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(J,ge,je,$e,Me)=>hi(Qr,()=>oc(J,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(J,ge,je,$e,Me)=>hi(be,()=>Au(J,be.sessionId,ge,je,$e,Me)),onOpenRun:(J,ge)=>hi(be,()=>Oa(J,ge)),runExperimentName:ac,onOpenExperiment:(J,ge)=>hi(be,()=>ju(J,ge)),experimentName:sf,onOpenSubagent:(J,ge,je)=>hi(be,()=>lc(be.sessionId,J,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:J=>df(Oe,{view:J}),onToggledChange:J=>df(Oe,{toggled:J}),onOpenFile:(J,ge,je,$e)=>hi(Oe,()=>oc(J,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:H,parentExperiment:ue.find(J=>J.id===_r.parentExperimentId)??null,onOpenView:(J,ge,je)=>{hi(Bs,()=>Is(_r.id,J,je,ge))},onOpenCode:(J,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,J,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(J,ge)=>{Kr(!1),k_(J,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const j5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=j5.useParams(),{pane:n}=j5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>ub}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>ub}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>ub}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=j5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=ub._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); +`)+1)}let H=[];try{H=$.trim()?a3($):[]}catch{return null}if(B.truncated&&H.every(G=>G.hunks.length===0))return null;let q=0,Y=0;for(const G of H){const X=Ob(G);q+=X.additions,Y+=X.deletions}return{fileCount:H.length,additions:q,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Xw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Vr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Vr(a),children:[f.jsx(pb,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&v6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,H1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function j5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function q1(e){if(e.children.length===0)return j5(e);const n=e.children.reduce((t,r)=>t+q1(r),0)+H1*(e.children.length-1);return Math.max(j5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Vr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Vr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Vr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(pb,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:tv({name:Ne(t.branchName)}),"aria-label":tv({name:Ne(t.branchName)}),href:rb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(mb,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-j5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+q1(O),0)+H1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=q1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+H1}}let w=0;for(const y of S){const C=q1(y);b(y,w+C/2,0),w+=C+H1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Wv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Wv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Wv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:J=>J.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const J=t?Wa(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var J;return((J=w.data)==null?void 0:J.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((J,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:E1(je.projectId,je.activeSessionId,J),replace:ge})},[s]),B=R.useCallback(J=>{const ge=Ll(J);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),H=R.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:J??void 0})},[t,O]),q=R.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Y=R.useCallback(J=>{var ge;if(n)if(J==="chat"){const je=l.current;s.navigate({href:E1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(J=>{Pr(te.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[te]),W=R.useMemo(()=>Zp(),[n]),U=ct(W),Z=U.data??null,ce=R.useCallback(J=>{Pr(W.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[W]),re=R.useRef(void 0);re.current=Z==null?void 0:Z.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!U.data&&U.error?Bne():null].filter(J=>J!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(V4(n)),ue=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ue);Ct.current=ue;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ue.every(J=>J.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ue:ue.filter(J=>J.chatSessionId===u),[ue,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const J=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>J.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=J=>{let ge=En.current.get(J);return ge||(ge=new HEt,En.current.set(J,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(J=>{const ge=[...J];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(J=>{dr.current=J,zi(J)},[]),Fr=R.useCallback(J=>{const ge=Et(J);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in J){const Me=Ms(je,en.current,J);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(J=>{const ge=Et(J),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(J)];vs.current=je,Rn(je),B(J)},[B]),cs=R.useCallback((J,ge,je)=>{const $e=Et(J),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Fr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(J));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(J)];vs.current=tt,Rn(tt),O(Ll(J,je))},[Fr,ls,Ls,O]),bs=R.useCallback(J=>{const ge=dr.current;ge&&Et(ge)===Et(J)&&Ls(null)},[Ls]);R.useEffect(()=>{let J=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),J=!0;return}if(J&&$e.key==="Enter"){$e.preventDefault(),J=!1;const Lt=dr.current;Lt&&bs(Lt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((J,ge)=>{const je=Et(J),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(J=>J+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((J,ge,je)=>{if(Rn(J.tabHistory),vs.current=J.tabHistory,Nr(J.experimentsTabOpen),fn(J.filesTabOpen),tn(J.artifactsTabOpen),un(J.expTabs),on(J.fileTabs),lt(Me=>Me===J.planTabs?Me:J.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(J.subagentTabs),On(J.codeTabs),ls(J.contentTabOrder),Ls(J.previewTab),Jt(J.filesView),ur(J.filesToggled),Zt(J.scope),Ke(J.panelMax),ji(J.treeViewport),Yn(M.current.activeSessionId===O0&&J.fileTabs.some(Me=>Yu(Me,{path:k1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of J.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Hr,workspace:oa}=K0t({projectId:Z&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(Z==null?void 0:Z.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const J=Jl.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((J,ge)=>{var at;if(!n)return;J&&ge!=null&&ge.replace&&u===null&&(Hr(),W0t(n,J));const je=cu(DO(n),J??"new"),$e=je?je.active:Wc(n)?(at=T6(J??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&J&&u===null?M.current.pane:$e;s.navigate({href:E1(n,J,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Hr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(J=>J+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:J})=>{var ge;return((ge=Rd(J.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(J=>J.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const J=cb(i.href);!Z||!$n||!J||(ub.queue({lastLocation:J,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===J?250:0),La.current=J)},[i.href,Z,$n,oo,os,Ze]);const ec=(Z==null?void 0:Z.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async J=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:J}),ce($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||Z!=null&&Z.tourCompleted||Ai()},[n,ec,Ai,Z==null?void 0:Z.tourCompleted]);const Mt=(L==null?void 0:L.find(J=>J.id===n))??null;R.useEffect(()=>{const J=Q||Z===null?null:Mt==null?void 0:Mt.name;document.title=J?`${Oo(J)} — OpenResearch`:"OpenResearch"},[Q,Z,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(J=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:J})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},J))},[O,xs]),Ri=()=>{I.refetch(),U.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!Z||lo.current)return;lo.current=!0,le.current=Z.preferredAgent;const J=N6()??Z.workspace;J&&(Cs(J.railOpen),ks(Math.min(J.panelWidth,T0())),_t(J.experimentsView))},[Z]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(J=>{const ge=++sc.current;ce($e=>$e&&{...$e,preferredAgent:J});const je=co.current.then(()=>r.mutateAsync({preferredAgent:J})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const J=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Os=R.useCallback(J=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(J)).then(je=>{if(hr.current!==J||Ut.current!==J||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const J=hr.current;J&&(Ut.current=J,vt.current.clear(),Dt.current.clear(),Os(J))},onRun:J=>{if(J.projectId!==hr.current||J.projectId!==Ut.current)return;const ge=vt.current.get(J.id),je=Dt.current.has(J.id);if(ge&&ge.updatedAt>J.updatedAt||(vt.current.set(J.id,J),Dt.current.add(J.id),J.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(J.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=J.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(J.id,J)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((J,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:J,view:ge};un(at=>at.some(tt=>L2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((J,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ue.map(J=>{var ge;return[J.id,((ge=J.title)==null?void 0:ge.trim())||J.slug||El()]})),[ue,G]),Zs=YR(zu),el=R.useMemo(()=>{const J=new Map;for(const ge of Ie)J.set(ge.id,Zs.get(ge.experimentId)??El());return J},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(J=>{const ge=tl.get(J);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(J=>{const ge=Zs.get(J);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((J,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===J||$e.id.startsWith(J));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(J=>{const ge=nr.findIndex(je=>L2(je,J));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[nr,yr,b]),uo=R.useCallback((J,ge="preview")=>{J.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,J);Dr.current.fileTabs.some(at=>Yu(at,J))||C.current.delete(Me),E.current.add(Me)}const $e=RO(J);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,J));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(J,ge)},[cs]),fi=R.useCallback((J,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(J,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((J,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(J,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(J=>uo({path:J,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((J,ge,je,$e,Me,at="preview")=>{const tt=fi(J,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((J,ge)=>{bs(J),ge()},[bs]),of=R.useCallback(J=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,J));if(ge===-1)return;const je=n?Ms(n,u,J):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(J,{path:k1,source:"artifacts"})&&Yn(!1),yr(J,Et(b)===Et(J)))},[u,Mn,yr,n,b]),lf=R.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),x_=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:J};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(J=>{const ge=xt.findIndex(je=>je.promptId===J.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,xt,b]),lc=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(J=>{const ge=ft.findIndex(je=>je.spawnPartId===J.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let J=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Dv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{J&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=lv(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{J=!1,at()}},[ft]);const uc=R.useCallback((J,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:J,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:J,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((J,ge)=>{On(je=>je.map($e=>qf($e,J)?{...$e,...ge}:$e)),ge.view&&O(Ll({...J,...ge}))},[]),S_=R.useCallback(J=>{const ge=xn.findIndex(je=>qf(je,J));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(J=>{J==="experiments"?Nr(!1):J==="files"?fn(!1):tn(!1),yr(J,b===J)},[yr,b]),ff=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=J.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Wv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(J,ge)=>{F(je=>je?QR(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(J=>Yu(J,{path:k1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const J=nl.data.messages.flatMap(je=>{const $e=Dv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=J==null?void 0:J.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(J=>qf(J,Ae))??null:null,Ue=new Map;for(const J of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(J),J);const zn=ca?Et(ca):null,jn=di.filter(J=>J!==zn).map(J=>Ue.get(J)).filter(q0t),fr=J=>ao!==null&&Et(ao)===Et(J),Ln=J=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>of(J)},`file:${z6(J)}`),_r=Bs?ue.find(J=>J.id===Bs.id)??null:null,da=Oe?ue.find(J=>J.id===Oe.experimentId&&J.branchName===Oe.branch)??null:null,_f=J=>{var je,$e;if("path"in J)return Ln(J);if("id"in J){const Me=ue.find(at=>at.id===J.id);return f.jsx(Fc,{active:Bs!==null&&L2(Bs,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>Tu(J)},Et(J))}if("kind"in J&&J.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===J.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>w_(J)},Et(J));if("kind"in J)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===J.spawnPartId,label:((je=uf[J.spawnPartId])==null?void 0:je.label)??J.label??Wne(),shimmer:(($e=uf[J.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>cf(J)},Et(J));const ge=ue.find(Me=>Me.id===J.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,J),label:(ge==null?void 0:ge.slug)??J.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>S_(J)},Et(J))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||Z===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(J=>J.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(Z==null?void 0:Z.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:Z.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:J=>{F(ge=>ge?QR(ge,J):[J])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ue,runs:Ie,onOpenExperiment:(J,ge)=>Is(J,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:N4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(_b,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(J=>!J),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Gr,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(J=>J.id===d&&J.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(J=>!J),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ue,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ue.length>0?gne():void 0,experiments:br,onOpen:(J,ge)=>{Is(J.id,"overview",ge)},onOpenLogs:(J,ge,je)=>{Is(J,"terminal",je,ge)},onOpenCode:(J,ge)=>{const je=ue.find($e=>$e.id===J);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(J,ge,je,$e)=>oc(J,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const J=Ms(n,u,Dn);C.current.delete(J),E.current.add(J)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:J=>{N.current[Ms(n,u,Dn)]=J,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(J,ge,je,$e)=>hi(Dn,()=>oc(J,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:J=>{rr.current.set(Ms(n,u,Dn),J),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(J=>J.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(J,ge,je,$e,Me)=>hi(Qr,()=>oc(J,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(J,ge,je,$e,Me)=>hi(be,()=>Au(J,be.sessionId,ge,je,$e,Me)),onOpenRun:(J,ge)=>hi(be,()=>Oa(J,ge)),runExperimentName:ac,onOpenExperiment:(J,ge)=>hi(be,()=>ju(J,ge)),experimentName:sf,onOpenSubagent:(J,ge,je)=>hi(be,()=>lc(be.sessionId,J,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:J=>df(Oe,{view:J}),onToggledChange:J=>df(Oe,{toggled:J}),onOpenFile:(J,ge,je,$e)=>hi(Oe,()=>oc(J,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:H,parentExperiment:ue.find(J=>J.id===_r.parentExperimentId)??null,onOpenView:(J,ge,je)=>{hi(Bs,()=>Is(_r.id,J,je,ge))},onOpenCode:(J,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,J,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(J,ge)=>{Kr(!1),k_(J,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const T5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=T5.useParams(),{pane:n}=T5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>db}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>db}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>db}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=T5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=db._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); diff --git a/ui/dist/index.html b/ui/dist/index.html index dc96f4f0c..1631c55cb 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index da42bab68..1e985c5ed 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -3072,7 +3072,13 @@ function GitTab({ defaultPromptAutoTopics ?? enabled, true, ]) - .then(() => setDefaultPromptOpen(false)) + .then((defaults) => { + // Publish the result into the shared cache: other handlers and the + // new-project form read these defaults, and a stale entry would make + // their next write revert what was just answered here. + setScopedQueryData(getProjectDefaultsQuery().queryKey, defaults); + setDefaultPromptOpen(false); + }) .catch((err) => setDefaultPromptError(err instanceof Error ? err.message : String(err))) .finally(() => setDefaultPromptSaving(false)); }; From 7e540e1e09aeb485cea209172e340e63f97665b7 Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 13:29:59 +0800 Subject: [PATCH 7/9] Stop pinning the auto-topics default to the sync setting Sending an absent auto-topics field is not neutral: the handler derived a value from the sync flag and stored it, so a client that only toggled syncing froze the auto-topics default at that answer for good. Persist the field only when the client sends it and let the existing fallback track the sync default for anyone who never chose one. The sync toggle in the defaults tab now omits the field for the same reason, and the stale-cache comment on the auto-topics toggle says what the handler actually sends. --- src/commands/up.rs | 13 +++++++------ .../{index-CFHdEJ5E.js => index-BnkydNlI.js} | 2 +- ui/dist/index.html | 2 +- ui/src/components/SettingsPage.tsx | 15 ++++++++------- 4 files changed, 17 insertions(+), 15 deletions(-) rename ui/dist/assets/{index-CFHdEJ5E.js => index-BnkydNlI.js} (99%) diff --git a/src/commands/up.rs b/src/commands/up.rs index 51d062e54..362e90197 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -4996,12 +4996,13 @@ async fn set_project_defaults(Json(req): Json) -> ApiResu )); } crate::config::set_github_for_new_projects(req.github_for_new_projects)?; - // Auto topics only ever apply to a project that syncs, so a client toggling - // sync alone keeps them on rather than silently disabling them. - crate::config::set_github_auto_topics_for_new_projects( - req.github_auto_topics_for_new_projects - .unwrap_or(req.github_for_new_projects), - )?; + // Only persist auto topics when the client asked for them. Deriving and + // storing a value from the sync flag here would pin auto topics to this + // answer and stop `github_auto_topics_for_new_projects()` from tracking + // later sync changes for a user who never chose an explicit value. + if let Some(auto_topics) = req.github_auto_topics_for_new_projects { + crate::config::set_github_auto_topics_for_new_projects(auto_topics)?; + } if let Some(seen) = req.github_default_prompt_seen { crate::config::set_github_default_prompt_seen(seen)?; } diff --git a/ui/dist/assets/index-CFHdEJ5E.js b/ui/dist/assets/index-BnkydNlI.js similarity index 99% rename from ui/dist/assets/index-CFHdEJ5E.js rename to ui/dist/assets/index-BnkydNlI.js index 71a479d9a..7fbbd4340 100644 --- a/ui/dist/assets/index-CFHdEJ5E.js +++ b/ui/dist/assets/index-BnkydNlI.js @@ -993,7 +993,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, `,u+3),p=d===-1?e.length:d;/^[ \t]*$/.test(e.slice(_,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Vr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:i6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(fb,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Nw(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Nw(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Vr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Vr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(wv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` `)))return f.jsx("code",{className:s,...r,children:t});const l=i?v3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Vr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const Tv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` -`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${Tv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Tv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};lb(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Pr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),ey="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),J3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function zw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?o6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:D4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:l6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():a6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),ib(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${zw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:zw(o).variant,children:zw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():f6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):d6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Pr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${ey} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Wr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Pr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?_6():nb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Wr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Wr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Pr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():c6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Pr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:ey,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():c6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Wr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[f6(),f.jsx(Wr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Wr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Pr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:ey,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Wr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:h6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:D4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:D4()}):f.jsx(Pt,{variant:"warning",children:nb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ty={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],jw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},e5=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=jw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||jw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),jw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ty[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?c6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":e5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ty[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||e5.includes(e.id)?_6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ty[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ty[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Gr,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Pr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!e5.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:_6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Pr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():nb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():a6(),f.jsx(Wr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:nb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Pr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:f6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:ey,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Wr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function t5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){t5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){t5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:E4({name:Ne(e)}),"aria-label":E4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){t5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Gr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Pr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},Tw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?r6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=Tw[n.channel])==null?void 0:d.call(Tw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Pr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?r6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=ov(),t=ct(n),r=t.data??null,s=x=>{Pr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,r.githubAutoTopicsForNewProjects,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Pr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:T4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Pr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(ov()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(ce=>{Pr(ov().queryKey,ce),m(!1)}).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??u6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):d6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Wr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Aw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Aw[e])==null?void 0:n.call(Aw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const n5=e=>e==="running"||e==="starting";function d8t(e){return n5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ab,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>n5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!n5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:p6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:p6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Av(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function r5(e){return`${e.plugin?`${Av(e.plugin)}: `:""}${Av(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Rw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${Tv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Tv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};lb(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Pr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),ey="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),J3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function zw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?o6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:D4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:l6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():a6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),ib(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${zw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:zw(o).variant,children:zw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():f6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):d6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Pr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${ey} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Wr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Pr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?_6():nb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Wr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Wr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Pr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():c6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Pr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:ey,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():c6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Wr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[f6(),f.jsx(Wr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Wr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Pr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:ey,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Wr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:h6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:D4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:D4()}):f.jsx(Pt,{variant:"warning",children:nb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ty={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],jw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},e5=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=jw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||jw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),jw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ty[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?c6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":e5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ty[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||e5.includes(e.id)?_6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ty[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ty[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Gr,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Pr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!e5.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:_6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Pr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():nb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():a6(),f.jsx(Wr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:nb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Pr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:f6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:ey,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Wr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function t5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){t5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){t5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:E4({name:Ne(e)}),"aria-label":E4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){t5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Gr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Pr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},Tw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?r6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=Tw[n.channel])==null?void 0:d.call(Tw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Pr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?r6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=ov(),t=ct(n),r=t.data??null,s=x=>{Pr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,void 0,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Pr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:T4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Pr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(ov()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(ce=>{Pr(ov().queryKey,ce),m(!1)}).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??u6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):d6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Wr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Aw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Aw[e])==null?void 0:n.call(Aw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const n5=e=>e==="running"||e==="starting";function d8t(e){return n5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ab,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>n5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!n5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:p6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:p6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Av(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function r5(e){return`${e.plugin?`${Av(e.plugin)}: `:""}${Av(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Rw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||r5(r).localeCompare(r5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:r5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function s5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(Av(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),Av(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` `)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const i5=6.5,pA=2*Math.PI*i5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Rv="!";function mA(e){return e.startsWith(Rv)?e.slice(Rv.length).trim():null}function T8t(e){return e.startsWith(Rv)?e.slice(Rv.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` diff --git a/ui/dist/index.html b/ui/dist/index.html index 1631c55cb..1b6b85139 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index 1e985c5ed..234ace020 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -2760,11 +2760,10 @@ function ProjectDefaultsTab() { const enabled = !settings.githubForNewProjects; setSaving(true); setError(null); - void setProjectDefaultsMutation.mutateAsync([ - enabled, - settings.githubAutoTopicsForNewProjects, - true, - ]) + // This only answers the sync default, so auto topics are left unset: they + // keep following it for anyone who never chose an explicit value. The + // trailing flag records that the one-time prompt has been answered. + void setProjectDefaultsMutation.mutateAsync([enabled, undefined, true]) .then(setSettings) .catch((err) => setError(err instanceof Error ? err.message : String(err))) .finally(() => setSaving(false)); @@ -2775,8 +2774,10 @@ function ProjectDefaultsTab() { const enabled = !settings.githubAutoTopicsForNewProjects; setSaving(true); setError(null); - // Only the auto-topics default is sent. Echoing the cached prompt-seen flag - // could flip it back if another flow just answered the one-time prompt. + // The sync default travels along because the endpoint requires it, and + // re-sending the value we just read is a no-op. The prompt-seen flag is + // deliberately omitted: echoing it from a possibly stale cache could flip it + // back after another flow answered the one-time prompt. void setProjectDefaultsMutation.mutateAsync([ settings.githubForNewProjects, enabled, From d9964a14ea9183e50dfd526ac46ef096b0787766 Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 13:44:43 +0800 Subject: [PATCH 8/9] Keep archive prefixes in arxiv topics and harden id parsing - Preserve the archive prefix of old-style ids: hep-th/9901001 now yields arxiv-hep-th-9901001 instead of arxiv-9901001, which several archives could share. - Make the parser total. It previously sliced at fixed byte offsets and split on the last slash, so a multi-byte or odd id could panic or index past the end. It now walks character boundaries and validates the id shape, returning no topic when the id cannot be understood, because publishing topics must never take a successful push down with it. - Understand URL forms uniformly: query strings, fragments, /pdf/ links and a trailing .pdf all resolve to the same topic, and the version suffix is dropped whether or not the extension is still attached. - Stop sending topic fields when GitHub sync is off in the new-project form. They are hidden in that state, so the request was persisting values the user could not see. --- src/local/github.rs | 212 ++++++++++++++++-- .../{index-BnkydNlI.js => index-CBPXEptP.js} | 2 +- ui/dist/index.html | 2 +- ui/src/components/NewProjectForm.tsx | 8 +- 4 files changed, 196 insertions(+), 28 deletions(-) rename ui/dist/assets/{index-BnkydNlI.js => index-CBPXEptP.js} (97%) diff --git a/src/local/github.rs b/src/local/github.rs index 4941f6764..0ea1f97af 100644 --- a/src/local/github.rs +++ b/src/local/github.rs @@ -363,41 +363,142 @@ fn normalize_topic(input: &str) -> Option { (!topic.is_empty()).then_some(topic) } +/// Derives the `arxiv-…` topic from whatever the project recorded as its paper +/// id: a bare id, an `arXiv:`-prefixed one, or a pasted URL. +/// +/// Every step is total — no slice a malformed id could index past, no unwrap — +/// and an id that cannot be understood simply yields no topic. Publishing topics +/// decorates a push that already succeeded, so parsing must never be able to +/// take the project flow down with it. fn normalize_arxiv_topic(paper_id: &str) -> Option { - let trimmed = paper_id.trim(); - // Pasted ids arrive as `arXiv:2401.12345` as often as the bare id; match the - // prefix case-insensitively or the scheme word rides into the topic. - let stripped = trimmed - .get(..6) - .filter(|prefix| prefix.eq_ignore_ascii_case("arxiv:")) - .map_or(trimmed, |_| trimmed[6..].trim()); - let id = stripped.split('/').next_back().unwrap_or(stripped); - let id = id.strip_suffix(".pdf").unwrap_or(id); - let id = strip_arxiv_version(id); - if id.is_empty() { - // A blank or scheme-only id has nothing to derive a topic from. + let raw = paper_id.trim(); + let path = raw.split(['?', '#']).next().unwrap_or(raw); + let path = strip_arxiv_url_prefix(path); + + let id = match_arxiv_id(path)?; + normalize_topic(&format!("arxiv-{}", id.replace(['.', '/'], "-"))) +} + +/// Drops the scheme, host and `abs`/`pdf` segment of an arXiv URL so only the id +/// path is left to match. Anything that is not a URL comes back unchanged. +fn strip_arxiv_url_prefix(raw: &str) -> &str { + if !(raw.starts_with("http://") || raw.starts_with("https://")) { + return raw; + } + let Some((_, rest)) = raw.split_once("://") else { + return raw; + }; + let Some((_, path)) = rest.split_once('/') else { + // Host with no path: nothing left to match. + return ""; + }; + match path.split_once('/') { + Some((kind, tail)) + if kind.eq_ignore_ascii_case("abs") || kind.eq_ignore_ascii_case("pdf") => + { + tail + } + _ => path, + } +} + +/// `Some(id)` when `candidate` is shaped like an arXiv id, new style +/// (`2401.12345`) or old style (`hep-th/9901001`). +fn known_arxiv_id_shape(candidate: &str) -> Option<&str> { + let digits = |text: &str, min: usize, max: usize| { + (min..=max).contains(&text.len()) && text.bytes().all(|byte| byte.is_ascii_digit()) + }; + // New style: YYMM.NNNNN. + if let Some((head, tail)) = candidate.split_once('.') { + if digits(head, 4, 4) && digits(tail, 4, 5) { + return Some(candidate); + } + } + // Old style: an archive, optionally with a subcategory, plus a 7-digit + // number. The archive may carry a hyphen (`hep-th`), so this must not + // require a dot in the head. + let (archive, number) = candidate.rsplit_once('/')?; + if archive.is_empty() || !digits(number, 7, 7) { return None; } - let id = id.replace('.', "-"); - normalize_topic(&format!("arxiv-{id}")) + let archive_shape = archive.len() <= 32 + && archive.split('.').all(|part| { + !part.is_empty() + && part + .chars() + .all(|ch| ch.is_ascii_alphanumeric() || ch == '-' || ch == '.') + }); + archive_shape.then_some(candidate) +} + +/// The longest arxiv-shaped id ending `path`, so an old-style `hep-th/9901001` +/// keeps its archive prefix instead of degrading to `9901001`, a number several +/// archives can share. +/// +/// Walks separators through `char_indices`, never a byte offset, so a multi-byte +/// id cannot land the slice inside a character. +fn match_arxiv_id(path: &str) -> Option { + let cleaned = strip_arxiv_version(path); + let mut offset = 0; + loop { + let candidate = &cleaned[offset..]; + let candidate = strip_prefix_ignore_case(candidate, "arxiv:").unwrap_or(candidate); + let candidate = strip_suffix_ignore_case(candidate, ".pdf"); + let candidate = candidate.trim_matches('/'); + if !candidate.is_empty() && known_arxiv_id_shape(candidate).is_some() { + return Some(candidate.to_string()); + } + let slash = cleaned[offset..] + .char_indices() + .find(|(_, ch)| *ch == '/') + .map(|(index, _)| index)?; + offset += slash + 1; + } +} + +/// Case-insensitive prefix strip that compares ASCII only, so a multi-byte input +/// cannot make it slice through a character. +fn strip_prefix_ignore_case<'a>(text: &'a str, prefix: &str) -> Option<&'a str> { + let head = text.get(..prefix.len())?; + head.eq_ignore_ascii_case(prefix) + .then(|| &text[prefix.len()..]) +} + +/// Case-insensitive suffix strip that compares ASCII only, so a multi-byte input +/// cannot make it slice through a character. +fn strip_suffix_ignore_case<'a>(text: &'a str, suffix: &str) -> &'a str { + let Some(cut) = text.len().checked_sub(suffix.len()) else { + return text; + }; + match text.get(cut..) { + Some(tail) if tail.eq_ignore_ascii_case(suffix) => &text[..cut], + _ => text, + } } /// Drops a trailing `vN` so every version of one paper maps to one topic — /// otherwise `2401.12345v1` and `v2` land in separate search buckets. /// /// Only a `v` followed by digits counts, and only when digits precede it, so an -/// old-style id like `hep-th/9901001` keeps its trailing `1`. +/// old-style id like `hep-th/9901001` keeps its trailing `1`. A trailing +/// extension is tolerated (`2401.12345v2.pdf`) because this runs before the +/// caller has decided whether to strip one. fn strip_arxiv_version(id: &str) -> &str { - if let Some((head, tail)) = id.rsplit_once('v') { - if !head.is_empty() - && head.ends_with(|ch: char| ch.is_ascii_digit()) - && !tail.is_empty() - && tail.chars().all(|ch| ch.is_ascii_digit()) - { - return head; - } + // Tolerate a trailing extension so `2401.12345v2.pdf` is understood whether + // or not the caller strips the `.pdf` first. + let tail = strip_suffix_ignore_case(id, ".pdf"); + // Split on the `v` itself; the trailing digits must stay in the searched + // string, so this cannot look only at the digit-stripped prefix. + let Some((head, version)) = tail.rsplit_once('v') else { + return id; + }; + if version.is_empty() || !version.bytes().all(|byte| byte.is_ascii_digit()) { + return id; } - id + if head.is_empty() || !head.ends_with(|ch: char| ch.is_ascii_digit()) { + return id; + } + head } #[cfg(test)] @@ -494,6 +595,69 @@ mod tests { } } + #[test] + fn old_style_ids_keep_their_archive_prefix() { + // The archive prefix is signal: `9901001` alone is shared across archives. + let topic = |id: &str| default_topics_for_project(Some(id)); + assert_eq!(topic("hep-th/9901001")[1], "arxiv-hep-th-9901001"); + assert_eq!(topic("cs.CL/0701001")[1], "arxiv-cs-cl-0701001"); + assert_eq!( + topic("https://arxiv.org/abs/hep-th/9901001")[1], + "arxiv-hep-th-9901001" + ); + // The version suffix is still dropped, archive prefix and all. + assert_eq!(topic("hep-th/9901001v3")[1], "arxiv-hep-th-9901001"); + } + + #[test] + fn unparseable_paper_ids_yield_no_topic_without_panicking() { + // Topics decorate a push that already succeeded, so a strange id must + // degrade to "no arxiv topic" rather than take the flow down. + for id in [ + "", + " ", + "arxiv:", + "arXiv:", + "not a paper id", + "https://example.com/abs/", + "https://arxiv.org/abs/", + "http://", + "https://", + "hep-th/", + "//", + "..", + "2401", + "2401.", + "v2", + "日本語のタイトル", + "arxiv:日本語", + "2401.12345/../../etc/passwd", + "x".repeat(500).as_str(), + "\u{0}", + ] { + assert_eq!( + default_topics_for_project(Some(id)), + vec!["openresearch"], + "id {id:?} should publish no arxiv topic" + ); + } + } + + #[test] + fn malformed_ids_cannot_slip_a_bogus_topic_through() { + // Path traversal and query strings must not become part of the topic. + let topic = |id: &str| default_topics_for_project(Some(id)); + assert_eq!( + topic("https://arxiv.org/abs/2401.12345?context=cs")[1], + "arxiv-2401-12345" + ); + assert_eq!(topic("2401.12345#section")[1], "arxiv-2401-12345"); + assert_eq!( + topic("https://arxiv.org/pdf/2401.12345v2.pdf")[1], + "arxiv-2401-12345" + ); + } + #[test] fn old_style_and_malformed_ids_keep_their_signals() { // Old-style ids end in digits but carry no `vN`, so nothing is stripped. diff --git a/ui/dist/assets/index-BnkydNlI.js b/ui/dist/assets/index-CBPXEptP.js similarity index 97% rename from ui/dist/assets/index-BnkydNlI.js rename to ui/dist/assets/index-CBPXEptP.js index 7fbbd4340..49abe8cb4 100644 --- a/ui/dist/assets/index-BnkydNlI.js +++ b/ui/dist/assets/index-CBPXEptP.js @@ -500,7 +500,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function B2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():i6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(fb,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function n3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),U=(oe,ue=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([ib(oe,ue),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&oe.some(ye=>ye.id===ue))return ue;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ue=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const Z=oe=>{const ue=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ue||nt.fetchQuery(W4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=oe=>j(ue=>ue.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ue=>ue.includes(oe)?ue.filter(pe=>pe!==oe):[...ue,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ue=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(B2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(z1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(z1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>Z(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>ce(oe.paperId),disabled:u,children:f.jsx(Gr,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(z1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?o6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:sb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(n3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ob,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??a6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ob,{tone:e?"success":n||e===null?"danger":"warning",children:e?o6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function mb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=v6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function $2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?F:r==="paper"&&H&&!d?W:u,Z=$2(U.trim(),200),ce=ct({...B0(Z),enabled:!!Z&&Z===U.trim()}),re=Z===U.trim()?ce.data??null:null,ne=Z===U.trim()?((rr=ce.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(Z!==U.trim()||ce.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ue=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(ov()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=$2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=$2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...W4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(W4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(C2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,githubAutoTopicsEnabled:T,githubTopics:Tgt(M),locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?C2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?C2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ue=="string"&&!Te&&!Dt),un=Ut??`github.com/${ue??"you"}/${Ie}`,Mn=ue===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ue===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ue===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),"aria-label":S1(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ue===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):l6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?d6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":E4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":tv({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(mb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":j4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:j4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},j1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=j1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:j1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?s6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=j1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Wr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Wr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Wr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await ib(!0)}}}),l=j1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?s6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return lb(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:iv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:sb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ue,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:iv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):I4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ue=t.find(ye=>ye.id===q))==null?void 0:ue.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=iv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},Z=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(n3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[Z(L0(),B,"models"),i.length>0&&Z(G,H,"reasoning"),te.length>0&&Z(tN(),L,"speed"),t.length>0&&Z(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(n3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(tN()),re(te,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,U=F.top-12,Z=Math.min(380,X.scrollHeight),ce=i?W>=Z||W>=U:UU;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?W:U))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===sv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function r3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function hv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():R4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(r3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:N2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":N2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:N2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=av(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Pr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=av(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Gr,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=X5({from:"__root__"}),t=Zv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Zv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&ub.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Pr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),_v=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),pv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(_v(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(_v(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[_v(e,n,{sessionId:r,ref:s}).queryKey,_v(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ob,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||gb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||gb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return i3(n)})(e)||SI(e)||gb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. + */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function B2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():i6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(fb,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function n3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),U=(oe,ue=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([ib(oe,ue),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&oe.some(ye=>ye.id===ue))return ue;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ue=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const Z=oe=>{const ue=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ue||nt.fetchQuery(W4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=oe=>j(ue=>ue.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ue=>ue.includes(oe)?ue.filter(pe=>pe!==oe):[...ue,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ue=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(B2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(z1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(z1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>Z(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>ce(oe.paperId),disabled:u,children:f.jsx(Gr,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(z1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?o6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:sb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(n3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ob,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??a6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ob,{tone:e?"success":n||e===null?"danger":"warning",children:e?o6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function mb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=v6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function $2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?F:r==="paper"&&H&&!d?W:u,Z=$2(U.trim(),200),ce=ct({...B0(Z),enabled:!!Z&&Z===U.trim()}),re=Z===U.trim()?ce.data??null:null,ne=Z===U.trim()?((rr=ce.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(Z!==U.trim()||ce.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ue=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(ov()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=$2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=$2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...W4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(W4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(C2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,...E?{githubAutoTopicsEnabled:T,githubTopics:Tgt(M)}:{},locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?C2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?C2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ue=="string"&&!Te&&!Dt),un=Ut??`github.com/${ue??"you"}/${Ie}`,Mn=ue===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ue===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ue===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),"aria-label":S1(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ue===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):l6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?d6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":E4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":tv({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(mb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":j4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:j4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},j1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=j1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:j1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?s6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=j1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Wr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Wr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Wr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await ib(!0)}}}),l=j1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?s6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return lb(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:iv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:sb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ue,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:iv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):I4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ue=t.find(ye=>ye.id===q))==null?void 0:ue.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=iv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},Z=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(n3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[Z(L0(),B,"models"),i.length>0&&Z(G,H,"reasoning"),te.length>0&&Z(tN(),L,"speed"),t.length>0&&Z(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(n3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(tN()),re(te,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,U=F.top-12,Z=Math.min(380,X.scrollHeight),ce=i?W>=Z||W>=U:UU;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?W:U))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===sv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function r3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function hv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():R4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(r3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:N2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":N2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:N2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=av(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Pr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=av(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Gr,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=X5({from:"__root__"}),t=Zv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Zv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&ub.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Pr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),_v=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),pv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(_v(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(_v(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[_v(e,n,{sessionId:r,ref:s}).queryKey,_v(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ob,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||gb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||gb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return i3(n)})(e)||SI(e)||gb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gb(e,n){if(e){if(typeof e=="string")return i3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i3(e,n):void 0}}function i3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,i=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var Pg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rm(e,n){return e(n={exports:{}},n.exports),n.exports}var Ui=rm((function(e){/*! diff --git a/ui/dist/index.html b/ui/dist/index.html index 1b6b85139..f1a17b0f2 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/src/components/NewProjectForm.tsx b/ui/src/components/NewProjectForm.tsx index 4891e474e..07b3a26f6 100644 --- a/ui/src/components/NewProjectForm.tsx +++ b/ui/src/components/NewProjectForm.tsx @@ -261,8 +261,12 @@ export function NewProjectForm({ requireNewFolder: mode === "blank", initializeGit: true, githubSyncEnabled, - githubAutoTopicsEnabled, - githubTopics: parseTopics(githubTopics), + // Topic fields are hidden while syncing is off, so sending them would + // persist state the user cannot see and could surface later as topics + // they never confirmed. + ...(githubSyncEnabled + ? { githubAutoTopicsEnabled, githubTopics: parseTopics(githubTopics) } + : {}), locale: getLocale(), ...(mode === "paper" && paper ? { paperId: paper.paperId, cloneUrl: paper.repoUrl ?? undefined } From d12d9427dad8e7f59684b5567ad7745823a74f87 Mon Sep 17 00:00:00 2001 From: "zexuan.peng" Date: Tue, 15 Sep 2026 14:08:44 +0800 Subject: [PATCH 9/9] Read the settings once and give each topics control its own name - Derive the auto-topics fallback from the same settings load instead of calling back into github_for_new_projects(). The second read was extra I/O and could see a different file if settings.json was rewritten in between. - Name the new-project topics input after the field itself rather than the generic "Repository topics" label. - Give the per-project topics switch its own label, so it is no longer announced with the same name as the text field below it. --- src/telemetry.rs | 10 +- .../{index-CBPXEptP.js => index-BWO6cMBy.js} | 376 +++++++++--------- ui/dist/index.html | 2 +- ui/messages/en.json | 3 +- ui/messages/fa.json | 3 +- ui/messages/zh-CN.json | 3 +- ui/src/components/NewProjectForm.tsx | 2 +- ui/src/components/SettingsPage.tsx | 2 +- 8 files changed, 205 insertions(+), 196 deletions(-) rename ui/dist/assets/{index-CBPXEptP.js => index-BWO6cMBy.js} (84%) diff --git a/src/telemetry.rs b/src/telemetry.rs index 202bbd764..fa350c2ea 100644 --- a/src/telemetry.rs +++ b/src/telemetry.rs @@ -294,9 +294,15 @@ pub(crate) fn set_github_for_new_projects(enabled: bool) -> std::io::Result<()> } pub(crate) fn github_auto_topics_for_new_projects() -> bool { + // One load, so the fallback cannot observe a different file than the value + // it falls back from when settings.json is rewritten in between. load_settings() - .and_then(|settings| settings.github_auto_topics_for_new_projects) - .unwrap_or_else(github_for_new_projects) + .map(|settings| { + settings + .github_auto_topics_for_new_projects + .unwrap_or(settings.github_for_new_projects.unwrap_or(false)) + }) + .unwrap_or(false) } pub(crate) fn set_github_auto_topics_for_new_projects(enabled: bool) -> std::io::Result<()> { diff --git a/ui/dist/assets/index-CBPXEptP.js b/ui/dist/assets/index-BWO6cMBy.js similarity index 84% rename from ui/dist/assets/index-CBPXEptP.js rename to ui/dist/assets/index-BWO6cMBy.js index 49abe8cb4..bfa1ff0ad 100644 --- a/ui/dist/assets/index-CBPXEptP.js +++ b/ui/dist/assets/index-BWO6cMBy.js @@ -1,4 +1,4 @@ -var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in e?sG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>iG(e,typeof n!="symbol"?n+"":n,t),s2=(e,n,t)=>n.has(e)||Z8("Cannot "+t);var de=(e,n,t)=>(s2(e,n,"read from private field"),t?t.call(e):n.get(e)),st=(e,n,t)=>n.has(e)?Z8("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(s2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ot=(e,n,t)=>(s2(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return de(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i2={exports:{}},s0={};/** +var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in e?sG(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Fs=(e,n,t)=>iG(e,typeof n!="symbol"?n+"":n,t),r2=(e,n,t)=>n.has(e)||Z8("Cannot "+t);var de=(e,n,t)=>(r2(e,n,"read from private field"),t?t.call(e):n.get(e)),st=(e,n,t)=>n.has(e)?Z8("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Fe=(e,n,t,r)=>(r2(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t),Ot=(e,n,t)=>(r2(e,n,"access private method"),t);var r0=(e,n,t,r)=>({set _(s){Fe(e,n,s,t)},get _(){return de(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s2={exports:{}},s0={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var J8;function aG(){if(J8)return s0;J8=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var e9;function oG(){return e9||(e9=1,i2.exports=aG()),i2.exports}var f=oG(),a2={exports:{}},Xt={};/** + */var J8;function aG(){if(J8)return s0;J8=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return s0.Fragment=n,s0.jsx=t,s0.jsxs=t,s0}var e9;function oG(){return e9||(e9=1,s2.exports=aG()),s2.exports}var f=oG(),i2={exports:{}},Xt={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,W){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,W,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,W,U){var Z=U.ref;return{$$typeof:e,type:F,key:W,ref:Z!==void 0?Z:null,props:U}}function O(F,W){return M(F.type,W,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var W={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(U){return W[U]})}var H=/\/+/g;function q(F,W){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):W.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(W){F.status==="pending"&&(F.status="fulfilled",F.value=W)},function(W){F.status==="pending"&&(F.status="rejected",F.reason=W)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function G(F,W,U,Z,ce){var re=typeof F;(re==="undefined"||re==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,G(ne(F._payload),W,U,Z,ce)}}if(ne)return ce=ce(F),ne=Z===""?"."+q(F,0):Z,E(ce)?(U="",ne!=null&&(U=ne.replace(H,"$&/")+"/"),G(ce,W,U,"",function(oe){return oe})):ce!=null&&(B(ce)&&(ce=O(ce,U+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+ne)),W.push(ce)),1;ne=0;var Q=Z===""?".":Z+":";if(E(F))for(var le=0;le{const n=R.useContext(cM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(cM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,A5,XR,dG=(XR=class{constructor(){st(this,Qc,uG);st(this,A5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return de(this,Qc).setTimeout(e,n)}clearTimeout(e){de(this,Qc).clearTimeout(e)}setInterval(e,n){return de(this,Qc).setInterval(e,n)}clearInterval(e){de(this,Qc).clearInterval(e)}},Qc=new WeakMap,A5=new WeakMap,XR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function uM(e){return typeof e=="number"&&e>=0&&e!==1/0}function dM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==R5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function R5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Jw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Jw(e)&&Jw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function e4(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?M5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const D5=Symbol();function fM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===D5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function L5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const O5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,ZR,xG=(ZR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){de(this,Yc)||this.setEventListener(de(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=de(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){de(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof de(this,ud)=="boolean"?de(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,ZR);const I5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,JR,kG=(JR=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,Xc)||this.setEventListener(de(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=de(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){de(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return de(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,JR);const U1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function hM(e){return(e??"online")==="online"?U1.isOnline():!0}var G1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof G1}function _M(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new G1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>I5.isFocused()&&(e.networkMode==="always"||U1.isOnline())&&e.canRun(),m=()=>hM(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(O5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,eM,pM=(eM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(O5()?1/0:3e5))}clearGcTimeout(){de(this,dd)!==void 0&&(ad.clearTimeout(de(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,eM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=fM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,tM,jG=(tM=class extends pM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,de(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??de(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return de(this,wh)}get promise(){var n;return(n=de(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...de(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,wa).remove(this)}setData(n,t){const r=e4(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=de(this,hs))==null?void 0:r.promise;return(s=de(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return de(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!dM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),de(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(de(this,hs)&&(de(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?de(this,hs).cancel({revert:!0}):de(this,hs).cancelRetry()),this.scheduleGc()),de(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=de(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(de(this,hs))return de(this,hs).continueRetry(),de(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=fM(this.options,t),T=(()=>{const j={client:de(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:de(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=de(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,_M({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof G1&&E.revert&&this.setState({...de(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=de(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=de(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof G1){if(E.silent)return de(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=de(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=de(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{de(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),de(this,wa).notify({query:this,type:"updated",action:n})})},tM);function mM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hM(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,t4,n4,r4,s4,i4,a4,o4,l4,nM,B5=(nM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(de(this,Sn).addObserver(this),u9(de(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,i4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c4(de(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c4(de(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,a4).call(this),Ot(this,Un,o4).call(this),de(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=de(this,Sn);if(this.options=de(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,de(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,l4).call(this),de(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&de(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:de(this,Sn),observer:this});const s=this.hasListeners();s&&d9(de(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||$r(this.options.staleTime,de(this,Sn))!==$r(t.staleTime,de(this,Sn)))&&Ot(this,Un,n4).call(this);const i=Ot(this,Un,r4).call(this);s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||i!==de(this,Zc))&&Ot(this,Un,s4).call(this,i)}getOptimisticResult(n){const t=de(this,ni).getQueryCache().build(de(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,de(this,Sn).state)),r}getCurrentResult(){return de(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){de(this,Nh).add(n)}getCurrentQuery(){return de(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=de(this,ni).defaultQueryOptions(n),r=de(this,ni).getQueryCache().build(de(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=de(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),de(this,ri)))}createResult(n,t){var N;const r=de(this,Sn),s=this.options,i=de(this,ri),a=de(this,pd),o=de(this,kh),l=n!==r?n.state:de(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...mM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=de(this,Eh))==null?void 0:N.state.data,de(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=e4(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===de(this,Dp))p=de(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=e4(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);de(this,zl)&&(m=de(this,zl),p=de(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:$5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=de(this,ri),t=this.createResult(de(this,Sn),this.options);if(Fe(this,pd,de(this,Sn).state),Fe(this,kh,this.options),de(this,pd).data!==void 0&&Fe(this,Eh,de(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!de(this,Nh).size)return!0;const o=new Set(a??de(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(de(this,ri)).some(l=>{const u=l;return de(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(de(this,ri))}),de(this,ni).getQueryCache().notify({query:de(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,i4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,l4).call(this);let t=de(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},t4=function(n){return!O5()&&$r(this.options.enabled,de(this,Sn))!==!1&&uM(n)},n4=function(){Ot(this,Un,a4).call(this);const n=$r(this.options.staleTime,de(this,Sn));if(de(this,ri).isStale||!Ot(this,Un,t4).call(this,n))return;const t=dM(de(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{de(this,ri).isStale||this.updateResult()},t))},r4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(de(this,Sn)):this.options.refetchInterval)??!1},s4=function(n){Ot(this,Un,o4).call(this),Fe(this,Zc,n),!(de(this,Zc)===0||!Ot(this,Un,t4).call(this,de(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||I5.isFocused())&&Ot(this,Un,S0).call(this)},de(this,Zc)))},i4=function(){Ot(this,Un,n4).call(this),Ot(this,Un,s4).call(this,Ot(this,Un,r4).call(this))},a4=function(){de(this,md)!==void 0&&(ad.clearTimeout(de(this,md)),Fe(this,md,void 0))},o4=function(){de(this,gd)!==void 0&&(ad.clearInterval(de(this,gd)),Fe(this,gd,void 0))},l4=function(){const n=de(this,ni).getQueryCache().build(de(this,ni),this.options);if(n===de(this,Sn))return;const t=de(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},nM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&c4(e,n,n.refetchOnMount)}function c4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&$5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&$5(e,t)}function $5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,rM,AG=(rM=class extends pM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||gM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){de(this,Eo).includes(n)||(de(this,Eo).push(n),this.clearGcTimeout(),de(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,de(this,Eo).filter(t=>t!==n)),this.scheduleGc(),de(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){de(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():de(this,qs).remove(this))}continue(){var n;return((n=de(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:de(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,_M({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),de(this,qs).config.onMutate&&await de(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=de(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=de(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=de(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=de(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{de(this,vd)===s&&Fe(this,vd,void 0),de(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{de(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),de(this,qs).notify({mutation:this,type:"updated",action:n})})},rM);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,sM,RG=(sM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){de(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);r?r.push(n):de(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(de(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&de(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{de(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),de(this,jl).clear(),de(this,qa).clear()})}getAll(){return Array.from(de(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,sM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,u4,iM,MG=(iM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=de(this,Tl).defaultMutationOptions(t),A0(this.options,r)||de(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:de(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=de(this,Us))==null?void 0:s.state.status)==="pending"&&de(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&de(this,Us)&&(de(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=de(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,u4).call(this,t)}getCurrentResult(){return de(this,Jc)}reset(){var t;(t=de(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,u4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=de(this,Us))==null||s.removeObserver(this),Fe(this,Us,de(this,Tl).getMutationCache().build(de(this,Tl),this.options)),de(this,Us).addObserver(this),de(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=de(this,Us))==null?void 0:r.state)??gM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},u4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(de(this,Al)&&this.hasListeners()){const d=de(this,Jc).variables,p=de(this,Jc).context,m={client:de(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=de(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=de(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=de(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=de(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(de(this,Jc))})})},iM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,d4,f4,vM,h4,_4,p4,aM,DG=(aM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&de(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,_4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,de(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=de(this,Fi),s=Ot(this,ms,h4).call(this,de(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=de(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,_4).call(this,d,p)})})),Ot(this,ms,p4).call(this)))})}getCurrentResult(){return de(this,si)}getQueries(){return de(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return de(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,h4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,f4).call(this,a??s,t,i),()=>Ot(this,ms,d4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,d4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},f4=function(n,t,r){if(t){const s=de(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(de(this,si)!==de(this,Bp)||i||t!==de(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,de(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,M5(de(this,yd),t(n)))),de(this,yd)}return n},vM=function(){var n;return!((n=de(this,bd))!=null&&n.combine)||de(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=de(this,si)[r])==null?void 0:s.data)===void 0})},h4=function(n){const t=new Map;de(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=de(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new B5(de(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},_4=function(n,t){const r=de(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,de(this,si).slice()),de(this,si)[r]=t,Ot(this,ms,p4).call(this))},p4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,vM).call(this),r=de(this,yd),s=t?r:Ot(this,ms,f4).call(this,Ot(this,ms,d4).call(this,de(this,si),de(this,Pp)),(n=de(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(de(this,si))})})}},aM),zo,oM,LG=(oM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??R5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){de(this,zo).has(n.queryHash)||(de(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=de(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&de(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return de(this,zo).get(n)}getAll(){return[...de(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,oM),zr,eu,tu,Th,Ah,nu,Rh,Mh,lM,OG=(lM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,de(this,nu)===1&&(Fe(this,Rh,I5.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onFocus())})),Fe(this,Mh,U1.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,de(this,nu)===0&&((e=de(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=de(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return de(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return de(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=de(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return de(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=de(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return de(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>de(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=de(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=de(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>de(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(de(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>de(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return U1.isOnline()?de(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,zr)}getMutationCache(){return de(this,eu)}getDefaultOptions(){return de(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){de(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...de(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){de(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...de(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...de(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=R5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===D5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...de(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){de(this,zr).clear(),de(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,lM);const bM=R.createContext(!1),yM=()=>R.useContext(bM);bM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),xM=()=>R.useContext(BG),wM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?L5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},SM=e=>{R.useEffect(()=>{e.clearReset()},[e])},kM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||L5(t,[e.error,r])),CM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},m4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,EM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=yM(),i=xM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{CM(S);const v=r.getQueryCache().get(S.queryHash);wM(S,i,v)}),SM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>m4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&m4(b,S)){const w=new B5(r,b);return EM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&kM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=yM(),s=xM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,CM(a),wM(a,s,o),SM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),m4(a,_))throw EM(a,u,s);if(kM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,B5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&L5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Vv=0;const g4=new Set,HG=()=>Vv,_9=e=>(g4.add(e),()=>{g4.delete(e)}),za=()=>["workspace",Vv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Vv++,du.clear(),P5({queryKey:t}),g4.forEach(r=>r()),!0}const Fn=e=>e[1]===Vv;async function P5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Pr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var o2={exports:{}},i0={},l2={exports:{}},c2={};/** + */var t9;function lG(){if(t9)return Xt;t9=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,v={};function b(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}b.prototype.isReactComponent={},b.prototype.setState=function(F,W){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,W,"setState")},b.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function w(){}w.prototype=b.prototype;function y(F,W,U){this.props=F,this.context=W,this.refs=v,this.updater=U||x}var C=y.prototype=new w;C.constructor=y,S(C,b.prototype),C.isPureReactComponent=!0;var E=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function M(F,W,U){var Z=U.ref;return{$$typeof:e,type:F,key:W,ref:Z!==void 0?Z:null,props:U}}function O(F,W){return M(F.type,W,F.props)}function B(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){var W={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(U){return W[U]})}var H=/\/+/g;function q(F,W){return typeof F=="object"&&F!==null&&F.key!=null?$(""+F.key):W.toString(36)}function Y(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(N,N):(F.status="pending",F.then(function(W){F.status==="pending"&&(F.status="fulfilled",F.value=W)},function(W){F.status==="pending"&&(F.status="rejected",F.reason=W)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function G(F,W,U,Z,ce){var re=typeof F;(re==="undefined"||re==="boolean")&&(F=null);var ne=!1;if(F===null)ne=!0;else switch(re){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(F.$$typeof){case e:case n:ne=!0;break;case _:return ne=F._init,G(ne(F._payload),W,U,Z,ce)}}if(ne)return ce=ce(F),ne=Z===""?"."+q(F,0):Z,E(ce)?(U="",ne!=null&&(U=ne.replace(H,"$&/")+"/"),G(ce,W,U,"",function(oe){return oe})):ce!=null&&(B(ce)&&(ce=O(ce,U+(ce.key==null||F&&F.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+ne)),W.push(ce)),1;ne=0;var Q=Z===""?".":Z+":";if(E(F))for(var le=0;le{const n=R.useContext(uM);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cG=({client:e,children:n})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(uM.Provider,{value:e,children:n})),uG={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Qc,A5,ZR,dG=(ZR=class{constructor(){st(this,Qc,uG);st(this,A5,!1)}setTimeoutProvider(e){Fe(this,Qc,e)}setTimeout(e,n){return de(this,Qc).setTimeout(e,n)}clearTimeout(e){de(this,Qc).clearTimeout(e)}setInterval(e,n){return de(this,Qc).setInterval(e,n)}clearInterval(e){de(this,Qc).clearInterval(e)}},Qc=new WeakMap,A5=new WeakMap,ZR);const ad=new dG;function fG(e){setTimeout(e,0)}const hG=typeof window>"u"||"Deno"in globalThis;function Ws(){}function _G(e,n){return typeof e=="function"?e(n):e}function dM(e){return typeof e=="number"&&e>=0&&e!==1/0}function fM(e,n){return Math.max(e+(n||0)-Date.now(),0)}function $r(e,n){return typeof e=="function"?e(n):e}function r9(e,n){const{type:t="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a){if(r){if(n.queryHash!==R5(a,n.options))return!1}else if(!Ih(n.queryKey,a))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&n.isStale()!==o||s&&s!==n.state.fetchStatus||i&&!i(n))}function s9(e,n){const{exact:t,status:r,predicate:s,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(Td(n.options.mutationKey)!==Td(i))return!1}else if(!Ih(n.options.mutationKey,i))return!1}return!(r&&n.state.status!==r||s&&!s(n))}function R5(e,n){return((n==null?void 0:n.queryKeyHashFn)||Td)(e)}function Td(e){return JSON.stringify(e,(n,t)=>Zw(t)?Object.keys(t).sort().reduce((r,s)=>(r[s]=t[s],r),{}):t)}function Ih(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let r=0;r500)return n;const r=i9(e)&&i9(n);if(!r&&!(Zw(e)&&Zw(n)))return n;const s=(r?e:Object.keys(e)).length,i=r?n:Object.keys(n),a=i.length,o=r?new Array(a):{};let l=0;for(let u=0;u{ad.setTimeout(n,e)})}function Jw(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?M5(e,n):n}function gG(e,n,t=0){const r=[...e,n];return t&&r.length>t?r.slice(1):r}function vG(e,n,t=0){const r=[n,...e];return t&&r.length>t?r.slice(0,-1):r}const D5=Symbol();function hM(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===D5?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function L5(e,n){return typeof e=="function"?e(...n):!!e}function bG(e,n,t){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=n()),r||(r=!0,s.aborted?t():s.addEventListener("abort",t,{once:!0})),s)}),e}let yG=()=>hG;const O5=()=>yG();var Gd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ud,Yc,bh,JR,xG=(JR=class extends Gd{constructor(){super();st(this,ud);st(this,Yc);st(this,bh);Fe(this,bh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){de(this,Yc)||this.setEventListener(de(this,bh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Yc))==null||n.call(this),Fe(this,Yc,void 0))}setEventListener(n){var t;Fe(this,bh,n),(t=de(this,Yc))==null||t.call(this),Fe(this,Yc,n(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(n){de(this,ud)!==n&&(Fe(this,ud,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(t=>{t(n)})}isFocused(){var n;return typeof de(this,ud)=="boolean"?de(this,ud):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},ud=new WeakMap,Yc=new WeakMap,bh=new WeakMap,JR);const I5=new xG,wG=fG;function SG(){let e=[],n=0,t=o=>{o()},r=o=>{o()},s=wG;const i=o=>{n?e.push(o):s(()=>{t(o)})},a=()=>{const o=e;e=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;n++;try{l=o()}finally{n--,n||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}const Tr=SG();var yh,Xc,xh,eM,kG=(eM=class extends Gd{constructor(){super();st(this,yh,!0);st(this,Xc);st(this,xh);Fe(this,xh,n=>{if(typeof window<"u"&&window.addEventListener){const t=()=>n(!0),r=()=>n(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,Xc)||this.setEventListener(de(this,xh))}onUnsubscribe(){var n;this.hasListeners()||((n=de(this,Xc))==null||n.call(this),Fe(this,Xc,void 0))}setEventListener(n){var t;Fe(this,xh,n),(t=de(this,Xc))==null||t.call(this),Fe(this,Xc,n(this.setOnline.bind(this)))}setOnline(n){de(this,yh)!==n&&(Fe(this,yh,n),this.listeners.forEach(t=>{t(n)}))}isOnline(){return de(this,yh)}},yh=new WeakMap,Xc=new WeakMap,xh=new WeakMap,eM);const q1=new kG;function CG(e){return Math.min(1e3*2**e,3e4)}function _M(e){return(e??"online")==="online"?q1.isOnline():!0}var U1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EG(e){return e instanceof U1}function pM(e){let n=!1,t=0,r,s="pending",i,a;const o=new Promise((w,y)=>{i=w,a=y});o.catch(Ws);const l=()=>s!=="pending",u=w=>{var y;if(!l()){const C=new U1(w);S(C),(y=e.onCancel)==null||y.call(e,C)}},_=()=>{n=!0},d=()=>{n=!1},p=()=>I5.isFocused()&&(e.networkMode==="always"||q1.isOnline())&&e.canRun(),m=()=>_M(e.networkMode)&&e.canRun(),x=w=>{l()||(r==null||r(),s="resolved",i(w))},S=w=>{l()||(r==null||r(),s="rejected",a(w))},v=()=>new Promise(w=>{var y;r=C=>{(l()||p())&&w(C)},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;r=void 0,l()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(l())return;let w;const y=t===0?e.initialPromise:void 0;try{w=y??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(x).catch(C=>{var M;if(l())return;const E=e.retry??(O5()?0:3),N=e.retryDelay??CG,T=typeof N=="function"?N(t,C):N,j=E===!0||typeof E=="number"&&tp()?void 0:v()).then(()=>{n?S(C):b()})})};return{promise:o,status:()=>s,cancel:u,continue:()=>(r==null||r(),o),cancelRetry:_,continueRetry:d,canStart:m,start:()=>(m()?b():v().then(b),o)}}var dd,tM,mM=(tM=class{constructor(){st(this,dd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dM(this.gcTime)&&Fe(this,dd,ad.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(O5()?1/0:3e5))}clearGcTimeout(){de(this,dd)!==void 0&&(ad.clearTimeout(de(this,dd)),Fe(this,dd,void 0))}},dd=new WeakMap,tM);function NG(e){return{onFetch:(n,t)=>{var _,d,p,m,x;const r=n.options,s=(p=(d=(_=n.fetchOptions)==null?void 0:_.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((m=n.state.data)==null?void 0:m.pages)||[],a=((x=n.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let S=!1;const v=y=>{bG(y,()=>n.signal,()=>S=!0)},b=hM(n.options,n.fetchOptions),w=async(y,C,E)=>{if(S)return Promise.reject(n.signal.reason);if(C==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:n.client,queryKey:n.queryKey,pageParam:C,direction:E?"backward":"forward",meta:n.options.meta};return v(B),B})(),j=await b(T),{maxPages:M}=n.options,O=E?vG:gG;return{pages:O(y.pages,j,M),pageParams:O(y.pageParams,C,M)}};if(s&&i.length){const y=s==="backward",C=y?zG:o9,E={pages:i,pageParams:a};o=await w(E,C(r,E),y)}else{const y=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:o9(r,o);if(l>0&&C==null)break;o=await w(o,C),l++}while(l{var S,v;return(v=(S=n.options).persister)==null?void 0:v.call(S,u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t)}:n.fetchFn=u}}}function o9(e,{pages:n,pageParams:t}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,t[r],t):void 0}function zG(e,{pages:n,pageParams:t}){var r;return n.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,n[0],n,t[0],t):void 0}var wh,fd,Sh,wa,hd,hs,Rp,_d,Ha,kl,nM,jG=(nM=class extends mM{constructor(n){super();st(this,Ha);st(this,wh);st(this,fd);st(this,Sh);st(this,wa);st(this,hd);st(this,hs);st(this,Rp);st(this,_d);Fe(this,_d,!1),Fe(this,Rp,n.defaultOptions),this.setOptions(n.options),this.observers=[],Fe(this,hd,n.client),Fe(this,wa,de(this,hd).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Fe(this,fd,c9(this.options)),this.state=n.state??de(this,fd),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return de(this,wh)}get promise(){var n;return(n=de(this,hs))==null?void 0:n.promise}setOptions(n){if(this.options={...de(this,Rp),...n},n!=null&&n._type&&Fe(this,wh,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=c9(this.options);t.data!==void 0&&(this.setState(l9(t.data,t.dataUpdatedAt)),Fe(this,fd,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,wa).remove(this)}setData(n,t){const r=Jw(this.state.data,n,this.options);return Ot(this,Ha,kl).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(n){Ot(this,Ha,kl).call(this,{type:"setState",state:n})}cancel(n){var r,s;const t=(r=de(this,hs))==null?void 0:r.promise;return(s=de(this,hs))==null||s.cancel(n),t?t.then(Ws).catch(Ws):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return de(this,fd)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>$r(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D5||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>$r(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!fM(this.state.dataUpdatedAt,n)}onFocus(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}onOnline(){var n,t;(n=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(t=de(this,hs))==null||t.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),de(this,wa).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const t=this.observers.indexOf(n);t!==-1&&(this.observers.splice(t,1),this.observers.length||(de(this,hs)&&(de(this,_d)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?de(this,hs).cancel({revert:!0}):de(this,hs).cancelRetry()),this.scheduleGc()),de(this,wa).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ot(this,Ha,kl).call(this,{type:"invalidate"})}async fetch(n,t){var u,_,d,p,m,x,S,v,b,w,y,C;if(this.state.fetchStatus!=="idle"&&((u=de(this,hs))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(de(this,hs))return de(this,hs).continueRetry(),de(this,hs).promise}if(n&&this.setOptions(n),!this.options.queryFn){const E=this.observers.find(N=>N.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,s=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Fe(this,_d,!0),r.signal)})},i=()=>{const E=hM(this.options,t),T=(()=>{const j={client:de(this,hd),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Fe(this,_d,!1),this.options.persister?this.options.persister(E,T,this):E(T)},o=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:de(this,hd),state:this.state,fetchFn:i};return s(E),E})();(_=de(this,wh)==="infinite"?NG(this.options.pages):this.options.behavior)==null||_.onFetch(o,this),Fe(this,Sh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ot(this,Ha,kl).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta});const l=Fe(this,hs,pM({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,onCancel:E=>{E instanceof U1&&E.revert&&this.setState({...de(this,Sh),fetchStatus:"idle"}),r.abort()},onFail:(E,N)=>{Ot(this,Ha,kl).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{Ot(this,Ha,kl).call(this,{type:"pause"})},onContinue:()=>{Ot(this,Ha,kl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const E=await l.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(x=(m=de(this,wa).config).onSuccess)==null||x.call(m,E,this),(v=(S=de(this,wa).config).onSettled)==null||v.call(S,E,this.state.error,this),E}catch(E){if(E instanceof U1){if(E.silent)return de(this,hs).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw Ot(this,Ha,kl).call(this,{type:"error",error:E}),(w=(b=de(this,wa).config).onError)==null||w.call(b,E,this),(C=(y=de(this,wa).config).onSettled)==null||C.call(y,this.state.data,E,this),E}finally{de(this,hs)===l&&Fe(this,hs,void 0),this.scheduleGc()}}},wh=new WeakMap,fd=new WeakMap,Sh=new WeakMap,wa=new WeakMap,hd=new WeakMap,hs=new WeakMap,Rp=new WeakMap,_d=new WeakMap,Ha=new WeakSet,kl=function(n){const t=r=>{switch(n.type){case"failed":return{...r,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...gM(r.data,this.options),fetchMeta:n.meta??null};case"success":const s={...r,...l9(n.data,n.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sh,n.manual?s:void 0),s;case"error":const i=n.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...n.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),de(this,wa).notify({query:this,type:"updated",action:n})})},nM);function gM(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_M(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l9(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c9(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,r=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ni,Sn,Mp,ri,pd,kh,zl,Dp,Ch,Eh,md,gd,Zc,Nh,Un,S0,e4,t4,n4,r4,s4,i4,a4,o4,rM,B5=(rM=class extends Gd{constructor(n,t){super();st(this,Un);st(this,ni);st(this,Sn);st(this,Mp);st(this,ri);st(this,pd);st(this,kh);st(this,zl);st(this,Dp);st(this,Ch);st(this,Eh);st(this,md);st(this,gd);st(this,Zc);st(this,Nh,new Set);this.options=t,Fe(this,ni,n),Fe(this,zl,null),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(de(this,Sn).addObserver(this),u9(de(this,Sn),this.options)?Ot(this,Un,S0).call(this):this.updateResult(),Ot(this,Un,s4).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return l4(de(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return l4(de(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ot(this,Un,i4).call(this),Ot(this,Un,a4).call(this),de(this,Sn).removeObserver(this)}setOptions(n){const t=this.options,r=de(this,Sn);if(this.options=de(this,ni).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,de(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ot(this,Un,o4).call(this),de(this,Sn).setOptions(this.options),t._defaulted&&!A0(this.options,t)&&de(this,ni).getQueryCache().notify({type:"observerOptionsUpdated",query:de(this,Sn),observer:this});const s=this.hasListeners();s&&d9(de(this,Sn),r,this.options,t)&&Ot(this,Un,S0).call(this),this.updateResult(),s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||$r(this.options.staleTime,de(this,Sn))!==$r(t.staleTime,de(this,Sn)))&&Ot(this,Un,t4).call(this);const i=Ot(this,Un,n4).call(this);s&&(de(this,Sn)!==r||$r(this.options.enabled,de(this,Sn))!==$r(t.enabled,de(this,Sn))||i!==de(this,Zc))&&Ot(this,Un,r4).call(this,i)}getOptimisticResult(n){const t=de(this,ni).getQueryCache().build(de(this,ni),n),r=this.createResult(t,n);return A0(this.getCurrentResult(),r)||(Fe(this,ri,r),Fe(this,kh,this.options),Fe(this,pd,de(this,Sn).state)),r}getCurrentResult(){return de(this,ri)}trackResult(n,t){return new Proxy(n,{get:(r,s)=>(this.trackProp(s),t==null||t(s),Reflect.get(r,s))})}trackProp(n){de(this,Nh).add(n)}getCurrentQuery(){return de(this,Sn)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const t=de(this,ni).defaultQueryOptions(n),r=de(this,ni).getQueryCache().build(de(this,ni),t);let s=()=>{},i;const a=new Promise(o=>{i=o,s=de(this,ni).getQueryCache().subscribe(l=>{l.type==="updated"&&l.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),o(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const o=this.createResult(r,t);return i==null||i(o),o}).finally(()=>{s()}),a])}fetch(n){return Ot(this,Un,S0).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),de(this,ri)))}createResult(n,t){var N;const r=de(this,Sn),s=this.options,i=de(this,ri),a=de(this,pd),o=de(this,kh),l=n!==r?n.state:de(this,Mp),{state:u}=n;let _={...u},d=!1,p;if(t._optimisticResults){const T=this.hasListeners(),j=!T&&u9(n,t),M=T&&d9(n,r,t,s);(j||M)&&(_={..._,...gM(u.data,n.options)}),t._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:S}=_;p=_.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&S==="pending"){let T;i!=null&&i.isPlaceholderData&&t.placeholderData===(o==null?void 0:o.placeholderData)?(T=i.data,v=!0):T=typeof t.placeholderData=="function"?t.placeholderData((N=de(this,Eh))==null?void 0:N.state.data,de(this,Eh)):t.placeholderData,T!==void 0&&(S="success",p=Jw(i==null?void 0:i.data,T,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===(a==null?void 0:a.data)&&t.select===de(this,Dp))p=de(this,Ch);else try{Fe(this,Dp,t.select),p=t.select(p),p=Jw(i==null?void 0:i.data,p,t),Fe(this,Ch,p),Fe(this,zl,null)}catch(T){Fe(this,zl,T)}else p===void 0&&Fe(this,zl,null);de(this,zl)&&(m=de(this,zl),p=de(this,Ch),x=Date.now(),S="error",d=!1);const b=_.fetchStatus==="fetching",w=S==="pending",y=S==="error",C=w&&b,E=p!==void 0;return{status:S,fetchStatus:_.fetchStatus,isPending:w,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:_.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>l.dataUpdateCount||_.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:y&&!E,isPaused:_.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&E,isStale:$5(n,t),refetch:this.refetch,isEnabled:$r(t.enabled,n)!==!1}}updateResult(){const n=de(this,ri),t=this.createResult(de(this,Sn),this.options);if(Fe(this,pd,de(this,Sn).state),Fe(this,kh,this.options),de(this,pd).data!==void 0&&Fe(this,Eh,de(this,Sn)),A0(t,n))return;Fe(this,ri,t);const s=(()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!de(this,Nh).size)return!0;const o=new Set(a??de(this,Nh));return this.options.throwOnError&&o.add("error"),Object.keys(de(this,ri)).some(l=>{const u=l;return de(this,ri)[u]!==n[u]&&o.has(u)})})();Tr.batch(()=>{s&&this.listeners.forEach(i=>{i(de(this,ri))}),de(this,ni).getQueryCache().notify({query:de(this,Sn),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ot(this,Un,s4).call(this)}},ni=new WeakMap,Sn=new WeakMap,Mp=new WeakMap,ri=new WeakMap,pd=new WeakMap,kh=new WeakMap,zl=new WeakMap,Dp=new WeakMap,Ch=new WeakMap,Eh=new WeakMap,md=new WeakMap,gd=new WeakMap,Zc=new WeakMap,Nh=new WeakMap,Un=new WeakSet,S0=function(n){Ot(this,Un,o4).call(this);let t=de(this,Sn).fetch(this.options,n);return n!=null&&n.throwOnError||(t=t.catch(Ws)),t},e4=function(n){return!O5()&&$r(this.options.enabled,de(this,Sn))!==!1&&dM(n)},t4=function(){Ot(this,Un,i4).call(this);const n=$r(this.options.staleTime,de(this,Sn));if(de(this,ri).isStale||!Ot(this,Un,e4).call(this,n))return;const t=fM(de(this,ri).dataUpdatedAt,n)+1;Fe(this,md,ad.setTimeout(()=>{de(this,ri).isStale||this.updateResult()},t))},n4=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(de(this,Sn)):this.options.refetchInterval)??!1},r4=function(n){Ot(this,Un,a4).call(this),Fe(this,Zc,n),!(de(this,Zc)===0||!Ot(this,Un,e4).call(this,de(this,Zc)))&&Fe(this,gd,ad.setInterval(()=>{(this.options.refetchIntervalInBackground||I5.isFocused())&&Ot(this,Un,S0).call(this)},de(this,Zc)))},s4=function(){Ot(this,Un,t4).call(this),Ot(this,Un,r4).call(this,Ot(this,Un,n4).call(this))},i4=function(){de(this,md)!==void 0&&(ad.clearTimeout(de(this,md)),Fe(this,md,void 0))},a4=function(){de(this,gd)!==void 0&&(ad.clearInterval(de(this,gd)),Fe(this,gd,void 0))},o4=function(){const n=de(this,ni).getQueryCache().build(de(this,ni),this.options);if(n===de(this,Sn))return;const t=de(this,Sn);Fe(this,Sn,n),Fe(this,Mp,n.state),this.hasListeners()&&(t==null||t.removeObserver(this),n.addObserver(this))},rM);function TG(e,n){return $r(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$r(n.retryOnMount,e)===!1)}function u9(e,n){return TG(e,n)||e.state.data!==void 0&&l4(e,n,n.refetchOnMount)}function l4(e,n,t){if($r(n.enabled,e)!==!1&&$r(n.staleTime,e)!=="static"){const r=typeof t=="function"?t(e):t;return r==="always"||r!==!1&&$5(e,n)}return!1}function d9(e,n,t,r){return(e!==n||$r(r.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&$5(e,t)}function $5(e,n){return $r(n.enabled,e)!==!1&&e.isStaleByTime($r(n.staleTime,e))}var Lp,Eo,qs,vd,No,Uc,sM,AG=(sM=class extends mM{constructor(n){super();st(this,No);st(this,Lp);st(this,Eo);st(this,qs);st(this,vd);Fe(this,Lp,n.client),this.mutationId=n.mutationId,Fe(this,qs,n.mutationCache),Fe(this,Eo,[]),this.state=n.state||vM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){de(this,Eo).includes(n)||(de(this,Eo).push(n),this.clearGcTimeout(),de(this,qs).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Fe(this,Eo,de(this,Eo).filter(t=>t!==n)),this.scheduleGc(),de(this,qs).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){de(this,Eo).length||(this.state.status==="pending"?this.scheduleGc():de(this,qs).remove(this))}continue(){var n;return((n=de(this,vd))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var o,l,u,_,d,p,m,x,S,v,b,w,y,C,E,N,T,j;const t=()=>{Ot(this,No,Uc).call(this,{type:"continue"})},r={client:de(this,Lp),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Fe(this,vd,pM({fn:()=>this.options.mutationFn?this.options.mutationFn(n,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{Ot(this,No,Uc).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{Ot(this,No,Uc).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,qs).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)t();else{Ot(this,No,Uc).call(this,{type:"pending",variables:n,isPaused:a}),de(this,qs).config.onMutate&&await de(this,qs).config.onMutate(n,this,r);const O=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,n,r));O!==this.state.context&&Ot(this,No,Uc).call(this,{type:"pending",context:O,variables:n,isPaused:a})}const M=await s.start();return await((_=(u=de(this,qs).config).onSuccess)==null?void 0:_.call(u,M,n,this.state.context,this,r)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,M,n,this.state.context,r)),await((x=(m=de(this,qs).config).onSettled)==null?void 0:x.call(m,M,null,this.state.variables,this.state.context,this,r)),await((v=(S=this.options).onSettled)==null?void 0:v.call(S,M,null,n,this.state.context,r)),Ot(this,No,Uc).call(this,{type:"success",data:M}),M}catch(M){try{await((w=(b=de(this,qs).config).onError)==null?void 0:w.call(b,M,n,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((C=(y=this.options).onError)==null?void 0:C.call(y,M,n,this.state.context,r))}catch(O){Promise.reject(O)}try{await((N=(E=de(this,qs).config).onSettled)==null?void 0:N.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,M,n,this.state.context,r))}catch(O){Promise.reject(O)}throw Ot(this,No,Uc).call(this,{type:"error",error:M}),M}finally{de(this,vd)===s&&Fe(this,vd,void 0),de(this,qs).runNext(this)}}},Lp=new WeakMap,Eo=new WeakMap,qs=new WeakMap,vd=new WeakMap,No=new WeakSet,Uc=function(n){const t=r=>{switch(n.type){case"failed":return{...r,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...r,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:n.error,failureCount:r.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{de(this,Eo).forEach(r=>{r.onMutationUpdate(n)}),de(this,qs).notify({mutation:this,type:"updated",action:n})})},sM);function vM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jl,qa,Op,iM,RG=(iM=class extends Gd{constructor(n={}){super();st(this,jl);st(this,qa);st(this,Op);this.config=n,Fe(this,jl,new Set),Fe(this,qa,new Map),Fe(this,Op,0)}build(n,t,r){const s=new AG({client:n,mutationCache:this,mutationId:++r0(this,Op)._,options:n.defaultMutationOptions(t),state:r});return this.add(s),s}add(n){de(this,jl).add(n);const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);r?r.push(n):de(this,qa).set(t,[n])}this.notify({type:"added",mutation:n})}remove(n){if(de(this,jl).delete(n)){const t=xg(n);if(typeof t=="string"){const r=de(this,qa).get(t);if(r)if(r.length>1){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}else r[0]===n&&de(this,qa).delete(t)}}this.notify({type:"removed",mutation:n})}canRun(n){var r;const t=xg(n);if(typeof t=="string"){const s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===n}else return!0}runNext(n){var r,s;const t=xg(n);return typeof t=="string"?((s=(r=de(this,qa).get(t))==null?void 0:r.find(i=>i!==n&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Tr.batch(()=>{de(this,jl).forEach(n=>{this.notify({type:"removed",mutation:n})}),de(this,jl).clear(),de(this,qa).clear()})}getAll(){return Array.from(de(this,jl))}find(n){const t={exact:!0,...n};return this.getAll().find(r=>s9(t,r))}findAll(n={}){return this.getAll().filter(t=>s9(n,t))}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}resumePausedMutations(){const n=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(n.map(t=>t.continue().catch(Ws))))}},jl=new WeakMap,qa=new WeakMap,Op=new WeakMap,iM);function xg(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Tl,Jc,Us,Al,Do,k0,c4,aM,MG=(aM=class extends Gd{constructor(t,r){super();st(this,Do);st(this,Tl);st(this,Jc);st(this,Us);st(this,Al);Fe(this,Tl,t),this.setOptions(r),this.bindMethods(),Ot(this,Do,k0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var s;const r=this.options;this.options=de(this,Tl).defaultMutationOptions(t),A0(this.options,r)||de(this,Tl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:de(this,Us),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Td(r.mutationKey)!==Td(this.options.mutationKey)?this.reset():((s=de(this,Us))==null?void 0:s.state.status)==="pending"&&de(this,Us).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&de(this,Us)&&(de(this,Us).addObserver(this),Ot(this,Do,k0).call(this))}onUnsubscribe(){var t;this.hasListeners()||(t=de(this,Us))==null||t.removeObserver(this)}onMutationUpdate(t){Ot(this,Do,k0).call(this),Ot(this,Do,c4).call(this,t)}getCurrentResult(){return de(this,Jc)}reset(){var t;(t=de(this,Us))==null||t.removeObserver(this),Fe(this,Us,void 0),Ot(this,Do,k0).call(this),Ot(this,Do,c4).call(this)}mutate(t,r){var s;return Fe(this,Al,r),(s=de(this,Us))==null||s.removeObserver(this),Fe(this,Us,de(this,Tl).getMutationCache().build(de(this,Tl),this.options)),de(this,Us).addObserver(this),de(this,Us).execute(t)}},Tl=new WeakMap,Jc=new WeakMap,Us=new WeakMap,Al=new WeakMap,Do=new WeakSet,k0=function(){var r;const t=((r=de(this,Us))==null?void 0:r.state)??vM();Fe(this,Jc,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},c4=function(t){Tr.batch(()=>{var r,s,i,a,o,l,u,_;if(de(this,Al)&&this.hasListeners()){const d=de(this,Jc).variables,p=de(this,Jc).context,m={client:de(this,Tl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(s=(r=de(this,Al)).onSuccess)==null||s.call(r,t.data,d,p,m)}catch(x){Promise.reject(x)}try{(a=(i=de(this,Al)).onSettled)==null||a.call(i,t.data,null,d,p,m)}catch(x){Promise.reject(x)}}else if((t==null?void 0:t.type)==="error"){try{(l=(o=de(this,Al)).onError)==null||l.call(o,t.error,d,p,m)}catch(x){Promise.reject(x)}try{(_=(u=de(this,Al)).onSettled)==null||_.call(u,void 0,t.error,d,p,m)}catch(x){Promise.reject(x)}}}this.listeners.forEach(d=>{d(de(this,Jc))})})},aM);function f9(e,n){const t=new Set(n);return e.filter(r=>!t.has(r))}var zh,si,jh,bd,Fi,yd,Ip,Bp,$p,Pp,ms,u4,d4,bM,f4,h4,_4,oM,DG=(oM=class extends Gd{constructor(n,t,r){super();st(this,ms);st(this,zh);st(this,si);st(this,jh);st(this,bd);st(this,Fi);st(this,yd);st(this,Ip);st(this,Bp);st(this,$p);st(this,Pp,[]);Fe(this,zh,n),Fe(this,bd,r),Fe(this,jh,[]),Fe(this,Fi,[]),Fe(this,si,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&de(this,Fi).forEach(n=>{n.subscribe(t=>{Ot(this,ms,h4).call(this,n,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,de(this,Fi).forEach(n=>{n.destroy()})}setQueries(n,t){Fe(this,jh,n),Fe(this,bd,t),Tr.batch(()=>{const r=de(this,Fi),s=Ot(this,ms,f4).call(this,de(this,jh));s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),a=i.map(d=>d.getCurrentResult()),o=r.length!==i.length,l=i.some((d,p)=>d!==r[p]),u=o||l,_=u?!0:a.some((d,p)=>{const m=de(this,si)[p];return!m||!A0(d,m)});!u&&!_||(u&&(Fe(this,Pp,s),Fe(this,Fi,i)),Fe(this,si,a),this.hasListeners()&&(u&&(f9(r,i).forEach(d=>{d.destroy()}),f9(i,r).forEach(d=>{d.subscribe(p=>{Ot(this,ms,h4).call(this,d,p)})})),Ot(this,ms,_4).call(this)))})}getCurrentResult(){return de(this,si)}getQueries(){return de(this,Fi).map(n=>n.getCurrentQuery())}getObservers(){return de(this,Fi)}getOptimisticResult(n,t){const r=Ot(this,ms,f4).call(this,n),s=r.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=r.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>Ot(this,ms,d4).call(this,a??s,t,i),()=>Ot(this,ms,u4).call(this,s,r)]}},zh=new WeakMap,si=new WeakMap,jh=new WeakMap,bd=new WeakMap,Fi=new WeakMap,yd=new WeakMap,Ip=new WeakMap,Bp=new WeakMap,$p=new WeakMap,Pp=new WeakMap,ms=new WeakSet,u4=function(n,t){const r=new Set;return t.map((s,i)=>{const a=n[i];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{r.has(o)||(r.add(o),t.forEach(l=>{l.observer.trackProp(o)}))})})},d4=function(n,t,r){if(t){const s=de(this,$p),i=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((a,o)=>a!==s[o]));return(de(this,si)!==de(this,Bp)||i||t!==de(this,Ip))&&(Fe(this,Ip,t),Fe(this,Bp,de(this,si)),r!==void 0&&Fe(this,$p,r),Fe(this,yd,M5(de(this,yd),t(n)))),de(this,yd)}return n},bM=function(){var n;return!((n=de(this,bd))!=null&&n.combine)||de(this,Fi).some((t,r)=>{var s;return t.options.suspense&&((s=de(this,si)[r])==null?void 0:s.data)===void 0})},f4=function(n){const t=new Map;de(this,Fi).forEach(s=>{const i=s.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(s):t.set(i,[s])});const r=[];return n.forEach(s=>{var o;const i=de(this,zh).defaultQueryOptions(s),a=((o=t.get(i.queryHash))==null?void 0:o.shift())??new B5(de(this,zh),i);r.push({defaultedQueryOptions:i,observer:a})}),r},h4=function(n,t){const r=de(this,Fi).indexOf(n);r!==-1&&(Fe(this,si,de(this,si).slice()),de(this,si)[r]=t,Ot(this,ms,_4).call(this))},_4=function(){var n;if(this.hasListeners()){const t=Ot(this,ms,bM).call(this),r=de(this,yd),s=t?r:Ot(this,ms,d4).call(this,Ot(this,ms,u4).call(this,de(this,si),de(this,Pp)),(n=de(this,bd))==null?void 0:n.combine);(t||r!==s)&&Tr.batch(()=>{this.listeners.forEach(i=>{i(de(this,si))})})}},oM),zo,lM,LG=(lM=class extends Gd{constructor(n={}){super();st(this,zo);this.config=n,Fe(this,zo,new Map)}build(n,t,r){const s=t.queryKey,i=t.queryHash??R5(s,t);let a=this.get(i);return a||(a=new jG({client:n,queryKey:s,queryHash:i,options:n.defaultQueryOptions(t),state:r,defaultOptions:n.getQueryDefaults(s)}),this.add(a)),a}add(n){de(this,zo).has(n.queryHash)||(de(this,zo).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const t=de(this,zo).get(n.queryHash);t&&(n.destroy(),t===n&&de(this,zo).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tr.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return de(this,zo).get(n)}getAll(){return[...de(this,zo).values()]}find(n){const t={exact:!0,...n};return this.getAll().find(r=>r9(t,r))}findAll(n={}){const t=this.getAll();return Object.keys(n).length>0?t.filter(r=>r9(n,r)):t}notify(n){Tr.batch(()=>{this.listeners.forEach(t=>{t(n)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},zo=new WeakMap,lM),zr,eu,tu,Th,Ah,nu,Rh,Mh,cM,OG=(cM=class{constructor(e={}){st(this,zr);st(this,eu);st(this,tu);st(this,Th);st(this,Ah);st(this,nu);st(this,Rh);st(this,Mh);Fe(this,zr,e.queryCache||new LG),Fe(this,eu,e.mutationCache||new RG),Fe(this,tu,e.defaultOptions||{}),Fe(this,Th,new Map),Fe(this,Ah,new Map),Fe(this,nu,0)}mount(){r0(this,nu)._++,de(this,nu)===1&&(Fe(this,Rh,I5.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onFocus())})),Fe(this,Mh,q1.subscribe(async e=>{e&&(await this.resumePausedMutations(),de(this,zr).onOnline())})))}unmount(){var e,n;r0(this,nu)._--,de(this,nu)===0&&((e=de(this,Rh))==null||e.call(this),Fe(this,Rh,void 0),(n=de(this,Mh))==null||n.call(this),Fe(this,Mh,void 0))}isFetching(e){return de(this,zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return de(this,eu).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=de(this,zr).build(this,n),r=t.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime($r(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return de(this,zr).findAll(e).map(({queryKey:n,state:t})=>[n,t.data])}setQueryData(e,n,t){var a;const r=this.defaultQueryOptions({queryKey:e}),s=(a=de(this,zr).get(r.queryHash))==null?void 0:a.state.data,i=_G(n,s);if(i!==void 0)return de(this,zr).build(this,r).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Tr.batch(()=>de(this,zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,t)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return(t=de(this,zr).get(n.queryHash))==null?void 0:t.state}removeQueries(e){const n=de(this,zr);Tr.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=de(this,zr);return Tr.batch(()=>{const r=t.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},n)})}cancelQueries(e,n={}){const t={revert:!0,...n},r=Tr.batch(()=>de(this,zr).findAll(e).map(s=>s.cancel(t)));return Promise.all(r).then(Ws).catch(Ws)}invalidateQueries(e,n={}){return Tr.batch(()=>(de(this,zr).findAll(e).forEach(t=>{t.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},r=Tr.batch(()=>de(this,zr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(Ws)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ws)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n),r=t.isStaleByTime($r(n.staleTime,t))?await t.fetch(n):t.state.data,s=n.select;return s?s(r):r}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=de(this,zr).build(this,n);return t.isStaleByTime($r(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ws).catch(Ws)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ws).catch(Ws)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return q1.isOnline()?de(this,eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,zr)}getMutationCache(){return de(this,eu)}getDefaultOptions(){return de(this,tu)}setDefaultOptions(e){Fe(this,tu,e)}setQueryDefaults(e,n){de(this,Th).set(Td(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...de(this,Th).values()],t={};return n.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(e,n){de(this,Ah).set(Td(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...de(this,Ah).values()],t={};return n.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...de(this,tu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=R5(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===D5&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...de(this,tu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){de(this,zr).clear(),de(this,eu).clear()}},zr=new WeakMap,eu=new WeakMap,tu=new WeakMap,Th=new WeakMap,Ah=new WeakMap,nu=new WeakMap,Rh=new WeakMap,Mh=new WeakMap,cM);const yM=R.createContext(!1),xM=()=>R.useContext(yM);yM.Provider;function IG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const BG=R.createContext(IG()),wM=()=>R.useContext(BG),SM=(e,n,t)=>{const r=t!=null&&t.state.error&&typeof e.throwOnError=="function"?L5(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||r)&&(n.isReset()||(e.retryOnMount=!1))},kM=e=>{R.useEffect(()=>{e.clearReset()},[e])},CM=({result:e,errorResetBoundary:n,throwOnError:t,query:r,suspense:s})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||L5(t,[e.error,r])),EM=e=>{if(e.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>t(r(...s)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},p4=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,NM=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function $G({queries:e,...n},t){const r=a_(),s=xM(),i=wM(),a=n.subscribed!==!1,o=R.useMemo(()=>e.map(S=>{const v=r.defaultQueryOptions(S);return v._optimisticResults=s?"isRestoring":a?"optimistic":void 0,v}),[e,r,s,a]);o.forEach(S=>{EM(S);const v=r.getQueryCache().get(S.queryHash);SM(S,i,v)}),kM(i);const[l]=R.useState(()=>new DG(r,o,n)),[u,_,d]=l.getOptimisticResult(o,n.combine),p=!s&&a;R.useSyncExternalStore(R.useCallback(S=>p?l.subscribe(Tr.batchCalls(S)):Ws,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setQueries(o,n)},[o,n,l]);const m=u.some((S,v)=>p4(o[v],S))?u.flatMap((S,v)=>{const b=o[v];if(b&&p4(b,S)){const w=new B5(r,b);return NM(b,w,i)}return[]}):[];if(m.length>0)throw Promise.all(m);const x=u.find((S,v)=>{const b=o[v];return b&&CM({result:S,errorResetBoundary:i,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(x)throw x.error;return _(d())}function PG(e,n,t){const r=xM(),s=wM(),i=a_(),a=i.defaultQueryOptions(e),o=i.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,EM(a),SM(a,s,o),kM(s);const[u]=R.useState(()=>new n(i,a)),_=u.getOptimisticResult(a),d=!r&&l;if(R.useSyncExternalStore(R.useCallback(p=>{const m=d?u.subscribe(Tr.batchCalls(p)):Ws;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(a)},[a,u]),p4(a,_))throw NM(a,u,s);if(CM({result:_,errorResetBoundary:s,throwOnError:a.throwOnError,query:o,suspense:a.suspense}))throw _.error;return a.notifyOnChangeProps?_:u.trackResult(_)}function ct(e,n){return PG(e,B5)}function FG(e,n){const t=a_(),r=t.getQueryCache();return R.useSyncExternalStore(R.useCallback(s=>r.subscribe(Tr.batchCalls(s)),[r]),()=>t.isFetching(e),()=>t.isFetching(e))}function mn(e,n){const t=a_(),[r]=R.useState(()=>new MG(t,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const s=R.useSyncExternalStore(R.useCallback(a=>r.subscribe(Tr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=R.useCallback((...a)=>{r.mutate(a[0],a[1]).catch(Ws)},[r]);if(s.error&&L5(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const nt=new OG({defaultOptions:{queries:{staleTime:3e4,gcTime:6e5,retry:!1,networkMode:"always",refetchOnReconnect:!0},mutations:{retry:!1,networkMode:"always"}}}),du=new Set;let h9=null,Wv=0;const m4=new Set,HG=()=>Wv,_9=e=>(m4.add(e),()=>{m4.delete(e)}),za=()=>["workspace",Wv],zt=(e,...n)=>[...za(),e,...n];function qG(e,n=!1){if(h9===e&&!n)return!1;const t=za();return h9=e,Wv++,du.clear(),P5({queryKey:t}),m4.forEach(r=>r()),!0}const Fn=e=>e[1]===Wv;async function P5(e){await nt.cancelQueries(e,{revert:!1}),nt.removeQueries(e)}function Pr(e,n){if(Fn(e))return nt.setQueryData(e,n)}var a2={exports:{}},i0={},o2={exports:{}},l2={};/** * @license React * scheduler.production.js * @@ -22,7 +22,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var te=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(U,te))Zs(ce,U)?(G[I]=ce,G[Z]=te,I=Z):(G[I]=U,G[W]=te,I=W);else if(Zs(ce,te))G[I]=ce,G[Z]=te,I=Z;else break e}}return X}function s(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-G),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=B,$=function(){q.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=te,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var te=p;p=X;try{return G.apply(this,arguments)}finally{p=te}}}})(c2)),c2}var m9;function GG(){return m9||(m9=1,l2.exports=UG()),l2.exports}var u2={exports:{}},Hs={};/** + */var p9;function UG(){return p9||(p9=1,(function(e){function n(G,X){var te=G.length;G.push(X);e:for(;0>>1,L=G[I];if(0>>1;Is(U,te))Zs(ce,U)?(G[I]=ce,G[Z]=te,I=Z):(G[I]=U,G[W]=te,I=W);else if(Zs(ce,te))G[I]=ce,G[Z]=te,I=Z;else break e}}return X}function s(G,X){var te=G.sortIndex-X.sortIndex;return te!==0?te:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],_=1,d=null,p=3,m=!1,x=!1,S=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(G){for(var X=t(u);X!==null;){if(X.callback===null)r(u);else if(X.startTime<=G)r(u),X.sortIndex=X.expirationTime,n(l,X);else break;X=t(u)}}function E(G){if(S=!1,C(G),!x)if(t(l)!==null)x=!0,N||(N=!0,$());else{var X=t(u);X!==null&&Y(E,X.startTime-G)}}var N=!1,T=-1,j=5,M=-1;function O(){return v?!0:!(e.unstable_now()-MG&&O());){var I=d.callback;if(typeof I=="function"){d.callback=null,p=d.priorityLevel;var L=I(d.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){d.callback=L,C(G),X=!0;break t}d===t(l)&&r(l),C(G)}else r(l);d=t(l)}if(d!==null)X=!0;else{var F=t(u);F!==null&&Y(E,F.startTime-G),X=!1}}break e}finally{d=null,p=te,m=!1}X=void 0}}finally{X?$():N=!1}}}var $;if(typeof y=="function")$=function(){y(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=B,$=function(){q.postMessage(null)}}else $=function(){b(B,0)};function Y(G,X){T=b(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=te,n(u,G),t(l)===null&&G===t(u)&&(S?(w(T),T=-1):S=!0,Y(E,te-I))):(G.sortIndex=L,n(l,G),x||m||(x=!0,N||(N=!0,$()))),G},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(G){var X=p;return function(){var te=p;p=X;try{return G.apply(this,arguments)}finally{p=te}}}})(l2)),l2}var m9;function GG(){return m9||(m9=1,o2.exports=UG()),o2.exports}var c2={exports:{}},Hs={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var g9;function WG(){if(g9)return Hs;g9=1;var e=Vp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),u2.exports=WG(),u2.exports}/** + */var g9;function WG(){if(g9)return Hs;g9=1;var e=Vp();function n(l){var u="https://react.dev/errors/"+l;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),c2.exports=WG(),c2.exports}/** * @license React * react-dom-client.production.js * @@ -38,15 +38,15 @@ var sG=Object.defineProperty;var Z8=e=>{throw TypeError(e)};var iG=(e,n,t)=>n in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var b9;function VG(){if(b9)return i0;b9=1;var e=GG(),n=Vp(),t=NM();function r(c){var h="https://react.dev/errors/"+c;if(1L||(c.current=I[L],I[L]=null,L--)}function U(c,h){L++,I[L]=c.current,c.current=h}var Z=F(null),ce=F(null),re=F(null),ne=F(null);function Q(c,h){switch(U(re,h),U(ce,c),U(Z,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?x8(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=x8(h),c=w8(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}W(Z),U(Z,c)}function le(){W(Z),W(ce),W(re)}function oe(c){c.memoizedState!==null&&U(ne,c);var h=Z.current,g=w8(h,c.type);h!==g&&(U(ce,c),U(Z,g))}function ue(c){ce.current===c&&(W(Z),W(ce)),ne.current===c&&(W(ne),J_._currentValue=te)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1L||(c.current=I[L],I[L]=null,L--)}function U(c,h){L++,I[L]=c.current,c.current=h}var Z=F(null),ce=F(null),re=F(null),ne=F(null);function Q(c,h){switch(U(re,h),U(ce,c),U(Z,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?x8(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=x8(h),c=w8(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}W(Z),U(Z,c)}function le(){W(Z),W(ce),W(re)}function oe(c){c.memoizedState!==null&&U(ne,c);var h=Z.current,g=w8(h,c.type);h!==g&&(U(ce,c),U(Z,g))}function ue(c){ce.current===c&&(W(Z),W(ce)),ne.current===c&&(W(ne),J_._currentValue=te)}var pe,Se;function ye(c){if(pe===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);pe=h&&h[1]||"",Se=-1)":-1A||_e[k]!==Ce[A]){var De=` `+_e[k].replace(" at new "," at ");return c.displayName&&De.includes("")&&(De=De.replace("",c.displayName)),De}while(1<=k&&0<=A);break}}}finally{qe=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?ye(g):""}function Te(c,h){switch(c.tag){case 26:case 27:case 5:return ye(c.type);case 16:return ye("Lazy");case 13:return c.child!==h&&h!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ie(c.type,!1);case 11:return Ie(c.type.render,!1);case 1:return Ie(c.type,!0);case 31:return ye("Activity");default:return""}}function vt(c){try{var h="",g=null;do h+=Te(c,g),g=c,c=c.return;while(c);return h}catch(k){return` Error generating stack: `+k.message+` -`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Fr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=wy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=xy(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function Dy(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ly(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Oy(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Iy=!1;function R_(){if(Iy){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Iy=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Iy=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,nx(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function ex(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,te,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function tx(){return Ts(J_)}function Q7(){return Ur().memoizedState}function Y7(){return Ur().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:Ty()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=by(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=by(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function nx(c,h,g,k){if(k={lane:2,revertLane:Dx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=by(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Qy(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Zy,useDeferredValue:function(c,h){var g=ei();return Jy(g,c,h)},useTransition:function(){var c=Qy(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),mx(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=Ey(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=Ey(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Bx(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(qr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return U(qr,qr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=qr.current,U(qr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),$y(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(ky(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ue(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(qr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),$y(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(ky(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ue(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(qr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),$y(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function gx(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function vx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function bx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Hr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(bx(c,h,g),c=c.sibling;c!==null;)bx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,yx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,Fx=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Hx={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Nx,Nx=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=ax(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function Ax(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(Sx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):kx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Rx=!1,sg=!1,Mx=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Rx||(Rx=!0,bU())}function V_(c,h){if(!Mx&&sg){Mx=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Mx=!1}}function vU(){c8()}function c8(){sg=Rx=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Fr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Fr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Fr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Fr(g.imageSizes)+'"]')):A+='[href="'+Fr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Fr(k)+'"][href="'+Fr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Qx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Yx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Yx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Fr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Fr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Fr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Qx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Yx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Qx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Xx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Xx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),o2.exports=VG(),o2.exports}var QG=KG();const YG=!1;var zM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const jM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function TM(e){for(const n in e)if(jM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(W1(e)&&W1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function V1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,AM=5;function RM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=AM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Kv(e,n,d,l,s,i,a,o)}function MM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Kv(!1,r,i,1,t,0,s);for(const i of s)i.sort(MM);n.masksTree=t,n.flatCache=K1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=H5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Kv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),H5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=H5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=LM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Kv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&F5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(MM);return{processedTree:{segmentTree:r,singleCache:K1(1e3),matchCache:K1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function H5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=DM(e,r,s);return{route:s.node.route,rawParams:i}}function DM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function OM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function IM(e){return Rl(OM(e))}function Q1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return Q1(e,t)===Q1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function d2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function v4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=v4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=v4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=v4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function f2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=f2(s):Array.isArray(i)?i.push(f2(s)):t[r]=[i,f2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function BM(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=b4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$M(e[t],n);return n}}}function OW(e){const n=IM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function b4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $M(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Y1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=q5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Y1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=q5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),H=!!v;H||(_=u),u=Y1(O,B),v=[$,B,(v==null?void 0:v[2])||M],H||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,H=!B&&!$||d;d=!1;const q=H?"GO":$?"BACK":"FORWARD",Y=H?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:q})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const H=$.enableBeforeUnload??!0;if(H===!0){O=!0;break}if(typeof H=="function"&&H()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Y1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=q5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function q5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Qv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=K1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=IM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=b4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Y1(i.href,{});i={...i,to:b4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,H]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!H||H.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&TM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=$M(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(V1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Qv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&V1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=LM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function y4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=y4(e,"component");let r=y4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?y4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function U5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return BM(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Yv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function G5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:K5(e,n,t,G5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=K5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function W5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=W5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=W5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function V5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function PM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(PM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?G5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],K5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Yv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,H;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(PM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const q=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=q&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(q){o.invalid=!0,Ml(e,o),m=R0(e,n,l,q,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const q=o._flight;o._flight=w,(H=W5(e,o,q))==null||H.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(q=>(E&&(B9(o,q,u),q[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),q)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},q=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,q,i)]).then(q=>j.then(Y=>(E&&!q&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),q)));if(r.push([t,j,M]),!y)return j.then(q=>$9(o,q));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(q=>(o.isFetching=!1,B9(O,q,!1),q));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(q=>$9(O,q))}async function x4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function K5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:G5(t,l),i=!0}}return r}async function FM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Yv?x4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function HM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await x4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Yv){const w=await x4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=FM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:U5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:HM(e,a,i,r[6]===t.length?r[6]:0)}function w4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>w4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!U5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function UM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=U5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,UM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function GM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));V5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await FM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await GM(e,n,o);return}if(await HM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}UM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await qM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await GM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Qv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Qv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});V5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>w4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&w4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),V5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await qM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var WM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||F5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=OM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends WM{constructor(e){super(e)}},Q5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:VM()?e:n})}function VM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var KM=R.createContext(null);function li(e){return R.useContext(KM)}var Xv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const S4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:QM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){S4[k4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,Z1(e))}});let Eg=0,k4=0,Co,C4=0;function dV(e){try{++C4,e()}finally{--C4||YM()}}function Z1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function YM(){if(!(C4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),Z1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&QM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),YM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,Z1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&QM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,Z1(this)}};return n(),t}var h2={exports:{}},_2={},p2={exports:{}},m2={};/** +`+k.stack}}var Dt=Object.prototype.hasOwnProperty,Ut=e.unstable_scheduleCallback,Ft=e.unstable_cancelCallback,mt=e.unstable_shouldYield,rt=e.unstable_requestPaint,ut=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,Ze=e.unstable_NormalPriority,_t=e.unstable_LowPriority,wt=e.unstable_IdlePriority,Zt=e.log,We=e.unstable_setDisableYieldValue,Gt=null,an=null;function yn(c){if(typeof Zt=="function"&&We(c),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Gt,c)}catch{}}var Vt=Math.clz32?Math.clz32:cn,Yn=Math.log,ln=Math.LN2;function cn(c){return c>>>=0,c===0?32:31-(Yn(c)/ln|0)|0}var br=256,Xn=262144,Zn=4194304;function Rn(c){var h=c&42;if(h!==0)return h;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function Rr(c,h,g){var k=c.pendingLanes;if(k===0)return 0;var A=0,D=c.suspendedLanes,K=c.pingedLanes;c=c.warmLanes;var se=k&134217727;return se!==0?(k=se&~D,k!==0?A=Rn(k):(K&=se,K!==0?A=Rn(K):g||(g=se&~c,g!==0&&(A=Rn(g))))):(se=k&~D,se!==0?A=Rn(se):K!==0?A=Rn(K):g||(g=k&~c,g!==0&&(A=Rn(g)))),A===0?0:h!==0&&h!==A&&(h&D)===0&&(D=A&-A,g=h&-h,D>=g||D===32&&(g&4194048)!==0)?h:A}function Nr(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function bt(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 fn(){var c=Zn;return Zn<<=1,(Zn&62914560)===0&&(Zn=4194304),c}function Cn(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function tn(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nr(c,h,g,k,A,D){var K=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,_e=c.expirationTimes,Ce=c.hiddenUpdates;for(g=K&~g;0"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Ls=/[\n"\\]/g;function Fr(c){return c.replace(Ls,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Lr(c,h,g,k,A,D,K,se){c.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?c.type=K:c.removeAttribute("type"),h!=null?K==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+Dr(h)):c.value!==""+Dr(h)&&(c.value=""+Dr(h)):K!=="submit"&&K!=="reset"||c.removeAttribute("value"),h!=null?bs(c,K,Dr(h)):g!=null?bs(c,K,Dr(g)):k!=null&&c.removeAttribute("value"),A==null&&D!=null&&(c.defaultChecked=!!D),A!=null&&(c.checked=A&&typeof A!="function"&&typeof A!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Dr(se):c.removeAttribute("name")}function cs(c,h,g,k,A,D,K,se){if(D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.type=D),h!=null||g!=null){if(!(D!=="submit"&&D!=="reset"||h!=null)){Xs(c);return}g=g!=null?""+Dr(g):"",h=h!=null?""+Dr(h):g,se||h===c.value||(c.value=h),c.defaultValue=h}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,c.checked=se?c.checked:!!k,c.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(c.name=K),Xs(c)}function bs(c,h,g){h==="number"&&ls(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function yr(c,h,g,k){if(c=c.options,h){h={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=!1;if(Nn)try{var Mt={};Object.defineProperty(Mt,"passive",{get:function(){rc=!0}}),window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{rc=!1}var hr=null,xs=null,la=null;function Ri(){if(la)return la;var c,h=xs,g=h.length,k,A="value"in hr?hr.value:hr.textContent,D=A.length;for(c=0;c=ca),ua=" ",Ia=!1;function hc(c,h){switch(c){case"keyup":return Ru.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nl(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ie=!1;function be(c,h){switch(c){case"compositionend":return nl(h);case"keypress":return h.which!==32?null:(Ia=!0,ua);case"textInput":return c=h.data,c===ua&&Ia?null:c;default:return null}}function Ae(c,h){if(ie)return c==="compositionend"||!fc&&hc(c,h)?(c=Ri(),la=xs=hr=null,ie=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1=h)return{node:g,offset:h-c};c=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=Wn(g)}}function zs(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?zs(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ps(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=ls(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=ls(c.document)}return h}function _i(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Tn=Nn&&"documentMode"in document&&11>=document.documentMode,Yr=null,Js=null,sr=null,_c=!1;function pr(c,h,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;_c||Yr==null||Yr!==ls(k)||(k=Yr,"selectionStart"in k&&_i(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),sr&&Lt(sr,k)||(sr=k,k=ag(Js,"onSelect"),0>=K,A-=K,po=1<<32-Vt(h)+A|g<rn?(bn=yt,yt=null):bn=yt.sibling;var Bn=Ee(xe,yt,ke[rn],Be);if(Bn===null){yt===null&&(yt=bn);break}c&&yt&&Bn.alternate===null&&h(xe,yt),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn,yt=bn}if(rn===ke.length)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;rnrn?(bn=yt,yt=null):bn=yt.sibling;var Oc=Ee(xe,yt,Bn.value,Be);if(Oc===null){yt===null&&(yt=bn);break}c&&yt&&Oc.alternate===null&&h(xe,yt),me=D(Oc,me,rn),In===null?Rt=Oc:In.sibling=Oc,In=Oc,yt=bn}if(Bn.done)return g(xe,yt),wn&&il(xe,rn),Rt;if(yt===null){for(;!Bn.done;rn++,Bn=ke.next())Bn=Pe(xe,Bn.value,Be),Bn!==null&&(me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return wn&&il(xe,rn),Rt}for(yt=k(yt);!Bn.done;rn++,Bn=ke.next())Bn=ze(yt,xe,rn,Bn.value,Be),Bn!==null&&(c&&Bn.alternate!==null&&yt.delete(Bn.key===null?rn:Bn.key),me=D(Bn,me,rn),In===null?Rt=Bn:In.sibling=Bn,In=Bn);return c&&yt.forEach(function(rG){return h(xe,rG)}),wn&&il(xe,rn),Rt}function tr(xe,me,ke,Be){if(typeof ke=="object"&&ke!==null&&ke.type===S&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case m:e:{for(var Rt=ke.key;me!==null;){if(me.key===Rt){if(Rt=ke.type,Rt===S){if(me.tag===7){g(xe,me.sibling),Be=A(me,ke.props.children),Be.return=xe,xe=Be;break e}}else if(me.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===j&&Fu(Rt)===me.type){g(xe,me.sibling),Be=A(me,ke.props),T_(Be,ke),Be.return=xe,xe=Be;break e}g(xe,me);break}else h(xe,me);me=me.sibling}ke.type===S?(Be=Ou(ke.props.children,xe.mode,Be,ke.key),Be.return=xe,xe=Be):(Be=Sm(ke.type,ke.key,ke.props,null,xe.mode,Be),T_(Be,ke),Be.return=xe,xe=Be)}return K(xe);case x:e:{for(Rt=ke.key;me!==null;){if(me.key===Rt)if(me.tag===4&&me.stateNode.containerInfo===ke.containerInfo&&me.stateNode.implementation===ke.implementation){g(xe,me.sibling),Be=A(me,ke.children||[]),Be.return=xe,xe=Be;break e}else{g(xe,me);break}else h(xe,me);me=me.sibling}Be=xy(ke,xe.mode,Be),Be.return=xe,xe=Be}return K(xe);case j:return ke=Fu(ke),tr(xe,me,ke,Be)}if(Y(ke))return gt(xe,me,ke,Be);if($(ke)){if(Rt=$(ke),typeof Rt!="function")throw Error(r(150));return ke=Rt.call(ke),$t(xe,me,ke,Be)}if(typeof ke.then=="function")return tr(xe,me,Tm(ke),Be);if(ke.$$typeof===y)return tr(xe,me,Em(xe,ke),Be);Am(xe,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,me!==null&&me.tag===6?(g(xe,me.sibling),Be=A(me,ke),Be.return=xe,xe=Be):(g(xe,me),Be=yy(ke,xe.mode,Be),Be.return=xe,xe=Be),K(xe)):g(xe,me)}return function(xe,me,ke,Be){try{j_=0;var Rt=tr(xe,me,ke,Be);return Cf=null,Rt}catch(yt){if(yt===kf||yt===zm)throw yt;var In=Mi(29,yt,null,xe.mode);return In.lanes=Be,In.return=xe,In}finally{}}}var qu=f7(!0),h7=f7(!1),bc=!1;function My(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dy(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function yc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function xc(c,h,g){var k=c.updateQueue;if(k===null)return null;if(k=k.shared,(Pn&2)!==0){var A=k.pending;return A===null?h.next=h:(h.next=A.next,A.next=h),k.pending=h,h=wm(c),Yk(c,null,g),h}return xm(c,k,h,g),wm(c)}function A_(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}function Ly(c,h){var g=c.updateQueue,k=c.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,D=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};D===null?A=D=K:D=D.next=K,g=g.next}while(g!==null);D===null?A=D=h:D=D.next=h}else A=D=h;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:D,shared:k.shared,callbacks:k.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var Oy=!1;function R_(){if(Oy){var c=Sf;if(c!==null)throw c}}function M_(c,h,g,k){Oy=!1;var A=c.updateQueue;bc=!1;var D=A.firstBaseUpdate,K=A.lastBaseUpdate,se=A.shared.pending;if(se!==null){A.shared.pending=null;var _e=se,Ce=_e.next;_e.next=null,K===null?D=Ce:K.next=Ce,K=_e;var De=c.alternate;De!==null&&(De=De.updateQueue,se=De.lastBaseUpdate,se!==K&&(se===null?De.firstBaseUpdate=Ce:se.next=Ce,De.lastBaseUpdate=_e))}if(D!==null){var Pe=A.baseState;K=0,De=Ce=_e=null,se=D;do{var Ee=se.lane&-536870913,ze=Ee!==se.lane;if(ze?(vn&Ee)===Ee:(k&Ee)===Ee){Ee!==0&&Ee===wf&&(Oy=!0),De!==null&&(De=De.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var gt=c,$t=se;Ee=h;var tr=g;switch($t.tag){case 1:if(gt=$t.payload,typeof gt=="function"){Pe=gt.call(tr,Pe,Ee);break e}Pe=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=$t.payload,Ee=typeof gt=="function"?gt.call(tr,Pe,Ee):gt,Ee==null)break e;Pe=d({},Pe,Ee);break e;case 2:bc=!0}}Ee=se.callback,Ee!==null&&(c.flags|=64,ze&&(c.flags|=8192),ze=A.callbacks,ze===null?A.callbacks=[Ee]:ze.push(Ee))}else ze={lane:Ee,tag:se.tag,payload:se.payload,callback:se.callback,next:null},De===null?(Ce=De=ze,_e=Pe):De=De.next=ze,K|=Ee;if(se=se.next,se===null){if(se=A.shared.pending,se===null)break;ze=se,se=ze.next,ze.next=null,A.lastBaseUpdate=ze,A.shared.pending=null}}while(!0);De===null&&(_e=Pe),A.baseState=_e,A.firstBaseUpdate=Ce,A.lastBaseUpdate=De,D===null&&(A.shared.lanes=0),Ec|=K,c.lanes=K,c.memoizedState=Pe}}function _7(c,h){if(typeof c!="function")throw Error(r(191,c));c.call(h)}function p7(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;cD?D:8;var K=G.T,se={};G.T=se,tx(c,!1,h,g);try{var _e=A(),Ce=G.S;if(Ce!==null&&Ce(se,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var De=Wq(_e,k);O_(c,h,De,Bi(c))}else O_(c,h,k,Bi(c))}catch(Pe){O_(c,h,{then:function(){},status:"rejected",reason:Pe},Bi())}finally{X.p=D,K!==null&&se.types!==null&&(K.types=se.types),G.T=K}}function Zq(){}function Jy(c,h,g,k){if(c.tag!==5)throw Error(r(476));var A=V7(c).queue;W7(c,A,h,te,g===null?Zq:function(){return K7(c),g(k)})}function V7(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:te},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function K7(c){var h=V7(c);h.next===null&&(h=c.alternate.memoizedState),O_(c,h.next.queue,{},Bi())}function ex(){return Ts(J_)}function Q7(){return Ur().memoizedState}function Y7(){return Ur().memoizedState}function Jq(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Bi();c=yc(g);var k=xc(h,c,g);k!==null&&(bi(k,h,g),A_(k,h,g)),h={cache:jy()},c.payload=h;return}h=h.return}}function eU(c,h,g){var k=Bi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Fm(c)?Z7(h,g):(g=vy(c,h,g,k),g!==null&&(bi(g,c,k),J7(g,h,k)))}function X7(c,h,g){var k=Bi();O_(c,h,g,k)}function O_(c,h,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Fm(c))Z7(h,A);else{var D=c.alternate;if(c.lanes===0&&(D===null||D.lanes===0)&&(D=h.lastRenderedReducer,D!==null))try{var K=h.lastRenderedState,se=D(K,g);if(A.hasEagerState=!0,A.eagerState=se,tt(se,K))return xm(c,h,A,0),ir===null&&ym(),!1}catch{}finally{}if(g=vy(c,h,A,k),g!==null)return bi(g,c,k),J7(g,h,k),!0}return!1}function tx(c,h,g,k){if(k={lane:2,revertLane:Mx(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},Fm(c)){if(h)throw Error(r(479))}else h=vy(c,g,k,2),h!==null&&bi(h,c,2)}function Fm(c){var h=c.alternate;return c===nn||h!==null&&h===nn}function Z7(c,h){Nf=Dm=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function J7(c,h,g){if((g&4194048)!==0){var k=h.lanes;k&=c.pendingLanes,g|=k,h.lanes=g,Mn(c,g)}}var I_={readContext:Ts,use:Im,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useLayoutEffect:Or,useInsertionEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useSyncExternalStore:Or,useId:Or,useHostTransitionStatus:Or,useFormState:Or,useActionState:Or,useOptimistic:Or,useMemoCache:Or,useCacheRefresh:Or};I_.useEffectEvent=Or;var eC={readContext:Ts,use:Im,useCallback:function(c,h){return ei().memoizedState=[c,h===void 0?null:h],c},useContext:Ts,useEffect:I7,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,$m(4194308,4,F7.bind(null,h,c),g)},useLayoutEffect:function(c,h){return $m(4194308,4,c,h)},useInsertionEffect:function(c,h){$m(4,2,c,h)},useMemo:function(c,h){var g=ei();h=h===void 0?null:h;var k=c();if(Uu){yn(!0);try{c()}finally{yn(!1)}}return g.memoizedState=[k,h],k},useReducer:function(c,h,g){var k=ei();if(g!==void 0){var A=g(h);if(Uu){yn(!0);try{g(h)}finally{yn(!1)}}}else A=h;return k.memoizedState=k.baseState=A,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:A},k.queue=c,c=c.dispatch=eU.bind(null,nn,c),[k.memoizedState,c]},useRef:function(c){var h=ei();return c={current:c},h.memoizedState=c},useState:function(c){c=Ky(c);var h=c.queue,g=X7.bind(null,nn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:Xy,useDeferredValue:function(c,h){var g=ei();return Zy(g,c,h)},useTransition:function(){var c=Ky(!1);return c=W7.bind(null,nn,c.queue,!0,!1),ei().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var k=nn,A=ei();if(wn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=h(),ir===null)throw Error(r(349));(vn&127)!==0||x7(k,h,g)}A.memoizedState=g;var D={value:g,getSnapshot:h};return A.queue=D,I7(S7.bind(null,k,D,c),[c]),k.flags|=2048,jf(9,{destroy:void 0},w7.bind(null,k,D,g,h),null),g},useId:function(){var c=ei(),h=ir.identifierPrefix;if(wn){var g=mo,k=po;g=(k&~(1<<32-Vt(k)-1)).toString(32)+g,h="_"+h+"R_"+g,g=Lm++,0<\/script>",D=D.removeChild(D.firstChild);break;case"select":D=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?D.multiple=!0:k.size&&(D.size=k.size);break;default:D=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}D[ft]=h,D[jt]=k;e:for(K=h.child;K!==null;){if(K.tag===5||K.tag===6)D.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===h)break e;for(;K.sibling===null;){if(K.return===null||K.return===h)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}h.stateNode=D;e:switch(Rs(D,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&dl(h)}}return gr(h),px(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==k&&dl(h);else{if(typeof k!="string"&&h.stateNode===null)throw Error(r(166));if(c=re.current,yf(h)){if(c=h.stateNode,g=h.memoizedProps,k=null,A=js,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}c[ft]=h,c=!!(c.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||b8(c.nodeValue,g)),c||gc(h,!0)}else c=og(c).createTextNode(k),c[ft]=h,h.stateNode=c}return gr(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(k=yf(h),g!==null){if(c===null){if(!k)throw Error(r(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),c=!1}else g=Cy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(Li(h),h):(Li(h),null);if((h.flags&128)!==0)throw Error(r(558))}return gr(h),null;case 13:if(k=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(A=yf(h),k!==null&&k.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[ft]=h}else Iu(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;gr(h),A=!1}else A=Cy(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=A),A=!0;if(!A)return h.flags&256?(Li(h),h):(Li(h),null)}return Li(h),(h.flags&128)!==0?(h.lanes=g,h):(g=k!==null,c=c!==null&&c.memoizedState!==null,g&&(k=h.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),D=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(D=k.memoizedState.cachePool.pool),D!==A&&(k.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),Wm(h,h.updateQueue),gr(h),null);case 4:return le(),c===null&&Ix(h.stateNode.containerInfo),gr(h),null;case 10:return ol(h.type),gr(h),null;case 19:if(W(qr),k=h.memoizedState,k===null)return gr(h),null;if(A=(h.flags&128)!==0,D=k.rendering,D===null)if(A)$_(k,!1);else{if(Ir!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(D=Mm(c),D!==null){for(h.flags|=128,$_(k,!1),c=D.updateQueue,h.updateQueue=c,Wm(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)Xk(g,c),g=g.sibling;return U(qr,qr.current&1|2),wn&&il(h,k.treeForkCount),h.child}c=c.sibling}k.tail!==null&&ut()>Xm&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304)}else{if(!A)if(c=Mm(D),c!==null){if(h.flags|=128,A=!0,c=c.updateQueue,h.updateQueue=c,Wm(h,c),$_(k,!0),k.tail===null&&k.tailMode==="hidden"&&!D.alternate&&!wn)return gr(h),null}else 2*ut()-k.renderingStartTime>Xm&&g!==536870912&&(h.flags|=128,A=!0,$_(k,!1),h.lanes=4194304);k.isBackwards?(D.sibling=h.child,h.child=D):(c=k.last,c!==null?c.sibling=D:h.child=D,k.last=D)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=ut(),c.sibling=null,g=qr.current,U(qr,A?g&1|2:g&1),wn&&il(h,k.treeForkCount),c):(gr(h),null);case 22:case 23:return Li(h),By(),k=h.memoizedState!==null,c!==null?c.memoizedState!==null!==k&&(h.flags|=8192):k&&(h.flags|=8192),k?(g&536870912)!==0&&(h.flags&128)===0&&(gr(h),h.subtreeFlags&6&&(h.flags|=8192)):gr(h),g=h.updateQueue,g!==null&&Wm(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),k=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(k=h.memoizedState.cachePool.pool),k!==g&&(h.flags|=2048),c!==null&&W(Pu),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),ol(Xr),gr(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function iU(c,h){switch(Sy(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return ol(Xr),le(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return ue(h),null;case 31:if(h.memoizedState!==null){if(Li(h),h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(Li(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Iu()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return W(qr),null;case 4:return le(),null;case 10:return ol(h.type),null;case 22:case 23:return Li(h),By(),c!==null&&W(Pu),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return ol(Xr),null;case 25:return null;default:return null}}function kC(c,h){switch(Sy(h),h.tag){case 3:ol(Xr),le();break;case 26:case 27:case 5:ue(h);break;case 4:le();break;case 31:h.memoizedState!==null&&Li(h);break;case 13:Li(h);break;case 19:W(qr);break;case 10:ol(h.type);break;case 22:case 23:Li(h),By(),c!==null&&W(Pu);break;case 24:ol(Xr)}}function P_(c,h){try{var g=h.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&c)===c){k=void 0;var D=g.create,K=g.inst;k=D(),K.destroy=k}g=g.next}while(g!==A)}}catch(se){Kn(h,h.return,se)}}function kc(c,h,g){try{var k=h.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var D=A.next;k=D;do{if((k.tag&c)===c){var K=k.inst,se=K.destroy;if(se!==void 0){K.destroy=void 0,A=h;var _e=g,Ce=se;try{Ce()}catch(De){Kn(A,_e,De)}}}k=k.next}while(k!==D)}}catch(De){Kn(h,h.return,De)}}function CC(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{p7(h,g)}catch(k){Kn(c,c.return,k)}}}function EC(c,h,g){g.props=Gu(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(k){Kn(c,h,k)}}function F_(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var k=c.stateNode;break;case 30:k=c.stateNode;break;default:k=c.stateNode}typeof g=="function"?c.refCleanup=g(k):g.current=k}}catch(A){Kn(c,h,A)}}function go(c,h){var g=c.ref,k=c.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Kn(c,h,A)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Kn(c,h,A)}else g.current=null}function NC(c){var h=c.type,g=c.memoizedProps,k=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Kn(c,c.return,A)}}function mx(c,h,g){try{var k=c.stateNode;NU(k,c.type,g,h),k[jt]=h}catch(A){Kn(c,c.return,A)}}function zC(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Ac(c.type)||c.tag===4}function gx(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||zC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Ac(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function vx(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=Hr));else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(vx(c,h,g),c=c.sibling;c!==null;)vx(c,h,g),c=c.sibling}function Vm(c,h,g){var k=c.tag;if(k===5||k===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(k!==4&&(k===27&&Ac(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(Vm(c,h,g),c=c.sibling;c!==null;)Vm(c,h,g),c=c.sibling}function jC(c){var h=c.stateNode,g=c.memoizedProps;try{for(var k=c.type,A=h.attributes;A.length;)h.removeAttributeNode(A[0]);Rs(h,k,g),h[ft]=c,h[jt]=g}catch(D){Kn(c,c.return,D)}}var fl=!1,es=!1,bx=!1,TC=typeof WeakSet=="function"?WeakSet:Set,ws=null;function aU(c,h){if(c=c.containerInfo,Px=_g,c=Ps(c),_i(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,D=k.focusNode;k=k.focusOffset;try{g.nodeType,D.nodeType}catch{g=null;break e}var K=0,se=-1,_e=-1,Ce=0,De=0,Pe=c,Ee=null;t:for(;;){for(var ze;Pe!==g||A!==0&&Pe.nodeType!==3||(se=K+A),Pe!==D||k!==0&&Pe.nodeType!==3||(_e=K+k),Pe.nodeType===3&&(K+=Pe.nodeValue.length),(ze=Pe.firstChild)!==null;)Ee=Pe,Pe=ze;for(;;){if(Pe===c)break t;if(Ee===g&&++Ce===A&&(se=K),Ee===D&&++De===k&&(_e=K),(ze=Pe.nextSibling)!==null)break;Pe=Ee,Ee=Pe.parentNode}Pe=ze}g=se===-1||_e===-1?null:{start:se,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(Fx={focusedElem:c,selectionRange:g},_g=!1,ws=h;ws!==null;)if(h=ws,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,ws=c;else for(;ws!==null;){switch(h=ws,D=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g title"))),Rs(D,k,g),D[ft]=c,Ke(D),k=D;break e;case"link":var K=O8("link","href",A).get(k+(g.href||""));if(K){for(var se=0;setr&&(K=tr,tr=$t,$t=K);var xe=Ns(se,$t),me=Ns(se,tr);if(xe&&me&&(ze.rangeCount!==1||ze.anchorNode!==xe.node||ze.anchorOffset!==xe.offset||ze.focusNode!==me.node||ze.focusOffset!==me.offset)){var ke=Pe.createRange();ke.setStart(xe.node,xe.offset),ze.removeAllRanges(),$t>tr?(ze.addRange(ke),ze.extend(me.node,me.offset)):(ke.setEnd(me.node,me.offset),ze.addRange(ke))}}}}for(Pe=[],ze=se;ze=ze.parentNode;)ze.nodeType===1&&Pe.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;seg?32:g,G.T=null,g=Ex,Ex=null;var D=zc,K=gl;if(ds=0,Df=zc=null,gl=0,(Pn&6)!==0)throw Error(r(331));var se=Pn;if(Pn|=4,FC(D.current),BC(D,D.current,K,g),Pn=se,V_(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Gt,D)}catch{}return!0}finally{X.p=A,G.T=k,i8(c,h)}}function o8(c,h,g){h=ha(g,h),h=ix(c.stateNode,h,2),c=xc(c,h,2),c!==null&&(tn(c,2),vo(c))}function Kn(c,h,g){if(c.tag===3)o8(c,c,g);else for(;h!==null;){if(h.tag===3){o8(h,c,g);break}else if(h.tag===1){var k=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Nc===null||!Nc.has(k))){c=ha(g,c),g=lC(2),k=xc(h,g,2),k!==null&&(cC(g,k,h,c),tn(k,2),vo(k));break}}h=h.return}}function Tx(c,h,g){var k=c.pingCache;if(k===null){k=c.pingCache=new cU;var A=new Set;k.set(h,A)}else A=k.get(h),A===void 0&&(A=new Set,k.set(h,A));A.has(g)||(wx=!0,A.add(g),c=_U.bind(null,c,h,g),h.then(c,c))}function _U(c,h,g){var k=c.pingCache;k!==null&&k.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,ir===c&&(vn&g)===g&&(Ir===4||Ir===3&&(vn&62914560)===vn&&300>ut()-Ym?(Pn&2)===0&&Lf(c,0):Sx|=g,Mf===vn&&(Mf=0)),vo(c)}function l8(c,h){h===0&&(h=fn()),c=Lu(c,h),c!==null&&(tn(c,h),vo(c))}function pU(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),l8(c,g)}function mU(c,h){var g=0;switch(c.tag){case 31:case 13:var k=c.stateNode,A=c.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=c.stateNode;break;case 22:k=c.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(h),l8(c,g)}function gU(c,h){return Ut(c,h)}var rg=null,If=null,Ax=!1,sg=!1,Rx=!1,Tc=0;function vo(c){c!==If&&c.next===null&&(If===null?rg=If=c:If=If.next=c),sg=!0,Ax||(Ax=!0,bU())}function V_(c,h){if(!Rx&&sg){Rx=!0;do for(var g=!1,k=rg;k!==null;){if(c!==0){var A=k.pendingLanes;if(A===0)var D=0;else{var K=k.suspendedLanes,se=k.pingedLanes;D=(1<<31-Vt(42|c)+1)-1,D&=A&~(K&~se),D=D&201326741?D&201326741|1:D?D|2:0}D!==0&&(g=!0,f8(k,D))}else D=vn,D=Rr(k,k===ir?D:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(D&3)===0||Nr(k,D)||(g=!0,f8(k,D));k=k.next}while(g);Rx=!1}}function vU(){c8()}function c8(){sg=Ax=!1;var c=0;Tc!==0&&jU()&&(c=Tc);for(var h=ut(),g=null,k=rg;k!==null;){var A=k.next,D=u8(k,h);D===0?(k.next=null,g===null?rg=A:g.next=A,A===null&&(If=g)):(g=k,(c!==0||(D&3)!==0)&&(sg=!0)),k=A}ds!==0&&ds!==5||V_(c),Tc!==0&&(Tc=0)}function u8(c,h){for(var g=c.suspendedLanes,k=c.pingedLanes,A=c.expirationTimes,D=c.pendingLanes&-62914561;0se)break;var De=_e.transferSize,Pe=_e.initiatorType;De&&y8(Pe)&&(_e=_e.responseEnd,K+=De*(_e"u"?null:document;function R8(c,h,g){var k=Bf;if(k&&typeof h=="string"&&h){var A=Fr(h);A='link[rel="'+c+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),A8.has(A)||(A8.add(A),c={rel:c,crossOrigin:g,href:h},k.querySelector(A)===null&&(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function BU(c){vl.D(c),R8("dns-prefetch",c,null)}function $U(c,h){vl.C(c,h),R8("preconnect",c,h)}function PU(c,h,g){vl.L(c,h,g);var k=Bf;if(k&&c&&h){var A='link[rel="preload"][as="'+Fr(h)+'"]';h==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+Fr(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+Fr(g.imageSizes)+'"]')):A+='[href="'+Fr(c)+'"]';var D=A;switch(h){case"style":D=$f(c);break;case"script":D=Pf(c)}ba.has(D)||(c=d({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ba.set(D,c),k.querySelector(A)!==null||h==="style"&&k.querySelector(X_(D))||h==="script"&&k.querySelector(Z_(D))||(h=k.createElement("link"),Rs(h,"link",c),Ke(h),k.head.appendChild(h)))}}function FU(c,h){vl.m(c,h);var g=Bf;if(g&&c){var k=h&&typeof h.as=="string"?h.as:"script",A='link[rel="modulepreload"][as="'+Fr(k)+'"][href="'+Fr(c)+'"]',D=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":D=Pf(c)}if(!ba.has(D)&&(c=d({rel:"modulepreload",href:c},h),ba.set(D,c),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Z_(D)))return}k=g.createElement("link"),Rs(k,"link",c),Ke(k),g.head.appendChild(k)}}}function HU(c,h,g){vl.S(c,h,g);var k=Bf;if(k&&c){var A=Mr(k).hoistableStyles,D=$f(c);h=h||"default";var K=A.get(D);if(!K){var se={loading:0,preload:null};if(K=k.querySelector(X_(D)))se.loading=5;else{c=d({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ba.get(D))&&Kx(c,g);var _e=K=k.createElement("link");Ke(_e),Rs(_e,"link",c),_e._p=new Promise(function(Ce,De){_e.onload=Ce,_e.onerror=De}),_e.addEventListener("load",function(){se.loading|=1}),_e.addEventListener("error",function(){se.loading|=2}),se.loading|=4,cg(K,h,k)}K={type:"stylesheet",instance:K,count:1,state:se},A.set(D,K)}}}function qU(c,h){vl.X(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0},h),(h=ba.get(A))&&Qx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function UU(c,h){vl.M(c,h);var g=Bf;if(g&&c){var k=Mr(g).hoistableScripts,A=Pf(c),D=k.get(A);D||(D=g.querySelector(Z_(A)),D||(c=d({src:c,async:!0,type:"module"},h),(h=ba.get(A))&&Qx(c,h),D=g.createElement("script"),Ke(D),Rs(D,"link",c),g.head.appendChild(D)),D={type:"script",instance:D,count:1,state:null},k.set(A,D))}}function M8(c,h,g,k){var A=(A=re.current)?lg(A):null;if(!A)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=$f(g.href),g=Mr(A).hoistableStyles,k=g.get(h),k||(k={type:"style",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=$f(g.href);var D=Mr(A).hoistableStyles,K=D.get(c);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},D.set(c,K),(D=A.querySelector(X_(c)))&&!D._p&&(K.instance=D,K.state.loading=5),ba.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ba.set(c,g),D||GU(A,c,g,K.state))),h&&k===null)throw Error(r(528,""));return K}if(h&&k!==null)throw Error(r(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Pf(g),g=Mr(A).hoistableScripts,k=g.get(h),k||(k={type:"script",instance:null,count:0,state:null},g.set(h,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function $f(c){return'href="'+Fr(c)+'"'}function X_(c){return'link[rel="stylesheet"]['+c+"]"}function D8(c){return d({},c,{"data-precedence":c.precedence,precedence:null})}function GU(c,h,g,k){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?k.loading=1:(h=c.createElement("link"),k.preload=h,h.addEventListener("load",function(){return k.loading|=1}),h.addEventListener("error",function(){return k.loading|=2}),Rs(h,"link",g),Ke(h),c.head.appendChild(h))}function Pf(c){return'[src="'+Fr(c)+'"]'}function Z_(c){return"script[async]"+c}function L8(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var k=c.querySelector('style[data-href~="'+Fr(g.href)+'"]');if(k)return h.instance=k,Ke(k),k;var A=d({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(c.ownerDocument||c).createElement("style"),Ke(k),Rs(k,"style",A),cg(k,g.precedence,c),h.instance=k;case"stylesheet":A=$f(g.href);var D=c.querySelector(X_(A));if(D)return h.state.loading|=4,h.instance=D,Ke(D),D;k=D8(g),(A=ba.get(A))&&Kx(k,A),D=(c.ownerDocument||c).createElement("link"),Ke(D);var K=D;return K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),h.state.loading|=4,cg(D,g.precedence,c),h.instance=D;case"script":return D=Pf(g.src),(A=c.querySelector(Z_(D)))?(h.instance=A,Ke(A),A):(k=g,(A=ba.get(D))&&(k=d({},g),Qx(k,A)),c=c.ownerDocument||c,A=c.createElement("script"),Ke(A),Rs(A,"link",k),c.head.appendChild(A),h.instance=A);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(k=h.instance,h.state.loading|=4,cg(k,g.precedence,c));return h.instance}function cg(c,h,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,D=A,K=0;K title"):null)}function WU(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function B8(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function VU(c,h,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=$f(k.href),D=h.querySelector(X_(A));if(D){h=D._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=dg.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=D,Ke(D);return}D=h.ownerDocument||h,k=D8(k),(A=ba.get(A))&&Kx(k,A),D=D.createElement("link"),Ke(D);var K=D;K._p=new Promise(function(se,_e){K.onload=se,K.onerror=_e}),Rs(D,"link",k),g.instance=D}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=dg.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var Yx=0;function KU(c,h){return c.stylesheets&&c.count===0&&hg(c,c.stylesheets),0Yx?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function dg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hg(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var fg=null;function hg(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,fg=new Map,h.forEach(QU,c),fg=null,dg.call(c))}function QU(c,h){if(!(h.state.loading&4)){var g=fg.get(c);if(g)var k=g.get(null);else{g=new Map,fg.set(c,g);for(var A=c.querySelectorAll("link[data-precedence],style[data-precedence]"),D=0;D"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),a2.exports=VG(),a2.exports}var QG=KG();const YG=!1;var jM=R.useLayoutEffect;function XG(e,n,t){R.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function ZG(e){const n=R.useRef(null);return R.useImperativeHandle(e,()=>n.current,[]),n}function K0(e){return e[e.length-1]}function Bh(e,n){return typeof e=="function"?e(n):e}const TM=Object.prototype.hasOwnProperty,JG=Object.prototype.propertyIsEnumerable;function AM(e){for(const n in e)if(TM.call(e,n))return!0;return!1}const eW=()=>Object.create(null),Ku=(e,n)=>od(e,n,eW);function od(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=S9(e)&&S9(s);if(!i&&!(G1(e)&&G1(s)))return s;const a=i?e:x9(e);if(!a)return s;const o=i?s:x9(s);if(!o)return s;const l=a.length,u=o.length,_=i?new Array(u):t();let d=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!w9(t)||!t.hasOwnProperty("isPrototypeOf"))}function w9(e){return Object.prototype.toString.call(e)==="[object Object]"}function S9(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ou(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ou(e[a],n[a],t)))return!1;return s===i}return!1}const tW=/[\x00-\x1f\x7f"<>`{}]/g;function nW(e){return e.replace(tW,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function k9(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return nW(n)}const rW=["http:","https:","mailto:","tel:"];function W1(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function a0(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=k9(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+k9(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function sW(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function iW(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const l={key:i,value:a,prev:r};r&&(r.next=l),r=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,r=void 0}}}const su=4,RM=5;function MM(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!B.parse&&B.caseSensitive===j&&B.prefix===N&&B.suffix===T));if(O)w=O;else{const B=aW(E,d,j,N,T);w=B,B.parent=s,B.depth=i;let $;E===1?$=s.dynamic??(s.dynamic=[]):E===3?$=s.optional??(s.optional=[]):$=s.wildcard??(s.wildcard=[]),$.push(B),$.length===2&&(a==null||a.push($))}break}}s=w}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const b=lh(d);b.kind=RM,b.parent=s,i++,b.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(b),s=b}const v=(t.path||!t.children)&&!t.isRoot;if(v&&d.endsWith("/")){const b=lh(d);b.kind=su,b.parent=s,i++,b.depth=i,s.index=b,s=b}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,v&&!s.route&&(s.route=t,s.fullPath=d)}if(t.children)for(const d of t.children)Vv(e,n,d,l,s,i,a,o)}function DM(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function lh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function aW(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function oW(e,n){const t=lh("/"),r=new Uint16Array(6),s=[];for(const i of e)Vv(!1,r,i,1,t,0,s);for(const i of s)i.sort(DM);n.masksTree=t,n.flatCache=V1(1e3)}function lW(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=H5(e,n.masksTree);return n.flatCache.set(e,r),r}function cW(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=lh("/"),Vv(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),H5(r,a,t)}function uW(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=H5(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=OM(i.route)),n.matchCache.set(r,i),i}function dW(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fW(e,n=!1,t){const r=lh(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let l=0;Vv(n,s,e,1,r,0,i,u=>{if(t==null||t(u,l),u.id in a&&F5(),a[u.id]=u,l!==0&&u.path){const _=dW(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}l++});for(const u of i)u.sort(DM);return{processedTree:{segmentTree:r,singleCache:V1(1e3),matchCache:V1(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function H5(e,n,t=!1){const r=e.split("/"),s=_W(e,r,n,t);if(!s)return null;const[i]=LM(e,r,s);return{route:s.node.route,rawParams:i}}function LM(e,n,t){var _,d,p,m;const r=hW(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((d=t.extract)==null?void 0:d.node)??0,l=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;N--){const T=d.wildcard[N],{prefix:j,suffix:M}=T;if(!(j&&(y||!(T.caseSensitive?C:E??(E=C.toLowerCase())).startsWith(j)))){if(M){if(y)continue;const O=n.slice(p).join("/"),B=O.slice(-M.length);if((T.caseSensitive?B:B.toLowerCase())!==M||O.length-M.length=0;T--){const j=d.optional[T];o.push({node:j,index:p,skipped:N,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}if(!y)for(let T=d.optional.length-1;T>=0;T--){const j=d.optional[T],{prefix:M,suffix:O}=j;if(M||O){const B=j.caseSensitive?C:E??(E=C.toLowerCase());if(M&&!B.startsWith(M)||O&&B.indexOf(O,B.length-O.length)=0;N--){const T=d.dynamic[N],{prefix:j,suffix:M}=T;if(j||M){const O=T.caseSensitive?C:E??(E=C.toLowerCase());if(j&&!O.startsWith(j)||M&&O.indexOf(M,O.length-M.length)=0;N--){const T=d.pathless[N];o.push({node:T,index:p,skipped:m,statics:x,dynamics:S,optionals:v,extract:b,rawParams:w})}}if(u)return u;if(r&&l){let _=l.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===su)>(e.node.kind===su)||n.node.kind===su==(e.node.kind===su)&&n.node.depth>e.node.depth))):!0}function g1(e){return v1(e.filter(n=>n!==void 0).join("/"))}function v1(e){return e.replace(/\/{2,}/g,"/")}function IM(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Rl(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function BM(e){return Rl(IM(e))}function K1(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function mW(e,n,t){return K1(e,t)===K1(n,t)}function gW({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=v1(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=v1(e)),a=e.split("/");a.length>1&&K0(a)==="";)a.pop();const u=n.split("/");for(let _=0,d=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(K0(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),l=(s?v1(o):o)||"/";return i&&r&&r.set(i,l),l}function vW(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function u2(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>N9(s,t)).join("/"):N9(r,t)}function E9({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,l,u="";for(;oe.state.__TSR_key||e.href;function CW(e){const n=e.getAttribute(z9);if(n)return`[${z9}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let kg=!1;const b1="window";function g4(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function j9(e){const n=new Set;for(const t of e){if(t===b1)continue;const r=g4(t);r&&n.add(r)}return n}function EW(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||kW,i=new Set,a=o=>{const l=Gc[o]||(Gc[o]={});for(const u of i)u===document?l[b1]={scrollX,scrollY}:u.isConnected&&(l[CW(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,kg=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{kg||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),SW()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const l=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,d=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const v=Gc[x];if(v){let b=Gc[m];for(const w in v){if(w===b1){if(_)continue}else{const y=g4(w);if(!y||_&&u&&(p??(p=j9(u)),p.has(y)))continue}b||(b=Gc[m]={}),b[w]??(b[w]=v[w])}}}kg=!0;try{const v=o.toLocation.hash,b=o.toLocation.state.__hashScrollIntoViewOptions??!0;let w=!1;if(_){!v&&u&&(p??(p=j9(u)));const y=v&&b&&d,C=r.restoring?Gc[m]:void 0;if(C)for(const E in C){const{scrollX:N,scrollY:T}=C[E];if(E===b1){if(y)continue;scrollTo({top:T,left:N,behavior:l}),w=!0}else{const j=g4(E);j&&(j.scrollLeft=N,j.scrollTop=T,p==null||p.delete(j))}}if(!v){const E={top:0,left:0,behavior:l};if(w||scrollTo(E),p)for(const N of p)N.scrollTo(E)}}!w&&v&&b&&((S=document.getElementById(v))==null||S.scrollIntoView(b))}finally{kg=!1}}))}function NW(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function d2(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zW(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=d2(s):Array.isArray(i)?i.push(d2(s)):t[r]=[i,d2(s)]}return t}const jW=/^(?:\s|["[{\d-]|fa|nu|tr)/,TW=RW(JSON.parse),AW=MW(JSON.stringify,JSON.parse);function RW(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=zW(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function MW(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!jW.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=NW(s,r);return i?`?${i}`:""}}const uh="__root__";function DW(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function $M(e){return e instanceof Response&&!!e.options}function LW(e){return{input:({url:n})=>{for(const t of e)n=v4(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=PM(e[t],n);return n}}}function OW(e){const n=BM(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=g1(["/",n,i.pathname]),i)}}function v4(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function PM(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function IW(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),l=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),d=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:l.get()}));function p(S){let v=i.get(S);return v||(v=t(void 0),i.set(S,v)),v}const m={status:a,location:o,resolvedLocation:l,ids:u,matches:_,byRoute:i,__store:d,getMatchStore:p,setMatches:x};function x(S){const v=u.get(),b=S.map(w=>w.routeId);s(()=>{iW(v,b)||u.set(b);for(const w of v)b.includes(w)||i.get(w).set(()=>{});for(const w of S){const y=p(w.routeId);y.get()!==w&&y.set(w)}})}return m}var lu="__TSR_index",T9="popstate",A9="beforeunload";function BW(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...l})=>{var d,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((d=e.getBlockers)==null?void 0:d.call(e))??[],_=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=Q1(l.path,l.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:l.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,l)=>{const u=n.state[lu];o=R9(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:a,state:o})},replace:(a,o,l)=>{const u=n.state[lu];o=R9(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[lu]!==0,createHref:a=>e.createHref(a),block:a=>{var l;if(!e.setBlockers)return()=>{};const o=((l=e.getBlockers)==null?void 0:l.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,d;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(d=e.setBlockers)==null||d.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function R9(e,n){n||(n={});const t=q5();return{...n,key:t,__TSR_key:t,[lu]:e}}function $W(e){var T,j;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),l=(()=>Q1(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((T=n.history.state)!=null&&T.__TSR_key)&&!((j=n.history.state)!=null&&j.key)){const M=q5();n.history.replaceState({[lu]:0,key:M,__TSR_key:M},"")}let u=l(),_,d=!1,p=!1,m=!1,x=!1;const S=()=>u;let v;const b=()=>{v&&(N._ignoreSubscribers=!0,(v[2]?n.history.pushState:n.history.replaceState)(v[1],"",v[0]),N._ignoreSubscribers=!1,v=void 0,_=void 0)},w=(M,O,B)=>{const $=o(O),H=!!v;H||(_=u),u=Q1(O,B),v=[$,B,(v==null?void 0:v[2])||M],H||queueMicrotask(()=>b())},y=M=>{u=l(),N.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=l(),O=M.state[lu]-u.state[lu],B=O===1,$=O===-1,H=!B&&!$||d;d=!1;const q=H?"GO":$?"BACK":"FORWARD",Y=H?{type:"GO",index:O}:{type:$?"BACK":"FORWARD"};if(m)m=!1;else{const G=i();if(typeof document<"u"&&G.length){for(const X of G)if(await X.blockerFn({currentLocation:u,nextLocation:M,action:q})){p=!0,n.history.go(1),N.notify(Y);return}}}u=l(),N.notify(Y)},E=M=>{if(x){x=!1;return}let O=!1;const B=i();if(typeof document<"u"&&B.length)for(const $ of B){const H=$.enableBeforeUnload??!0;if(H===!0){O=!0;break}if(typeof H=="function"&&H()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},N=BW({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>w(!0,M,O),replaceState:(M,O)=>w(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{d=!0,n.history.go(M)},createHref:M=>o(M),flush:b,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(A9,E,{capture:!0}),n.removeEventListener(T9,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(A9,E,{capture:!0}),n.addEventListener(T9,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return N._ignoreSubscribers||y("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return N._ignoreSubscribers||y("REPLACE"),O},N}function PW(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Q1(e,n){const t=PW(e),r=t.indexOf("#"),s=t.indexOf("?"),i=q5();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[lu]:0,key:i,__TSR_key:i}}}function q5(){return(Math.random()+1).toString(36).substring(7)}function M9(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Kv(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function D9({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function FW(e,n,t,r){var s,i,a,o;for(const l of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===l.routeId)||(i=(s=e.routesById[l.routeId].options).onLeave)==null||i.call(s,l)}for(const l of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[l.routeId].options)[n.some(u=>u.routeId===l.routeId)?"onStay":"onEnter"])==null||o.call(a,l)}}var HW=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??YG??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vW(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=$W()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=V1(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=IW(this.latestLocation,u),EW(this)}const o=this.options.basepath??"/",l=this.options.rewrite;if(i||s!==o||a!==l){this.basepath=o;const u=[],_=BM(o);_&&_!=="/"&&u.push(OW({basepath:o})),l&&u.push(l),this.rewrite=u.length===0?void 0:u.length===1?u[0]:LW(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=fW(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&oW(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:l,search:u,hash:_,href:d,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),w=this.options.stringifySearch(b);return{href:l+w+_,publicHref:l+w+_,pathname:a0(l).path,external:!1,searchStr:w,search:Ku(r==null?void 0:r.search,b),hash:a0(_.slice(1)).path,state:od(r==null?void 0:r.state,p)}}const m=new URL(d,this.origin),x=v4(this.rewrite,m),S=this.options.parseSearch(x.search),v=this.options.stringifySearch(S);return x.search=v,{href:x.href.replace(x.origin,""),publicHref:d,pathname:a0(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:v,search:Ku(r==null?void 0:r.search,S),hash:a0(x.hash.slice(1)).path,state:od(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const l=s(a);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>gW({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=uW(Rl(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const B=Q1(i.href,{});i={...i,to:v4(this.rewrite,new URL(B.pathname,this.origin)).pathname,search:this.options.parseSearch(B.search),hash:B.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const l=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],d=this.resolvePathWithBase(l,i.to?`${i.to}`:".");let p=L9(i.params,_);const m=this.routesByPath[Rl(d)];let x;if(m)x=this.getRouteBranch(m);else if(d.includes("$"))x=[];else{const[B,$,H]=this.getMatchedRoutes(d);x=B,this.options.notFoundRoute&&(!H||H.path!=="/"&&$["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&AM(p))for(const B of x){const $=((M=B.options.params)==null?void 0:M.stringify)??B.options.stringifyParams;if($){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,$(p))}catch{}}}const S=t.leaveParams?d:a0(E9({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let v=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const B={};x.forEach($=>{if($.options.validateSearch)try{Object.assign(B,y1($.options.validateSearch,{...B,...v}))}catch{}}),v=B}v=UW(v,i,x,t._includeValidateSearch),v=Ku(u,v);const b=this.options.stringifySearch(v),w=i.hash===!0?a.hash:i.hash?Bh(i.hash,a.hash):void 0,y=w?`#${w}`:"";let C=i.state===!0?a.state:i.state?Bh(i.state,a.state):{};i.state&&(C=od(a.state,C));const E=`${S}${b}${y}`;let N,T,j=!1;if(this.rewrite){const B=new URL(E,this.origin),$=PM(this.rewrite,B);N=B.href.replace(B.origin,""),$.origin!==this.origin?(T=$.href,j=!0):T=$.pathname+$.search+$.hash}else N=sW(E),T=N;return{publicHref:T,href:N,pathname:S,search:v,searchStr:b,state:C,hash:w??"",external:j,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=lW(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:l,...u}=i.route,_=L9(l,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Rl(this.latestLocation.href)===Rl(s.href)&&ou(D9(s.state),D9(this.latestLocation.state)),o=this._commitPromise;let l;const u=new Promise(_=>{l=_});if(u.resolve=()=>{l(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:d,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const l=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=l;const u=this.commitLocation({...l,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===l&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var l,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const d=this.buildLocation({to:t,...a});s=s??d.publicHref,i=i??d.publicHref}const _=!o&&i?i:s;if(W1(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const d=((u=(l=this.history).getBlockers)==null?void 0:u.call(l))??[];for(const p of d)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await JW(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Kv(o,l)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(d=>!s||s(d)).map(d=>d.id)),o=[];for(const[d,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(d),o.push(d));const l=d=>{if(a.has(d.id)){const p=this.routesById[d.routeId],m={...d,invalid:!0,...(t!=null&&t.forcePending||d.status==="error"||d.status==="notFound")&&M9(p)?{status:"pending",error:void 0}:void 0};return d._flight=void 0,m}return d};this._committed=r.map(l);for(const[d,p]of this._cache)a.has(d)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const d of a)(_=this._flights)==null||_.delete(d);for(const d of o)d.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&W1(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,d]of r)(!i||i(d))&&(o.push(_),a.push(d));const l=[];for(const[_,d]of s??[])(!i||d.some(i))&&(l.push(_),a.push(...d));for(const _ of o)r.delete(_);for(const _ of l)s.delete(_);for(const _ of a){const d=_._flight;_._flight=void 0,d&&!--d[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===d&&this._flights.delete(_.id),l.push(d[1]))}for(const _ of l)_.abort()},this.loadRouteChunk=dh,this.preloadRoute=t=>eV(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=cW(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!l||t.params&&!ou(l.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ou(o.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??AW,parseSearch:e.parseSearch??TW,protocolAllowlist:e.protocolAllowlist??rW}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=OM(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Rl(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?GW(this.options.notFoundMode,i):void 0,l=new Array(i.length),u=this._committed,_=(x,S)=>{const v=u[S];return(v==null?void 0:v.routeId)===x.id?v:x===this.options.notFoundRoute?u.find(b=>b.routeId===x.id):void 0};let d;for(let x=0;x{const m=p(l.preSearchFilters?l.preSearchFilters.reduce((x,S)=>S(x),d):d);return l.postSearchFilters?l.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=l.validateSearch;if(r&&u){const _=({search:d,next:p,meta:m})=>{const x=p(d);try{const S=y1(u,x);if(m&&S)for(const v in S)v in x||(m.defaulted||(m.defaulted=new Map)).set(v,S[v]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,l,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return l;const d=Bh(n.search,l);return u&&(u.explicit=d),d}const _=(d,p)=>{if(p){const m=u||{};return{search:i(o+1,d,m),meta:m}}return i(o+1,d,u)};return s[o]({search:l,next:_,meta:u})};return i(0,e)}function GW(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return uh}function L9(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,Bh(e,t))}function O9(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function b4(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function WW(e,n){const t=b4(e,"component");let r=b4(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function dh(e,n,t){const r=()=>n===!1?void 0:n?b4(e,n):WW(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...l}=a.options;Object.assign(e.options,l),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function U5(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Vd(e,n){return e.routesById[n.routeId]}function Y0(e,n,t){return $M(e)?[qi,e]:$h(e)?(e.routeId||(e.routeId=t),[Qv,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Il,e]):[Lo,e]}function G5(e,n){var r,s;let t=Y0(n,!0,e.id);if(t[0]!==Il)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=Y0(i,!0,e.id)}return t}function R0(e,n,t,r,s){return s[0].signal.aborted?fu:K5(e,n,t,G5(t,r),s)}async function VW(e,n,t,r,s,i){var _,d;const[a,o]=n,l=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...v,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}if(l.aborted)return[p,fu];const b=m.paramsError??m.searchError;if(b!==void 0)return Ml(e,m),[p,R0(e,n,x,b,t)];const w=x.options.beforeLoad;if(!w)continue;const y=m.status;p>=i&&(m.status="pending",(d=t[7])==null||d.call(t));try{X0(e,m,"beforeLoad",t[0]);const C=await Wd(w({...v,search:m.search,context:m.context,...e.options.additionalContext}),l);if(l.aborted)return[p,fu];const E=K5(e,n,x,Y0(C,!1,x.id),t);if(E[0]!==Lo)return Ml(e,m),[p,E];m.context={...m.context,...C}}catch(C){return Ml(e,m),[p,R0(e,n,x,C,t)]}finally{m.status=y,X0(e,m,!1,t[0])}}s()}function W5(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ml(e,n){var r;const t=n._flight;n._flight=void 0,(r=W5(e,n,t))==null||r.abort()}function ki(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(l=>l.id===a.id)))o[2]=0;else{const l=W5(e,a,o);l&&s.push(l)}}for(const a of s)a.abort()}function V5(e){for(const n of e){const t=n._flight;t&&t[2]++}}function X0(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function FM(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:l=>e.navigate({...l,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function I9(e,n,t,r,s,i,a){const o=a[0],l=o.signal;if(l.aborted)return fu;if(!s)return[Lo,void 0];let u=t._flight;X0(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(FM(e,n,t,r,_,i,!!a[3]))).then(d=>Y0(d,!1,r.id),d=>Y0(d,!0,r.id)).then(d=>{var p;return d[0]!==Lo&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),d[0]===Il&&u[2]?G5(r,d[1]):d}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],K5(e,n,r,await Wd(u[0],l),a)}catch(_){if(_!==l||!l.aborted)throw _;return Ml(e,t),fu}finally{X0(e,t,!1,o)}}function B9(e,n,t){n[0]!==qi&&(e.status="success",e.error=void 0,n[0]===Lo?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function KW(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ml(e,r)}function $9(e,n){return n[0]===Il||n[0]===Qv?{...e,status:n[0]===Il?"error":"notFound",error:n[1],_flight:void 0}:e}function QW(e,n,t,r,s,i,a){var $,H;const o=n[1][t],l=Vd(e,o),u=!!i[3],_=e._cache.get(o.id);let d,p=!1,m;try{if(o.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(FM(e,n,o,l,i[0],s,u))),i[0].signal.aborted&&(m=fu)),!m)if(o.status!=="success")p=!0;else{const q=u||o.preload?l.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||d||d===void 0&&Date.now()-o.updatedAt>=q&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(q){o.invalid=!0,Ml(e,o),m=R0(e,n,l,q,i)}const x=l.options.loader,S=typeof x=="function",v=S?x:x==null?void 0:x.handler,b=!u||l.options.preload!==!1;let w=b&&x?($=e._flights)==null?void 0:$.get(o.id):void 0;w===o._flight||m?w=void 0:w&&!p&&!u&&d===void 0?p=!0:p||(w=void 0);const y=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&b,E=C&&!y&&(o.status!=="success"||!!x),N=t>=a?i[7]:void 0,T=l.lazyFn&&l._lazy!==!0?N:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),w&&w[2]++,E){const q=o._flight;o._flight=w,(H=W5(e,o,q))==null||H.abort(),t>=a&&(o.status="pending"),N==null||N()}C||(o.isFetching=!1);const j=(m?Promise.resolve(m):E?I9(e,n,o,l,v,s,i):Promise.resolve([Lo,o.loaderData])).then(q=>(E&&(B9(o,q,u),q[0]===Lo&&(x&&!i[0].signal.aborted&&KW(e,o,_),t>=a&&(o.status="pending"))),q)),M=Wd(Promise.resolve().then(()=>dh(l,void 0,T)),i[0].signal).then(()=>{},q=>n[1].some((Y,G)=>G<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,R0(e,n,l,q,i)]).then(q=>j.then(Y=>(E&&!q&&Y[0]===Lo&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",N==null||N()),q)));if(r.push([t,j,M]),!y)return j.then(q=>$9(o,q));const O={...o,status:"pending",preload:!1,_flight:w};o.invalid=!1,o.isFetching="loader";const B=I9(e,n,O,l,v,s,i).then(q=>(o.isFetching=!1,B9(O,q,!1),q));return(n[2]??(n[2]=[])).push([t,B,M,O]),B.then(q=>$9(O,q))}async function y4(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const l=Vd(e,n[o]);try{const u=dh(l,!1);u&&await Wd(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(l.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function kd(e,n){n[2]&&(ki(e,n[2].map(t=>t[3])),n[2]=void 0)}async function P9(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=qi)throw[o,a];!s&&a[0]!==Lo&&(s=[o,a],await Promise.all((t??[]).map(l=>{if(!(l[0]<=o))return l[1].then(u=>{if(u[0]===qi)throw[l[0],u]})})))}})))}catch(i){return i}return n??s}function K5(e,n,t,r,s,i){for(;r[0]===qi;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[qi,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(l){r=i?[Il,l]:G5(t,l),i=!0}}return r}async function HM(e,n,t,r,s,i){const a=n[1];let o=await s,l=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Qv?y4(e,a,m,r.signal):m[0];let d=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=qi)d=0;else if(o){d=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=d)break;const x=await m[1];if(x[0]!==Lo&&x[0]=d)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=qi){const m=o[1];if(m[0]!==qi||m[1].options.reloadDocument||m[2])return kd(e,n),m;l=!0,o=[0,[Il,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],v=m==null?void 0:m[1],b=()=>{m&&(S._notFound=void 0,x===Il?S.status="error":(v.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=v,S.isFetching=!1)};b(),m||i==null||i();const w=Vd(e,S);try{await Wd(m?Promise.resolve().then(()=>dh(w,x===Il?"errorComponent":"notFoundComponent")):Promise.all([dh(w),dh(w,"notFoundComponent")]),r.signal)}catch(y){if(y===r.signal&&r.signal.aborted)return kd(e,n),fu}m?l&&(r.abort(),await Promise.all([...t.map(y=>y[1]),...t.map(y=>y[2]),...(n[2]??[]).map(y=>y[1])]),kd(e,n),ki(e,a),b()):S.status="success"}return n}async function qM(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let l=r;lw._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const w=await y4(e,t,void 0,i,u);t[u]._notFound=void 0,t[w]._notFound=!0,u=w}let _=u<0?t.length:u+1,d=0;for(;d<_&&d!==u;){const w=t[d],y=r[2][d],C=l[d];if((y==null?void 0:y.id)!==w.id||y.status!=="success"||y._notFound||w.preload||(C==null?void 0:C.id)!==w.id||C.status!=="success"||C._notFound)break;d++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let w=m;w<_&&!i.aborted;w++)x=QW(e,s,w,p,x,r,d)},v=await VW(e,s,r,_,S,d);if(v){if(r[4]=!0,_=v[0],v[1][0]===Qv){const w=await y4(e,t,v,i);v[2]=w,_=Math.min(_,w+1)}else v[1][0]>=qi&&(_=0);S()}if(!i.aborted&&!r[3]){const w=[];for(const[y,C]of e._flights??[])C[2]||(e._flights.delete(y),w.push(C[1]));for(const y of w)y.abort()}const b=HM(e,s,p,r[0],P9(p,v,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=P9(s[2],void 0,void 0,b.then(w=>Q0(w)?0:U5(t).length,()=>0))),a=await b}catch(l){if(kd(e,s),l===i&&i.aborted)return fu;throw l}return Q0(a)?a:qM(e,a,i,r[6]===t.length?r[6]:0)}function x4(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>x4(e,n),w);return}s[2]=0}const v=t.map(w=>({...w,_flight:void 0}));v[o].status="pending";const b=s[4]=e.startTransition(()=>e.stores.setMatches(v),v).then(w=>(w&&e._pending===s&&s[4]===b&&!s[2]&&(s[2]=Date.now()+x),w));return}}function o0(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function F9(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!U5(n[3]).some(i=>i.id===t[1]))return;let s;try{await Wd(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function GM(e,n){e._committed=n,e.stores.setMatches(n)}function YW(e,n,t,r){const s=e._committed,i=e._cache;for(const l of t)l.preload=!1,r&&(l._assetEnd=void 0);const a=U5(t).length,o=new Map;{const l=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((d,p)=>d.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,GM(e,t),ki(e,[...i.values(),...s],[...t,...o.values()]),FW(e,s,t,n)}async function Cg(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function WM(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function XW(e,n,t,r,s){const i=t.map(l=>({...l}));V5(i);for(const l of r)Ml(e,i[l[0]]),i[l[0]]=l[3];const a=[n[2],i];let o;try{o=await HM(e,a,r,n[0],s)}catch(l){throw ki(e,i),l}if(Q0(o)){ki(e,i),o[0]===qi&&e._tx===n&&e._committed===t&&await WM(e,n,o);return}if(await qM(e,o,n[0].signal),e._tx!==n||e._committed!==t){ki(e,i);return}for(const l of i){const u=e._cache.get(l.id);u!=null&&u._flight&&u._flight===l._flight&&(e._cache.delete(l.id),Ml(e,u))}GM(e,i),ki(e,t,i)}async function ZW(e,n,t,r,s,i){const a=await UM(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(Q0(a)){const d=a[0]===qi&&e._tx===n;if((!d||a[1].options.reloadDocument)&&o0(e,n),ki(e,n[3]),n[3]=[],!d)return;if(e._tx!==n){o0(e,n);return}await WM(e,n,a);return}const o=a[1];if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const l=n[2],u=Kv(l,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await F9(e,n),e._tx!==n){o0(e,n),ki(e,o),kd(e,a);return}const d=()=>{o0(e,n),YW(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(d,o);if(e._tx!==n){kd(e,a);return}_!=null&&_.length&&XW(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function JW(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,l=e._handoff,u=l==null?void 0:l[0](),_=new AbortController,d=e._preflight;if(e._preflight=_,u||l==null||l[1](),d==null||d.abort(),!_.signal.aborted){const E=Kv(i,r);e.emit({type:"onBeforeNavigate",...E}),_.signal.aborted||e.emit({type:"onBeforeLoad",...E})}if(_.signal.aborted){await Cg(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});V5(x);const S=u?l[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ki(e,x),await Cg(e,t);return}e._preflight=void 0;let v;const b=()=>ZW(e,y,p,()=>x4(e,y),n==null?void 0:n.sync,S),w=n!=null&&n.sync?new Promise(E=>v=E):Promise.resolve().then(b).then(),y=[m,o,i,x,Date.now(),w];if(e._tx=y,t){for(const E of e.stores.matches.get()){if(e._tx!==y)break;E.isFetching&&X0(e,E,!1)}t[0].abort(),ki(e,t[3],y[3],!0)}if(e._tx!==y){ki(e,y[3]),y[3]=[],v==null||v(),await Cg(e,y);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(E=>E._notFound))&&x4(e,y),v==null||v(b()),await w,await Cg(e,y)}async function eV(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,l;try{try{a=e.matchRoutes(t,{_controller:i}),V5(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),l=await UM(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ki(e,a)),i.abort()}if(!Q0(l))return l[1];if(!o||l.length<3)return;t=l[2]}catch(u){$h(u)||console.error(u);return}}}const tV="Error preloading route! ☝️";var VM=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var l,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(l=this.options).getParentRoute)==null?void 0:u.call(l),r?this._path=uh:this.parentRoute||F5();let s=r?uh:t==null?void 0:t.path;s&&s!=="/"&&(s=IM(s));const i=(t==null?void 0:t.id)||s;let a=r?uh:g1([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=g1(["/",a]));const o=a==="__root__"?"/":g1([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Rl(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>DW({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},nV=class extends VM{constructor(e){super(e)}},Q5=class extends R.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?R.createElement(this.props.errorComponent??rV,{error:e,reset:this.reset}):this.props.children}};function rV({error:e}){const[n,t]=R.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),n?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function sV({children:e,fallback:n=null}){return f.jsx(Je.Fragment,{children:KM()?e:n})}function KM(){return Je.useSyncExternalStore(iV,()=>!0,()=>!1)}function iV(){return()=>{}}var QM=R.createContext(null);function li(e){return R.useContext(QM)}var Yv=R.createContext(void 0),aV=R.createContext(void 0),wr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(wr||{});function oV({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,d){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=d,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===d&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:d,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const d=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:d.subsTail=S,S!==void 0?S.nextSub=x:(d.subs=x)===void 0&&t(d),m}function i(u){let _=u.nextSub,d;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&l(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(d={value:_,prev:d},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let d,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const v=x.subs;v.nextSub!==void 0&&o(v),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=x.deps,_=x,++p;continue}if(!m){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;p--;){const v=_.subs,b=v.nextSub!==void 0;if(b?(u=d.value,d=d.prev):u=v,m){if(e(_)){b&&o(v),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const w=u.nextDep;if(w!==void 0){u=w;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,d=_.flags;(d&48)===32&&(_.flags=d|16,(d&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function l(u,_){let d=_.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function lV(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const w4=[];let x1=0;const{link:H9,unlink:cV,propagate:uV,checkDirty:YM,shallowPropagate:q9}=oV({update(e){return e._update()},notify(e){w4[S4++]=e,e.flags&=~wr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=wr.Mutable|wr.Dirty,X1(e))}});let Eg=0,S4=0,Co,k4=0;function dV(e){try{++k4,e()}finally{--k4||XM()}}function X1(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=cV(t,e)}function XM(){if(!(k4>0)){for(;Eg{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(i){const a=Co,o=(n==null?void 0:n.compare)??Object.is;if(t)Co=s,++x1,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=wr.Mutable|wr.RecursedCheck);try{const l=s._snapshot,u=typeof i=="function"?i(l):i===void 0&&t?r(l):i;return l===void 0||!o(l,u)?(s._snapshot=u,!0):!1}finally{Co=a,t&&(s.flags&=~wr.RecursedCheck),X1(s)}}};return t?(s.flags=wr.Mutable|wr.Dirty,s.get=function(){const i=s.flags;if(i&wr.Dirty||i&wr.Pending&&YM(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&q9(a)}}else i&wr.Pending&&(s.flags=i&~wr.Pending);return Co!==void 0&&H9(s,Co,x1),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(uV(a),q9(a),XM())}},s}function fV(e){const n=()=>{const r=Co;Co=t,++x1,t.depsTail=void 0,t.flags=wr.Watching|wr.RecursedCheck;try{return e()}finally{Co=r,t.flags&=~wr.RecursedCheck,X1(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:wr.Watching|wr.RecursedCheck,notify(){const r=this.flags;r&wr.Dirty||r&wr.Pending&&YM(this.deps,this)?n():this.flags=wr.Watching},stop(){this.flags=wr.None,this.depsTail=void 0,X1(this)}};return n(),t}var f2={exports:{}},h2={},_2={exports:{}},p2={};/** * @license React * use-sync-external-store-shim.production.js * @@ -54,7 +54,7 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var G9;function hV(){if(G9)return m2;G9=1;var e=Vp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return m2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,m2}var W9;function _V(){return W9||(W9=1,p2.exports=hV()),p2.exports}/** + */var G9;function hV(){if(G9)return p2;G9=1;var e=Vp();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(d,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,v=x[1];return i(function(){S.value=m,S.getSnapshot=p,l(S)&&v({inst:S})},[d,m,p]),s(function(){return l(S)&&v({inst:S}),d(function(){l(S)&&v({inst:S})})},[d]),a(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!t(d,m)}catch{return!0}}function u(d,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return p2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,p2}var W9;function _V(){return W9||(W9=1,_2.exports=hV()),_2.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -62,22 +62,22 @@ Error generating stack: `+k.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var V9;function pV(){if(V9)return _2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return _2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},_2}var K9;function mV(){return K9||(K9=1,h2.exports=pV()),h2.exports}var XM=mV();const gV=Wp(XM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return XM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Y5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Xv),r=e.from??t,s=n.stores.getMatchStore(r),i=Y5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&F5()}function ZM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function JM(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function eD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function tD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Zv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function X5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function g2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return V1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),V1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=Q1(e.pathname,r),o=Q1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:H,hash:q,state:Y,mask:G,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,W=VM(),U=g2(e.search),Z=g2(e.params),ce=g2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,U,Z,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,ce,t.basepath,W,we!==void 0)]},[ce,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ue=oe?Bh(s,{})??SV:v2,pe=oe?v2:Bh(i,{})??v2,Se=[C,ue.className,pe.className].filter(Boolean).join(" "),ye=(y||ue.style||pe.style)&&{...y,...ue.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){b2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&b2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&b2(r)};return{...F,...ue,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var v2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,b2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Jv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends WM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>X5({...t,from:this.id}),this.useSearch=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>eD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>JM({...t,from:this.id}),this.useLoaderData=t=>ZM({...t,from:this.id}),this.useNavigate=()=>Zv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Jv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>X5({...n,from:this.id}),this.useSearch=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>eD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>JM({...n,from:this.id}),this.useLoaderData=n=>ZM({...n,from:this.id}),this.useNavigate=()=>Zv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Jv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(Q5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function nD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function eb(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],rD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,sD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=eb(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=rD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?Q5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Xv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!rD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return eb(t,s)}if(n.status==="notFound")return nD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Xv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return nD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(sD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:eb(n),children:a}):a});function iD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{iD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),zM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Qv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=eb(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;zM(()=>{n[0]===t&&iD(n,!0)},[n,t]);const i=s?f.jsx(sD,{routeId:s}):null;return f.jsx(Xv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(Q5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){TM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(KM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function aD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Y5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Y5(e,n))}const J1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))J1.set(s,(J1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?J1.get(s):void 0,a=await t();if(!s||J1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function oD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!oD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const lD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],Z5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...Z5,...lD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...lD,...Z5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function tb(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])P5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])tb(r.id);P5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",J5=["en","zh-CN","fa"],cD="orx:locale",e6=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=e6;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=fD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,uD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(cD)??void 0;else if(hD(r)&&ev.has(r)){const i=ev.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let uD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=e6;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=fD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(cD,e);else if(hD(l)&&ev.has(l)){const u=ev.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of J5)if(t.toLowerCase()===n)return t}function dD(e){return!!e&&J5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${J5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function fD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:e6}const ev=new Map;function hD(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,_D=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,E4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,tv=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,y2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",mD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",x2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,w2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",nv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",N4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,t6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? + */var V9;function pV(){if(V9)return h2;V9=1;var e=Vp(),n=_V();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return h2.useSyncExternalStoreWithSelector=function(u,_,d,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function b(N){if(!w){if(w=!0,y=N,N=p(N),m!==void 0&&S.hasValue){var T=S.value;if(m(T,N))return C=T}return C=N}if(T=C,r(y,N))return T;var j=p(N);return m!==void 0&&m(T,j)?(y=N,T):(y=N,C=j)}var w=!1,y,C,E=d===void 0?null:d;return[function(){return b(_())},E===null?void 0:function(){return b(E())}]},[_,d,p,m]);var v=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=v},[v]),l(v),v},h2}var K9;function mV(){return K9||(K9=1,f2.exports=pV()),f2.exports}var ZM=mV();const gV=Wp(ZM);function vV(e,n){return e===n}function Bo(e,n,t=vV){const r=R.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=R.useCallback(()=>e==null?void 0:e.get(),[e]);return ZM.useSyncExternalStoreWithSelector(r,s,s,n,t)}var Q9={};function Y5(e,n){const t=R.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=od(t.current,s):s}}function Kd(e){const n=li(),t=R.useContext(e.from?aV:Yv),r=e.from??t,s=n.stores.getMatchStore(r),i=Y5(e,n),a=Bo(s,o=>o?i(o):Q9);if(a!==Q9)return a;(e.shouldThrow??!0)&&F5()}function JM(e){return Kd({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function eD(e){const{select:n,...t}=e;return Kd({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function tD(e){return Kd({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function nD(e){return Kd({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Xv(e){const n=li();return R.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function X5(e){return Kd({...e,select:n=>e.select?e.select(n.context):n.context})}function m2(e){const n=R.useRef(e);return ou(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function bV(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function yV(e,n,t){if(e!=null&&e.external)return W1(e.href,t)?void 0:e.href;if(!NV(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),W1(n,t)?void 0:n}catch{}}function xV(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!mW(e.pathname,n.pathname,r))return!1}else{const a=K1(e.pathname,r),o=K1(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ou(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function wV(e,n){const t=li(),r=ZG(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:l,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:v,target:b,disabled:w,style:y,className:C,onClick:E,onBlur:N,onFocus:T,onMouseEnter:j,onMouseLeave:M,onTouchStart:O,ignoreBlocker:B,params:$,search:H,hash:q,state:Y,mask:G,reloadDocument:X,unsafeRelative:te,from:I,_fromLocation:L,...F}=e,W=KM(),U=m2(e.search),Z=m2(e.params),ce=m2(a),re=R.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,U,Z,e.state,e.mask,e.unsafeRelative]),ne=R.useCallback(rt=>{const ut=t.buildLocation({_fromLocation:rt,...re}),Ct=EV(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,w),we=yV(Ct,o,t.protocolAllowlist);return[Ct==null?void 0:Ct.href,we,xV(rt,ut,ce,t.basepath,W,we!==void 0)]},[ce,w,W,re,t,o]),[Q,le,oe]=Bo(t.stores.location,ne,bV),ue=oe?Bh(s,{})??SV:g2,pe=oe?g2:Bh(i,{})??g2,Se=[C,ue.className,pe.className].filter(Boolean).join(" "),ye=(y||ue.style||pe.style)&&{...y,...ue.style,...pe.style},qe=R.useRef(!1),Ie=e.reloadDocument||le||w?!1:l??t.options.defaultPreload,Te=u??t.options.defaultPreloadDelay??0,vt=R.useCallback(()=>{t.preloadRoute(re).catch(rt=>{console.warn(rt),console.warn(tV)})},[t,re]),Dt=R.useCallback(rt=>{if(!rt){v2(r);return}if(!(rt.isIntersecting??Ie==="intent")){rt.isIntersecting===!1&&v2(r);return}if(!Te){vt();return}M0.has(r)||M0.set(r,setTimeout(()=>{M0.delete(r),vt()},Te))},[vt,r,Ie,Te]);XG(r,Dt,Ie!=="viewport"),R.useEffect(()=>{qe.current||Ie==="render"&&(vt(),qe.current=!0)},[vt,Ie]);const Ut=rt=>{const ut=rt.currentTarget.getAttribute("target"),Ct=b!==void 0?b:ut;!w&&!(rt.metaKey||rt.altKey||rt.ctrlKey||rt.shiftKey)&&!rt.defaultPrevented&&(!Ct||Ct==="_self")&&rt.button===0&&(rt.preventDefault(),t.navigate({...re,replace:p,resetScroll:x,hashScrollIntoView:d,startTransition:m,viewTransition:S,ignoreBlocker:B}))};if(le)return{...F,ref:r,href:le,...v&&{children:v},...b&&{target:b},...w&&{disabled:w},...y&&{style:y},...C&&{className:C},...E&&{onClick:E},...N&&{onBlur:N},...T&&{onFocus:T},...j&&{onMouseEnter:j},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const Ft=()=>{Ie==="intent"&&vt()},mt=()=>{Ie==="intent"&&v2(r)};return{...F,...ue,...pe,href:Q,ref:r,onClick:Hf([E,Ut]),onBlur:Hf([N,mt]),onFocus:Hf([T,Dt]),onMouseEnter:Hf([j,Dt]),onMouseLeave:Hf([M,mt]),onTouchStart:Hf([O,Ft]),disabled:!!w,target:b,...ye&&{style:ye},...Se&&{className:Se},...w&&kV,...oe&&CV}}var g2={},SV={className:"active"},kV={role:"link","aria-disabled":!0},CV={"data-status":"active","aria-current":"page"},M0=new WeakMap,v2=e=>{clearTimeout(M0.get(e)),M0.delete(e)},Hf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function EV(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function NV(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Zv=R.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=wV(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...l}=i;return R.createElement("a",l,a)}return R.createElement(t,i,a)}),zV=class extends VM{constructor(n){super(n),this.useMatch=t=>Kd({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>X5({...t,from:this.id}),this.useSearch=t=>nD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>tD({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>eD({...t,from:this.id}),this.useLoaderData=t=>JM({...t,from:this.id}),this.useNavigate=()=>Xv({from:this.fullPath}),this.Link=Je.forwardRef((t,r)=>f.jsx(Zv,{ref:r,from:this.fullPath,...t}))}};function jV(e){return new zV(e)}function TV(){return e=>RV(e)}var AV=class extends nV{constructor(e){super(e),this.useMatch=n=>Kd({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>X5({...n,from:this.id}),this.useSearch=n=>nD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>tD({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>eD({...n,from:this.id}),this.useLoaderData=n=>JM({...n,from:this.id}),this.useNavigate=()=>Xv({from:this.fullPath}),this.Link=Je.forwardRef((n,t)=>f.jsx(Zv,{ref:t,from:this.fullPath,...n}))}};function RV(e){return new AV(e)}function qo(e){return n=>{const t=jV(n);return t.isRoot=!1,t}}function MV(e){const n=li(),t=`not-found-${Bo(n.stores.location,r=>r.pathname)}-${Bo(n.stores.status,r=>r)}`;return f.jsx(Q5,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if($h(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if($h(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function DV(){return f.jsx("p",{children:"Not Found"})}function Yf(e){return f.jsx(f.Fragment,{children:e.children})}function rD(e,n,t){return n.options.notFoundComponent?f.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...t}):f.jsx(DV,{})}function Jv(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?f.jsx(t,{}):null}var LV=(e,n)=>e[0]===n[0]&&e[1]===n[1],sD=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,iD=R.memo(function({routeId:n}){const t=li();return f.jsx(OV,{router:t,match:Bo(t.stores.getMatchStore(n),r=>r)})});function OV({router:e,match:n}){var d,p;const t=e.routesById[n.routeId],r=Jv(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((d=e.options.notFoundRoute)==null?void 0:d.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",l=sD(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?R.Suspense:Yf,u=s?Q5:Yf,_=a?MV:Yf;return f.jsxs(t.isRoot?t.options.shellComponent??Yf:Yf,{children:[f.jsx(Yv.Provider,{value:n.routeId,children:f.jsx(l,{fallback:r,children:f.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if($h(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:f.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return R.createElement(a,m)},children:o?f.jsx(sV,{fallback:r,children:f.jsx(Y9,{match:n})}):f.jsx(Y9,{match:n})})})})}),null]})}var Y9=R.memo(function({match:n}){const t=li(),r=n.routeId,s=t.routesById[r],i=R.useMemo(()=>{var l;const o=(l=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:l({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=R.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?f.jsx(o,{},i):f.jsx(Z0,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!sD(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Jv(t,s)}if(n.status==="notFound")return rD(t,s,n.error);if(n.status==="error")throw n.error;return a}),Z0=R.memo(function(){const n=li(),t=R.useContext(Yv);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=Bo(o,l=>[!!l._notFound,l.error],LV),i=Bo(n.stores.ids,l=>l[l.indexOf(t)+1])}if(r)return rD(n,n.routesById[t],s);if(!i)return null;const a=f.jsx(iD,{routeId:i});return t===uh?f.jsx(R.Suspense,{fallback:Jv(n),children:a}):a});function aD(e,n){const t=e[1];e.length=0,t==null||t(n)}function IV({t:e}){const n=li(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{aD(t,!1),t.push(s,i),e(n),R.startTransition(r)}),jM(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Rl(s.publicHref)!==Rl(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Kv(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function BV(){const e=li(),n=e.routesById[uh],t=Jv(e,n),r=e.ssr?Yf:R.Suspense,s=f.jsxs(f.Fragment,{children:[f.jsx(IV,{t:R.useState()[1]}),f.jsx(r,{fallback:t,children:f.jsx($V,{})})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:s}):s}function $V(){const e=li(),n=e._rendered,t=Bo(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;jM(()=>{n[0]===t&&aD(n,!0)},[n,t]);const i=s?f.jsx(iD,{routeId:s}):null;return f.jsx(Yv.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:f.jsx(Q5,{getResetKey:()=>r,onCatch:void 0,children:i})})}var PV=e=>({createMutableStore:U9,createReadonlyStore:U9,batch:dV}),FV=e=>new HV(e),HV=class extends HW{constructor(e){super(e,PV)}};function qV({router:e,children:n,...t}){AM(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=f.jsx(QM.Provider,{value:e,children:n});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function UV({router:e,...n}){return f.jsx(qV,{router:e,...n,children:f.jsx(BV,{})})}function GV(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function WV(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=GV(e),a=li(),{history:o}=a,[l,u]=R.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return R.useEffect(()=>{const _=async d=>{function p(b){const w=a.parseLocation(b),[,y,C]=a.getMatchedRoutes(w.pathname);return C===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:w.pathname,params:y,search:a.options.parseSearch(b.search)}}const m=p(d.currentLocation),x=p(d.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:d.action,current:m,next:x});if(!i)return S;if(!S)return!1;const v=await new Promise(b=>{u({status:"blocked",current:m,next:x,action:d.action,proceed:()=>b(!1),reset:()=>b(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),v};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),l}function oD(e){const n=li({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return Bo(t.stores.__store,Y5(e,t))}function VV(e){const n=li();return Bo(n.stores.location,Y5(e,n))}const Z1=new WeakMap,w1=new WeakMap;function Ga(e,n,t="*"){var r;for(const s of e.getQueryCache().findAll({queryKey:n}))Z1.set(s,(Z1.get(s)??0)+1),(r=w1.get(s))==null||r.add(t)}function Kp(e,n,t,r=!0){if(!n)return e;const s=new Map(n.map(l=>[l.id,l])),i=new Set(e.map(l=>l.id)),a=n.filter(l=>t.has(l.id)&&!i.has(l.id)),o=e.filter(l=>!t.has(l.id)||s.has(l.id)).map(l=>t.has(l.id)?s.get(l.id)??l:l);return r?[...a,...o]:[...o,...a]}async function o_(e,n,t,r=(s,i)=>i??s){const s=e.getQueryCache().find({queryKey:n,exact:!0}),i=s?Z1.get(s):void 0,a=await t();if(!s||Z1.get(s)===i||s.state.fetchStatus!=="fetching"||e.getQueryCache().find({queryKey:n,exact:!0})!==s)return a;e.setQueryData(n,l=>l??a);const o=new Set;w1.set(s,o);try{const l=await t();return o.size?r(l,e.getQueryData(n),o):l}finally{w1.get(s)===o&&w1.delete(s)}}const Ph=e=>typeof e=="string"&&/^[0-9a-f]{40}$/i.test(e);function lD(e){const n=e.queryKey[2];if(n==="resolvedFile")return Ph(e.queryKey[7]);const t=n==="getProjectFile"?e.queryKey[5]:n==="getCodeTree"?e.queryKey[4]:null;return typeof t=="object"&&t!==null&&"ref"in t&&Ph(t.ref)}function xa(e,n=za(),t,r=!1){if(!Fn(n))return;const s={queryKey:n,predicate:i=>e.includes(String(i.queryKey[2]))&&!lD(i)&&(!t||t(i))};r?nt.cancelQueries(s).then(()=>{Fn(n)&&nt.invalidateQueries(s)}):nt.invalidateQueries(s)}const cD=["resolvedFile","getProjectFile","getArtifactFileText","getArtifactFileMetadata"],Z5=["getArtifacts","getArtifactFileText","getArtifactFileMetadata"],KV=["listProjects","listProjectActivity","listExperiments","listRuns","listChatSessions","getChatMessages","getHarnesses","getUpdateStatus",...Z5,...cD,"getAbsoluteFile","fileVersion","getCodeTree","getSessionWorktree","getRunDiff","getExperimentDiff"];function QV(e,n=za(),t=!1){const r=nt.getQueryData([...n,"listChatSessions",e])??[],s=nt.getQueryData([...n,"listRuns",e])??[],i=nt.getQueryData([...n,"listExperiments",e])??[];xa([...cD,...Z5,"getRunDiff","getExperimentDiff","getCodeTree","getSessionWorktree","fileVersion","getProjectGitStatus","getOverleafState","getOverleafStatus"],n,a=>{const o=a.queryKey[2];return o==="getRunDiff"?s.some(l=>l.id===a.queryKey[3]):o==="getExperimentDiff"?i.some(l=>l.id===a.queryKey[3]):o==="getSessionWorktree"?r.some(l=>l.id===a.queryKey[3]):o==="fileVersion"?typeof a.queryKey[3]=="string"&&a.queryKey[3].startsWith(`/api/projects/${e}/`):a.queryKey[3]===e},t)}function eb(e){const n=za();du.add(e),Ga(nt,[...n,"listChatSessions"],e),nt.setQueriesData({queryKey:[...n,"listChatSessions"]},t=>t==null?void 0:t.filter(r=>r.id!==e));for(const t of["getChatMessages","getSessionWorktree"])P5({queryKey:[...n,t,e]})}function YV(e){const n=za(),t=nt.getQueryData([...n,"listChatSessions",e]);for(const r of t??[])eb(r.id);P5({queryKey:n,predicate:r=>r.queryKey.slice(3).includes(e)})}const XV={hf:["getHfSettings","getComputeSettings","getEnvVars"],tinker:["getTinkerSettings","getComputeSettings","getEnvVars"],k8s:["getK8sSettings","getComputeSettings"],modal:["getModalSettings","getComputeSettings","getEnvVars"],slurm:["getSlurmSettings","getComputeSettings"],ray:["getRaySettings","getComputeSettings"],env:["getEnvVars","getHfSettings","getTinkerSettings","getModalSettings","getSlurmSettings","getRaySettings","getK8sSettings","getOpenResearchSettings","getComputeSettings","getHarnesses"],"data-dir":["getDataDir"],ssh:["getSshHosts","getSshConfig","getSshMasterStatus","getComputeSettings"],compute:["getComputeSettings"],git:["githubAccount","repoAccess","getProjectGitStatus"],profile:["getProfile"],"lit-sources":["getLitSources"],projects:["getProjectDefaults","getProjectGitStatus"],telemetry:["getTelemetry"]};function ZV(e,n){var a;if(!Fn(n))return;const t=(o,l=n,u)=>xa(o,l,u,!0),r=e.split("?")[0];if(/\/(ui-state|open|prewarm|validate|preflight)$/.test(r))return;const s=(a=/^\/api\/settings\/([^/]+)/.exec(r))==null?void 0:a[1];if(s){t(XV[s]??[],n);return}if(r.startsWith("/api/local-models")&&!/\/(discover|check)$/.test(r)){t(["getLocalModels","getHarnesses"],n);return}if(r==="/api/user-skills"){t(["listUserSkills","getSkills","getSkillContent"],n);return}if(r==="/api/latex-templates"){t(["listLatexTemplates"],n);return}if(r==="/api/overleaf/token"){t(["getOverleafSettings","getOverleafState","getOverleafStatus"],n);return}if(r.startsWith("/api/update/")){t(["getUpdateStatus","getLocalMachine"],n);return}if(r.startsWith("/api/remote/")||r.startsWith("/_orx/")){t(["listRemoteSessions"],n),nt.invalidateQueries({queryKey:["gateway","runtime"]});return}if(r.startsWith("/api/chat/")){r==="/api/chat/sessions"&&t(["getProjectStarterPrompts","listProjectActivity"],n);return}const i=/^\/api\/projects\/([^/]+)(.*)$/.exec(r);if(i){const[,o,l]=i;if(l.startsWith("/file")){QV(o,n,!0);return}t(["listProjects","listProjectActivity"],n),t(["getProjectGitStatus","getCodeTree","getProjectStarterPrompts"],n,u=>u.queryKey[3]===o);return}(r==="/api/projects"||r==="/api/onboarding/complete")&&t(["listProjects","listProjectActivity","getUiState","getProfile"],n)}const JV={},eK="en",J5=["en","zh-CN","fa"],uD="orx:locale",e6=["localStorage","preferredLanguage","baseLocale"],X9=[],J0=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let Z9=!1,z=()=>{var t;let e=e6;!J0&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=hD(window.location.href));const n=tK(e);if(n)return Z9||(Z9=!0,dD(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function tK(e,n){let t;for(const r of e){if(r==="baseLocale")t=eK;else if(r==="preferredLanguage"&&!J0)t=aK();else if(r==="localStorage"&&!J0)t=localStorage.getItem(uD)??void 0;else if(_D(r)&&J1.has(r)){const i=J1.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return sK(a)}}const s=ep(t);if(s)return s}}const nK=e=>{window.location.reload()};let dD=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=z()}catch{}const s=[];let i=e6;!J0&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=hD(window.location.href));for(const l of i)if(l!=="baseLocale"){if(l==="localStorage"&&typeof window<"u")localStorage.setItem(uD,e);else if(_D(l)&&J1.has(l)){const u=J1.get(l);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(d=>{throw new Error(`Custom strategy "${l}" setLocale failed.`,{cause:d})}),s.push(_))}}}const a=()=>{!J0&&t.reload&&window.location&&e!==r&&nK()};if(s.length)return Promise.all(s).then(()=>{a()});a()},rK=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function ep(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of J5)if(t.toLowerCase()===n)return t}function fD(e){return!!e&&J5.some(n=>n===e)}function sK(e){const n=ep(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${J5.join(", ")}`)}function iK(e,n){return e.exec(n.href)}function aK(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=ep(t.fullTag);if(r)return r;const s=ep(t.baseTag);if(s)return s}}function oK(e){return lK(e)}function lK(e){const n=typeof e=="string"?new URL(e,rK()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&ep(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let J9,eE;function cK(e){if(X9.length===0)return;const n=typeof e=="string"?e:e.href;if(J9===n)return eE;const t=new URL(n,"http://example.com"),r=oK(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of X9){const l=new JV(o.match,a.href);if(iK(l,a)){i=o;break}}if(i)break}return J9=n,eE=i,i}function hD(e){const n=cK(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:e6}const J1=new Map;function _D(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const uK=e=>`Actions for ${e==null?void 0:e.name}`,dK=e=>`${e==null?void 0:e.name} 的操作`,fK=e=>`عملیات ${e==null?void 0:e.name}`,hK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dK(e):t==="fa"?fK(e):uK(e)}),_K=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,pK=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,mK=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,gK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pK(e):t==="fa"?mK(e):_K(e)}),vK=e=>`Branch: ${e==null?void 0:e.branch}`,bK=e=>`分支:${e==null?void 0:e.branch}`,yK=e=>`شاخه: ${e==null?void 0:e.branch}`,xK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Browse code on ${e==null?void 0:e.branch}`,SK=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,kK=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,pD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),CK=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,EK=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,NK=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,zK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EK(e):t==="fa"?NK(e):CK(e)}),jK=e=>`Collapse ${e==null?void 0:e.name}`,TK=e=>`折叠 ${e==null?void 0:e.name}`,AK=e=>`بستن ${e==null?void 0:e.name}`,RK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=e=>`Committed changes versus ${e==null?void 0:e.parent}`,DK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,LK=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,OK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?DK(e):t==="fa"?LK(e):MK(e)}),IK=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,BK=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,$K=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,PK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),FK=e=>`Copy ${e==null?void 0:e.value}`,HK=e=>`复制 ${e==null?void 0:e.value}`,qK=e=>`کپی ${e==null?void 0:e.value}`,UK=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?HK(e):t==="fa"?qK(e):FK(e)}),GK=e=>`Delete ${e==null?void 0:e.name}`,WK=e=>`删除 ${e==null?void 0:e.name}`,VK=e=>`حذف ${e==null?void 0:e.name}`,C4=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WK(e):t==="fa"?VK(e):GK(e)}),KK=e=>`Download ${e==null?void 0:e.name}`,QK=e=>`下载 ${e==null?void 0:e.name}`,YK=e=>`بارگیری ${e==null?void 0:e.name}`,tE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?QK(e):t==="fa"?YK(e):KK(e)}),XK=e=>`Expand ${e==null?void 0:e.name}`,ZK=e=>`展开 ${e==null?void 0:e.name}`,JK=e=>`باز کردن ${e==null?void 0:e.name}`,eQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZK(e):t==="fa"?JK(e):XK(e)}),tQ=e=>`Hide additional ${e==null?void 0:e.target}`,nQ=e=>`隐藏其余${e==null?void 0:e.target}`,rQ=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,sQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nQ(e):t==="fa"?rQ(e):tQ(e)}),iQ=e=>`Hide error details for ${e==null?void 0:e.activity}`,aQ=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,oQ=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,lQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aQ(e):t==="fa"?oQ(e):iQ(e)}),cQ=e=>`${e==null?void 0:e.count} consecutive identical calls`,uQ=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,dQ=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,fQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uQ(e):t==="fa"?dQ(e):cQ(e)}),hQ=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,_Q=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,pQ=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,mQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Q(e):t==="fa"?pQ(e):hQ(e)}),gQ=e=>`Open ${e==null?void 0:e.branch} on GitHub`,vQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,bQ=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,mD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vQ(e):t==="fa"?bQ(e):gQ(e)}),yQ=e=>`Open experiment ${e==null?void 0:e.name}`,xQ=e=>`打开实验 ${e==null?void 0:e.name}`,wQ=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,SQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xQ(e):t==="fa"?wQ(e):yQ(e)}),kQ=e=>`Open ${e==null?void 0:e.path} in the right pane`,CQ=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,EQ=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,NQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?CQ(e):t==="fa"?EQ(e):kQ(e)}),zQ=e=>`Open ${e==null?void 0:e.name}`,jQ=e=>`打开 ${e==null?void 0:e.name}`,TQ=e=>`باز کردن ${e==null?void 0:e.name}`,AQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jQ(e):t==="fa"?TQ(e):zQ(e)}),RQ=e=>`Open logs for run ${e==null?void 0:e.run}`,MQ=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,DQ=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,LQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MQ(e):t==="fa"?DQ(e):RQ(e)}),OQ=e=>`Open ${e==null?void 0:e.name} on GitHub`,IQ=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,BQ=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,ev=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?IQ(e):t==="fa"?BQ(e):OQ(e)}),$Q=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,PQ=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,FQ=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,HQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PQ(e):t==="fa"?FQ(e):$Q(e)}),qQ=e=>`Overleaf — ${e==null?void 0:e.status}`,UQ=e=>`Overleaf — ${e==null?void 0:e.status}`,GQ=e=>`Overleaf — ${e==null?void 0:e.status}`,WQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?UQ(e):t==="fa"?GQ(e):qQ(e)}),VQ=e=>`Preview /${e==null?void 0:e.name} skill`,KQ=e=>`预览 /${e==null?void 0:e.name} 技能`,QQ=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,YQ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KQ(e):t==="fa"?QQ(e):VQ(e)}),XQ=e=>`Remove annotation ${e==null?void 0:e.number}`,ZQ=e=>`移除批注 ${e==null?void 0:e.number}`,JQ=e=>`حذف یادداشت ${e==null?void 0:e.number}`,eY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZQ(e):t==="fa"?JQ(e):XQ(e)}),tY=e=>`Remove ${e==null?void 0:e.name}`,nY=e=>`移除 ${e==null?void 0:e.name}`,rY=e=>`حذف ${e==null?void 0:e.name}`,sY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nY(e):t==="fa"?rY(e):tY(e)}),iY=e=>`Remove queued message: ${e==null?void 0:e.text}`,aY=e=>`移除排队消息:${e==null?void 0:e.text}`,oY=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,lY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aY(e):t==="fa"?oY(e):iY(e)}),cY=e=>`Retry queued message: ${e==null?void 0:e.text}`,uY=e=>`重试排队消息:${e==null?void 0:e.text}`,dY=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,fY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uY(e):t==="fa"?dY(e):cY(e)}),hY=e=>`Run ${e==null?void 0:e.id}`,_Y=e=>`运行 ${e==null?void 0:e.id}`,pY=e=>`اجرای ${e==null?void 0:e.id}`,mY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?_Y(e):t==="fa"?pY(e):hY(e)}),gY=e=>`Show error details for ${e==null?void 0:e.activity}`,vY=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,bY=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,yY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vY(e):t==="fa"?bY(e):gY(e)}),xY=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,wY=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,SY=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,kY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wY(e):t==="fa"?SY(e):xY(e)}),CY=e=>`${e==null?void 0:e.name} skill`,EY=e=>`${e==null?void 0:e.name} 技能`,NY=e=>`مهارت ${e==null?void 0:e.name}`,zY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?EY(e):t==="fa"?NY(e):CY(e)}),jY=e=>`Value for ${e==null?void 0:e.name}`,TY=e=>`${e==null?void 0:e.name} 的值`,AY=e=>`مقدار ${e==null?void 0:e.name}`,RY=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TY(e):t==="fa"?AY(e):jY(e)}),MY=()=>"Agent reported back",DY=()=>"智能体已返回结果",LY=()=>"عامل نتیجه را گزارش کرد",OY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DY():t==="fa"?LY():MY()}),IY=()=>"Browse",BY=()=>"浏览",$Y=()=>"مرور",PY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),FY=()=>"Browsing…",HY=()=>"正在浏览…",qY=()=>"در حال مرور…",UY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HY():t==="fa"?qY():FY()}),GY=()=>"Checked experiment status and updated notes",WY=()=>"已检查实验状态并更新笔记",VY=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",KY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WY():t==="fa"?VY():GY()}),QY=()=>"Closed an agent",YY=()=>"已关闭智能体",XY=()=>"عامل بسته شد",ZY=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YY():t==="fa"?XY():QY()}),JY=()=>"Compacted context",eX=()=>"上下文已压缩",tX=()=>"زمینه فشرده شد",nX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Compacting context…",sX=()=>"正在压缩上下文…",iX=()=>"در حال فشرده‌سازی زمینه…",aX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=e=>`Created ${e==null?void 0:e.target}`,lX=e=>`已创建 ${e==null?void 0:e.target}`,cX=e=>`${e==null?void 0:e.target} ایجاد شد`,uX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?lX(e):t==="fa"?cX(e):oX(e)}),dX=()=>"Delegate",fX=()=>"委派",hX=()=>"واگذاری",_X=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fX():t==="fa"?hX():dX()}),pX=()=>"Delegating…",mX=()=>"正在委派…",gX=()=>"در حال واگذاری…",vX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mX():t==="fa"?gX():pX()}),bX=e=>`Deleted ${e==null?void 0:e.target}`,yX=e=>`已删除 ${e==null?void 0:e.target}`,xX=e=>`${e==null?void 0:e.target} حذف شد`,wX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yX(e):t==="fa"?xX(e):bX(e)}),SX=()=>"Edit",kX=()=>"编辑",CX=()=>"ویرایش",EX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=e=>`Edited ${e==null?void 0:e.target}`,zX=e=>`已编辑 ${e==null?void 0:e.target}`,jX=e=>`${e==null?void 0:e.target} ویرایش شد`,TX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Editing…",RX=()=>"正在编辑…",MX=()=>"در حال ویرایش…",DX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),LX=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,OX=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,IX=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,BX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OX(e):t==="fa"?IX(e):LX(e)}),$X=e=>`Listed files matching ${e==null?void 0:e.pattern}`,PX=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,FX=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,HX=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PX(e):t==="fa"?FX(e):$X(e)}),qX=()=>"Load",UX=()=>"加载",GX=()=>"بارگیری",WX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UX():t==="fa"?GX():qX()}),VX=()=>"Loaded a skill",KX=()=>"已加载技能",QX=()=>"یک مهارت بارگیری شد",YX=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KX():t==="fa"?QX():VX()}),XX=e=>`Loaded ${e==null?void 0:e.name} skill`,ZX=e=>`已加载技能 ${e==null?void 0:e.name}`,JX=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,eZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZX(e):t==="fa"?JX(e):XX(e)}),tZ=()=>"Loading…",nZ=()=>"正在加载…",rZ=()=>"در حال بارگیری…",sZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=e=>`Opened ${e==null?void 0:e.target}`,aZ=e=>`已打开 ${e==null?void 0:e.target}`,oZ=e=>`${e==null?void 0:e.target} باز شد`,lZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?aZ(e):t==="fa"?oZ(e):iZ(e)}),cZ=e=>`Ran ${e==null?void 0:e.command}`,uZ=e=>`已运行 ${e==null?void 0:e.command}`,dZ=e=>`${e==null?void 0:e.command} اجرا شد`,fZ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uZ(e):t==="fa"?dZ(e):cZ(e)}),hZ=()=>"Ran a sub-agent",_Z=()=>"已运行子智能体",pZ=()=>"یک عامل فرعی اجرا شد",mZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Read",vZ=()=>"读取",bZ=()=>"خواندن",yZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vZ():t==="fa"?bZ():gZ()}),xZ=()=>"Read experiment notes",wZ=()=>"已读取实验笔记",SZ=()=>"یادداشت‌های آزمایش خوانده شد",kZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wZ():t==="fa"?SZ():xZ()}),CZ=()=>"Read a paper",EZ=()=>"已读取论文",NZ=()=>"یک مقاله خوانده شد",zZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=e=>`Read ${e==null?void 0:e.name} skill`,TZ=e=>`已读取技能 ${e==null?void 0:e.name}`,AZ=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,b2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?TZ(e):t==="fa"?AZ(e):jZ(e)}),RZ=e=>`Read ${e==null?void 0:e.target}`,MZ=e=>`已读取 ${e==null?void 0:e.target}`,DZ=e=>`${e==null?void 0:e.target} خوانده شد`,l0=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?MZ(e):t==="fa"?DZ(e):RZ(e)}),LZ=()=>"Read a web page",OZ=()=>"已读取网页",IZ=()=>"یک صفحهٔ وب خوانده شد",BZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OZ():t==="fa"?IZ():LZ()}),$Z=()=>"Reading…",PZ=()=>"正在读取…",FZ=()=>"در حال خواندن…",HZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PZ():t==="fa"?FZ():$Z()}),qZ=()=>"Resumed an agent",UZ=()=>"已恢复智能体",GZ=()=>"عامل از سر گرفته شد",WZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UZ():t==="fa"?GZ():qZ()}),VZ=()=>"Review",KZ=()=>"查看",QZ=()=>"بازبینی",YZ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZ():t==="fa"?QZ():VZ()}),XZ=()=>"Reviewed run log",ZZ=()=>"已查看运行日志",JZ=()=>"گزارش اجرا بازبینی شد",eJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZ():t==="fa"?JZ():XZ()}),tJ=()=>"Reviewed run logs",nJ=()=>"已查看运行日志",rJ=()=>"گزارش‌های اجرا بازبینی شد",sJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJ():t==="fa"?rJ():tJ()}),iJ=()=>"Reviewed experiment status and notes",aJ=()=>"已查看实验状态和笔记",oJ=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",lJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),cJ=()=>"Reviewing…",uJ=()=>"正在查看…",dJ=()=>"در حال بازبینی…",fJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uJ():t==="fa"?dJ():cJ()}),hJ=()=>"Run",_J=()=>"运行",pJ=()=>"اجرا",mJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_J():t==="fa"?pJ():hJ()}),gJ=()=>"Running…",vJ=()=>"正在运行…",bJ=()=>"در حال اجرا…",gD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vJ():t==="fa"?bJ():gJ()}),yJ=()=>"Search",xJ=()=>"搜索",wJ=()=>"جست‌وجو",SJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJ():t==="fa"?wJ():yJ()}),kJ=()=>"Searched alphaXiv full text",CJ=()=>"已搜索 alphaXiv 全文",EJ=()=>"متن کامل alphaXiv جست‌وجو شد",NJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"Searched alphaXiv semantically",jJ=()=>"已对 alphaXiv 进行语义搜索",TJ=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",AJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=()=>"Searched bioRxiv",MJ=()=>"已搜索 bioRxiv",DJ=()=>"bioRxiv جست‌وجو شد",LJ=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MJ():t==="fa"?DJ():RJ()}),OJ=()=>"Searched code",IJ=()=>"已搜索代码",BJ=()=>"کد جست‌وجو شد",y2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IJ():t==="fa"?BJ():OJ()}),$J=e=>`Searched code for “${e==null?void 0:e.pattern}”`,PJ=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,FJ=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,x2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PJ(e):t==="fa"?FJ(e):$J(e)}),HJ=e=>`Searched images for “${e==null?void 0:e.query}”`,qJ=e=>`已搜索图片“${e==null?void 0:e.query}”`,UJ=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,GJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qJ(e):t==="fa"?UJ(e):HJ(e)}),WJ=()=>"Searched the literature",VJ=()=>"已搜索文献",KJ=()=>"منابع علمی جست‌وجو شد",nE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJ():t==="fa"?KJ():WJ()}),QJ=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,YJ=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,XJ=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,ZJ=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?YJ(e):t==="fa"?XJ(e):QJ(e)}),JJ=()=>"Searched OpenAlex",eee=()=>"已搜索 OpenAlex",tee=()=>"OpenAlex جست‌وجو شد",nee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),ree=e=>`Searched the web for “${e==null?void 0:e.query}”`,see=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,iee=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,rE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?see(e):t==="fa"?iee(e):ree(e)}),aee=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,oee=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,lee=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,cee=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oee(e):t==="fa"?lee(e):aee(e)}),uee=()=>"Searching…",dee=()=>"正在搜索…",fee=()=>"در حال جست‌وجو…",hee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Sent input to an agent",pee=()=>"已向智能体发送输入",mee=()=>"ورودی به عامل فرستاده شد",gee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),vee=()=>"Spawned an agent",bee=()=>"已创建智能体",yee=()=>"یک عامل ساخته شد",xee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bee():t==="fa"?yee():vee()}),wee=()=>"Sub-agent",See=()=>"子智能体",kee=()=>"عامل فرعی",Cee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Sub-agent interrupted",Nee=()=>"子智能体已中断",zee=()=>"عامل فرعی متوقف شد",jee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Tee=()=>"Sub-agent started",Aee=()=>"子智能体已启动",Ree=()=>"عامل فرعی آغاز شد",Mee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aee():t==="fa"?Ree():Tee()}),Dee=()=>"Updated experiment notes",Lee=()=>"已更新实验笔记",Oee=()=>"یادداشت‌های آزمایش به‌روز شد",Iee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Bee=()=>"Waiting on an agent",$ee=()=>"正在等待智能体",Pee=()=>"در انتظار عامل",Fee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ee():t==="fa"?Pee():Bee()}),Hee=e=>`Approval required: ${e==null?void 0:e.label}`,qee=e=>`需要批准:${e==null?void 0:e.label}`,Uee=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,sE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qee(e):t==="fa"?Uee(e):Hee(e)}),Gee=()=>"The CLI is retrying the turn.",Wee=()=>"CLI 正在重试本轮。",Vee=()=>"CLI در حال تلاش دوباره برای این نوبت است.",Kee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wee():t==="fa"?Vee():Gee()}),Qee=()=>"Continue is available.",Yee=()=>"可以继续。",Xee=()=>"ادامه در دسترس است.",Zee=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yee():t==="fa"?Xee():Qee()}),Jee=()=>"Retry is available.",ete=()=>"可以重试。",tte=()=>"تلاش دوباره در دسترس است.",nte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Running a tool",ste=()=>"正在运行工具",ite=()=>"در حال اجرای ابزار",ate=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Tool activity completed",lte=()=>"工具活动已完成",cte=()=>"فعالیت ابزار کامل شد",ute=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),dte=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,fte=e=>`工具活动失败:${e==null?void 0:e.labels}`,hte=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,_te=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fte(e):t==="fa"?hte(e):dte(e)}),pte=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,mte=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,gte=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,vte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mte(e):t==="fa"?gte(e):pte(e)}),bte=()=>"Turn did not finish.",yte=()=>"本轮未完成。",xte=()=>"این نوبت کامل نشد.",wte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yte():t==="fa"?xte():bte()}),Ste=()=>"Artifacts",kte=()=>"产物",Cte=()=>"خروجی‌ها",vD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kte():t==="fa"?Cte():Ste()}),Ete=()=>"Close panel",Nte=()=>"关闭面板",zte=()=>"بستن پنل",tv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nte():t==="fa"?zte():Ete()}),jte=()=>"Current task",Tte=()=>"当前任务",Ate=()=>"وظیفهٔ فعلی",iE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tte():t==="fa"?Ate():jte()}),Rte=()=>"Drag to resize panel",Mte=()=>"拖动以调整面板大小",Dte=()=>"برای تغییر اندازهٔ پنل بکشید",Lte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mte():t==="fa"?Dte():Rte()}),Ote=()=>"Drag toward the center to restore panel",Ite=()=>"向中央拖动以恢复面板",Bte=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",$te=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"Entire project",Fte=()=>"整个项目",Hte=()=>"کل پروژه",aE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fte():t==="fa"?Hte():Pte()}),qte=()=>"Expand panel",Ute=()=>"展开面板",Gte=()=>"گسترش پنل",oE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ute():t==="fa"?Gte():qte()}),Wte=e=>`Experiment filter: ${e==null?void 0:e.scope}`,Vte=e=>`实验筛选:${e==null?void 0:e.scope}`,Kte=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,Qte=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vte(e):t==="fa"?Kte(e):Wte(e)}),Yte=()=>"Experiment view",Xte=()=>"实验视图",Zte=()=>"نمای آزمایش",Jte=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xte():t==="fa"?Zte():Yte()}),ene=()=>"Experiments",tne=()=>"实验",nne=()=>"آزمایش‌ها",bD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),rne=()=>"Files",sne=()=>"文件",ine=()=>"فایل‌ها",E4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sne():t==="fa"?ine():rne()}),ane=()=>"Filter experiments",one=()=>"筛选实验",lne=()=>"فیلتر آزمایش‌ها",cne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?one():t==="fa"?lne():ane()}),une=()=>"Current task filtering is unavailable for unattributed experiments",dne=()=>"存在无法归属的实验时,不能按当前任务筛选",fne=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",hne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dne():t==="fa"?fne():une()}),_ne=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",pne=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",mne=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",gne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pne():t==="fa"?mne():_ne()}),vne=()=>"Open a task to filter to its experiments",bne=()=>"请打开一个任务以筛选其实验",yne=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",xne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bne():t==="fa"?yne():vne()}),wne=()=>"projects",Sne=()=>"项目",kne=()=>"پروژه‌ها",D0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sne():t==="fa"?kne():wne()}),Cne=()=>"Restore panel",Ene=()=>"还原面板",Nne=()=>"بازگرداندن اندازهٔ پنل",lE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ene():t==="fa"?Nne():Cne()}),zne=()=>"Retry",jne=()=>"重试",Tne=()=>"تلاش دوباره",Gi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jne():t==="fa"?Tne():zne()}),Ane=()=>"Select a project to browse its files.",Rne=()=>"选择一个项目以浏览其文件。",Mne=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",Dne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rne():t==="fa"?Mne():Ane()}),Lne=()=>"settings",One=()=>"设置",Ine=()=>"تنظیمات",Bne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?One():t==="fa"?Ine():Lne()}),$ne=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,Pne=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,Fne=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,Hne=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Pne(e):t==="fa"?Fne(e):$ne(e)}),qne=()=>"Sub-agent",Une=()=>"子智能体",Gne=()=>"عامل فرعی",Wne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Une():t==="fa"?Gne():qne()}),Vne=()=>"Table",Kne=()=>"表格",Qne=()=>"جدول",Yne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kne():t==="fa"?Qne():Vne()}),Xne=()=>"Tree",Zne=()=>"树状图",Jne=()=>"درخت",ere=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zne():t==="fa"?Jne():Xne()}),tre=e=>`Collapse ${e==null?void 0:e.name}`,nre=e=>`折叠 ${e==null?void 0:e.name}`,rre=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,sre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nre(e):t==="fa"?rre(e):tre(e)}),ire=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,are=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,ore=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,t6=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?are(e):t==="fa"?ore(e):ire(e)}),lre=e=>`Delete folder ${e==null?void 0:e.name}`,cre=e=>`删除文件夹 ${e==null?void 0:e.name}`,ure=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,dre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cre(e):t==="fa"?ure(e):lre(e)}),fre=e=>`Expand ${e==null?void 0:e.name}`,hre=e=>`展开 ${e==null?void 0:e.name}`,_re=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,pre=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hre(e):t==="fa"?_re(e):fre(e)}),mre=()=>"Binary or unsupported file — no inline preview.",gre=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",vre=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",bre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gre():t==="fa"?vre():mre()}),yre=()=>"Copy path",xre=()=>"复制路径",wre=()=>"کپی مسیر",Sre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xre():t==="fa"?wre():yre()}),kre=()=>"Artifact not found",Cre=()=>"找不到产物",Ere=()=>"خروجی پیدا نشد",Nre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cre():t==="fa"?Ere():kre()}),zre=()=>"Open raw",jre=()=>"打开原始文件",Tre=()=>"باز کردن فایل خام",Are=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jre():t==="fa"?Tre():zre()}),Rre=()=>"Click an artifact to view it",Mre=()=>"点击产物即可查看",Dre=()=>"برای مشاهده، یک خروجی را انتخاب کنید",Lre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mre():t==="fa"?Dre():Rre()}),Ore=()=>"Delete artifact",Ire=()=>"删除产物",Bre=()=>"حذف خروجی",cE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),$re=()=>"Delete folder",Pre=()=>"删除文件夹",Fre=()=>"حذف پوشه",Hre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pre():t==="fa"?Fre():$re()}),qre=()=>"Failed to load:",Ure=()=>"加载失败:",Gre=()=>"بارگیری ناموفق بود:",Wre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ure():t==="fa"?Gre():qre()}),Vre=()=>"File truncated — showing the first 512 KB.",Kre=()=>"文件已截断——仅显示前 512 KB。",Qre=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Yre=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kre():t==="fa"?Qre():Vre()}),Xre=()=>"Listing truncated — the folder has more artifacts.",Zre=()=>"列表已截断——文件夹中还有更多产物。",Jre=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zre():t==="fa"?Jre():Xre()}),tse=()=>"Loading…",nse=()=>"正在加载…",rse=()=>"در حال بارگیری…",yD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nse():t==="fa"?rse():tse()}),sse=()=>"Loading artifacts…",ise=()=>"正在加载产物…",ase=()=>"در حال بارگیری خروجی‌ها…",ose=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ise():t==="fa"?ase():sse()}),lse=()=>"Modified",cse=()=>"修改时间",use=()=>"ویرایش‌شده",dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cse():t==="fa"?use():lse()}),fse=()=>"No artifacts yet",hse=()=>"尚无产物",_se=()=>"هنوز خروجی‌ای وجود ندارد",pse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hse():t==="fa"?_se():fse()}),mse=()=>"Open raw in new tab",gse=()=>"在新标签页中打开原始文件",vse=()=>"باز کردن فایل خام در زبانهٔ جدید",uE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gse():t==="fa"?vse():mse()}),bse=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files.",yse=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件。",xse=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید.",wse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yse():t==="fa"?xse():bse()}),Sse=()=>"File too large to preview inline.",kse=()=>"文件太大,无法内嵌预览。",Cse=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",Ese=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"This is the baseline branch, so there is no parent comparison.",zse=()=>"这是基线分支,因此没有父分支可供比较。",jse=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",Tse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Failed to load changes:",Rse=()=>"加载更改失败:",Mse=()=>"بارگیری تغییرات ناموفق بود:",Dse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Loading changes…",Ose=()=>"正在加载更改…",Ise=()=>"در حال بارگیری تغییرات…",Bse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ose():t==="fa"?Ise():Lse()}),$se=()=>"No committed changes from the parent branch.",Pse=()=>"与父分支相比没有已提交的更改。",Fse=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",Hse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pse():t==="fa"?Fse():$se()}),qse=e=>`agent ${e==null?void 0:e.number}`,Use=e=>`智能体 ${e==null?void 0:e.number}`,Gse=e=>`عامل ${e==null?void 0:e.number}`,dE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Use(e):t==="fa"?Gse(e):qse(e)}),Wse=()=>"agent sessions",Vse=()=>"智能体会话",Kse=()=>"نشست‌های عامل‌ها",Qse=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vse():t==="fa"?Kse():Wse()}),Yse=()=>"All sessions",Xse=()=>"所有会话",Zse=()=>"همهٔ نشست‌ها",xD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=e=>`${e==null?void 0:e.count} annotations`,eie=e=>`${e==null?void 0:e.count} 条批注`,tie=e=>`${e==null?void 0:e.count} یادداشت`,nie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eie(e):t==="fa"?tie(e):Jse(e)}),rie=()=>"Archive",sie=()=>"归档",iie=()=>"بایگانی",aie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",lie=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",cie=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",uie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),die=()=>"Asked about selected text",fie=()=>"已询问所选文本",hie=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",_ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fie():t==="fa"?hie():die()}),pie=()=>"Attachment",mie=()=>"附件",gie=()=>"پیوست",vie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),bie=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,yie=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,xie=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,wie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yie(e):t==="fa"?xie(e):bie(e)}),Sie=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",kie=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",Cie=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",Eie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Nie=()=>"Wait for the turn to finish before running a command.",zie=()=>"请等待本轮结束后再运行命令。",jie=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",Tie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=e=>`Exited with code ${e==null?void 0:e.code}`,Rie=e=>`退出码 ${e==null?void 0:e.code}`,Mie=e=>`با کد ${e==null?void 0:e.code} خارج شد`,Die=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rie(e):t==="fa"?Mie(e):Aie(e)}),Lie=e=>`Command not run: ${e==null?void 0:e.error}`,Oie=e=>`命令未运行:${e==null?void 0:e.error}`,Iie=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,fE=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Oie(e):t==="fa"?Iie(e):Lie(e)}),Bie=()=>"Collapse tool activity",$ie=()=>"折叠工具活动",Pie=()=>"بستن فعالیت ابزارها",Fie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Hie=()=>"Continue",qie=()=>"继续",Uie=()=>"ادامه",Gie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qie():t==="fa"?Uie():Hie()}),Wie=e=>`Delete “${e==null?void 0:e.title}”? Its transcript will be permanently removed.`,Vie=e=>`删除“${e==null?void 0:e.title}”? 其对话记录将被永久移除。`,Kie=e=>`«${e==null?void 0:e.title}» حذف شود؟ -رونوشت آن برای همیشه حذف خواهد شد.`,Qie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Xie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Zie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Jie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xie(e):t==="fa"?Zie(e):Yie(e)}),eae=()=>"Could not exit Plan mode. Try again.",tae=()=>"无法退出计划模式。请重试。",nae=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",rae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Expand tool activity",iae=()=>"展开工具活动",aae=()=>"باز کردن فعالیت ابزارها",oae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=()=>"experiments",cae=()=>"实验",uae=()=>"آزمایش‌ها",dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cae():t==="fa"?uae():lae()}),fae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,hae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,_ae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,pae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,gae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,vae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,bae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=e=>`Message not sent: ${e==null?void 0:e.error}`,xae=e=>`消息未发送:${e==null?void 0:e.error}`,wae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,Sae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xae(e):t==="fa"?wae(e):yae(e)}),kae=()=>"Model unavailable",Cae=()=>"模型不可用",Eae=()=>"مدل در دسترس نیست",Nae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),zae=()=>"New session",jae=()=>"新会话",Tae=()=>"نشست جدید",hE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jae():t==="fa"?Tae():zae()}),Aae=()=>"No active sessions",Rae=()=>"没有活跃会话",Mae=()=>"نشست فعالی وجود ندارد",Dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No activity",Oae=()=>"无活动",Iae=()=>"بدون فعالیت",Bae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No archived sessions",Pae=()=>"没有已归档的会话",Fae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"No sessions yet",Uae=()=>"还没有会话",Gae=()=>"هنوز نشستی وجود ندارد",Wae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"1 annotation",Kae=()=>"1 条批注",Qae=()=>"۱ یادداشت",Yae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"Open sub-agent transcript",Zae=()=>"打开子智能体记录",Jae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",eoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),toe=()=>"About this demo",noe=()=>"关于此演示",roe=()=>"دربارهٔ این نسخهٔ نمایشی",_E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?noe():t==="fa"?roe():toe()}),soe=()=>"Accept and auto mode",ioe=()=>"接受并使用自动模式",aoe=()=>"پذیرش و حالت خودکار",ooe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Accept and bypass all",coe=()=>"接受并跳过所有审批",uoe=()=>"پذیرش و عبور از همهٔ تأییدها",doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"Active",hoe=()=>"活跃",_oe=()=>"فعال",poe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"All",goe=()=>"全部",voe=()=>"همه",boe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Allow",xoe=()=>"允许",woe=()=>"اجازه دادن",Soe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Approval required",Coe=()=>"需要批准",Eoe=()=>"نیازمند تأیید",Noe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Archived",joe=()=>"已归档",Toe=()=>"بایگانی‌شده",pE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Aoe=()=>"Ask about this",Roe=()=>"询问此内容",Moe=()=>"دربارهٔ این بپرسید",Doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Loe=()=>"Attach a PDF or image",Ooe=()=>"附加 PDF 或图片",Ioe=()=>"پیوست PDF یا تصویر",mE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),Boe=()=>"Bash",$oe=()=>"Bash",Poe=()=>"Bash",xD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$oe():t==="fa"?Poe():Boe()}),Foe=()=>"Browsed the web",Hoe=()=>"已浏览网页",qoe=()=>"وب مرور شد",gE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hoe():t==="fa"?qoe():Foe()}),Uoe=()=>"Built the project",Goe=()=>"已构建项目",Woe=()=>"پروژه ساخته شد",Voe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancel",Qoe=()=>"取消",Yoe=()=>"لغو",Xoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Cancelled an experiment run",Joe=()=>"已取消实验运行",ele=()=>"اجرای آزمایش لغو شد",tle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked code style",rle=()=>"已检查代码风格",sle=()=>"سبک کد بررسی شد",ile=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked compute options",ole=()=>"已检查算力选项",lle=()=>"گزینه‌های رایانشی بررسی شد",cle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=()=>"Checked experiment status",dle=()=>"已检查实验状态",fle=()=>"وضعیت آزمایش بررسی شد",vE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dle():t==="fa"?fle():ule()}),hle=()=>"Checked Git status",_le=()=>"已检查 Git 状态",ple=()=>"وضعیت Git بررسی شد",mle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked local times",vle=()=>"已查询当地时间",ble=()=>"زمان‌های محلی بررسی شد",yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked market data",wle=()=>"已查询市场数据",Sle=()=>"داده‌های بازار بررسی شد",kle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked sports data",Ele=()=>"已查询体育数据",Nle=()=>"داده‌های ورزشی بررسی شد",zle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked the weather",Tle=()=>"已查询天气",Ale=()=>"آب‌وهوا بررسی شد",Rle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Checked types",Dle=()=>"已检查类型",Lle=()=>"نوع‌ها بررسی شد",Ole=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ile=()=>"Clear annotations",Ble=()=>"清除批注",$le=()=>"پاک کردن یادداشت‌ها",bE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Customize",Fle=()=>"自定义",Hle=()=>"سفارشی‌سازی",qle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),Ule=()=>"Data sources",Gle=()=>"数据源",Wle=()=>"منابع داده",S2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gle():t==="fa"?Wle():Ule()}),Vle=()=>"Delegated a task to a new agent",Kle=()=>"已将任务委派给新智能体",Qle=()=>"وظیفه به عامل جدید واگذار شد",Yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Xle=()=>"Delete",Zle=()=>"删除",Jle=()=>"حذف",wD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zle():t==="fa"?Jle():Xle()}),ece=()=>"Deny",tce=()=>"拒绝",nce=()=>"رد کردن",rce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),sce=()=>"Edit and re-send",ice=()=>"编辑并重新发送",ace=()=>"ویرایش و ارسال دوباره",yE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ice():t==="fa"?ace():sce()}),oce=()=>"Edit message",lce=()=>"编辑消息",cce=()=>"ویرایش پیام",uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),dce=()=>"Edited a file",fce=()=>"已编辑文件",hce=()=>"فایل ویرایش شد",xE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fce():t==="fa"?hce():dce()}),_ce=()=>"Exit Bash mode",pce=()=>"退出 Bash 模式",mce=()=>"خروج از حالت Bash",wE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pce():t==="fa"?mce():_ce()}),gce=()=>"Exit Plan mode",vce=()=>"退出计划模式",bce=()=>"خروج از حالت طرح",SE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vce():t==="fa"?bce():gce()}),yce=()=>"Failed:",xce=()=>"失败:",wce=()=>"ناموفق:",n6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xce():t==="fa"?wce():yce()}),Sce=()=>"Filter sessions",kce=()=>"筛选会话",Cce=()=>"فیلتر نشست‌ها",kE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"is unavailable.",Nce=()=>"不可用。",zce=()=>"در دسترس نیست.",jce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Later queued messages will wait until this is retried or removed.",Ace=()=>"后续排队的消息会等待此消息重试或移除。",Rce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Mce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Dce=()=>"Listed files",Lce=()=>"已列出文件",Oce=()=>"فایل‌ها فهرست شد",CE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lce():t==="fa"?Oce():Dce()}),Ice=()=>"Listed project runs",Bce=()=>"已列出项目运行",$ce=()=>"اجراهای پروژه فهرست شد",Pce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Listed projects",Hce=()=>"已列出项目",qce=()=>"پروژه‌ها فهرست شد",Uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"Loading conversation…",Wce=()=>"正在加载对话…",Vce=()=>"در حال بارگیری گفتگو…",Kce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"New Chat",Yce=()=>"新对话",Xce=()=>"گفتگوی جدید",Zce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Jce=()=>"Next version",eue=()=>"下一版本",tue=()=>"نسخهٔ بعدی",EE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),nue=()=>"Open the session this agent spawned",rue=()=>"打开此智能体创建的会话",sue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",iue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Opened web pages",oue=()=>"已打开网页",lue=()=>"صفحه‌های وب باز شد",cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan",due=()=>"计划",fue=()=>"طرح",hue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan approved",pue=()=>"计划已批准",mue=()=>"طرح تأیید شد",gue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan rejected",bue=()=>"计划已拒绝",yue=()=>"طرح رد شد",xue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan resolved",Sue=()=>"计划已处理",kue=()=>"طرح تعیین تکلیف شد",Cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Plan revision requested",Nue=()=>"已请求修改计划",zue=()=>"درخواست بازنگری طرح ثبت شد",jue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),Tue=()=>"Previous version",Aue=()=>"上一版本",Rue=()=>"نسخهٔ قبلی",NE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aue():t==="fa"?Rue():Tue()}),Mue=()=>"Ran a command",Due=()=>"已运行命令",Lue=()=>"فرمان اجرا شد",Oue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Ran tests",Bue=()=>"已运行测试",$ue=()=>"آزمون‌ها اجرا شد",Pue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read a file",Hue=()=>"已读取文件",que=()=>"فایل خوانده شد",Uue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read Git history",Wue=()=>"已读取 Git 历史",Vue=()=>"تاریخچهٔ Git خوانده شد",Kue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Read project details",Yue=()=>"已读取项目详情",Xue=()=>"جزئیات پروژه خوانده شد",Zue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Reject",ede=()=>"拒绝",tde=()=>"رد کردن",nde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove",sde=()=>"移除",ide=()=>"حذف",ade=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove annotation",lde=()=>"移除批注",cde=()=>"حذف یادداشت",ude=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),dde=()=>"Remove file",fde=()=>"移除文件",hde=()=>"حذف فایل",zE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),_de=()=>"Remove image",pde=()=>"移除图片",mde=()=>"حذف تصویر",jE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),gde=()=>"Remove queued message",vde=()=>"移除排队消息",bde=()=>"حذف پیام صف",TE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vde():t==="fa"?bde():gde()}),yde=()=>"Rename",xde=()=>"重命名",wde=()=>"تغییر نام",SD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xde():t==="fa"?wde():yde()}),Sde=()=>"Reviewed code changes",kde=()=>"已审查代码更改",Cde=()=>"تغییرات کد بازبینی شد",Ede=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Nde=()=>"Run",zde=()=>"运行",jde=()=>"اجرا",AE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zde():t==="fa"?jde():Nde()}),Tde=()=>"Selected chat text",Ade=()=>"已选聊天文本",Rde=()=>"متن انتخاب‌شدهٔ گفتگو",Mde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Selected text:",Lde=()=>"已选文本:",Ode=()=>"متن انتخاب‌شده:",Ide=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Send",$de=()=>"发送",Pde=()=>"ارسال",z4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"Session options",Hde=()=>"会话选项",qde=()=>"گزینه‌های نشست",RE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hde():t==="fa"?qde():Fde()}),Ude=()=>"Session title",Gde=()=>"会话标题",Wde=()=>"عنوان نشست",Vde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Kde=()=>"Show sidebar",Qde=()=>"显示侧边栏",Yde=()=>"نمایش نوار کناری",ME=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qde():t==="fa"?Yde():Kde()}),Xde=()=>"Started an experiment run",Zde=()=>"已启动实验运行",Jde=()=>"اجرای آزمایش آغاز شد",efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Reading the project to suggest where to start…",nfe=()=>"正在阅读项目以建议从哪里开始…",rfe=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",sfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Starter prompts",afe=()=>"入门提示",ofe=()=>"پیشنهادهای شروع",lfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),cfe=()=>"Stop",ufe=()=>"停止",dfe=()=>"توقف",DE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ufe():t==="fa"?dfe():cfe()}),ffe=()=>"Submit",hfe=()=>"提交",_fe=()=>"ارسال",pfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Tool failed",gfe=()=>"工具失败",vfe=()=>"ابزار ناموفق بود",bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),yfe=()=>"Used tools",xfe=()=>"已使用工具",wfe=()=>"ابزارها استفاده شد",kD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xfe():t==="fa"?wfe():yfe()}),Sfe=()=>"View full plan",kfe=()=>"查看完整计划",Cfe=()=>"مشاهدهٔ طرح کامل",Efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waited for an experiment run",zfe=()=>"已等待实验运行",jfe=()=>"برای اجرای آزمایش صبر شد",Tfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"Waiting for your input…",Rfe=()=>"正在等待你的输入…",Mfe=()=>"منتظر ورودی شما…",Dfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"What should we research?",Ofe=()=>"我们应该研究什么?",Ife=()=>"چه چیزی را پژوهش کنیم؟",Bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"You, mid-task",Pfe=()=>"你(任务进行中)",Ffe=()=>"شما، هنگام انجام وظیفه",Hfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Pasted image",Ufe=()=>"粘贴的图片",Gfe=()=>"تصویر جای‌گذاری‌شده",Wfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Vfe=()=>"Plan",Kfe=()=>"计划",Qfe=()=>"طرح",CD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kfe():t==="fa"?Qfe():Vfe()}),Yfe=()=>"Plan mode — ready to proceed?",Xfe=()=>"计划模式 — 准备好继续了吗?",Zfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Jfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),ehe=()=>"Proposed plan",the=()=>"提议的计划",nhe=()=>"طرح پیشنهادی",LE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),rhe=()=>"Question",she=()=>"问题",ihe=()=>"پرسش",ahe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Queued",lhe=()=>"已排队",che=()=>"در صف",uhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),dhe=()=>"Recents",fhe=()=>"最近",hhe=()=>"اخیر",ED=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fhe():t==="fa"?hhe():dhe()}),_he=()=>"Re-check its setup.",phe=()=>"请重新检查其设置。",mhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",ghe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not recover this turn. Try again.",bhe=()=>"无法恢复本轮。请重试。",yhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=()=>"Could not remove the queued message. Try again.",She=()=>"无法移除排队消息。请重试。",khe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Che=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?She():t==="fa"?khe():whe()}),Ehe=e=>`Could not re-send: ${e==null?void 0:e.error}`,Nhe=e=>`无法重新发送:${e==null?void 0:e.error}`,zhe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,jhe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),The=()=>"Resolved",Ahe=()=>"已处理",Rhe=()=>"رسیدگی شد",Mhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"Could not retry the queued message. Try again.",Lhe=()=>"无法重试排队消息。请重试。",Ohe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Ihe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"run logs",$he=()=>"运行日志",Phe=()=>"گزارش‌های اجرا",Fhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Hhe=()=>"Scroll to bottom",qhe=()=>"滚动到底部",Uhe=()=>"رفتن به پایین گفتگو",OE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qhe():t==="fa"?Uhe():Hhe()}),Ghe=()=>"The selected harness is unavailable",Whe=()=>"所选智能体工具不可用",Vhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",k2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Whe():t==="fa"?Vhe():Ghe()}),Khe=()=>"Session limit reached",Qhe=()=>"已达到会话使用限额",Yhe=()=>"به سقف مصرف نشست رسیده‌اید",Xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"The chat session was not created",Jhe=()=>"未能创建聊天会话",e_e=()=>"نشست گفت‌وگو ایجاد نشد",t_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>"Show full conversation",r_e=()=>"显示完整对话",s_e=()=>"نمایش کامل گفتگو",i_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>" · Spawned by another agent",o_e=()=>" · 由另一个智能体创建",l_e=()=>" · ساخته‌شده به‌دست عامل دیگر",c_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=()=>"Starting…",d_e=()=>"正在启动…",f_e=()=>"در حال شروع…",h_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d_e():t==="fa"?f_e():u_e()}),__e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,p_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,m_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,g_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p_e(e):t==="fa"?m_e(e):__e(e)}),v_e=()=>"Could not stop the turn. Try again.",b_e=()=>"无法停止本轮。请重试。",y_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",x_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b_e():t==="fa"?y_e():v_e()}),w_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,S_e=e=>`无法切换分支:${e==null?void 0:e.error}`,k_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,C_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S_e(e):t==="fa"?k_e(e):w_e(e)}),E_e=()=>"The agent",N_e=()=>"智能体",z_e=()=>"عامل",j_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Thinking",A_e=()=>"正在思考",R_e=()=>"در حال فکر کردن",M_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),D_e=()=>"Could not toggle Plan mode. Try again.",L_e=()=>"无法切换计划模式。请重试。",O_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",IE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=()=>"This turn did not finish.",B_e=()=>"本轮未完成。",$_e=()=>"این نوبت کامل نشد.",BE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),P_e=()=>"Type a custom answer…",F_e=()=>"输入自定义回答…",H_e=()=>"پاسخ دلخواه را بنویسید…",q_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Unarchive",G_e=()=>"取消归档",W_e=()=>"خارج کردن از بایگانی",V_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),K_e=()=>"Untitled",Q_e=()=>"未命名",Y_e=()=>"بدون عنوان",Ng=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q_e():t==="fa"?Y_e():K_e()}),X_e=()=>"Could not update permissions. Try again.",Z_e=()=>"无法更新权限。请重试。",J_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",e0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=()=>"Work details",n0e=()=>"工作详情",r0e=()=>"جزئیات کار",s0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),i0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,a0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,o0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,l0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=e=>`Worked for ${e==null?void 0:e.duration}`,u0e=e=>`已工作 ${e==null?void 0:e.duration}`,d0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,f0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u0e(e):t==="fa"?d0e(e):c0e(e)}),h0e=()=>"Working…",_0e=()=>"正在工作…",p0e=()=>"در حال کار…",r6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_0e():t==="fa"?p0e():h0e()}),m0e=()=>"Close tab",g0e=()=>"关闭标签页",v0e=()=>"بستن زبانه",b0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),y0e=()=>"Changes",x0e=()=>"更改",w0e=()=>"تغییرات",ND=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x0e():t==="fa"?w0e():y0e()}),S0e=()=>"Code browser view",k0e=()=>"代码浏览器视图",C0e=()=>"نمای مرورگر کد",E0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Files",z0e=()=>"文件",j0e=()=>"فایل‌ها",T0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Refresh",R0e=()=>"刷新",M0e=()=>"تازه‌سازی",$E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"listing truncated",L0e=()=>"列表已截断",O0e=()=>"فهرست کوتاه شده است",I0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"No files.",$0e=()=>"没有文件。",P0e=()=>"فایلی وجود ندارد.",F0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Refresh failed:",q0e=()=>"刷新失败:",U0e=()=>"تازه‌سازی ناموفق بود:",G0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Cancelling…",V0e=()=>"正在取消…",K0e=()=>"در حال لغو…",Q0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Y0e=()=>"Checking…",X0e=()=>"正在检查…",Z0e=()=>"در حال بررسی…",Xi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X0e():t==="fa"?Z0e():Y0e()}),J0e=()=>"Copied",epe=()=>"已复制",tpe=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),npe=e=>`Failed to load: ${e==null?void 0:e.error}`,rpe=e=>`加载失败:${e==null?void 0:e.error}`,spe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,zD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?rpe(e):t==="fa"?spe(e):npe(e)}),ipe=()=>"Loading…",ape=()=>"正在加载…",ope=()=>"در حال بارگیری…",jD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),lpe=e=>`+ ${e==null?void 0:e.count} more`,cpe=e=>`另有 ${e==null?void 0:e.count} 项`,upe=e=>`${e==null?void 0:e.count}+ مورد دیگر`,dpe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cpe(e):t==="fa"?upe(e):lpe(e)}),fpe=()=>"Rendered view",hpe=()=>"渲染视图",_pe=()=>"نمای رندرشده",rv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hpe():t==="fa"?_pe():fpe()}),ppe=()=>"Save",mpe=()=>"保存",gpe=()=>"ذخیره",no=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mpe():t==="fa"?gpe():ppe()}),vpe=()=>"Saving…",bpe=()=>"正在保存…",ype=()=>"در حال ذخیره…",Ei=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bpe():t==="fa"?ype():vpe()}),xpe=()=>"Show less",wpe=()=>"收起",Spe=()=>"نمایش کمتر",TD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wpe():t==="fa"?Spe():xpe()}),kpe=()=>"Show more",Cpe=()=>"展开",Epe=()=>"نمایش بیشتر",Npe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),zpe=()=>"Stop",jpe=()=>"停止",Tpe=()=>"توقف",AD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Ape=()=>"Stopping…",Rpe=()=>"正在停止…",Mpe=()=>"در حال توقف…",Dpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Lpe=()=>"View source",Ope=()=>"查看源代码",Ipe=()=>"نمایش متن منبع",rh=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ope():t==="fa"?Ipe():Lpe()}),Bpe=()=>"Runs as a remote Hugging Face Job",$pe=()=>"作为远程 Hugging Face Job 运行",Ppe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs as a Job on your Kubernetes cluster",qpe=()=>"作为 Kubernetes 集群上的 Job 运行",Upe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs directly on this computer",Vpe=()=>"直接在此计算机上运行",Kpe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs in a remote Modal sandbox",Xpe=()=>"在远程 Modal 沙箱中运行",Zpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on an ephemeral OpenResearch box",tme=()=>"在临时 OpenResearch 主机上运行",nme=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs on the connected Ray cluster",ime=()=>"在已连接的 Ray 集群上运行",ame=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs as a scheduled job on your Slurm cluster",cme=()=>"作为 Slurm 集群上的调度作业运行",ume=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs on a host from your SSH config",hme=()=>"在 SSH 配置中的主机上运行",_me=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"Runs through Tinker’s remote compute",gme=()=>"通过 Tinker 远程算力运行",vme=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"HF Jobs",xme=()=>"HF Jobs",wme=()=>"HF Jobs",Sme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"Kubernetes",Cme=()=>"Kubernetes",Eme=()=>"Kubernetes",Nme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"This machine",jme=()=>"此计算机",Tme=()=>"این رایانه",RD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jme():t==="fa"?Tme():zme()}),Ame=()=>"Modal",Rme=()=>"Modal",Mme=()=>"Modal",Dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"OpenResearch",Ome=()=>"OpenResearch",Ime=()=>"OpenResearch",Bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Ray",Pme=()=>"Ray",Fme=()=>"Ray",Hme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"Slurm",Ume=()=>"Slurm",Gme=()=>"Slurm",Wme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"SSH",Kme=()=>"SSH",Qme=()=>"SSH",Yme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"Tinker",Zme=()=>"Tinker",Jme=()=>"Tinker",ege=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",nge=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",rge=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",sge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",age=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",oge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",lge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",uge=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",dge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",fge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"This computer must stay awake and online while Tinker runs.",_ge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",pge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",mge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window",vge=()=>"上下文窗口",bge=()=>"پنجرهٔ زمینه",yge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=()=>"Context window used",wge=()=>"已使用的上下文窗口",Sge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",kge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wge():t==="fa"?Sge():xge()}),Cge=e=>`${e==null?void 0:e.value} tokens`,Ege=e=>`${e==null?void 0:e.value} 个 token`,Nge=e=>`${e==null?void 0:e.value} توکن`,zge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Age=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Rge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tge(e):t==="fa"?Age(e):jge(e)}),Mge=()=>"No runs yet — ask the agent to launch one.",Dge=()=>"尚无运行——让智能体启动一个。",Lge=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Oge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Ige=()=>"Run",Bge=()=>"运行",$ge=()=>"اجرا",PE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bge():t==="fa"?$ge():Ige()}),Pge=()=>"Switch run",Fge=()=>"切换运行",Hge=()=>"تغییر اجرا",qge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fge():t==="fa"?Hge():Pge()}),Uge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Gge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Wge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Qge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Yge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Xge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}m`,Jge=e=>`${e==null?void 0:e.value} 分钟`,e1e=e=>`${e==null?void 0:e.value} دقیقه`,t1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=e=>`${e==null?void 0:e.value}s`,r1e=e=>`${e==null?void 0:e.value} 秒`,s1e=e=>`${e==null?void 0:e.value} ثانیه`,i1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):n1e(e)}),a1e=()=>"Code",o1e=()=>"代码",l1e=()=>"کد",c1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"created",d1e=()=>"创建于",f1e=()=>"ایجادشده",h1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"from",p1e=()=>"来自",m1e=()=>"از",g1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Logs",b1e=()=>"日志",y1e=()=>"گزارش‌ها",x1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Latest run",S1e=()=>"最新运行",k1e=()=>"آخرین اجرا",C1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Code",N1e=()=>"代码",z1e=()=>"کد",j1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"Commit",A1e=()=>"提交",R1e=()=>"کامیت",M1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"created",L1e=()=>"创建于",O1e=()=>"ایجادشده",I1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Description",$1e=()=>"说明",P1e=()=>"توضیحات",F1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"Duration",q1e=()=>"时长",U1e=()=>"مدت",G1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"exit",V1e=()=>"退出码",K1e=()=>"خروج",Q1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"from",X1e=()=>"来自",Z1e=()=>"از",J1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Logs",tve=()=>"日志",nve=()=>"گزارش‌ها",rve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run",ive=()=>"运行",ave=()=>"اجرا",ove=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Run history",cve=()=>"运行历史",uve=()=>"تاریخچهٔ اجرا",dve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Started",hve=()=>"开始时间",_ve=()=>"آغاز",pve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Runs",gve=()=>"运行",vve=()=>"اجراها",bve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",xve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",wve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",Sve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No runs yet",Cve=()=>"还没有运行",Eve=()=>"هنوز اجرایی وجود ندارد",Nve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"No experiments yet.",jve=()=>"还没有实验。",Tve=()=>"هنوز آزمایشی وجود ندارد.",Ave=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Not run yet",Mve=()=>"尚未运行",Dve=()=>"هنوز اجرا نشده",Lve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"1 run",Ive=()=>"1 次运行",Bve=()=>"۱ اجرا",$ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"Open logs",Fve=()=>"打开日志",Hve=()=>"باز کردن گزارش‌ها",qve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fve():t==="fa"?Hve():Pve()}),Uve=e=>`${e==null?void 0:e.count} runs`,Gve=e=>`${e==null?void 0:e.count} 次运行`,Wve=e=>`${e==null?void 0:e.count} اجرا`,Vve=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gve(e):t==="fa"?Wve(e):Uve(e)}),Kve=()=>"Stop requested",Qve=()=>"已请求停止",Yve=()=>"درخواست توقف ثبت شد",Xve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Stop run",Jve=()=>"停止运行",ebe=()=>"توقف اجرا",tbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Code",rbe=()=>"代码",sbe=()=>"کد",ibe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Experiments",obe=()=>"实验",lbe=()=>"آزمایش‌ها",cbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Logs",dbe=()=>"日志",fbe=()=>"گزارش‌ها",hbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Stop failed:",pbe=()=>"停止失败:",mbe=()=>"توقف ناموفق بود:",gbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),vbe=()=>"Clipboard access is unavailable.",bbe=()=>"无法访问剪贴板。",ybe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",MD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bbe():t==="fa"?ybe():vbe()}),xbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,wbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,Sbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,kbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):xbe(e)}),Cbe=()=>"Duplicate",Ebe=()=>"创建副本",Nbe=()=>"ایجاد نسخهٔ تکراری",zbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),jbe=e=>`File actions for ${e==null?void 0:e.path}`,Tbe=e=>`${e==null?void 0:e.path} 的文件操作`,Abe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Rbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tbe(e):t==="fa"?Abe(e):jbe(e)}),Mbe=()=>"Open",Dbe=()=>"打开",Lbe=()=>"باز کردن",Obe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Mbe()}),Ibe=e=>`Rename ${e==null?void 0:e.path}`,Bbe=e=>`重命名 ${e==null?void 0:e.path}`,$be=e=>`تغییر نام ${e==null?void 0:e.path}`,Pbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Hbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,qbe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Ube=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Hbe(e):t==="fa"?qbe(e):Fbe(e)}),Gbe=()=>"Binary file — no inline preview.",Wbe=()=>"二进制文件——无法内嵌预览。",Vbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Kbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Qbe=()=>"This file changed on disk. Your edits have not been overwritten.",Ybe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Xbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",FE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Qbe()}),Zbe=()=>"Compile failed",Jbe=()=>"编译失败",eye=()=>"کامپایل ناموفق بود",tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),nye=()=>"Compile PDF",rye=()=>"编译 PDF",sye=()=>"کامپایل PDF",HE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rye():t==="fa"?sye():nye()}),iye=()=>"Compiled, but the engine reported errors — check the output below.",aye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",oye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",lye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy command",uye=()=>"复制命令",dye=()=>"کپی فرمان",fye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Copy install command",_ye=()=>"复制安装命令",pye=()=>"کپی فرمان نصب",mye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"This file was deleted on disk. Your edits have not been discarded.",vye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",bye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",qE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vye():t==="fa"?bye():gye()}),yye=()=>"Discard my edits and reload",xye=()=>"放弃我的编辑并重新加载",wye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Sye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),kye=()=>"Discard unsaved changes and close this file?",Cye=()=>"要丢弃未保存的更改并关闭此文件吗?",Eye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",UE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cye():t==="fa"?Eye():kye()}),Nye=()=>"Dismiss",zye=()=>"关闭",jye=()=>"بستن",Tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss compile message",Rye=()=>"关闭编译消息",Mye=()=>"بستن پیام کامپایل",Dye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Dismiss Overleaf message",Oye=()=>"关闭 Overleaf 消息",Iye=()=>"بستن پیام Overleaf",Bye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),$ye=()=>"Download",Pye=()=>"下载",Fye=()=>"بارگیری",DD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pye():t==="fa"?Fye():$ye()}),Hye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,qye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Uye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Gye=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qye(e):t==="fa"?Uye(e):Hye(e)}),Wye=()=>"Failed to load file:",Vye=()=>"加载文件失败:",Kye=()=>"بارگیری فایل ناموفق بود:",GE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vye():t==="fa"?Kye():Wye()}),Qye=()=>"File truncated — showing the first 512 KB.",Yye=()=>"文件已截断——仅显示前 512 KB。",Xye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Zye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=()=>"The page below stops partway — the full file could not be loaded.",exe=()=>"下方页面在中途结束——无法加载完整文件。",txe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",nxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?exe():t==="fa"?txe():Jye()}),rxe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,sxe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ixe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,axe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sxe(e):t==="fa"?ixe(e):rxe(e)}),oxe=()=>"Loading…",lxe=()=>"正在加载…",cxe=()=>"در حال بارگیری…",LD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lxe():t==="fa"?cxe():oxe()}),uxe=()=>"File not found.",dxe=()=>"找不到文件。",fxe=()=>"فایل پیدا نشد.",hxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dxe():t==="fa"?fxe():uxe()}),_xe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pxe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mxe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pxe(e):t==="fa"?mxe(e):_xe(e)}),vxe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,bxe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,yxe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,xxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bxe(e):t==="fa"?yxe(e):vxe(e)}),wxe=()=>"File not found on disk.",Sxe=()=>"磁盘上找不到此文件。",kxe=()=>"فایل روی دیسک پیدا نشد.",Cxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Nxe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,zxe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,jxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nxe(e):t==="fa"?zxe(e):Exe(e)}),Txe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Axe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Rxe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Mxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Axe(e):t==="fa"?Rxe(e):Txe(e)}),Dxe=()=>"Open in default editor",Lxe=()=>"在默认编辑器中打开",Oxe=()=>"باز کردن در ویرایشگر پیش‌فرض",WE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Ixe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Bxe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",$xe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Pxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Fxe=()=>"Overwrite disk file",Hxe=()=>"覆盖磁盘文件",qxe=()=>"بازنویسی فایل روی دیسک",Uxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hxe():t==="fa"?qxe():Fxe()}),Gxe=()=>"Compiled PDF is out of date",Wxe=()=>"已编译的 PDF 不是最新版本",Vxe=()=>"PDF کامپایل‌شده به‌روز نیست",Kxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wxe():t==="fa"?Vxe():Gxe()}),Qxe=()=>"project clone",Yxe=()=>"项目克隆",Xxe=()=>"کلون پروژه",zg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yxe():t==="fa"?Xxe():Qxe()}),Zxe=()=>"Recompile PDF",Jxe=()=>"重新编译 PDF",e2e=()=>"کامپایل دوبارهٔ PDF",VE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jxe():t==="fa"?e2e():Zxe()}),t2e=()=>"Reload from disk",n2e=()=>"从磁盘重新加载",r2e=()=>"بارگذاری مجدد از دیسک",s2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Save failed",a2e=()=>"保存失败",o2e=()=>"ذخیره ناموفق بود",l2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Saving…",u2e=()=>"正在保存…",d2e=()=>"در حال ذخیره…",f2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Selected — press ⌘C",_2e=()=>"已选中 — 按 ⌘C 复制",p2e=()=>"انتخاب شد — برای کپی ⌘C را بزنید",m2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"session’s worktree",v2e=()=>"会话工作树",b2e=()=>"درخت کاری نشست",jg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v2e():t==="fa"?b2e():g2e()}),y2e=()=>"Show compiled PDF",x2e=()=>"显示已编译的 PDF",w2e=()=>"نمایش PDF کامپایل‌شده",KE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x2e():t==="fa"?w2e():y2e()}),S2e=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",k2e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",C2e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",E2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"This session's worktree isn't available — showing the project clone's copy.",z2e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",j2e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",T2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z2e():t==="fa"?j2e():N2e()}),A2e=()=>"Unsaved",R2e=()=>"未保存",M2e=()=>"ذخیره نشده",OD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R2e():t==="fa"?M2e():A2e()}),D2e=()=>"Unsaved — ⌘S to save",L2e=()=>"未保存 — 按 ⌘S 保存",O2e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",I2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L2e():t==="fa"?O2e():D2e()}),B2e=()=>"Update orx on the remote machine to edit this file safely.",$2e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",P2e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",F2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$2e():t==="fa"?P2e():B2e()}),H2e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",q2e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",U2e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",G2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q2e():t==="fa"?U2e():H2e()}),W2e=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",V2e=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",K2e=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Q2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V2e():t==="fa"?K2e():W2e()}),Y2e=()=>"Back to preview",X2e=()=>"返回预览",Z2e=()=>"بازگشت به پیش‌نمایش",J2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),ewe=e=>`${e==null?void 0:e.count} changed files`,twe=e=>`${e==null?void 0:e.count} 个已更改文件`,nwe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,ID=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?twe(e):t==="fa"?nwe(e):ewe(e)}),rwe=()=>"Changed files",swe=()=>"已更改文件",iwe=()=>"فایل‌های تغییرکرده",awe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Diff preview truncated",lwe=()=>"差异预览已截断",cwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),dwe=e=>`${e==null?void 0:e.count} files shown (partial)`,fwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,_we=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fwe(e):t==="fa"?hwe(e):dwe(e)}),pwe=()=>"No changes.",mwe=()=>"没有更改。",gwe=()=>"تغییری وجود ندارد.",vwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No complete file preview was available before the cutoff.",ywe=()=>"在截断位置之前没有完整的文件预览。",xwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",wwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"No textual diff for this file.",kwe=()=>"此文件没有文本差异。",Cwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Ewe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"1 changed file",zwe=()=>"1 个已更改文件",jwe=()=>"۱ فایل تغییرکرده",BD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zwe():t==="fa"?jwe():Nwe()}),Twe=()=>"1 file shown (partial)",Awe=()=>"显示 1 个文件(部分)",Rwe=()=>"۱ فایل نمایش داده شده (ناقص)",Mwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=()=>"Unable to parse this diff.",Lwe=()=>"无法解析此差异。",Owe=()=>"خواندن این تفاوت ممکن نبود.",Iwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lwe():t==="fa"?Owe():Dwe()}),Bwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$we=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Pwe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Fwe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$we(e):t==="fa"?Pwe(e):Bwe(e)}),Hwe=()=>"View full diff",qwe=()=>"查看完整差异",Uwe=()=>"نمایش تفاوت کامل",Gwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"Create a token ↗",Vwe=()=>"创建令牌 ↗",Kwe=()=>"ساخت توکن ↗",Qwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Ywe=()=>"All projects",Xwe=()=>"所有项目",Zwe=()=>"همهٔ پروژه‌ها",QE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xwe():t==="fa"?Zwe():Ywe()}),Jwe=()=>"Configure Repository",e4e=()=>"配置仓库",t4e=()=>"پیکربندی مخزن",n4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Create a new project",s4e=()=>"新建项目",i4e=()=>"ایجاد پروژهٔ جدید",a4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"Hide sidebar",l4e=()=>"隐藏侧边栏",c4e=()=>"پنهان کردن نوار کناری",YE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),u4e=()=>"Project",d4e=()=>"项目",f4e=()=>"پروژه",h4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d4e():t==="fa"?f4e():u4e()}),_4e=e=>`${e==null?void 0:e.count} cancelled`,p4e=e=>`${e==null?void 0:e.count} 次取消`,m4e=e=>`${e==null?void 0:e.count} لغوشده`,g4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} done`,b4e=e=>`${e==null?void 0:e.count} 次完成`,y4e=e=>`${e==null?void 0:e.count} تمام‌شده`,x4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} failed`,S4e=e=>`${e==null?void 0:e.count} 次失败`,k4e=e=>`${e==null?void 0:e.count} ناموفق`,C4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count} files`,N4e=e=>`${e==null?void 0:e.count} 个文件`,z4e=e=>`${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count}+ files`,A4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,R4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,M4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=e=>`${e==null?void 0:e.count} live`,L4e=e=>`${e==null?void 0:e.count} 次进行中`,O4e=e=>`${e==null?void 0:e.count} فعال`,I4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L4e(e):t==="fa"?O4e(e):D4e(e)}),B4e=()=>"1 file",$4e=()=>"1 个文件",P4e=()=>"۱ فایل",F4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=()=>"1 run",q4e=()=>"1 次运行",U4e=()=>"۱ اجرا",G4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q4e():t==="fa"?U4e():H4e()}),W4e=e=>`${e==null?void 0:e.count} runs`,V4e=e=>`${e==null?void 0:e.count} 次运行`,K4e=e=>`${e==null?void 0:e.count} اجرا`,Q4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V4e(e):t==="fa"?K4e(e):W4e(e)}),Y4e=()=>"No instances yet.",X4e=()=>"还没有实例。",Z4e=()=>"هنوز نمونه‌ای وجود ندارد.",J4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Nothing running right now.",t3e=()=>"当前没有运行中的实例。",n3e=()=>"اکنون چیزی در حال اجرا نیست.",r3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its history.",i3e=()=>"请选择一个项目以查看其历史记录。",a3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"Select a project to see its runs.",c3e=()=>"请选择一个项目以查看其运行。",u3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",d3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=()=>"View history",h3e=()=>"查看历史记录",_3e=()=>"مشاهدهٔ تاریخچه",p3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h3e():t==="fa"?_3e():f3e()}),m3e=e=>`View history (${e==null?void 0:e.count})`,g3e=e=>`查看历史记录(${e==null?void 0:e.count})`,v3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,b3e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?g3e(e):t==="fa"?v3e(e):m3e(e)}),y3e=()=>"The engine exited without producing a PDF or a log.",x3e=()=>"引擎已退出,但没有生成 PDF 或日志。",w3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",S3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Loading…",C3e=()=>"正在加载…",E3e=()=>"در حال بارگیری…",N3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),z3e=()=>"Add local model",j3e=()=>"添加本地模型",T3e=()=>"افزودن مدل محلی",$D=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?j3e():t==="fa"?T3e():z3e()}),A3e=()=>"Local server address",R3e=()=>"本地服务器地址",M3e=()=>"نشانی سرور محلی",D3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"Find models",O3e=()=>"查找模型",I3e=()=>"یافتن مدل‌ها",B3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),$3e=()=>"(OpenAI compatible)",P3e=()=>"(兼容 OpenAI)",F3e=()=>"(سازگار با OpenAI)",PD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P3e():t==="fa"?F3e():$3e()}),H3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",q3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",U3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",G3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Connected",V3e=()=>"已连接",K3e=()=>"متصل شد",Q3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Context window",X3e=()=>"上下文窗口",Z3e=()=>"پنجرهٔ زمینه",J3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",t5e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",n5e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",r5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),s5e=()=>"Custom Endpoint",i5e=()=>"自定义端点",a5e=()=>"نقطهٔ اتصال سفارشی",s6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),o5e=e=>`Disconnect ${e==null?void 0:e.name}`,l5e=e=>`断开 ${e==null?void 0:e.name}`,c5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,u5e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?l5e(e):t==="fa"?c5e(e):o5e(e)}),d5e=()=>"Get OpenCode",f5e=()=>"获取 OpenCode",h5e=()=>"دریافت OpenCode",_5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",m5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",g5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",v5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"API key (optional)",y5e=()=>"API 密钥(可选)",x5e=()=>"کلید API (اختیاری)",w5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Save model",k5e=()=>"保存模型",C5e=()=>"ذخیرهٔ مدل",E5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Model server",z5e=()=>"模型服务器",j5e=()=>"سرور مدل",XE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Local models",A5e=()=>"本地模型",R5e=()=>"مدل‌های محلی",ZE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A5e():t==="fa"?R5e():T5e()}),M5e=()=>"API token (optional)",D5e=()=>"API 令牌(可选)",L5e=()=>"توکن API (اختیاری)",O5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),I5e=()=>"Copy",B5e=()=>"复制",$5e=()=>"کپی",i6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B5e():t==="fa"?$5e():I5e()}),P5e=()=>"Copy code",F5e=()=>"复制代码",H5e=()=>"کپی کد",q5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),U5e=()=>"Download",G5e=()=>"下载",W5e=()=>"بارگیری",FD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G5e():t==="fa"?W5e():U5e()}),V5e=()=>"This browser can’t preview this media format.",K5e=()=>"此浏览器无法预览该媒体格式。",Q5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Y5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>"Add Local Model",Z5e=()=>"添加本地模型",J5e=()=>"افزودن مدل محلی",e6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),t6e=()=>" · CLI configuration",n6e=()=>" · CLI 配置",r6e=()=>" · پیکربندی CLI",HD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),s6e=()=>"· Default",i6e=()=>"· 默认",a6e=()=>"· پیش‌فرض",qD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i6e():t==="fa"?a6e():s6e()}),o6e=()=>"Default model",l6e=()=>"默认模型",c6e=()=>"مدل پیش‌فرض",JE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l6e():t==="fa"?c6e():o6e()}),u6e=()=>"Detecting harnesses…",d6e=()=>"正在检测智能体工具…",f6e=()=>"در حال شناسایی ابزارهای عامل…",h6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Effort",p6e=()=>"推理强度",m6e=()=>"میزان استدلال",g6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Fast speed ·",b6e=()=>"快速 ·",y6e=()=>"سرعت بالا ·",x6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),w6e=()=>"Mode",S6e=()=>"模式",k6e=()=>"حالت",eN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),C6e=()=>"Model",E6e=()=>"模型",N6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E6e():t==="fa"?N6e():C6e()}),z6e=e=>`${e==null?void 0:e.count} more — search to find`,j6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,T6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,A6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?j6e(e):t==="fa"?T6e(e):z6e(e)}),R6e=()=>"Not available",M6e=()=>"不可用",D6e=()=>"در دسترس نیست",L6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),O6e=()=>"Search models…",I6e=()=>"搜索模型…",B6e=()=>"جست‌وجوی مدل‌ها…",UD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Sessions keep their harness. Start a new chat to switch.",P6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",F6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",H6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),q6e=()=>"Speed",U6e=()=>"速度",G6e=()=>"سرعت",tN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?U6e():t==="fa"?G6e():q6e()}),W6e=()=>"Unavailable",V6e=()=>"不可用",K6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V6e():t==="fa"?K6e():W6e()}),Q6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Y6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,X6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Z6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Y6e(e):t==="fa"?X6e(e):Q6e(e)}),J6e=()=>"Variant",eSe=()=>"变体",tSe=()=>"گونه",nSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced",sSe=()=>"高级",iSe=()=>"پیشرفته",aSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · Connect GitHub",lSe=()=>"高级 · 连接 GitHub",cSe=()=>"پیشرفته · اتصال GitHub",uSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Advanced · GitHub sync on",fSe=()=>"高级 · GitHub 同步已开启",hSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",_Se=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",mSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",gSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",vSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mSe():t==="fa"?gSe():pSe()}),bSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,ySe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,xSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,wSe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ySe(e):t==="fa"?xSe(e):bSe(e)}),SSe=()=>"Choose an existing project folder",kSe=()=>"选择现有项目文件夹",CSe=()=>"انتخاب پوشهٔ موجود پروژه",nN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kSe():t==="fa"?CSe():SSe()}),ESe=()=>"Choosing…",NSe=()=>"正在选择…",zSe=()=>"در حال انتخاب…",jSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone destination",ASe=()=>"克隆位置",RSe=()=>"مقصد کلون",MSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Clone paper project",LSe=()=>"克隆论文项目",OSe=()=>"کلون پروژهٔ مقاله",ISe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),BSe=()=>"Create project",$Se=()=>"创建项目",PSe=()=>"ایجاد پروژه",rN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Creating…",HSe=()=>"正在创建…",qSe=()=>"در حال ایجاد…",USe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),GSe=()=>"Choose a different destination. This path is a file, not a folder.",WSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",VSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",C2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WSe():t==="fa"?VSe():GSe()}),KSe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",QSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",YSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",sN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QSe():t==="fa"?YSe():KSe()}),XSe=()=>"Auto-apply repository topics",ZSe=()=>"自动添加仓库 topic",JSe=()=>"اعمال خودکار موضوع‌های مخزن",eke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.",nke=()=>"自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",rke=()=>"موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",ske=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Blank project",ake=()=>"空白项目",oke=()=>"پروژهٔ خالی",lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Cancel",uke=()=>"取消",dke=()=>"لغو",fke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Change",_ke=()=>"更改",pke=()=>"تغییر",mke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Change selected paper",vke=()=>"更改所选论文",bke=()=>"تغییر مقالهٔ انتخاب‌شده",yke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vke():t==="fa"?bke():gke()}),xke=()=>"Check out a Git branch before using this folder.",wke=()=>"使用此文件夹前,请先检出一个 Git 分支。",Ske=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",kke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wke():t==="fa"?Ske():xke()}),Cke=()=>"Checking project location.",Eke=()=>"正在检查项目位置。",Nke=()=>"در حال بررسی محل پروژه.",iN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),zke=()=>"Existing folder",jke=()=>"现有文件夹",Tke=()=>"پوشهٔ موجود",Ake=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"Experiment branches will be pushed to the remote GitHub repository.",Mke=()=>"实验分支将推送到远程 GitHub 仓库。",Dke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Oke=()=>"Extra topics (comma-separated), e.g. llm, benchmark",Ike=()=>"附加 topic(逗号分隔),例如 llm, benchmark",Bke=()=>"موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark",GD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),$ke=()=>"From a paper",Pke=()=>"从论文创建",Fke=()=>"از یک مقاله",Hke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Uke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Gke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Wke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"my-research",Kke=()=>"my-research",Qke=()=>"my-research",aN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Yke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Xke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Zke=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Jke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xke():t==="fa"?Zke():Yke()}),e7e=()=>"No public repository found on alphaXiv",t7e=()=>"在 alphaXiv 上未找到公开仓库",n7e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",r7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),s7e=()=>"OpenResearch will start a blank project with this paper's PDF.",i7e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",a7e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",o7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i7e():t==="fa"?a7e():s7e()}),l7e=()=>"Paper",c7e=()=>"论文",u7e=()=>"مقاله",d7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c7e():t==="fa"?u7e():l7e()}),f7e=()=>"Project location",h7e=()=>"项目位置",_7e=()=>"محل پروژه",E2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h7e():t==="fa"?_7e():f7e()}),p7e=()=>"Project name",m7e=()=>"项目名称",g7e=()=>"نام پروژه",oN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),v7e=()=>"Search for a paper by arXiv ID, URL, or title",b7e=()=>"按 arXiv ID、网址或标题搜索论文",y7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",x7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b7e():t==="fa"?y7e():v7e()}),w7e=()=>"Sync experiments to GitHub",S7e=()=>"将实验同步到 GitHub",k7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",C7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"That folder no longer exists. Choose it again.",N7e=()=>"该文件夹已不存在。请重新选择。",z7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",j7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),T7e=()=>"The selected folder contains an invalid Git repository.",A7e=()=>"所选文件夹包含无效的 Git 仓库。",R7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",M7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A7e():t==="fa"?R7e():T7e()}),D7e=()=>"The selected path is not a folder.",L7e=()=>"所选路径不是文件夹。",O7e=()=>"مسیر انتخاب‌شده پوشه نیست.",I7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L7e():t==="fa"?O7e():D7e()}),B7e=e=>`Checking ${e==null?void 0:e.repository}.`,$7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,P7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,F7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$7e(e):t==="fa"?P7e(e):B7e(e)}),H7e=e=>`Creates ${e==null?void 0:e.repository}.`,q7e=e=>`将创建 ${e==null?void 0:e.repository}。`,U7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,G7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?q7e(e):t==="fa"?U7e(e):H7e(e)}),W7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,V7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,K7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Q7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V7e(e):t==="fa"?K7e(e):W7e(e)}),Y7e=()=>"Project location is required.",X7e=()=>"必须填写项目位置。",Z7e=()=>"محل پروژه الزامی است.",lN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),J7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",eCe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",tCe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",cN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eCe():t==="fa"?tCe():J7e()}),nCe=()=>"A linked public code repository is cloned without credentials.",rCe=()=>"关联的公开代码仓库无需凭据即可克隆。",sCe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",iCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,oCe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,lCe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,cCe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oCe(e):t==="fa"?lCe(e):aCe(e)}),uCe=()=>"Searching alphaXiv…",dCe=()=>"正在搜索 alphaXiv…",fCe=()=>"در حال جست‌وجوی alphaXiv…",hCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Use folder",pCe=()=>"使用文件夹",mCe=()=>"استفاده از پوشه",gCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Can’t reach OpenResearch. This page is no longer live.",bCe=()=>"无法连接 OpenResearch。此页面已不再实时同步。",yCe=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",j4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"A workspace for your research agents",wCe=()=>"面向研究智能体的工作空间",SCe=()=>"فضای کاری برای عامل‌های پژوهشی شما",kCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Add papers that represent your research interests, including papers by other authors.",ECe=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",NCe=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",zCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"API key",TCe=()=>"API 密钥",ACe=()=>"کلید API",a6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),RCe=()=>"AI/ML",MCe=()=>"人工智能与机器学习",DCe=()=>"هوش مصنوعی و یادگیری ماشین",LCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MCe():t==="fa"?DCe():RCe()}),OCe=()=>"Biology",ICe=()=>"生物学",BCe=()=>"زیست‌شناسی",$Ce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),PCe=()=>"Other",FCe=()=>"其他",HCe=()=>"سایر",qCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FCe():t==="fa"?HCe():PCe()}),UCe=()=>"Physics",GCe=()=>"物理学",WCe=()=>"فیزیک",VCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GCe():t==="fa"?WCe():UCe()}),KCe=()=>"Back",QCe=()=>"返回",YCe=()=>"بازگشت",uN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QCe():t==="fa"?YCe():KCe()}),XCe=()=>"Check failed",ZCe=()=>"检查失败",JCe=()=>"بررسی ناموفق بود",e8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZCe():t==="fa"?JCe():XCe()}),t8e=()=>"Checking",n8e=()=>"正在检查",r8e=()=>"در حال بررسی",s8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"Checking Git…",a8e=()=>"正在检查 Git…",o8e=()=>"در حال بررسی Git…",l8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Choose a coding agent",u8e=()=>"选择编程智能体",d8e=()=>"یک عامل کدنویسی انتخاب کنید",f8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Choose a coding agent to continue.",_8e=()=>"选择一个编程智能体以继续。",p8e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",m8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Choose at least one research area to continue.",v8e=()=>"请至少选择一个研究领域后再继续。",b8e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",y8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Choose one or more.",w8e=()=>"请选择一项或多项。",S8e=()=>"یک یا چند مورد را انتخاب کنید.",k8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Choose your preferred coding agent",E8e=()=>"请选择首选编程智能体",N8e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",z8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Consolidate your research",T8e=()=>"集中管理研究",A8e=()=>"پژوهش خود را یکپارچه کنید",R8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Continue",D8e=()=>"继续",L8e=()=>"ادامه",dN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Describe your research area to continue.",I8e=()=>"请描述你的研究领域后再继续。",B8e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",$8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",F8e=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",H8e=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",q8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G8e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",W8e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",V8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Everything stays local",Q8e=()=>"一切都保留在本地",Y8e=()=>"همه‌چیز محلی می‌ماند",X8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Get started",J8e=()=>"开始使用",e9e=()=>"شروع",t9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J8e():t==="fa"?e9e():Z8e()}),n9e=()=>"Git is required for local experiments. Install Git, then re-check.",r9e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",s9e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",i9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Ground your agents",o9e=()=>"为智能体提供可靠依据",l9e=()=>"عامل‌هایتان را به منابع متصل کنید",c9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),u9e=()=>"Install broken",d9e=()=>"安装损坏",f9e=()=>"نصب خراب است",h9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d9e():t==="fa"?f9e():u9e()}),_9e=()=>"Install Git to continue",p9e=()=>"请安装 Git 后再继续",m9e=()=>"برای ادامه Git را نصب کنید",g9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p9e():t==="fa"?m9e():_9e()}),v9e=()=>"Local Git",b9e=()=>"本地 Git",y9e=()=>"Git محلی",x9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b9e():t==="fa"?y9e():v9e()}),w9e=()=>", and ",S9e=()=>" 和 ",k9e=()=>" و ",C9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Compatible with",N9e=()=>"兼容",z9e=()=>"سازگار با",j9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),T9e=()=>"Use your own local models",A9e=()=>"使用你自己的本地模型",R9e=()=>"از مدل‌های محلی خود استفاده کنید",M9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),D9e=()=>"Not detected",L9e=()=>"未检测到",O9e=()=>"شناسایی نشد",fN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),I9e=()=>"Not found",B9e=()=>"未找到",$9e=()=>"پیدا نشد",WD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Not signed in",F9e=()=>"未登录",H9e=()=>"وارد نشده",q9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),U9e=()=>"OpenResearch uses a coding agent already installed on this machine.",G9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",W9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",V9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G9e():t==="fa"?W9e():U9e()}),K9e=()=>"Other research area",Q9e=()=>"其他研究领域",Y9e=()=>"حوزهٔ پژوهشی دیگر",X9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q9e():t==="fa"?Y9e():K9e()}),Z9e=()=>"Re-check",J9e=()=>"重新检查",eEe=()=>"بررسی دوباره",VD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J9e():t==="fa"?eEe():Z9e()}),tEe=()=>"Ready",nEe=()=>"已就绪",rEe=()=>"آماده",o6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Re-check Git before continuing",iEe=()=>"请重新检查 Git 后再继续",aEe=()=>"پیش از ادامه Git را دوباره بررسی کنید",oEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Representative papers",cEe=()=>"代表性论文",uEe=()=>"مقاله‌های شاخص",dEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Research background",hEe=()=>"研究背景",_Ee=()=>"پیشینهٔ پژوهشی",pEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",vEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",hN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Search alphaXiv by title to link a paper…",yEe=()=>"按标题搜索 alphaXiv 以关联论文…",xEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Searching alphaXiv…",kEe=()=>"正在搜索 alphaXiv…",CEe=()=>"در حال جست‌وجوی alphaXiv…",EEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Selected",zEe=()=>"已选择",jEe=()=>"انتخاب‌شده",TEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Local model unavailable",REe=()=>"本地模型不可用",MEe=()=>"مدل محلی در دسترس نیست",KD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),DEe=()=>"Setting things up…",LEe=()=>"正在设置…",OEe=()=>"در حال راه‌اندازی…",IEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LEe():t==="fa"?OEe():DEe()}),BEe=()=>"Connect a local model or sign in to a coding agent to continue",$Ee=()=>"连接本地模型或登录编码智能体以继续",PEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",FEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ee():t==="fa"?PEe():BEe()}),HEe=()=>"Connect a local model or sign in to an agent to continue.",qEe=()=>"连接本地模型或登录一个智能体以继续。",UEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",GEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qEe():t==="fa"?UEe():HEe()}),WEe=()=>"Signed in",VEe=()=>"已登录",KEe=()=>"وارد شده",QEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VEe():t==="fa"?KEe():WEe()}),YEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",XEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",ZEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",JEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XEe():t==="fa"?ZEe():YEe()}),eNe=()=>"· Step 1 of 2",tNe=()=>"· 第 1 步,共 2 步",nNe=()=>"· مرحلهٔ ۱ از ۲",rNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tNe():t==="fa"?nNe():eNe()}),sNe=()=>"· Step 2 of 2",iNe=()=>"· 第 2 步,共 2 步",aNe=()=>"· مرحلهٔ ۲ از ۲",oNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Tell us about your research",cNe=()=>"介绍一下你的研究",uNe=()=>"از پژوهش خود بگویید",dNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),fNe=()=>"Tell us your other research area",hNe=()=>"告诉我们你的其他研究领域",_Ne=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",pNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hNe():t==="fa"?_Ne():fNe()}),mNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",gNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",vNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",bNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gNe():t==="fa"?vNe():mNe()}),yNe=()=>"Unable to verify",xNe=()=>"无法验证",wNe=()=>"تأیید ممکن نیست",SNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xNe():t==="fa"?wNe():yNe()}),kNe=()=>"Update required",CNe=()=>"需要更新",ENe=()=>"نیازمند به‌روزرسانی",NNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Waiting for the Git check",jNe=()=>"正在等待 Git 检查",TNe=()=>"در انتظار بررسی Git",ANe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jNe():t==="fa"?TNe():zNe()}),RNe=()=>"Waiting for the local tool checks",MNe=()=>"正在等待本地工具检查",DNe=()=>"در انتظار بررسی ابزارهای محلی",LNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MNe():t==="fa"?DNe():RNe()}),ONe=()=>"What areas are you interested in?",INe=()=>"你对哪些领域感兴趣?",BNe=()=>"به چه حوزه‌هایی علاقه دارید؟",$Ne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),PNe=()=>"Your code, data, and experiment history stay on your machine.",FNe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",HNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",qNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FNe():t==="fa"?HNe():PNe()}),UNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",GNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",WNe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",VNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GNe():t==="fa"?WNe():UNe()}),KNe=()=>"Add cookie",QNe=()=>"添加 cookie",YNe=()=>"افزودن کوکی",XNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Changed here and on Overleaf — choose which copy to keep",JNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",eze=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",tze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"Create a token ↗",rze=()=>"创建令牌 ↗",sze=()=>"ساخت توکن ↗",ize=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),aze=()=>"Overleaf Git token",oze=()=>"Overleaf Git 令牌",lze=()=>"توکن Git در Overleaf",_N=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oze():t==="fa"?lze():aze()}),cze=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",uze=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",dze=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",fze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Import from browser",_ze=()=>"从浏览器导入",pze=()=>"وارد کردن از مرورگر",mze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"In step with Overleaf",vze=()=>"已与 Overleaf 同步",bze=()=>"با Overleaf همگام است",QD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),yze=()=>"The last sync did not finish.",xze=()=>"上次同步未完成。",wze=()=>"آخرین همگام‌سازی کامل نشد.",Sze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xze():t==="fa"?wze():yze()}),kze=()=>"Link and sync",Cze=()=>"关联并同步",Eze=()=>"پیوند و همگام‌سازی",Nze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"Connecting to Overleaf…",jze=()=>"正在连接 Overleaf…",Tze=()=>"در حال اتصال به Overleaf…",Aze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Edits are live on Overleaf",Mze=()=>"编辑已在 Overleaf 实时同步",Dze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Lze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mze():t==="fa"?Dze():Rze()}),Oze=()=>"Retry",Ize=()=>"重试",Bze=()=>"تلاش دوباره",$ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Live sync stopped.",Fze=()=>"实时同步已停止。",Hze=()=>"همگام‌سازی زنده متوقف شد.",qze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Live sync starts once the paper is in step with Overleaf.",Gze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Wze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Vze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Kze=()=>"My projects ↗",Qze=()=>"我的项目 ↗",Yze=()=>"پروژه‌های من ↗",pN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qze():t==="fa"?Yze():Kze()}),Xze=()=>"Nothing could be synced.",Zze=()=>"没有内容可以同步。",Jze=()=>"هیچ موردی قابل همگام‌سازی نبود.",eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open Overleaf ↗",nje=()=>"打开 Overleaf ↗",rje=()=>"باز کردن Overleaf ↗",sje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Cancel",aje=()=>"取消",oje=()=>"لغو",YD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",cje=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",uje=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",dje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Keep this copy",hje=()=>"保留此副本",_je=()=>"نگه داشتن این نسخه",pje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Open in Overleaf",gje=()=>"在 Overleaf 中打开",vje=()=>"باز کردن در Overleaf",bje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),yje=()=>"Replace the Overleaf token",xje=()=>"替换 Overleaf 令牌",wje=()=>"جایگزینی توکن Overleaf",mN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xje():t==="fa"?wje():yje()}),Sje=()=>"Sync files",kje=()=>"同步文件",Cje=()=>"همگام‌سازی فایل‌ها",Eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Unlink",zje=()=>"取消关联",jje=()=>"قطع پیوند",Tje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=()=>"Upload a copy as a new project ↗",Rje=()=>"上传副本作为新项目 ↗",Mje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",XD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rje():t==="fa"?Mje():Aje()}),Dje=()=>"Use Overleaf's",Lje=()=>"使用 Overleaf 的副本",Oje=()=>"استفاده از نسخهٔ Overleaf",Ije=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"This paper stays in step with Overleaf.",$je=()=>"此论文将与 Overleaf 保持同步。",Pje=()=>"این مقاله با Overleaf همگام می‌ماند.",Fje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$je():t==="fa"?Pje():Bje()}),Hje=()=>"Paste it instead",qje=()=>"改为粘贴",Uje=()=>"به‌جایش بچسبانید",Gje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qje():t==="fa"?Uje():Hje()}),Wje=e=>`Pulled ${e==null?void 0:e.paths}.`,Vje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Kje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Qje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vje(e):t==="fa"?Kje(e):Wje(e)}),Yje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Xje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Zje=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Jje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),eTe=e=>`Pushed ${e==null?void 0:e.paths}.`,tTe=e=>`已推送 ${e==null?void 0:e.paths}。`,nTe=e=>`${e==null?void 0:e.paths} ارسال شد.`,rTe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tTe(e):t==="fa"?nTe(e):eTe(e)}),sTe=()=>"Add a fresh Overleaf session cookie to start following again.",iTe=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",aTe=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",oTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Save the file first",cTe=()=>"请先保存文件",uTe=()=>"ابتدا فایل را ذخیره کنید",dTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),fTe=()=>"Save this file to sync it with Overleaf",hTe=()=>"保存此文件以与 Overleaf 同步",_Te=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",ZD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),pTe=()=>"Save token",mTe=()=>"保存令牌",gTe=()=>"ذخیرهٔ توکن",vTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),bTe=()=>"Send this paper to Overleaf",yTe=()=>"将此论文发送到 Overleaf",xTe=()=>"ارسال مقاله به Overleaf",wTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yTe():t==="fa"?xTe():bTe()}),STe=()=>"Overleaf session cookie",kTe=()=>"Overleaf 会话 cookie",CTe=()=>"کوکی نشست Overleaf",T4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kTe():t==="fa"?CTe():STe()}),ETe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",NTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",zTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",jTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=()=>"Overleaf sync failed",ATe=()=>"Overleaf 同步失败",RTe=()=>"همگام‌سازی با Overleaf ناموفق بود",A4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ATe():t==="fa"?RTe():TTe()}),MTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",DTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",LTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",OTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Syncing with Overleaf…",BTe=()=>"正在与 Overleaf 同步…",$Te=()=>"در حال همگام‌سازی با Overleaf…",JD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),PTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",FTe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",HTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",qTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FTe():t==="fa"?HTe():PTe()}),UTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",GTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",WTe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",VTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GTe():t==="fa"?WTe():UTe()}),KTe=()=>"Toggle Plan mode for this chat",QTe=()=>"切换此聊天的计划模式",YTe=()=>"تغییر حالت طرح این گفت‌وگو",XTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QTe():t==="fa"?YTe():KTe()}),ZTe=()=>"Accept and auto mode",JTe=()=>"接受并使用自动模式",eAe=()=>"پذیرش و حالت خودکار",tAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JTe():t==="fa"?eAe():ZTe()}),nAe=()=>"Accept and bypass all",rAe=()=>"接受并跳过所有审批",sAe=()=>"پذیرش و عبور از همهٔ تأییدها",iAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rAe():t==="fa"?sAe():nAe()}),aAe=()=>"Accept plan",oAe=()=>"接受计划",lAe=()=>"پذیرش طرح",cAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oAe():t==="fa"?lAe():aAe()}),uAe=e=>`${e==null?void 0:e.agent} proposed a plan`,dAe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,fAe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,hAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dAe(e):t==="fa"?fAe(e):uAe(e)}),_Ae=e=>`${e==null?void 0:e.agent} is ready to proceed`,pAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,mAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,gAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pAe(e):t==="fa"?mAe(e):_Ae(e)}),vAe=()=>"Back",bAe=()=>"返回",yAe=()=>"بازگشت",xAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bAe():t==="fa"?yAe():vAe()}),wAe=()=>"More approval options",SAe=()=>"更多批准选项",kAe=()=>"گزینه‌های تأیید بیشتر",CAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Open plan",NAe=()=>"打开计划",zAe=()=>"باز کردن طرح",jAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),TAe=()=>"Reject",AAe=()=>"拒绝",RAe=()=>"رد کردن",MAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),DAe=()=>"Revise",LAe=()=>"修改",OAe=()=>"بازنگری",IAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LAe():t==="fa"?OAe():DAe()}),BAe=()=>"Revise…",$Ae=()=>"修改…",PAe=()=>"بازنگری…",FAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ae():t==="fa"?PAe():BAe()}),HAe=()=>"What should change? (optional)",qAe=()=>"需要更改什么?(可选)",UAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",GAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qAe():t==="fa"?UAe():HAe()}),WAe=e=>`${e==null?void 0:e.count} active`,VAe=e=>`${e==null?void 0:e.count} 个活跃`,KAe=e=>`${e==null?void 0:e.count} فعال`,QAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?VAe(e):t==="fa"?KAe(e):WAe(e)}),YAe=e=>`${e==null?void 0:e.count} total agents`,XAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,ZAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,JAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?XAe(e):t==="fa"?ZAe(e):YAe(e)}),eRe=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,tRe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,nRe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,rRe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tRe(e):t==="fa"?nRe(e):eRe(e)}),sRe=()=>"Agents",iRe=()=>"智能体",aRe=()=>"عامل‌ها",gN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),oRe=()=>"arXiv paper ID:",lRe=()=>"arXiv 论文 ID:",cRe=()=>"شناسهٔ مقالهٔ arXiv:",uRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Cancel",fRe=()=>"取消",hRe=()=>"لغو",_Re=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),pRe=()=>"Created",mRe=()=>"创建时间",gRe=()=>"ایجادشده",vRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mRe():t==="fa"?gRe():pRe()}),bRe=()=>"Delete project?",yRe=()=>"删除项目?",xRe=()=>"پروژه حذف شود؟",wRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"Delete project",kRe=()=>"删除项目",CRe=()=>"حذف پروژه",ERe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"Deleting…",zRe=()=>"正在删除…",jRe=()=>"در حال حذف…",TRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),ARe=()=>"Experiments",RRe=()=>"实验",MRe=()=>"آزمایش‌ها",vN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RRe():t==="fa"?MRe():ARe()}),DRe=()=>"The local folder and linked GitHub repository are kept.",LRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",ORe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",IRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"The local folder is kept.",$Re=()=>"本地文件夹会保留。",PRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",FRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"New project",qRe=()=>"新建项目",URe=()=>"پروژهٔ جدید",eL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"No projects yet — create one to get started.",WRe=()=>"尚无项目——新建一个即可开始。",VRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",KRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Project",YRe=()=>"项目",XRe=()=>"پروژه",ZRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),JRe=()=>"Projects",eMe=()=>"项目",tMe=()=>"پروژه‌ها",nMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eMe():t==="fa"?tMe():JRe()}),rMe=()=>"Repository",sMe=()=>"仓库",iMe=()=>"مخزن",bN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),aMe=()=>"Idle",oMe=()=>"空闲",lMe=()=>"بیکار",cMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Local",dMe=()=>"本地",fMe=()=>"محلی",l6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dMe():t==="fa"?fMe():uMe()}),hMe=()=>"1 total agent",_Me=()=>"共 1 个智能体",pMe=()=>"در مجموع ۱ عامل",mMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=e=>`${e==null?void 0:e.count} running`,vMe=e=>`${e==null?void 0:e.count} 个运行中`,bMe=e=>`${e==null?void 0:e.count} در حال اجرا`,yMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vMe(e):t==="fa"?bMe(e):gMe(e)}),xMe=e=>`${e==null?void 0:e.count} total`,wMe=e=>`共 ${e==null?void 0:e.count} 个`,SMe=e=>`در مجموع ${e==null?void 0:e.count}`,yN=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wMe(e):t==="fa"?SMe(e):xMe(e)}),kMe=()=>"Installing the compatible binary. This may take a few minutes.",CMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",EMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",NMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),zMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,jMe=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,TMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,AMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jMe(e):t==="fa"?TMe(e):zMe(e)}),RMe=()=>"Check again",MMe=()=>"再次检查",DMe=()=>"بررسی دوباره",xN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MMe():t==="fa"?DMe():RMe()}),LMe=()=>"Closing…",OMe=()=>"正在关闭…",IMe=()=>"در حال بستن…",BMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OMe():t==="fa"?IMe():LMe()}),$Me=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,PMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,FMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,HMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PMe(e):t==="fa"?FMe(e):$Me(e)}),qMe=()=>"Preparing your remote workspace…",UMe=()=>"正在准备远程工作区…",GMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",WMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UMe():t==="fa"?GMe():qMe()}),VMe=e=>`Connecting to ${e==null?void 0:e.host}`,KMe=e=>`正在连接到 ${e==null?void 0:e.host}`,QMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,YMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KMe(e):t==="fa"?QMe(e):VMe(e)}),XMe=()=>"Close remote host picker",ZMe=()=>"关闭远程主机选择器",JMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",eDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZMe():t==="fa"?JMe():XMe()}),tDe=()=>"Choose a configured SSH host.",nDe=()=>"选择已配置的 SSH 主机。",rDe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",sDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nDe():t==="fa"?rDe():tDe()}),iDe=()=>"Connect to remote",aDe=()=>"连接到远程主机",oDe=()=>"اتصال به میزبان راه‌دور",tL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aDe():t==="fa"?oDe():iDe()}),lDe=()=>"Disconnect",cDe=()=>"断开连接",uDe=()=>"قطع اتصال",R4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Your remote work is still running. Reconnect when you’re ready.",fDe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",hDe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",_De=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`Disconnected from ${e==null?void 0:e.host}`,mDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,gDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,nL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),vDe=e=>`Could not connect to ${e==null?void 0:e.host}`,bDe=e=>`无法连接到 ${e==null?void 0:e.host}`,yDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,xDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bDe(e):t==="fa"?yDe(e):vDe(e)}),wDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",SDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",kDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",CDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SDe():t==="fa"?kDe():wDe()}),EDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",NDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",zDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",jDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),TDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ADe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,RDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,MDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ADe(e):t==="fa"?RDe(e):TDe(e)}),DDe=()=>"OpenResearch binary",LDe=()=>"OpenResearch 二进制文件",ODe=()=>"فایل اجرایی OpenResearch",IDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LDe():t==="fa"?ODe():DDe()}),BDe=()=>"OpenResearch Database",$De=()=>"OpenResearch 数据库",PDe=()=>"پایگاه دادهٔ OpenResearch",FDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",qDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",UDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",GDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qDe():t==="fa"?UDe():HDe()}),WDe=()=>"Install OpenResearch?",VDe=()=>"安装 OpenResearch?",KDe=()=>"OpenResearch نصب شود؟",QDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VDe():t==="fa"?KDe():WDe()}),YDe=()=>"Installing…",XDe=()=>"正在安装…",ZDe=()=>"در حال نصب…",JDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),eLe=()=>"No matching SSH hosts",tLe=()=>"没有匹配的 SSH 主机",nLe=()=>"میزبان SSH منطبقی پیدا نشد",rLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iLe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aLe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=()=>"Open remote",cLe=()=>"打开远程工作区",uLe=()=>"باز کردن راه‌دور",dLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),fLe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",hLe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",_Le=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",pLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",gLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",vLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",bLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gLe():t==="fa"?vLe():mLe()}),yLe=()=>"Preparing remote workspace…",xLe=()=>"正在准备远程工作区…",wLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",SLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),kLe=()=>"Reconnect",CLe=()=>"重新连接",ELe=()=>"اتصال دوباره",wN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),NLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",zLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",jLe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",TLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zLe():t==="fa"?jLe():NLe()}),ALe=e=>`Reconnecting to ${e==null?void 0:e.host}`,RLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,MLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,DLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RLe(e):t==="fa"?MLe(e):ALe(e)}),LLe=()=>"Search SSH hosts",OLe=()=>"搜索 SSH 主机",ILe=()=>"جستجوی میزبان‌های SSH",SN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),BLe=e=>`SSH: ${e==null?void 0:e.host}`,$Le=e=>`SSH:${e==null?void 0:e.host}`,PLe=e=>`SSH: ${e==null?void 0:e.host}`,N2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),FLe=()=>"Start a new OpenResearch host",HLe=()=>"启动新的 OpenResearch 主机",qLe=()=>"راه‌اندازی میزبان جدید OpenResearch",ULe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HLe():t==="fa"?qLe():FLe()}),GLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,WLe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,VLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,KLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WLe(e):t==="fa"?VLe(e):GLe(e)}),QLe=()=>"Stop OpenResearch",YLe=()=>"停止 OpenResearch",XLe=()=>"توقف OpenResearch",ZLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,eOe=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,tOe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,nOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eOe(e):t==="fa"?tOe(e):JLe(e)}),rOe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,sOe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,iOe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,aOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sOe(e):t==="fa"?iOe(e):rOe(e)}),oOe=()=>"Stop OpenResearch on host",lOe=()=>"停止主机上的 OpenResearch",cOe=()=>"توقف OpenResearch روی میزبان",rL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>"This will also:",dOe=()=>"这还将:",fOe=()=>"این کار همچنین:",hOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"End 1 pending approval.",pOe=()=>"结束 1 个待审批请求。",mOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",gOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),vOe=()=>"Leave 1 submitted experiment running.",bOe=()=>"让 1 个已提交实验继续运行。",yOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bOe():t==="fa"?yOe():vOe()}),wOe=()=>"Disconnect 1 other client.",SOe=()=>"断开 1 个其他客户端。",kOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",COe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Keep 1 queued message saved.",NOe=()=>"保留 1 条排队消息。",zOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",jOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),TOe=()=>"Interrupt 1 active agent turn.",AOe=()=>"中断 1 个活动代理任务。",ROe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",MOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AOe():t==="fa"?ROe():TOe()}),DOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,LOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,OOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,IOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LOe(e):t==="fa"?OOe(e):DOe(e)}),BOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,$Oe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,POe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,FOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,qOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,UOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,GOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qOe(e):t==="fa"?UOe(e):HOe(e)}),WOe=()=>"Stopping host…",VOe=()=>"正在停止主机…",KOe=()=>"در حال توقف میزبان…",QOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Update",XOe=()=>"更新",ZOe=()=>"به‌روزرسانی",kN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,eIe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,tIe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,nIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eIe(e):t==="fa"?tIe(e):JOe(e)}),rIe=()=>"Update OpenResearch?",sIe=()=>"更新 OpenResearch?",iIe=()=>"OpenResearch به‌روزرسانی شود؟",aIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Updating…",lIe=()=>"正在更新…",cIe=()=>"در حال به‌روزرسانی…",uIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),dIe=()=>"Disable syncing",fIe=()=>"关闭同步",hIe=()=>"غیرفعال کردن همگام‌سازی",_Ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fIe():t==="fa"?hIe():dIe()}),pIe=()=>"Enable GitHub syncing",mIe=()=>"启用 GitHub 同步",gIe=()=>"فعال‌سازی همگام‌سازی GitHub",vIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mIe():t==="fa"?gIe():pIe()}),bIe=()=>"Enabling…",yIe=()=>"正在启用…",xIe=()=>"در حال فعال‌سازی…",wIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yIe():t==="fa"?xIe():bIe()}),SIe=()=>"Updating…",kIe=()=>"正在更新…",CIe=()=>"در حال به‌روزرسانی…",EIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,zIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,jIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,TIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zIe(e):t==="fa"?jIe(e):NIe(e)}),AIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,RIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,MIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,DIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RIe(e):t==="fa"?MIe(e):AIe(e)}),LIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,OIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,IIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,BIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OIe(e):t==="fa"?IIe(e):LIe(e)}),$Ie=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,PIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,FIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,HIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PIe(e):t==="fa"?FIe(e):$Ie(e)}),qIe=()=>"CLI is retrying…",UIe=()=>"CLI 正在重试…",GIe=()=>"CLI در حال تلاش دوباره است…",WIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UIe():t==="fa"?GIe():qIe()}),VIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,KIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,QIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,YIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KIe(e):t==="fa"?QIe(e):VIe(e)}),XIe=()=>"Sending again…",ZIe=()=>"正在重新发送…",JIe=()=>"در حال ارسال دوباره…",eBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,nBe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,rBe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,sBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Retrying…",aBe=()=>"正在重试…",oBe=()=>"در حال تلاش دوباره…",sL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),lBe=()=>"Default speed",cBe=()=>"默认速度",uBe=()=>"سرعت پیش‌فرض",dBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cBe():t==="fa"?uBe():lBe()}),fBe=()=>"Standard",hBe=()=>"标准",_Be=()=>"استاندارد",pBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hBe():t==="fa"?_Be():fBe()}),mBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,gBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,vBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,bBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gBe(e):t==="fa"?vBe(e):mBe(e)}),yBe=()=>"Appearance",xBe=()=>"外观",wBe=()=>"ظاهر",SBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check",CBe=()=>"检查",EBe=()=>"بررسی",NBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"Check again",jBe=()=>"再次检查",TBe=()=>"بررسی دوباره",Qp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),ABe=()=>"Check for updates",RBe=()=>"检查更新",MBe=()=>"بررسی به‌روزرسانی",DBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RBe():t==="fa"?MBe():ABe()}),LBe=()=>"Check now",OBe=()=>"立即检查",IBe=()=>"اکنون بررسی کن",BBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Check setup",PBe=()=>"检查设置",FBe=()=>"بررسی راه‌اندازی",HBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PBe():t==="fa"?FBe():$Be()}),qBe=()=>"orx checks a few times a day on its own.",UBe=()=>"orx 每天会自动检查几次。",GBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",WBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UBe():t==="fa"?GBe():qBe()}),VBe=()=>"Choose a flavor",KBe=()=>"选择配置",QBe=()=>"انتخاب پیکربندی",YBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KBe():t==="fa"?QBe():VBe()}),XBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,ZBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,JBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZBe(e):t==="fa"?JBe(e):XBe(e)}),t$e=()=>"clean",n$e=()=>"无更改",r$e=()=>"بدون تغییر",s$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>`Already linked at ${e==null?void 0:e.link}.`,a$e=e=>`已链接到 ${e==null?void 0:e.link}。`,o$e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=e=>`Linked ${e==null?void 0:e.link}.`,u$e=e=>`已链接 ${e==null?void 0:e.link}。`,d$e=e=>`${e==null?void 0:e.link} پیوند شد.`,f$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u$e(e):t==="fa"?d$e(e):c$e(e)}),h$e=()=>"Connect",_$e=()=>"连接",p$e=()=>"اتصال",c6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_$e():t==="fa"?p$e():h$e()}),m$e=()=>"Connected via GitHub CLI",g$e=()=>"已通过 GitHub CLI 连接",v$e=()=>"از طریق GitHub CLI متصل است",iL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g$e():t==="fa"?v$e():m$e()}),b$e=()=>"Connecting…",y$e=()=>"正在连接…",x$e=()=>"در حال اتصال…",aL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y$e():t==="fa"?x$e():b$e()}),w$e=e=>`CPU cores: ${e==null?void 0:e.count}`,S$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,k$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,C$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S$e(e):t==="fa"?k$e(e):w$e(e)}),E$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",N$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",z$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",j$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"the current project",A$e=()=>"当前项目",R$e=()=>"پروژهٔ فعلی",M$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),D$e=e=>`${e==null?void 0:e.value} (custom)`,L$e=e=>`${e==null?void 0:e.value}(自定义)`,O$e=e=>`${e==null?void 0:e.value} (سفارشی)`,I$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L$e(e):t==="fa"?O$e(e):D$e(e)}),B$e=()=>"detached",$$e=()=>"分离头指针",P$e=()=>"جدا از شاخه",u6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Disconnected",H$e=()=>"已断开连接",q$e=()=>"قطع اتصال",oL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),U$e=()=>"Environment tab",G$e=()=>"环境标签页",W$e=()=>"زبانهٔ محیط",V$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G$e():t==="fa"?W$e():U$e()}),K$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Y$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,X$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Q$e(e):t==="fa"?Y$e(e):K$e(e)}),Z$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",J$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",ePe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",tPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J$e():t==="fa"?ePe():Z$e()}),nPe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",rPe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",sPe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",iPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",oPe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",lPe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",cPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=e=>`GPU × ${e==null?void 0:e.count}`,dPe=e=>`${e==null?void 0:e.count} 个 GPU`,fPe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,hPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dPe(e):t==="fa"?fPe(e):uPe(e)}),_Pe=()=>"has changes",pPe=()=>"有更改",mPe=()=>"دارای تغییر",gPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),vPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,bPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,yPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,xPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bPe(e):t==="fa"?yPe(e):vPe(e)}),wPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",SPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",kPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",CPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"Install",NPe=()=>"安装",zPe=()=>"نصب",jPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),TPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,APe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,RPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,MPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?APe(e):t==="fa"?RPe(e):TPe(e)}),DPe=e=>`Install the ${e==null?void 0:e.command} command`,LPe=e=>`安装 ${e==null?void 0:e.command} 命令`,OPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,IPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LPe(e):t==="fa"?OPe(e):DPe(e)}),BPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",$Pe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",PPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",FPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Pe():t==="fa"?PPe():BPe()}),HPe=()=>"Install the new release now instead of waiting for the background update.",qPe=()=>"立即安装新版本,无需等待后台更新。",UPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qPe():t==="fa"?UPe():HPe()}),WPe=()=>"Discard your unsaved Kubernetes changes?",VPe=()=>"要放弃未保存的 Kubernetes 更改吗?",KPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",QPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VPe():t==="fa"?KPe():WPe()}),YPe=()=>"Key from",XPe=()=>"密钥来自",ZPe=()=>"کلید از",JPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XPe():t==="fa"?ZPe():YPe()}),eFe=()=>"Use current kubectl context",tFe=()=>"使用当前 kubectl 上下文",nFe=()=>"استفاده از کانتکست فعلی kubectl",rFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=e=>`Use current context (${e==null?void 0:e.context})`,iFe=e=>`使用当前上下文(${e==null?void 0:e.context})`,aFe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,oFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iFe(e):t==="fa"?aFe(e):sFe(e)}),lFe=()=>"Language",cFe=()=>"语言",uFe=()=>"زبان",dFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),fFe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,hFe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,_Fe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,pFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hFe(e):t==="fa"?_Fe(e):fFe(e)}),mFe=()=>"Make default",gFe=()=>"设为默认值",vFe=()=>"پیش‌فرض شود",bFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gFe():t==="fa"?vFe():mFe()}),yFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",xFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",wFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",SFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xFe():t==="fa"?wFe():yFe()}),kFe=()=>"Replace token ID",CFe=()=>"替换令牌 ID",EFe=()=>"جایگزینی شناسهٔ توکن",NFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Replace token secret",jFe=()=>"替换令牌密钥",TFe=()=>"جایگزینی رمز توکن",AFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jFe():t==="fa"?TFe():zFe()}),RFe=()=>"How to get a Modal token",MFe=()=>"如何获取 Modal 令牌",DFe=()=>"روش دریافت توکن Modal",LFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MFe():t==="fa"?DFe():RFe()}),OFe=()=>"Token ID",IFe=()=>"令牌 ID",BFe=()=>"شناسهٔ توکن",$Fe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Token secret",FFe=()=>"令牌密钥",HFe=()=>"رمز توکن",qFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FFe():t==="fa"?HFe():PFe()}),UFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,GFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,WFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,lL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?GFe(e):t==="fa"?WFe(e):UFe(e)}),VFe=e=>`Needs ${e==null?void 0:e.tool}`,KFe=e=>`需要 ${e==null?void 0:e.tool}`,QFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,YFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KFe(e):t==="fa"?QFe(e):VFe(e)}),XFe=()=>"Needs tools",ZFe=()=>"缺少工具",JFe=()=>"به ابزارها نیاز دارد",eHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZFe():t==="fa"?JFe():XFe()}),tHe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,nHe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,rHe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,sHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nHe(e):t==="fa"?rHe(e):tHe(e)}),iHe=()=>"New runs use SSH; choose a host when launching.",aHe=()=>"新运行将使用 SSH;启动时请选择主机。",oHe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"New token",uHe=()=>"新令牌",dHe=()=>"توکن جدید",fHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"No default flavor",_He=()=>"不设默认配置",pHe=()=>"بدون پیکربندی پیش‌فرض",mHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"none",vHe=()=>"无",bHe=()=>"هیچ‌کدام",d6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vHe():t==="fa"?bHe():gHe()}),yHe=()=>"Not connected",xHe=()=>"未连接",wHe=()=>"متصل نیست",cL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"not found on PATH",kHe=()=>"在 PATH 中未找到",CHe=()=>"در PATH پیدا نشد",EHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,zHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,jHe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,THe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"not initialized",RHe=()=>"尚未初始化",MHe=()=>"راه‌اندازی نشده",DHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Not set",OHe=()=>"未设置",IHe=()=>"تنظیم نشده",M4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"OAuth (subscription login)",$He=()=>"OAuth(订阅登录)",PHe=()=>"OAuth (ورود با اشتراک)",FHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,qHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,UHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,GHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):HHe(e)}),WHe=()=>"Setting up…",VHe=()=>"正在设置…",KHe=()=>"در حال راه‌اندازی…",QHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Account",XHe=()=>"账户",ZHe=()=>"حساب",f6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Add one with",eqe=()=>"使用以下命令添加:",tqe=()=>"یکی با این فرمان اضافه کنید:",nqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Add variable",sqe=()=>"添加变量",iqe=()=>"افزودن متغیر",aqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"Agent models",lqe=()=>"智能体模型",cqe=()=>"مدل‌های عامل",uqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),dqe=()=>"Anonymous usage analytics",fqe=()=>"匿名使用情况分析",hqe=()=>"تحلیل ناشناس استفاده",CN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fqe():t==="fa"?hqe():dqe()}),_qe=()=>"Auth",pqe=()=>"身份验证",mqe=()=>"احراز هویت",gqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),vqe=()=>"Authentication",bqe=()=>"身份验证",yqe=()=>"احراز هویت",uL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bqe():t==="fa"?yqe():vqe()}),xqe=()=>"Auto-apply GitHub topics for new projects",wqe=()=>"为新项目自动添加 GitHub topic",Sqe=()=>"اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید",EN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wqe():t==="fa"?Sqe():xqe()}),kqe=()=>"Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.",Cqe=()=>"为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",Eqe=()=>"مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",dL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cqe():t==="fa"?Eqe():kqe()}),Nqe=()=>"Back to Compute",zqe=()=>"返回算力设置",jqe=()=>"بازگشت به رایانش",fL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zqe():t==="fa"?jqe():Nqe()}),Tqe=()=>"Backend",Aqe=()=>"后端",Rqe=()=>"بک‌اند",Mqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aqe():t==="fa"?Rqe():Tqe()}),Dqe=()=>"Baseline",Lqe=()=>"基线",Oqe=()=>"خط مبنا",Iqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"Binary",$qe=()=>"可执行文件",Pqe=()=>"فایل اجرایی",Fqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Cancel",qqe=()=>"取消",Uqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qqe():t==="fa"?Uqe():Hqe()}),Gqe=()=>"Cancel new variable",Wqe=()=>"取消新变量",Vqe=()=>"لغو متغیر جدید",Kqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wqe():t==="fa"?Vqe():Gqe()}),Qqe=()=>"Checking compute targets…",Yqe=()=>"正在检查算力目标…",Xqe=()=>"در حال بررسی مقصدهای رایانشی…",Zqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Qqe()}),Jqe=()=>"Checking kubectl…",eUe=()=>"正在检查 kubectl…",tUe=()=>"در حال بررسی kubectl…",nUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eUe():t==="fa"?tUe():Jqe()}),rUe=()=>"Checking Modal…",sUe=()=>"正在检查 Modal…",iUe=()=>"در حال بررسی Modal…",aUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Choose a preset flavor",lUe=()=>"选择预设规格",cUe=()=>"یک پیکربندی آماده انتخاب کنید",NN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),uUe=()=>"cluster default",dUe=()=>"集群默认值",fUe=()=>"پیش‌فرض خوشه",zN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dUe():t==="fa"?fUe():uUe()}),hUe=()=>"cluster default (e.g. 4h, 30m)",_Ue=()=>"集群默认值(例如 4h、30m)",pUe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",mUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ue():t==="fa"?pUe():hUe()}),gUe=()=>"Cluster unreachable",vUe=()=>"无法连接集群",bUe=()=>"خوشه در دسترس نیست",yUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vUe():t==="fa"?bUe():gUe()}),xUe=()=>"Compute",wUe=()=>"算力",SUe=()=>"رایانش",hL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wUe():t==="fa"?SUe():xUe()}),kUe=()=>"Connect compute backends and choose where new runs execute.",CUe=()=>"连接算力后端,并选择新运行的执行位置。",EUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",NUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"Connected",jUe=()=>"已连接",TUe=()=>"متصل",AUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jUe():t==="fa"?TUe():zUe()}),RUe=()=>"Context",MUe=()=>"上下文",DUe=()=>"زمینه",LUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MUe():t==="fa"?DUe():RUe()}),OUe=()=>"Current",IUe=()=>"当前",BUe=()=>"فعلی",$Ue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),PUe=()=>"Currently off:",FUe=()=>"当前已关闭:",HUe=()=>"اکنون خاموش است:",qUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FUe():t==="fa"?HUe():PUe()}),UUe=()=>"Custom flavor",GUe=()=>"自定义规格",WUe=()=>"پیکربندی سفارشی",VUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GUe():t==="fa"?WUe():UUe()}),KUe=()=>"Custom flavor…",QUe=()=>"自定义规格…",YUe=()=>"پیکربندی سفارشی…",XUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QUe():t==="fa"?YUe():KUe()}),ZUe=()=>"Data directory",JUe=()=>"数据目录",eGe=()=>"پوشهٔ داده",tGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JUe():t==="fa"?eGe():ZUe()}),nGe=()=>"default",rGe=()=>"默认",sGe=()=>"پیش‌فرض",iGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rGe():t==="fa"?sGe():nGe()}),aGe=()=>"Default",oGe=()=>"默认",lGe=()=>"پیش‌فرض",_L=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oGe():t==="fa"?lGe():aGe()}),cGe=()=>"Default destination",uGe=()=>"默认目标",dGe=()=>"مقصد پیش‌فرض",fGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uGe():t==="fa"?dGe():cGe()}),hGe=()=>"Detecting hardware…",_Ge=()=>"正在检测硬件…",pGe=()=>"در حال شناسایی سخت‌افزار…",mGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Detecting harnesses…",vGe=()=>"正在检测智能体工具…",bGe=()=>"در حال شناسایی ابزارهای عامل…",yGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",wGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",SGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",kGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Effective URL",EGe=()=>"实际使用的网址",NGe=()=>"نشانی مؤثر",zGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Enable GitHub syncing for new projects",TGe=()=>"为新项目启用 GitHub 同步",AGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",jN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),RGe=()=>"Environment",MGe=()=>"环境",DGe=()=>"محیط",pL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MGe():t==="fa"?DGe():RGe()}),LGe=()=>"Failed",OGe=()=>"失败",IGe=()=>"ناموفق",h6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OGe():t==="fa"?IGe():LGe()}),BGe=()=>"General",$Ge=()=>"常规",PGe=()=>"عمومی",FGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ge():t==="fa"?PGe():BGe()}),HGe=()=>"GitHub publishing",qGe=()=>"GitHub 发布",UGe=()=>"انتشار در GitHub",GGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qGe():t==="fa"?UGe():HGe()}),WGe=()=>"Git token",VGe=()=>"Git 令牌",KGe=()=>"توکن Git",QGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VGe():t==="fa"?KGe():WGe()}),YGe=()=>"Harnesses",XGe=()=>"智能体工具",ZGe=()=>"ابزارهای عامل",JGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XGe():t==="fa"?ZGe():YGe()}),eWe=()=>"hf_…",tWe=()=>"hf_…",nWe=()=>"hf_…",rWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",iWe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",aWe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",oWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"Initialize Git",cWe=()=>"初始化 Git",uWe=()=>"راه‌اندازی Git",dWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),fWe=()=>"Install",hWe=()=>"安装",_We=()=>"نصب",mL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hWe():t==="fa"?_We():fWe()}),pWe=()=>"Install broken",mWe=()=>"安装损坏",gWe=()=>"نصب خراب است",vWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mWe():t==="fa"?gWe():pWe()}),bWe=()=>"Install GitHub CLI",yWe=()=>"安装 GitHub CLI",xWe=()=>"نصب GitHub CLI",wWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yWe():t==="fa"?xWe():bWe()}),SWe=()=>"Install updates automatically",kWe=()=>"自动安装更新",CWe=()=>"نصب خودکار به‌روزرسانی‌ها",TN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),EWe=()=>"Instance history",NWe=()=>"实例历史",zWe=()=>"تاریخچهٔ نمونه‌ها",jWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NWe():t==="fa"?zWe():EWe()}),TWe=()=>"Invalid Token",AWe=()=>"令牌无效",RWe=()=>"توکن نامعتبر",MWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AWe():t==="fa"?RWe():TWe()}),DWe=()=>"Jobs / Dashboard URL",LWe=()=>"Jobs / 控制台网址",OWe=()=>"نشانی Jobs / داشبورد",IWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"kubectl not found",$We=()=>"未找到 kubectl",PWe=()=>"kubectl پیدا نشد",FWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$We():t==="fa"?PWe():BWe()}),HWe=()=>"Latest",qWe=()=>"最新版本",UWe=()=>"جدیدترین",GWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qWe():t==="fa"?UWe():HWe()}),WWe=()=>"Loading…",VWe=()=>"正在加载…",KWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VWe():t==="fa"?KWe():WWe()}),QWe=()=>"Loading Ray settings…",YWe=()=>"正在加载 Ray 设置…",XWe=()=>"در حال بارگیری تنظیمات Ray…",ZWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YWe():t==="fa"?XWe():QWe()}),JWe=()=>"Loading slurm settings…",eVe=()=>"正在加载 Slurm 设置…",tVe=()=>"در حال بارگیری تنظیمات Slurm…",nVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eVe():t==="fa"?tVe():JWe()}),rVe=()=>"Loading status…",sVe=()=>"正在加载状态…",iVe=()=>"در حال بارگیری وضعیت…",aVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sVe():t==="fa"?iVe():rVe()}),oVe=()=>"Local only",lVe=()=>"仅本地",cVe=()=>"فقط محلی",uVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lVe():t==="fa"?cVe():oVe()}),dVe=()=>"Local repository",fVe=()=>"本地仓库",hVe=()=>"مخزن محلی",_Ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fVe():t==="fa"?hVe():dVe()}),pVe=()=>"Login node",mVe=()=>"登录节点",gVe=()=>"گرهٔ ورود",vVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mVe():t==="fa"?gVe():pVe()}),bVe=()=>"Make GitHub syncing the default?",yVe=()=>"将 GitHub 同步设为默认值?",xVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",wVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yVe():t==="fa"?xVe():bVe()}),SVe=()=>"Missing bash/tar",kVe=()=>"缺少 bash/tar",CVe=()=>"bash/tar موجود نیست",EVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kVe():t==="fa"?CVe():SVe()}),NVe=()=>"More compute options",zVe=()=>"更多算力选项",jVe=()=>"گزینه‌های رایانشی بیشتر",TVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zVe():t==="fa"?jVe():NVe()}),AVe=()=>"Move failed:",RVe=()=>"移动失败:",MVe=()=>"انتقال ناموفق بود:",DVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RVe():t==="fa"?MVe():AVe()}),LVe=()=>"Moved. orx is now using the new location.",OVe=()=>"已移动。orx 现在使用新位置。",IVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",BVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OVe():t==="fa"?IVe():LVe()}),$Ve=()=>"Namespace",PVe=()=>"命名空间",FVe=()=>"فضای نام",HVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PVe():t==="fa"?FVe():$Ve()}),qVe=()=>"New location",UVe=()=>"新位置",GVe=()=>"محل جدید",WVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UVe():t==="fa"?GVe():qVe()}),VVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",KVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",QVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",YVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KVe():t==="fa"?QVe():VVe()}),XVe=()=>"New variable key",ZVe=()=>"新变量键名",JVe=()=>"کلید متغیر جدید",eKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZVe():t==="fa"?JVe():XVe()}),tKe=()=>"New variable value",nKe=()=>"新变量值",rKe=()=>"مقدار متغیر جدید",sKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nKe():t==="fa"?rKe():tKe()}),iKe=()=>"No code, prompts, file contents, or account identifiers are sent.",aKe=()=>"不会发送代码、提示词、文件内容或账户标识符。",oKe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",lKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aKe():t==="fa"?oKe():iKe()}),cKe=()=>"No hosts found in ~/.ssh/config.",uKe=()=>"在 ~/.ssh/config 中未找到主机。",dKe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",fKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uKe():t==="fa"?dKe():cKe()}),hKe=()=>"No job-create permission",_Ke=()=>"没有创建 Job 的权限",pKe=()=>"مجوز ساخت Job وجود ندارد",mKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ke():t==="fa"?pKe():hKe()}),gKe=()=>"No Write Permissions",vKe=()=>"无写入权限",bKe=()=>"بدون مجوز نوشتن",yKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vKe():t==="fa"?bKe():gKe()}),xKe=()=>"No key on this computer to register — load a registered key with",wKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",SKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",kKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wKe():t==="fa"?SKe():xKe()}),CKe=()=>"No key on this computer yet — create one with",EKe=()=>"此计算机上还没有密钥——使用以下命令创建:",NKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",zKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EKe():t==="fa"?NKe():CKe()}),jKe=()=>"No Slurm CLI",TKe=()=>"无 Slurm CLI",AKe=()=>"بدون CLI اسلورم",RKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TKe():t==="fa"?AKe():jKe()}),MKe=()=>"None registered",DKe=()=>"未注册任何密钥",LKe=()=>"هیچ‌کدام ثبت نشده",OKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DKe():t==="fa"?LKe():MKe()}),IKe=()=>"Not checked",BKe=()=>"未检查",$Ke=()=>"بررسی نشده",gL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BKe():t==="fa"?$Ke():IKe()}),PKe=()=>"Not configured",FKe=()=>"未配置",HKe=()=>"پیکربندی نشده",nb=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FKe():t==="fa"?HKe():PKe()}),qKe=()=>"Not installed",UKe=()=>"未安装",GKe=()=>"نصب نیست",WKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UKe():t==="fa"?GKe():qKe()}),VKe=()=>"Not now",KKe=()=>"暂不",QKe=()=>"اکنون نه",YKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KKe():t==="fa"?QKe():VKe()}),XKe=()=>"Not on this computer",ZKe=()=>"不在此计算机上",JKe=()=>"روی این رایانه نیست",eQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZKe():t==="fa"?JKe():XKe()}),tQe=()=>"Not set (pass --host per launch)",nQe=()=>"未设置(每次启动时传入 --host)",rQe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",sQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Not signed in",aQe=()=>"未登录",oQe=()=>"وارد نشده",vL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),lQe=()=>"On this computer",cQe=()=>"在此计算机上",uQe=()=>"روی این رایانه",dQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cQe():t==="fa"?uQe():lQe()}),fQe=()=>"Open a project to inspect its repository and GitHub publication state.",hQe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",_Qe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",pQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hQe():t==="fa"?_Qe():fQe()}),mQe=()=>"Open job page",gQe=()=>"打开作业页面",vQe=()=>"باز کردن صفحهٔ کار",AN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gQe():t==="fa"?vQe():mQe()}),bQe=()=>"Open on GitHub",yQe=()=>"在 GitHub 上打开",xQe=()=>"باز کردن در GitHub",RN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yQe():t==="fa"?xQe():bQe()}),wQe=()=>", or create one with",SQe=()=>",或使用以下命令创建:",kQe=()=>"، یا با این فرمان یکی بسازید:",CQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SQe():t==="fa"?kQe():wQe()}),EQe=()=>"Org",NQe=()=>"组织",zQe=()=>"سازمان",jQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"Orgs",AQe=()=>"组织",RQe=()=>"سازمان‌ها",MQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),DQe=()=>"orx can't update this install",LQe=()=>"orx 无法更新此安装",OQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",IQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LQe():t==="fa"?OQe():DQe()}),BQe=()=>"Overleaf",$Qe=()=>"Overleaf",PQe=()=>"Overleaf",bL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),FQe=()=>"Overleaf Git authentication token",HQe=()=>"Overleaf Git 身份验证令牌",qQe=()=>"توکن احراز هویت Git در Overleaf",UQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HQe():t==="fa"?qQe():FQe()}),GQe=()=>"Overridden by env",WQe=()=>"已被环境变量覆盖",VQe=()=>"بازنویسی‌شده توسط محیط",KQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WQe():t==="fa"?VQe():GQe()}),QQe=()=>"Partition",YQe=()=>"分区",XQe=()=>"پارتیشن",ZQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YQe():t==="fa"?XQe():QQe()}),JQe=()=>"Path",eYe=()=>"路径",tYe=()=>"مسیر",nYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eYe():t==="fa"?tYe():JQe()}),rYe=()=>"Plan",sYe=()=>"方案",iYe=()=>"سطح اشتراک",aYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sYe():t==="fa"?iYe():rYe()}),oYe=()=>"Project",lYe=()=>"项目",cYe=()=>"پروژه",uYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lYe():t==="fa"?cYe():oYe()}),dYe=()=>"Ray version",fYe=()=>"Ray 版本",hYe=()=>"نسخهٔ Ray",_Ye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),pYe=()=>"Reachable",mYe=()=>"可访问",gYe=()=>"در دسترس",vYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mYe():t==="fa"?gYe():pYe()}),bYe=()=>"Reading ~/.ssh/config…",yYe=()=>"正在读取 ~/.ssh/config…",xYe=()=>"در حال خواندن ‎~/.ssh/config…",yL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yYe():t==="fa"?xYe():bYe()}),wYe=()=>"Ready",SYe=()=>"就绪",kYe=()=>"آماده",Yp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),CYe=()=>"Ready to move",EYe=()=>"可以移动",NYe=()=>"آمادهٔ انتقال",zYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EYe():t==="fa"?NYe():CYe()}),jYe=()=>"Configured",TYe=()=>"已配置",AYe=()=>"پیکربندی‌شده",_6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),RYe=()=>"Refresh",MYe=()=>"刷新",DYe=()=>"تازه‌سازی",Xp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MYe():t==="fa"?DYe():RYe()}),LYe=()=>"Remotes",OYe=()=>"远程仓库",IYe=()=>"مخزن‌های دوردست",BYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OYe():t==="fa"?IYe():LYe()}),$Ye=()=>"Repository",PYe=()=>"仓库",FYe=()=>"مخزن",HYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PYe():t==="fa"?FYe():$Ye()}),qYe=()=>"Repository topics",UYe=()=>"仓库 topic",GYe=()=>"موضوع‌های مخزن",S1=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UYe():t==="fa"?GYe():qYe()}),WYe=()=>"Restart to finish updating",VYe=()=>"重新启动以完成更新",KYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",QYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VYe():t==="fa"?KYe():WYe()}),YYe=()=>"Running instances",XYe=()=>"正在运行的实例",ZYe=()=>"نمونه‌های در حال اجرا",JYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),eXe=()=>"Runtime",tXe=()=>"运行时间",nXe=()=>"زمان اجرا",rXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>". Save it under that key if it's meant for HF Jobs.",iXe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",aXe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",oXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>"Session cookie",cXe=()=>"会话 cookie",uXe=()=>"کوکی نشست",dXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),fXe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",hXe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",_Xe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",pXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hXe():t==="fa"?_Xe():fXe()}),mXe=()=>"Settings",gXe=()=>"设置",vXe=()=>"تنظیمات",p6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gXe():t==="fa"?vXe():mXe()}),bXe=()=>"Signed in",yXe=()=>"已登录",xXe=()=>"وارد شده",wXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yXe():t==="fa"?xXe():bXe()}),SXe=()=>"Source",kXe=()=>"来源",CXe=()=>"منبع",xL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kXe():t==="fa"?CXe():SXe()}),EXe=()=>"SSH Key",NXe=()=>"SSH 密钥",zXe=()=>"کلید SSH",jXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NXe():t==="fa"?zXe():EXe()}),TXe=()=>"Started",AXe=()=>"开始时间",RXe=()=>"آغاز",MXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),DXe=()=>"State",LXe=()=>"状态",OXe=()=>"وضعیت",IXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LXe():t==="fa"?OXe():DXe()}),BXe=()=>"Status",$Xe=()=>"状态",PXe=()=>"وضعیت",l_=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),FXe=()=>"Storage",HXe=()=>"存储",qXe=()=>"ذخیره‌سازی",UXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HXe():t==="fa"?qXe():FXe()}),GXe=()=>"Sync",WXe=()=>"同步",VXe=()=>"همگام‌سازی",KXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"Syncing off",YXe=()=>"同步已关闭",XXe=()=>"همگام‌سازی خاموش",ZXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Test connection",eZe=()=>"测试连接",tZe=()=>"آزمایش اتصال",nZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Testing…",sZe=()=>"正在测试…",iZe=()=>"در حال آزمایش…",aZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),oZe=()=>", then add it with",lZe=()=>",然后使用以下命令添加:",cZe=()=>"، سپس با این فرمان اضافه‌اش کنید:",uZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lZe():t==="fa"?cZe():oZe()}),dZe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",fZe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",hZe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",_Ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fZe():t==="fa"?hZe():dZe()}),pZe=()=>"This saved destination is not configured. Set it up below or choose another backend.",mZe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",gZe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",vZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mZe():t==="fa"?gZe():pZe()}),bZe=()=>"This value looks like a Hugging Face token — compute runs only read it from",yZe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",xZe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",wZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yZe():t==="fa"?xZe():bZe()}),SZe=()=>"Time limit",kZe=()=>"时间限制",CZe=()=>"محدودیت زمانی",EZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Unable to verify",zZe=()=>"无法验证",jZe=()=>"تأیید ممکن نیست",D4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),TZe=()=>"Unknown",AZe=()=>"未知",RZe=()=>"نامشخص",wL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AZe():t==="fa"?RZe():TZe()}),MZe=()=>"Update required",DZe=()=>"需要更新",LZe=()=>"نیازمند به‌روزرسانی",OZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DZe():t==="fa"?LZe():MZe()}),IZe=()=>"Updates",BZe=()=>"更新",$Ze=()=>"به‌روزرسانی‌ها",MN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BZe():t==="fa"?$Ze():IZe()}),PZe=()=>"Usage analytics",FZe=()=>"使用情况分析",HZe=()=>"تحلیل استفاده",qZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FZe():t==="fa"?HZe():PZe()}),UZe=()=>"value",GZe=()=>"值",WZe=()=>"مقدار",SL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GZe():t==="fa"?WZe():UZe()}),VZe=()=>"Variables available to runs and the research agent (API keys, tokens).",KZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",QZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",YZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KZe():t==="fa"?QZe():VZe()}),XZe=()=>"Version",ZZe=()=>"版本",JZe=()=>"نسخه",kL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZe():t==="fa"?JZe():XZe()}),eJe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",tJe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",nJe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",rJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tJe():t==="fa"?nJe():eJe()}),sJe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",iJe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",aJe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",oJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iJe():t==="fa"?aJe():sJe()}),lJe=()=>"Pick a login node first",cJe=()=>"请先选择登录节点",uJe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",dJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cJe():t==="fa"?uJe():lJe()}),fJe=()=>"Providers",hJe=()=>"提供商",_Je=()=>"ارائه‌دهندگان",pJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hJe():t==="fa"?_Je():fJe()}),mJe=()=>"Reconnect",gJe=()=>"重新连接",vJe=()=>"اتصال دوباره",CL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gJe():t==="fa"?vJe():mJe()}),bJe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yJe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,xJe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,wJe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?yJe(e):t==="fa"?xJe(e):bJe(e)}),SJe=()=>"Reinstall with the orx installer to get automatic updates.",kJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",CJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",EJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kJe():t==="fa"?CJe():SJe()}),NJe=()=>"Re-link",zJe=()=>"重新链接",jJe=()=>"پیوند دوباره",TJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zJe():t==="fa"?jJe():NJe()}),AJe=()=>"Remove cookie",RJe=()=>"移除 cookie",MJe=()=>"حذف کوکی",DJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RJe():t==="fa"?MJe():AJe()}),LJe=()=>"Remove token",OJe=()=>"移除令牌",IJe=()=>"حذف توکن",BJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OJe():t==="fa"?IJe():LJe()}),$Je=()=>"Removing…",PJe=()=>"正在移除…",FJe=()=>"در حال حذف…",DN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PJe():t==="fa"?FJe():$Je()}),HJe=()=>"Replace anyway",qJe=()=>"仍要替换",UJe=()=>"به‌هرحال جایگزین کن",GJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qJe():t==="fa"?UJe():HJe()}),WJe=()=>"Replace key",VJe=()=>"替换密钥",KJe=()=>"جایگزینی کلید",QJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJe():t==="fa"?KJe():WJe()}),YJe=()=>"Replace token",XJe=()=>"替换令牌",ZJe=()=>"جایگزینی توکن",JJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XJe():t==="fa"?ZJe():YJe()}),eet=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,tet=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,net=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,ret=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tet(e):t==="fa"?net(e):eet(e)}),set=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,iet=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,aet=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,oet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iet(e):t==="fa"?aet(e):set(e)}),cet=()=>"Run `gh auth login` in your terminal.",uet=()=>"请在终端中运行 `gh auth login`。",det=()=>"در پایانه `gh auth login` را اجرا کنید.",fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uet():t==="fa"?det():cet()}),het=()=>"Saved",_et=()=>"已保存",pet=()=>"ذخیره شده",LN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_et():t==="fa"?pet():het()}),met=()=>"Set up",get=()=>"设置",vet=()=>"راه‌اندازی",bet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?get():t==="fa"?vet():met()}),yet=()=>"Set up SSH key",xet=()=>"设置 SSH 密钥",wet=()=>"راه‌اندازی کلید SSH",ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"Sign in",Eet=()=>"登录",Net=()=>"ورود",EL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),zet=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,jet=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Tet=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,NL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jet(e):t==="fa"?Tet(e):zet(e)}),Aet=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Ret=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Met=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Det=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ret():t==="fa"?Met():Aet()}),Let=()=>"The terminal disconnected before setup completed. Try again.",Oet=()=>"设置完成前终端连接已断开。请重试。",Iet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",ON=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oet():t==="fa"?Iet():Let()}),Bet=()=>"Dark",$et=()=>"深色",Pet=()=>"تیره",Fet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$et():t==="fa"?Pet():Bet()}),Het=()=>"Theme",qet=()=>"主题",Uet=()=>"پوسته",IN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qet():t==="fa"?Uet():Het()}),Get=()=>"Light",Wet=()=>"浅色",Vet=()=>"روشن",Ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wet():t==="fa"?Vet():Get()}),Qet=()=>"System",Yet=()=>"系统",Xet=()=>"سیستم",Zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=()=>"Set up billing in the Tinker console",ett=()=>"在 Tinker 控制台设置账单",ttt=()=>"تنظیم پرداخت در کنسول Tinker",ntt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ett():t==="fa"?ttt():Jet()}),rtt=()=>"Billing setup required",stt=()=>"需要设置账单",itt=()=>"تنظیم پرداخت لازم است",att=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",ltt=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",ctt=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",utt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"Invalid Key",ftt=()=>"密钥无效",htt=()=>"کلید نامعتبر",_tt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Token from",mtt=()=>"令牌来自",gtt=()=>"توکن از",vtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),btt=()=>"Update now",ytt=()=>"立即更新",xtt=()=>"اکنون به‌روزرسانی کن",wtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ytt():t==="fa"?xtt():btt()}),Stt=e=>`Update to ${e==null?void 0:e.version}`,ktt=e=>`更新到 ${e==null?void 0:e.version}`,Ctt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Ett=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ktt(e):t==="fa"?Ctt(e):Stt(e)}),Ntt=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",ztt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",jtt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Ttt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ztt():t==="fa"?jtt():Ntt()}),Att=()=>"Updating default destination…",Rtt=()=>"正在更新默认运行位置…",Mtt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Dtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rtt():t==="fa"?Mtt():Att()}),Ltt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",Ott=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Itt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Btt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ott():t==="fa"?Itt():Ltt()}),$tt=()=>"Validating…",Ptt=()=>"正在验证…",Ftt=()=>"در حال اعتبارسنجی…",zL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ptt():t==="fa"?Ftt():$tt()}),Htt=()=>"View settings",qtt=()=>"查看设置",Utt=()=>"مشاهدهٔ تنظیمات",Gtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qtt():t==="fa"?Utt():Htt()}),Wtt=()=>"Skill",Vtt=()=>"技能",Ktt=()=>"مهارت",Qtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vtt():t==="fa"?Ktt():Wtt()}),Ytt=()=>"Loading skill…",Xtt=()=>"正在加载技能…",Ztt=()=>"در حال بارگیری مهارت…",Jtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xtt():t==="fa"?Ztt():Ytt()}),ent=()=>"Personal",tnt=()=>"个人",nnt=()=>"شخصی",rnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Alternatively, tell your agent to save a reusable skill for you.",int=()=>"或者,请你的智能体为你保存可重复使用的技能。",ant=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",ont=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,cnt=e=>`删除技能“${e==null?void 0:e.name}”?`,unt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,dnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cnt(e):t==="fa"?unt(e):lnt(e)}),fnt=e=>`Delete skill ${e==null?void 0:e.name}`,hnt=e=>`删除技能 ${e==null?void 0:e.name}`,_nt=e=>`حذف مهارت ${e==null?void 0:e.name}`,pnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hnt(e):t==="fa"?_nt(e):fnt(e)}),mnt=e=>`Delete the “${e==null?void 0:e.name}” template?`,gnt=e=>`删除模板“${e==null?void 0:e.name}”?`,vnt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,bnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gnt(e):t==="fa"?vnt(e):mnt(e)}),ynt=e=>`Delete template ${e==null?void 0:e.name}`,xnt=e=>`删除模板 ${e==null?void 0:e.name}`,wnt=e=>`حذف قالب ${e==null?void 0:e.name}`,Snt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xnt(e):t==="fa"?wnt(e):ynt(e)}),knt=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",Cnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Ent=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Nnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cnt():t==="fa"?Ent():knt()}),znt=()=>"Drop a SKILL.md or .zip here, or click to choose",jnt=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Tnt=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Ant=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jnt():t==="fa"?Tnt():znt()}),Rnt=()=>"Drop a .tex or .zip here, or click to choose",Mnt=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Dnt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Lnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mnt():t==="fa"?Dnt():Rnt()}),Ont=()=>"File too large (max 20 MB).",Int=()=>"文件过大(最大 20 MB)。",Bnt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",jL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Int():t==="fa"?Bnt():Ont()}),$nt=()=>" + 1 file",Pnt=()=>" + 1 个文件",Fnt=()=>" + ۱ فایل",Hnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pnt():t==="fa"?Fnt():$nt()}),qnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Unt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Gnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Wnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Remove from OpenResearch",Knt=()=>"从 OpenResearch 移除",Qnt=()=>"حذف از OpenResearch",Ynt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,Znt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,Jnt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,ert=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Znt(e):t==="fa"?Jnt(e):Xnt(e)}),trt=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,nrt=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,rrt=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,srt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nrt(e):t==="fa"?rrt(e):trt(e)}),irt=e=>` + ${e==null?void 0:e.count} files`,art=e=>` + ${e==null?void 0:e.count} 个文件`,ort=e=>` + ${e==null?void 0:e.count} فایل`,lrt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?art(e):t==="fa"?ort(e):irt(e)}),crt=()=>"Could not load skills:",urt=()=>"无法加载技能:",drt=()=>"بارگیری مهارت‌ها ممکن نشد:",frt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?urt():t==="fa"?drt():crt()}),hrt=()=>"Could not load templates:",_rt=()=>"无法加载模板:",prt=()=>"بارگیری قالب‌ها ممکن نشد:",mrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"Customize",vrt=()=>"自定义",brt=()=>"سفارشی‌سازی",yrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"Delete skill",wrt=()=>"删除技能",Srt=()=>"حذف مهارت",krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Delete template",Ert=()=>"删除模板",Nrt=()=>"حذف قالب",zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"LaTeX templates",Trt=()=>"LaTeX 模板",Art=()=>"قالب‌های LaTeX",Rrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"Loading skills…",Drt=()=>"正在加载技能…",Lrt=()=>"در حال بارگیری مهارت‌ها…",Ort=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Loading templates…",Brt=()=>"正在加载模板…",$rt=()=>"در حال بارگیری قالب‌ها…",Prt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"No skills yet.",Hrt=()=>"尚无技能。",qrt=()=>"هنوز مهارتی وجود ندارد.",Urt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"No templates yet.",Wrt=()=>"尚无模板。",Vrt=()=>"هنوز قالبی وجود ندارد.",Krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"Skills",Yrt=()=>"技能",Xrt=()=>"مهارت‌ها",Zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Uploading…",est=()=>"正在上传…",tst=()=>"در حال بارگذاری…",nst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",sst=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",ist=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ast=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"Upload a SKILL.md file or a .zip of a skill folder.",lst=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",cst=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",ust=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Upload a .tex file or a .zip of a template folder.",fst=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",hst=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",_st=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),pst=()=>"Close SSH config",mst=()=>"关闭 SSH 配置",gst=()=>"بستن پیکربندی SSH",vst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mst():t==="fa"?gst():pst()}),bst=()=>"Discard your unsaved SSH config changes?",yst=()=>"要放弃未保存的 SSH 配置更改吗?",xst=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",wst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yst():t==="fa"?xst():bst()}),Sst=()=>"Loading SSH config…",kst=()=>"正在加载 SSH 配置…",Cst=()=>"در حال بارگیری پیکربندی SSH…",Est=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kst():t==="fa"?Cst():Sst()}),Nst=()=>"SSH config saved",zst=()=>"SSH 配置已保存",jst=()=>"پیکربندی SSH ذخیره شد",Tst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zst():t==="fa"?jst():Nst()}),Ast=()=>"SSH config",Rst=()=>"SSH 配置",Mst=()=>"پیکربندی SSH",Dst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rst():t==="fa"?Mst():Ast()}),Lst=()=>"Configure SSH hosts…",Ost=()=>"配置 SSH 主机…",Ist=()=>"پیکربندی میزبان‌های SSH…",TL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ost():t==="fa"?Ist():Lst()}),Bst=()=>"Cancelled",$st=()=>"已取消",Pst=()=>"لغوشده",Fst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$st():t==="fa"?Pst():Bst()}),Hst=()=>"Cancelling",qst=()=>"正在取消",Ust=()=>"در حال لغو",Gst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Done",Vst=()=>"已完成",Kst=()=>"انجام‌شده",Qst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Editing",Xst=()=>"正在编辑",Zst=()=>"در حال ویرایش",Jst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=()=>"Failed",tit=()=>"失败",nit=()=>"ناموفق",rit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tit():t==="fa"?nit():eit()}),sit=()=>"Idle",iit=()=>"空闲",ait=()=>"بی‌کار",oit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iit():t==="fa"?ait():sit()}),lit=()=>"Running",cit=()=>"运行中",uit=()=>"در حال اجرا",dit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Starting",hit=()=>"正在启动",_it=()=>"در حال آغاز",pit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Copying…",git=()=>"正在复制…",vit=()=>"در حال کپی…",bit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>"Finalizing…",xit=()=>"正在完成…",wit=()=>"در حال نهایی‌سازی…",Sit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=e=>`${e==null?void 0:e.size} free at target`,Cit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,Eit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,Nit=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Cit(e):t==="fa"?Eit(e):kit(e)}),zit=e=>`Move all orx data to: +رونوشت آن برای همیشه حذف خواهد شد.`,Qie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vie(e):t==="fa"?Kie(e):Wie(e)}),Yie=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Xie=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Zie=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Jie=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xie(e):t==="fa"?Zie(e):Yie(e)}),eae=()=>"Could not exit Plan mode. Try again.",tae=()=>"无法退出计划模式。请重试。",nae=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",rae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Expand tool activity",iae=()=>"展开工具活动",aae=()=>"باز کردن فعالیت ابزارها",oae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),lae=()=>"experiments",cae=()=>"实验",uae=()=>"آزمایش‌ها",dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cae():t==="fa"?uae():lae()}),fae=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,hae=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,_ae=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,pae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hae(e):t==="fa"?_ae(e):fae(e)}),mae=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,gae=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,vae=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,bae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gae(e):t==="fa"?vae(e):mae(e)}),yae=e=>`Message not sent: ${e==null?void 0:e.error}`,xae=e=>`消息未发送:${e==null?void 0:e.error}`,wae=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,Sae=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xae(e):t==="fa"?wae(e):yae(e)}),kae=()=>"Model unavailable",Cae=()=>"模型不可用",Eae=()=>"مدل در دسترس نیست",Nae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cae():t==="fa"?Eae():kae()}),zae=()=>"New session",jae=()=>"新会话",Tae=()=>"نشست جدید",hE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jae():t==="fa"?Tae():zae()}),Aae=()=>"No active sessions",Rae=()=>"没有活跃会话",Mae=()=>"نشست فعالی وجود ندارد",Dae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"No activity",Oae=()=>"无活动",Iae=()=>"بدون فعالیت",Bae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oae():t==="fa"?Iae():Lae()}),$ae=()=>"No archived sessions",Pae=()=>"没有已归档的会话",Fae=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Hae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pae():t==="fa"?Fae():$ae()}),qae=()=>"No sessions yet",Uae=()=>"还没有会话",Gae=()=>"هنوز نشستی وجود ندارد",Wae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uae():t==="fa"?Gae():qae()}),Vae=()=>"1 annotation",Kae=()=>"1 条批注",Qae=()=>"۱ یادداشت",Yae=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kae():t==="fa"?Qae():Vae()}),Xae=()=>"Open sub-agent transcript",Zae=()=>"打开子智能体记录",Jae=()=>"باز کردن متن گفت‌وگوی عامل فرعی",eoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zae():t==="fa"?Jae():Xae()}),toe=()=>"About this demo",noe=()=>"关于此演示",roe=()=>"دربارهٔ این نسخهٔ نمایشی",_E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?noe():t==="fa"?roe():toe()}),soe=()=>"Accept and auto mode",ioe=()=>"接受并使用自动模式",aoe=()=>"پذیرش و حالت خودکار",ooe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ioe():t==="fa"?aoe():soe()}),loe=()=>"Accept and bypass all",coe=()=>"接受并跳过所有审批",uoe=()=>"پذیرش و عبور از همهٔ تأییدها",doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?coe():t==="fa"?uoe():loe()}),foe=()=>"Active",hoe=()=>"活跃",_oe=()=>"فعال",poe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hoe():t==="fa"?_oe():foe()}),moe=()=>"All",goe=()=>"全部",voe=()=>"همه",boe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?goe():t==="fa"?voe():moe()}),yoe=()=>"Allow",xoe=()=>"允许",woe=()=>"اجازه دادن",Soe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xoe():t==="fa"?woe():yoe()}),koe=()=>"Approval required",Coe=()=>"需要批准",Eoe=()=>"نیازمند تأیید",Noe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Archived",joe=()=>"已归档",Toe=()=>"بایگانی‌شده",pE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Aoe=()=>"Ask about this",Roe=()=>"询问此内容",Moe=()=>"دربارهٔ این بپرسید",Doe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Roe():t==="fa"?Moe():Aoe()}),Loe=()=>"Attach a PDF or image",Ooe=()=>"附加 PDF 或图片",Ioe=()=>"پیوست PDF یا تصویر",mE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ooe():t==="fa"?Ioe():Loe()}),Boe=()=>"Bash",$oe=()=>"Bash",Poe=()=>"Bash",wD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$oe():t==="fa"?Poe():Boe()}),Foe=()=>"Browsed the web",Hoe=()=>"已浏览网页",qoe=()=>"وب مرور شد",gE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hoe():t==="fa"?qoe():Foe()}),Uoe=()=>"Built the project",Goe=()=>"已构建项目",Woe=()=>"پروژه ساخته شد",Voe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Goe():t==="fa"?Woe():Uoe()}),Koe=()=>"Cancel",Qoe=()=>"取消",Yoe=()=>"لغو",Xoe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qoe():t==="fa"?Yoe():Koe()}),Zoe=()=>"Cancelled an experiment run",Joe=()=>"已取消实验运行",ele=()=>"اجرای آزمایش لغو شد",tle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Joe():t==="fa"?ele():Zoe()}),nle=()=>"Checked code style",rle=()=>"已检查代码风格",sle=()=>"سبک کد بررسی شد",ile=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rle():t==="fa"?sle():nle()}),ale=()=>"Checked compute options",ole=()=>"已检查算力选项",lle=()=>"گزینه‌های رایانشی بررسی شد",cle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ole():t==="fa"?lle():ale()}),ule=()=>"Checked experiment status",dle=()=>"已检查实验状态",fle=()=>"وضعیت آزمایش بررسی شد",vE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dle():t==="fa"?fle():ule()}),hle=()=>"Checked Git status",_le=()=>"已检查 Git 状态",ple=()=>"وضعیت Git بررسی شد",mle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_le():t==="fa"?ple():hle()}),gle=()=>"Checked local times",vle=()=>"已查询当地时间",ble=()=>"زمان‌های محلی بررسی شد",yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vle():t==="fa"?ble():gle()}),xle=()=>"Checked market data",wle=()=>"已查询市场数据",Sle=()=>"داده‌های بازار بررسی شد",kle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wle():t==="fa"?Sle():xle()}),Cle=()=>"Checked sports data",Ele=()=>"已查询体育数据",Nle=()=>"داده‌های ورزشی بررسی شد",zle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ele():t==="fa"?Nle():Cle()}),jle=()=>"Checked the weather",Tle=()=>"已查询天气",Ale=()=>"آب‌وهوا بررسی شد",Rle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tle():t==="fa"?Ale():jle()}),Mle=()=>"Checked types",Dle=()=>"已检查类型",Lle=()=>"نوع‌ها بررسی شد",Ole=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dle():t==="fa"?Lle():Mle()}),Ile=()=>"Clear annotations",Ble=()=>"清除批注",$le=()=>"پاک کردن یادداشت‌ها",bE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ble():t==="fa"?$le():Ile()}),Ple=()=>"Customize",Fle=()=>"自定义",Hle=()=>"سفارشی‌سازی",qle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fle():t==="fa"?Hle():Ple()}),Ule=()=>"Data sources",Gle=()=>"数据源",Wle=()=>"منابع داده",w2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gle():t==="fa"?Wle():Ule()}),Vle=()=>"Delegated a task to a new agent",Kle=()=>"已将任务委派给新智能体",Qle=()=>"وظیفه به عامل جدید واگذار شد",Yle=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kle():t==="fa"?Qle():Vle()}),Xle=()=>"Delete",Zle=()=>"删除",Jle=()=>"حذف",SD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zle():t==="fa"?Jle():Xle()}),ece=()=>"Deny",tce=()=>"拒绝",nce=()=>"رد کردن",rce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tce():t==="fa"?nce():ece()}),sce=()=>"Edit and re-send",ice=()=>"编辑并重新发送",ace=()=>"ویرایش و ارسال دوباره",yE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ice():t==="fa"?ace():sce()}),oce=()=>"Edit message",lce=()=>"编辑消息",cce=()=>"ویرایش پیام",uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),dce=()=>"Edited a file",fce=()=>"已编辑文件",hce=()=>"فایل ویرایش شد",xE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fce():t==="fa"?hce():dce()}),_ce=()=>"Exit Bash mode",pce=()=>"退出 Bash 模式",mce=()=>"خروج از حالت Bash",wE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pce():t==="fa"?mce():_ce()}),gce=()=>"Exit Plan mode",vce=()=>"退出计划模式",bce=()=>"خروج از حالت طرح",SE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vce():t==="fa"?bce():gce()}),yce=()=>"Failed:",xce=()=>"失败:",wce=()=>"ناموفق:",n6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xce():t==="fa"?wce():yce()}),Sce=()=>"Filter sessions",kce=()=>"筛选会话",Cce=()=>"فیلتر نشست‌ها",kE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"is unavailable.",Nce=()=>"不可用。",zce=()=>"در دسترس نیست.",jce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Later queued messages will wait until this is retried or removed.",Ace=()=>"后续排队的消息会等待此消息重试或移除。",Rce=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Mce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Dce=()=>"Listed files",Lce=()=>"已列出文件",Oce=()=>"فایل‌ها فهرست شد",CE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lce():t==="fa"?Oce():Dce()}),Ice=()=>"Listed project runs",Bce=()=>"已列出项目运行",$ce=()=>"اجراهای پروژه فهرست شد",Pce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Fce=()=>"Listed projects",Hce=()=>"已列出项目",qce=()=>"پروژه‌ها فهرست شد",Uce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hce():t==="fa"?qce():Fce()}),Gce=()=>"Loading conversation…",Wce=()=>"正在加载对话…",Vce=()=>"در حال بارگیری گفتگو…",Kce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wce():t==="fa"?Vce():Gce()}),Qce=()=>"New Chat",Yce=()=>"新对话",Xce=()=>"گفتگوی جدید",Zce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yce():t==="fa"?Xce():Qce()}),Jce=()=>"Next version",eue=()=>"下一版本",tue=()=>"نسخهٔ بعدی",EE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),nue=()=>"Open the session this agent spawned",rue=()=>"打开此智能体创建的会话",sue=()=>"باز کردن نشست ساخته‌شده توسط این عامل",iue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Opened web pages",oue=()=>"已打开网页",lue=()=>"صفحه‌های وب باز شد",cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Plan",due=()=>"计划",fue=()=>"طرح",hue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?due():t==="fa"?fue():uue()}),_ue=()=>"Plan approved",pue=()=>"计划已批准",mue=()=>"طرح تأیید شد",gue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pue():t==="fa"?mue():_ue()}),vue=()=>"Plan rejected",bue=()=>"计划已拒绝",yue=()=>"طرح رد شد",xue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bue():t==="fa"?yue():vue()}),wue=()=>"Plan resolved",Sue=()=>"计划已处理",kue=()=>"طرح تعیین تکلیف شد",Cue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sue():t==="fa"?kue():wue()}),Eue=()=>"Plan revision requested",Nue=()=>"已请求修改计划",zue=()=>"درخواست بازنگری طرح ثبت شد",jue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Nue():t==="fa"?zue():Eue()}),Tue=()=>"Previous version",Aue=()=>"上一版本",Rue=()=>"نسخهٔ قبلی",NE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aue():t==="fa"?Rue():Tue()}),Mue=()=>"Ran a command",Due=()=>"已运行命令",Lue=()=>"فرمان اجرا شد",Oue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Due():t==="fa"?Lue():Mue()}),Iue=()=>"Ran tests",Bue=()=>"已运行测试",$ue=()=>"آزمون‌ها اجرا شد",Pue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bue():t==="fa"?$ue():Iue()}),Fue=()=>"Read a file",Hue=()=>"已读取文件",que=()=>"فایل خوانده شد",Uue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hue():t==="fa"?que():Fue()}),Gue=()=>"Read Git history",Wue=()=>"已读取 Git 历史",Vue=()=>"تاریخچهٔ Git خوانده شد",Kue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wue():t==="fa"?Vue():Gue()}),Que=()=>"Read project details",Yue=()=>"已读取项目详情",Xue=()=>"جزئیات پروژه خوانده شد",Zue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yue():t==="fa"?Xue():Que()}),Jue=()=>"Reject",ede=()=>"拒绝",tde=()=>"رد کردن",nde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ede():t==="fa"?tde():Jue()}),rde=()=>"Remove",sde=()=>"移除",ide=()=>"حذف",ade=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"Remove annotation",lde=()=>"移除批注",cde=()=>"حذف یادداشت",ude=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),dde=()=>"Remove file",fde=()=>"移除文件",hde=()=>"حذف فایل",zE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),_de=()=>"Remove image",pde=()=>"移除图片",mde=()=>"حذف تصویر",jE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),gde=()=>"Remove queued message",vde=()=>"移除排队消息",bde=()=>"حذف پیام صف",TE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vde():t==="fa"?bde():gde()}),yde=()=>"Rename",xde=()=>"重命名",wde=()=>"تغییر نام",kD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xde():t==="fa"?wde():yde()}),Sde=()=>"Reviewed code changes",kde=()=>"已审查代码更改",Cde=()=>"تغییرات کد بازبینی شد",Ede=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Nde=()=>"Run",zde=()=>"运行",jde=()=>"اجرا",AE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zde():t==="fa"?jde():Nde()}),Tde=()=>"Selected chat text",Ade=()=>"已选聊天文本",Rde=()=>"متن انتخاب‌شدهٔ گفتگو",Mde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Dde=()=>"Selected text:",Lde=()=>"已选文本:",Ode=()=>"متن انتخاب‌شده:",Ide=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Send",$de=()=>"发送",Pde=()=>"ارسال",N4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"Session options",Hde=()=>"会话选项",qde=()=>"گزینه‌های نشست",RE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hde():t==="fa"?qde():Fde()}),Ude=()=>"Session title",Gde=()=>"会话标题",Wde=()=>"عنوان نشست",Vde=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gde():t==="fa"?Wde():Ude()}),Kde=()=>"Show sidebar",Qde=()=>"显示侧边栏",Yde=()=>"نمایش نوار کناری",ME=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qde():t==="fa"?Yde():Kde()}),Xde=()=>"Started an experiment run",Zde=()=>"已启动实验运行",Jde=()=>"اجرای آزمایش آغاز شد",efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zde():t==="fa"?Jde():Xde()}),tfe=()=>"Reading the project to suggest where to start…",nfe=()=>"正在阅读项目以建议从哪里开始…",rfe=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",sfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nfe():t==="fa"?rfe():tfe()}),ife=()=>"Starter prompts",afe=()=>"入门提示",ofe=()=>"پیشنهادهای شروع",lfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?afe():t==="fa"?ofe():ife()}),cfe=()=>"Stop",ufe=()=>"停止",dfe=()=>"توقف",DE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ufe():t==="fa"?dfe():cfe()}),ffe=()=>"Submit",hfe=()=>"提交",_fe=()=>"ارسال",pfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hfe():t==="fa"?_fe():ffe()}),mfe=()=>"Tool failed",gfe=()=>"工具失败",vfe=()=>"ابزار ناموفق بود",bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gfe():t==="fa"?vfe():mfe()}),yfe=()=>"Used tools",xfe=()=>"已使用工具",wfe=()=>"ابزارها استفاده شد",CD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xfe():t==="fa"?wfe():yfe()}),Sfe=()=>"View full plan",kfe=()=>"查看完整计划",Cfe=()=>"مشاهدهٔ طرح کامل",Efe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kfe():t==="fa"?Cfe():Sfe()}),Nfe=()=>"Waited for an experiment run",zfe=()=>"已等待实验运行",jfe=()=>"برای اجرای آزمایش صبر شد",Tfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zfe():t==="fa"?jfe():Nfe()}),Afe=()=>"Waiting for your input…",Rfe=()=>"正在等待你的输入…",Mfe=()=>"منتظر ورودی شما…",Dfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rfe():t==="fa"?Mfe():Afe()}),Lfe=()=>"What should we research?",Ofe=()=>"我们应该研究什么?",Ife=()=>"چه چیزی را پژوهش کنیم؟",Bfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ofe():t==="fa"?Ife():Lfe()}),$fe=()=>"You, mid-task",Pfe=()=>"你(任务进行中)",Ffe=()=>"شما، هنگام انجام وظیفه",Hfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pfe():t==="fa"?Ffe():$fe()}),qfe=()=>"Pasted image",Ufe=()=>"粘贴的图片",Gfe=()=>"تصویر جای‌گذاری‌شده",Wfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ufe():t==="fa"?Gfe():qfe()}),Vfe=()=>"Plan",Kfe=()=>"计划",Qfe=()=>"طرح",ED=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kfe():t==="fa"?Qfe():Vfe()}),Yfe=()=>"Plan mode — ready to proceed?",Xfe=()=>"计划模式 — 准备好继续了吗?",Zfe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Jfe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),ehe=()=>"Proposed plan",the=()=>"提议的计划",nhe=()=>"طرح پیشنهادی",LE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),rhe=()=>"Question",she=()=>"问题",ihe=()=>"پرسش",ahe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?she():t==="fa"?ihe():rhe()}),ohe=()=>"Queued",lhe=()=>"已排队",che=()=>"در صف",uhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lhe():t==="fa"?che():ohe()}),dhe=()=>"Recents",fhe=()=>"最近",hhe=()=>"اخیر",ND=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fhe():t==="fa"?hhe():dhe()}),_he=()=>"Re-check its setup.",phe=()=>"请重新检查其设置。",mhe=()=>"راه‌اندازی آن را دوباره بررسی کنید.",ghe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?phe():t==="fa"?mhe():_he()}),vhe=()=>"Could not recover this turn. Try again.",bhe=()=>"无法恢复本轮。请重试。",yhe=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bhe():t==="fa"?yhe():vhe()}),whe=()=>"Could not remove the queued message. Try again.",She=()=>"无法移除排队消息。请重试。",khe=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Che=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?She():t==="fa"?khe():whe()}),Ehe=e=>`Could not re-send: ${e==null?void 0:e.error}`,Nhe=e=>`无法重新发送:${e==null?void 0:e.error}`,zhe=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,jhe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nhe(e):t==="fa"?zhe(e):Ehe(e)}),The=()=>"Resolved",Ahe=()=>"已处理",Rhe=()=>"رسیدگی شد",Mhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ahe():t==="fa"?Rhe():The()}),Dhe=()=>"Could not retry the queued message. Try again.",Lhe=()=>"无法重试排队消息。请重试。",Ohe=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Ihe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"run logs",$he=()=>"运行日志",Phe=()=>"گزارش‌های اجرا",Fhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$he():t==="fa"?Phe():Bhe()}),Hhe=()=>"Scroll to bottom",qhe=()=>"滚动到底部",Uhe=()=>"رفتن به پایین گفتگو",OE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qhe():t==="fa"?Uhe():Hhe()}),Ghe=()=>"The selected harness is unavailable",Whe=()=>"所选智能体工具不可用",Vhe=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",S2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Whe():t==="fa"?Vhe():Ghe()}),Khe=()=>"Session limit reached",Qhe=()=>"已达到会话使用限额",Yhe=()=>"به سقف مصرف نشست رسیده‌اید",Xhe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qhe():t==="fa"?Yhe():Khe()}),Zhe=()=>"The chat session was not created",Jhe=()=>"未能创建聊天会话",e_e=()=>"نشست گفت‌وگو ایجاد نشد",t_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jhe():t==="fa"?e_e():Zhe()}),n_e=()=>"Show full conversation",r_e=()=>"显示完整对话",s_e=()=>"نمایش کامل گفتگو",i_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r_e():t==="fa"?s_e():n_e()}),a_e=()=>" · Spawned by another agent",o_e=()=>" · 由另一个智能体创建",l_e=()=>" · ساخته‌شده به‌دست عامل دیگر",c_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o_e():t==="fa"?l_e():a_e()}),u_e=()=>"Starting…",d_e=()=>"正在启动…",f_e=()=>"در حال شروع…",h_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d_e():t==="fa"?f_e():u_e()}),__e=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,p_e=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,m_e=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,g_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p_e(e):t==="fa"?m_e(e):__e(e)}),v_e=()=>"Could not stop the turn. Try again.",b_e=()=>"无法停止本轮。请重试。",y_e=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",x_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b_e():t==="fa"?y_e():v_e()}),w_e=e=>`Could not switch fork: ${e==null?void 0:e.error}`,S_e=e=>`无法切换分支:${e==null?void 0:e.error}`,k_e=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,C_e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S_e(e):t==="fa"?k_e(e):w_e(e)}),E_e=()=>"The agent",N_e=()=>"智能体",z_e=()=>"عامل",j_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N_e():t==="fa"?z_e():E_e()}),T_e=()=>"Thinking",A_e=()=>"正在思考",R_e=()=>"در حال فکر کردن",M_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A_e():t==="fa"?R_e():T_e()}),D_e=()=>"Could not toggle Plan mode. Try again.",L_e=()=>"无法切换计划模式。请重试。",O_e=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",IE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L_e():t==="fa"?O_e():D_e()}),I_e=()=>"This turn did not finish.",B_e=()=>"本轮未完成。",$_e=()=>"این نوبت کامل نشد.",BE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),P_e=()=>"Type a custom answer…",F_e=()=>"输入自定义回答…",H_e=()=>"پاسخ دلخواه را بنویسید…",q_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F_e():t==="fa"?H_e():P_e()}),U_e=()=>"Unarchive",G_e=()=>"取消归档",W_e=()=>"خارج کردن از بایگانی",V_e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G_e():t==="fa"?W_e():U_e()}),K_e=()=>"Untitled",Q_e=()=>"未命名",Y_e=()=>"بدون عنوان",Ng=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q_e():t==="fa"?Y_e():K_e()}),X_e=()=>"Could not update permissions. Try again.",Z_e=()=>"无法更新权限。请重试。",J_e=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",e0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z_e():t==="fa"?J_e():X_e()}),t0e=()=>"Work details",n0e=()=>"工作详情",r0e=()=>"جزئیات کار",s0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),i0e=e=>`${e==null?void 0:e.minutes}m ${e==null?void 0:e.seconds}s`,a0e=e=>`${e==null?void 0:e.minutes}分${e==null?void 0:e.seconds}秒`,o0e=e=>`${e==null?void 0:e.minutes} دقیقه ${e==null?void 0:e.seconds} ثانیه`,l0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a0e(e):t==="fa"?o0e(e):i0e(e)}),c0e=e=>`Worked for ${e==null?void 0:e.duration}`,u0e=e=>`已工作 ${e==null?void 0:e.duration}`,d0e=e=>`به‌مدت ${e==null?void 0:e.duration} کار کرد`,f0e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u0e(e):t==="fa"?d0e(e):c0e(e)}),h0e=()=>"Working…",_0e=()=>"正在工作…",p0e=()=>"در حال کار…",r6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_0e():t==="fa"?p0e():h0e()}),m0e=()=>"Close tab",g0e=()=>"关闭标签页",v0e=()=>"بستن زبانه",b0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g0e():t==="fa"?v0e():m0e()}),y0e=()=>"Changes",x0e=()=>"更改",w0e=()=>"تغییرات",zD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x0e():t==="fa"?w0e():y0e()}),S0e=()=>"Code browser view",k0e=()=>"代码浏览器视图",C0e=()=>"نمای مرورگر کد",E0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Files",z0e=()=>"文件",j0e=()=>"فایل‌ها",T0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Refresh",R0e=()=>"刷新",M0e=()=>"تازه‌سازی",$E=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"listing truncated",L0e=()=>"列表已截断",O0e=()=>"فهرست کوتاه شده است",I0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L0e():t==="fa"?O0e():D0e()}),B0e=()=>"No files.",$0e=()=>"没有文件。",P0e=()=>"فایلی وجود ندارد.",F0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$0e():t==="fa"?P0e():B0e()}),H0e=()=>"Refresh failed:",q0e=()=>"刷新失败:",U0e=()=>"تازه‌سازی ناموفق بود:",G0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q0e():t==="fa"?U0e():H0e()}),W0e=()=>"Cancelling…",V0e=()=>"正在取消…",K0e=()=>"در حال لغو…",Q0e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V0e():t==="fa"?K0e():W0e()}),Y0e=()=>"Checking…",X0e=()=>"正在检查…",Z0e=()=>"در حال بررسی…",Xi=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X0e():t==="fa"?Z0e():Y0e()}),J0e=()=>"Copied",epe=()=>"已复制",tpe=()=>"کپی شد",tp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?epe():t==="fa"?tpe():J0e()}),npe=e=>`Failed to load: ${e==null?void 0:e.error}`,rpe=e=>`加载失败:${e==null?void 0:e.error}`,spe=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,jD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?rpe(e):t==="fa"?spe(e):npe(e)}),ipe=()=>"Loading…",ape=()=>"正在加载…",ope=()=>"در حال بارگیری…",TD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),lpe=e=>`+ ${e==null?void 0:e.count} more`,cpe=e=>`另有 ${e==null?void 0:e.count} 项`,upe=e=>`${e==null?void 0:e.count}+ مورد دیگر`,dpe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cpe(e):t==="fa"?upe(e):lpe(e)}),fpe=()=>"Rendered view",hpe=()=>"渲染视图",_pe=()=>"نمای رندرشده",nv=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hpe():t==="fa"?_pe():fpe()}),ppe=()=>"Save",mpe=()=>"保存",gpe=()=>"ذخیره",no=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mpe():t==="fa"?gpe():ppe()}),vpe=()=>"Saving…",bpe=()=>"正在保存…",ype=()=>"در حال ذخیره…",Ei=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bpe():t==="fa"?ype():vpe()}),xpe=()=>"Show less",wpe=()=>"收起",Spe=()=>"نمایش کمتر",AD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wpe():t==="fa"?Spe():xpe()}),kpe=()=>"Show more",Cpe=()=>"展开",Epe=()=>"نمایش بیشتر",Npe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cpe():t==="fa"?Epe():kpe()}),zpe=()=>"Stop",jpe=()=>"停止",Tpe=()=>"توقف",RD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Ape=()=>"Stopping…",Rpe=()=>"正在停止…",Mpe=()=>"در حال توقف…",Dpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rpe():t==="fa"?Mpe():Ape()}),Lpe=()=>"View source",Ope=()=>"查看源代码",Ipe=()=>"نمایش متن منبع",rh=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ope():t==="fa"?Ipe():Lpe()}),Bpe=()=>"Runs as a remote Hugging Face Job",$pe=()=>"作为远程 Hugging Face Job 运行",Ppe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Fpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$pe():t==="fa"?Ppe():Bpe()}),Hpe=()=>"Runs as a Job on your Kubernetes cluster",qpe=()=>"作为 Kubernetes 集群上的 Job 运行",Upe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",Gpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qpe():t==="fa"?Upe():Hpe()}),Wpe=()=>"Runs directly on this computer",Vpe=()=>"直接在此计算机上运行",Kpe=()=>"مستقیماً روی این رایانه اجرا می‌شود",Qpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vpe():t==="fa"?Kpe():Wpe()}),Ype=()=>"Runs in a remote Modal sandbox",Xpe=()=>"在远程 Modal 沙箱中运行",Zpe=()=>"در sandbox دوردست Modal اجرا می‌شود",Jpe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xpe():t==="fa"?Zpe():Ype()}),eme=()=>"Runs on an ephemeral OpenResearch box",tme=()=>"在临时 OpenResearch 主机上运行",nme=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",rme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),sme=()=>"Runs on the connected Ray cluster",ime=()=>"在已连接的 Ray 集群上运行",ame=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",ome=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ime():t==="fa"?ame():sme()}),lme=()=>"Runs as a scheduled job on your Slurm cluster",cme=()=>"作为 Slurm 集群上的调度作业运行",ume=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cme():t==="fa"?ume():lme()}),fme=()=>"Runs on a host from your SSH config",hme=()=>"在 SSH 配置中的主机上运行",_me=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",pme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hme():t==="fa"?_me():fme()}),mme=()=>"Runs through Tinker’s remote compute",gme=()=>"通过 Tinker 远程算力运行",vme=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gme():t==="fa"?vme():mme()}),yme=()=>"HF Jobs",xme=()=>"HF Jobs",wme=()=>"HF Jobs",Sme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xme():t==="fa"?wme():yme()}),kme=()=>"Kubernetes",Cme=()=>"Kubernetes",Eme=()=>"Kubernetes",Nme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"This machine",jme=()=>"此计算机",Tme=()=>"این رایانه",MD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jme():t==="fa"?Tme():zme()}),Ame=()=>"Modal",Rme=()=>"Modal",Mme=()=>"Modal",Dme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rme():t==="fa"?Mme():Ame()}),Lme=()=>"OpenResearch",Ome=()=>"OpenResearch",Ime=()=>"OpenResearch",Bme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ome():t==="fa"?Ime():Lme()}),$me=()=>"Ray",Pme=()=>"Ray",Fme=()=>"Ray",Hme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pme():t==="fa"?Fme():$me()}),qme=()=>"Slurm",Ume=()=>"Slurm",Gme=()=>"Slurm",Wme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ume():t==="fa"?Gme():qme()}),Vme=()=>"SSH",Kme=()=>"SSH",Qme=()=>"SSH",Yme=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kme():t==="fa"?Qme():Vme()}),Xme=()=>"Tinker",Zme=()=>"Tinker",Jme=()=>"Tinker",ege=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zme():t==="fa"?Jme():Xme()}),tge=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",nge=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",rge=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",sge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nge():t==="fa"?rge():tge()}),ige=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",age=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",oge=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",lge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?age():t==="fa"?oge():ige()}),cge=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",uge=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",dge=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",fge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uge():t==="fa"?dge():cge()}),hge=()=>"This computer must stay awake and online while Tinker runs.",_ge=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",pge=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",mge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Context window",vge=()=>"上下文窗口",bge=()=>"پنجرهٔ زمینه",yge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vge():t==="fa"?bge():gge()}),xge=()=>"Context window used",wge=()=>"已使用的上下文窗口",Sge=()=>"پنجرهٔ زمینهٔ استفاده‌شده",kge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wge():t==="fa"?Sge():xge()}),Cge=e=>`${e==null?void 0:e.value} tokens`,Ege=e=>`${e==null?void 0:e.value} 个 token`,Nge=e=>`${e==null?void 0:e.value} توکن`,zge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ege(e):t==="fa"?Nge(e):Cge(e)}),jge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Tge=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Age=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Rge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tge(e):t==="fa"?Age(e):jge(e)}),Mge=()=>"No runs yet — ask the agent to launch one.",Dge=()=>"尚无运行——让智能体启动一个。",Lge=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Oge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dge():t==="fa"?Lge():Mge()}),Ige=()=>"Run",Bge=()=>"运行",$ge=()=>"اجرا",PE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bge():t==="fa"?$ge():Ige()}),Pge=()=>"Switch run",Fge=()=>"切换运行",Hge=()=>"تغییر اجرا",qge=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fge():t==="fa"?Hge():Pge()}),Uge=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,Gge=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Wge=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Vge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gge(e):t==="fa"?Wge(e):Uge(e)}),Kge=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,Qge=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,Yge=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,Xge=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Qge(e):t==="fa"?Yge(e):Kge(e)}),Zge=e=>`${e==null?void 0:e.value}m`,Jge=e=>`${e==null?void 0:e.value} 分钟`,e1e=e=>`${e==null?void 0:e.value} دقیقه`,t1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Jge(e):t==="fa"?e1e(e):Zge(e)}),n1e=e=>`${e==null?void 0:e.value}s`,r1e=e=>`${e==null?void 0:e.value} 秒`,s1e=e=>`${e==null?void 0:e.value} ثانیه`,i1e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?r1e(e):t==="fa"?s1e(e):n1e(e)}),a1e=()=>"Code",o1e=()=>"代码",l1e=()=>"کد",c1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o1e():t==="fa"?l1e():a1e()}),u1e=()=>"created",d1e=()=>"创建于",f1e=()=>"ایجادشده",h1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d1e():t==="fa"?f1e():u1e()}),_1e=()=>"from",p1e=()=>"来自",m1e=()=>"از",g1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),v1e=()=>"Logs",b1e=()=>"日志",y1e=()=>"گزارش‌ها",x1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b1e():t==="fa"?y1e():v1e()}),w1e=()=>"Latest run",S1e=()=>"最新运行",k1e=()=>"آخرین اجرا",C1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Code",N1e=()=>"代码",z1e=()=>"کد",j1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),T1e=()=>"Commit",A1e=()=>"提交",R1e=()=>"کامیت",M1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),D1e=()=>"created",L1e=()=>"创建于",O1e=()=>"ایجادشده",I1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L1e():t==="fa"?O1e():D1e()}),B1e=()=>"Description",$1e=()=>"说明",P1e=()=>"توضیحات",F1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$1e():t==="fa"?P1e():B1e()}),H1e=()=>"Duration",q1e=()=>"时长",U1e=()=>"مدت",G1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q1e():t==="fa"?U1e():H1e()}),W1e=()=>"exit",V1e=()=>"退出码",K1e=()=>"خروج",Q1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V1e():t==="fa"?K1e():W1e()}),Y1e=()=>"from",X1e=()=>"来自",Z1e=()=>"از",J1e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),eve=()=>"Logs",tve=()=>"日志",nve=()=>"گزارش‌ها",rve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tve():t==="fa"?nve():eve()}),sve=()=>"Run",ive=()=>"运行",ave=()=>"اجرا",ove=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ive():t==="fa"?ave():sve()}),lve=()=>"Run history",cve=()=>"运行历史",uve=()=>"تاریخچهٔ اجرا",dve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cve():t==="fa"?uve():lve()}),fve=()=>"Started",hve=()=>"开始时间",_ve=()=>"آغاز",pve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hve():t==="fa"?_ve():fve()}),mve=()=>"Runs",gve=()=>"运行",vve=()=>"اجراها",bve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gve():t==="fa"?vve():mve()}),yve=()=>"Experiments and their runs will appear here. Ask the agent to set up an experiment to get started.",xve=()=>"实验及其运行会显示在这里。让智能体设置一个实验即可开始。",wve=()=>"آزمایش‌ها و اجراهای آن‌ها اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید آزمایشی راه‌اندازی کند.",Sve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xve():t==="fa"?wve():yve()}),kve=()=>"No runs yet",Cve=()=>"还没有运行",Eve=()=>"هنوز اجرایی وجود ندارد",Nve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"No experiments yet.",jve=()=>"还没有实验。",Tve=()=>"هنوز آزمایشی وجود ندارد.",Ave=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Not run yet",Mve=()=>"尚未运行",Dve=()=>"هنوز اجرا نشده",Lve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mve():t==="fa"?Dve():Rve()}),Ove=()=>"1 run",Ive=()=>"1 次运行",Bve=()=>"۱ اجرا",$ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"Open logs",Fve=()=>"打开日志",Hve=()=>"باز کردن گزارش‌ها",qve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fve():t==="fa"?Hve():Pve()}),Uve=e=>`${e==null?void 0:e.count} runs`,Gve=e=>`${e==null?void 0:e.count} 次运行`,Wve=e=>`${e==null?void 0:e.count} اجرا`,Vve=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Gve(e):t==="fa"?Wve(e):Uve(e)}),Kve=()=>"Stop requested",Qve=()=>"已请求停止",Yve=()=>"درخواست توقف ثبت شد",Xve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qve():t==="fa"?Yve():Kve()}),Zve=()=>"Stop run",Jve=()=>"停止运行",ebe=()=>"توقف اجرا",tbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jve():t==="fa"?ebe():Zve()}),nbe=()=>"Code",rbe=()=>"代码",sbe=()=>"کد",ibe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rbe():t==="fa"?sbe():nbe()}),abe=()=>"Experiments",obe=()=>"实验",lbe=()=>"آزمایش‌ها",cbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?obe():t==="fa"?lbe():abe()}),ube=()=>"Logs",dbe=()=>"日志",fbe=()=>"گزارش‌ها",hbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dbe():t==="fa"?fbe():ube()}),_be=()=>"Stop failed:",pbe=()=>"停止失败:",mbe=()=>"توقف ناموفق بود:",gbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pbe():t==="fa"?mbe():_be()}),vbe=()=>"Clipboard access is unavailable.",bbe=()=>"无法访问剪贴板。",ybe=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",DD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bbe():t==="fa"?ybe():vbe()}),xbe=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,wbe=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,Sbe=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,kbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):xbe(e)}),Cbe=()=>"Duplicate",Ebe=()=>"创建副本",Nbe=()=>"ایجاد نسخهٔ تکراری",zbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ebe():t==="fa"?Nbe():Cbe()}),jbe=e=>`File actions for ${e==null?void 0:e.path}`,Tbe=e=>`${e==null?void 0:e.path} 的文件操作`,Abe=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Rbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Tbe(e):t==="fa"?Abe(e):jbe(e)}),Mbe=()=>"Open",Dbe=()=>"打开",Lbe=()=>"باز کردن",Obe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Mbe()}),Ibe=e=>`Rename ${e==null?void 0:e.path}`,Bbe=e=>`重命名 ${e==null?void 0:e.path}`,$be=e=>`تغییر نام ${e==null?void 0:e.path}`,Pbe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Bbe(e):t==="fa"?$be(e):Ibe(e)}),Fbe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Hbe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,qbe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Ube=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Hbe(e):t==="fa"?qbe(e):Fbe(e)}),Gbe=()=>"Binary file — no inline preview.",Wbe=()=>"二进制文件——无法内嵌预览。",Vbe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",Kbe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wbe():t==="fa"?Vbe():Gbe()}),Qbe=()=>"This file changed on disk. Your edits have not been overwritten.",Ybe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Xbe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",FE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Qbe()}),Zbe=()=>"Compile failed",Jbe=()=>"编译失败",eye=()=>"کامپایل ناموفق بود",tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jbe():t==="fa"?eye():Zbe()}),nye=()=>"Compile PDF",rye=()=>"编译 PDF",sye=()=>"کامپایل PDF",HE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rye():t==="fa"?sye():nye()}),iye=()=>"Compiled, but the engine reported errors — check the output below.",aye=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",oye=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",lye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Copy command",uye=()=>"复制命令",dye=()=>"کپی فرمان",fye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Copy install command",_ye=()=>"复制安装命令",pye=()=>"کپی فرمان نصب",mye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"This file was deleted on disk. Your edits have not been discarded.",vye=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",bye=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",qE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vye():t==="fa"?bye():gye()}),yye=()=>"Discard my edits and reload",xye=()=>"放弃我的编辑并重新加载",wye=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Sye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xye():t==="fa"?wye():yye()}),kye=()=>"Discard unsaved changes and close this file?",Cye=()=>"要丢弃未保存的更改并关闭此文件吗?",Eye=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",UE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cye():t==="fa"?Eye():kye()}),Nye=()=>"Dismiss",zye=()=>"关闭",jye=()=>"بستن",Tye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Dismiss compile message",Rye=()=>"关闭编译消息",Mye=()=>"بستن پیام کامپایل",Dye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Lye=()=>"Dismiss Overleaf message",Oye=()=>"关闭 Overleaf 消息",Iye=()=>"بستن پیام Overleaf",Bye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oye():t==="fa"?Iye():Lye()}),$ye=()=>"Download",Pye=()=>"下载",Fye=()=>"بارگیری",LD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pye():t==="fa"?Fye():$ye()}),Hye=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,qye=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Uye=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Gye=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qye(e):t==="fa"?Uye(e):Hye(e)}),Wye=()=>"Failed to load file:",Vye=()=>"加载文件失败:",Kye=()=>"بارگیری فایل ناموفق بود:",GE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vye():t==="fa"?Kye():Wye()}),Qye=()=>"File truncated — showing the first 512 KB.",Yye=()=>"文件已截断——仅显示前 512 KB。",Xye=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",Zye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yye():t==="fa"?Xye():Qye()}),Jye=()=>"The page below stops partway — the full file could not be loaded.",exe=()=>"下方页面在中途结束——无法加载完整文件。",txe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",nxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?exe():t==="fa"?txe():Jye()}),rxe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,sxe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ixe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,axe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sxe(e):t==="fa"?ixe(e):rxe(e)}),oxe=()=>"Loading…",lxe=()=>"正在加载…",cxe=()=>"در حال بارگیری…",OD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lxe():t==="fa"?cxe():oxe()}),uxe=()=>"File not found.",dxe=()=>"找不到文件。",fxe=()=>"فایل پیدا نشد.",hxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dxe():t==="fa"?fxe():uxe()}),_xe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,pxe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,mxe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,gxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pxe(e):t==="fa"?mxe(e):_xe(e)}),vxe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,bxe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,yxe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,xxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bxe(e):t==="fa"?yxe(e):vxe(e)}),wxe=()=>"File not found on disk.",Sxe=()=>"磁盘上找不到此文件。",kxe=()=>"فایل روی دیسک پیدا نشد.",Cxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Exe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Nxe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,zxe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,jxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nxe(e):t==="fa"?zxe(e):Exe(e)}),Txe=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Axe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,Rxe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Mxe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Axe(e):t==="fa"?Rxe(e):Txe(e)}),Dxe=()=>"Open in default editor",Lxe=()=>"在默认编辑器中打开",Oxe=()=>"باز کردن در ویرایشگر پیش‌فرض",WE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lxe():t==="fa"?Oxe():Dxe()}),Ixe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Bxe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",$xe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Pxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Fxe=()=>"Overwrite disk file",Hxe=()=>"覆盖磁盘文件",qxe=()=>"بازنویسی فایل روی دیسک",Uxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hxe():t==="fa"?qxe():Fxe()}),Gxe=()=>"Compiled PDF is out of date",Wxe=()=>"已编译的 PDF 不是最新版本",Vxe=()=>"PDF کامپایل‌شده به‌روز نیست",Kxe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wxe():t==="fa"?Vxe():Gxe()}),Qxe=()=>"project clone",Yxe=()=>"项目克隆",Xxe=()=>"کلون پروژه",zg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yxe():t==="fa"?Xxe():Qxe()}),Zxe=()=>"Recompile PDF",Jxe=()=>"重新编译 PDF",e2e=()=>"کامپایل دوبارهٔ PDF",VE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jxe():t==="fa"?e2e():Zxe()}),t2e=()=>"Reload from disk",n2e=()=>"从磁盘重新加载",r2e=()=>"بارگذاری مجدد از دیسک",s2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Save failed",a2e=()=>"保存失败",o2e=()=>"ذخیره ناموفق بود",l2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Saving…",u2e=()=>"正在保存…",d2e=()=>"در حال ذخیره…",f2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Selected — press ⌘C",_2e=()=>"已选中 — 按 ⌘C 复制",p2e=()=>"انتخاب شد — برای کپی ⌘C را بزنید",m2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"session’s worktree",v2e=()=>"会话工作树",b2e=()=>"درخت کاری نشست",jg=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v2e():t==="fa"?b2e():g2e()}),y2e=()=>"Show compiled PDF",x2e=()=>"显示已编译的 PDF",w2e=()=>"نمایش PDF کامپایل‌شده",KE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x2e():t==="fa"?w2e():y2e()}),S2e=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",k2e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",C2e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",E2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k2e():t==="fa"?C2e():S2e()}),N2e=()=>"This session's worktree isn't available — showing the project clone's copy.",z2e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",j2e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",T2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z2e():t==="fa"?j2e():N2e()}),A2e=()=>"Unsaved",R2e=()=>"未保存",M2e=()=>"ذخیره نشده",ID=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R2e():t==="fa"?M2e():A2e()}),D2e=()=>"Unsaved — ⌘S to save",L2e=()=>"未保存 — 按 ⌘S 保存",O2e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",I2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L2e():t==="fa"?O2e():D2e()}),B2e=()=>"Update orx on the remote machine to edit this file safely.",$2e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",P2e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",F2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$2e():t==="fa"?P2e():B2e()}),H2e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",q2e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",U2e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",G2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q2e():t==="fa"?U2e():H2e()}),W2e=()=>"Files in this workspace will appear here. Ask the agent to create a file to get started.",V2e=()=>"此工作区中的文件会显示在这里。让智能体创建一个文件即可开始。",K2e=()=>"فایل‌های این فضای کاری اینجا نمایش داده می‌شوند. برای شروع، از عامل بخواهید فایلی ایجاد کند.",Q2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V2e():t==="fa"?K2e():W2e()}),Y2e=()=>"Back to preview",X2e=()=>"返回预览",Z2e=()=>"بازگشت به پیش‌نمایش",J2e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),ewe=e=>`${e==null?void 0:e.count} changed files`,twe=e=>`${e==null?void 0:e.count} 个已更改文件`,nwe=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,BD=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?twe(e):t==="fa"?nwe(e):ewe(e)}),rwe=()=>"Changed files",swe=()=>"已更改文件",iwe=()=>"فایل‌های تغییرکرده",awe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?swe():t==="fa"?iwe():rwe()}),owe=()=>"Diff preview truncated",lwe=()=>"差异预览已截断",cwe=()=>"پیش‌نمایش تفاوت کوتاه شده است",uwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lwe():t==="fa"?cwe():owe()}),dwe=e=>`${e==null?void 0:e.count} files shown (partial)`,fwe=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,hwe=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,_we=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?fwe(e):t==="fa"?hwe(e):dwe(e)}),pwe=()=>"No changes.",mwe=()=>"没有更改。",gwe=()=>"تغییری وجود ندارد.",vwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mwe():t==="fa"?gwe():pwe()}),bwe=()=>"No complete file preview was available before the cutoff.",ywe=()=>"在截断位置之前没有完整的文件预览。",xwe=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",wwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ywe():t==="fa"?xwe():bwe()}),Swe=()=>"No textual diff for this file.",kwe=()=>"此文件没有文本差异。",Cwe=()=>"برای این فایل تفاوت متنی وجود ندارد.",Ewe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kwe():t==="fa"?Cwe():Swe()}),Nwe=()=>"1 changed file",zwe=()=>"1 个已更改文件",jwe=()=>"۱ فایل تغییرکرده",$D=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zwe():t==="fa"?jwe():Nwe()}),Twe=()=>"1 file shown (partial)",Awe=()=>"显示 1 个文件(部分)",Rwe=()=>"۱ فایل نمایش داده شده (ناقص)",Mwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Awe():t==="fa"?Rwe():Twe()}),Dwe=()=>"Unable to parse this diff.",Lwe=()=>"无法解析此差异。",Owe=()=>"خواندن این تفاوت ممکن نبود.",Iwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lwe():t==="fa"?Owe():Dwe()}),Bwe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,$we=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,Pwe=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,Fwe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$we(e):t==="fa"?Pwe(e):Bwe(e)}),Hwe=()=>"View full diff",qwe=()=>"查看完整差异",Uwe=()=>"نمایش تفاوت کامل",Gwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qwe():t==="fa"?Uwe():Hwe()}),Wwe=()=>"Create a token ↗",Vwe=()=>"创建令牌 ↗",Kwe=()=>"ساخت توکن ↗",Qwe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vwe():t==="fa"?Kwe():Wwe()}),Ywe=()=>"All projects",Xwe=()=>"所有项目",Zwe=()=>"همهٔ پروژه‌ها",QE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xwe():t==="fa"?Zwe():Ywe()}),Jwe=()=>"Configure Repository",e4e=()=>"配置仓库",t4e=()=>"پیکربندی مخزن",n4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?e4e():t==="fa"?t4e():Jwe()}),r4e=()=>"Create a new project",s4e=()=>"新建项目",i4e=()=>"ایجاد پروژهٔ جدید",a4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"Hide sidebar",l4e=()=>"隐藏侧边栏",c4e=()=>"پنهان کردن نوار کناری",YE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),u4e=()=>"Project",d4e=()=>"项目",f4e=()=>"پروژه",h4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d4e():t==="fa"?f4e():u4e()}),_4e=e=>`${e==null?void 0:e.count} cancelled`,p4e=e=>`${e==null?void 0:e.count} 次取消`,m4e=e=>`${e==null?void 0:e.count} لغوشده`,g4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?p4e(e):t==="fa"?m4e(e):_4e(e)}),v4e=e=>`${e==null?void 0:e.count} done`,b4e=e=>`${e==null?void 0:e.count} 次完成`,y4e=e=>`${e==null?void 0:e.count} تمام‌شده`,x4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?b4e(e):t==="fa"?y4e(e):v4e(e)}),w4e=e=>`${e==null?void 0:e.count} failed`,S4e=e=>`${e==null?void 0:e.count} 次失败`,k4e=e=>`${e==null?void 0:e.count} ناموفق`,C4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S4e(e):t==="fa"?k4e(e):w4e(e)}),E4e=e=>`${e==null?void 0:e.count} files`,N4e=e=>`${e==null?void 0:e.count} 个文件`,z4e=e=>`${e==null?void 0:e.count} فایل`,j4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?N4e(e):t==="fa"?z4e(e):E4e(e)}),T4e=e=>`${e==null?void 0:e.count}+ files`,A4e=e=>`至少 ${e==null?void 0:e.count} 个文件`,R4e=e=>`بیش از ${e==null?void 0:e.count} فایل`,M4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?A4e(e):t==="fa"?R4e(e):T4e(e)}),D4e=e=>`${e==null?void 0:e.count} live`,L4e=e=>`${e==null?void 0:e.count} 次进行中`,O4e=e=>`${e==null?void 0:e.count} فعال`,I4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L4e(e):t==="fa"?O4e(e):D4e(e)}),B4e=()=>"1 file",$4e=()=>"1 个文件",P4e=()=>"۱ فایل",F4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$4e():t==="fa"?P4e():B4e()}),H4e=()=>"1 run",q4e=()=>"1 次运行",U4e=()=>"۱ اجرا",G4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q4e():t==="fa"?U4e():H4e()}),W4e=e=>`${e==null?void 0:e.count} runs`,V4e=e=>`${e==null?void 0:e.count} 次运行`,K4e=e=>`${e==null?void 0:e.count} اجرا`,Q4e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V4e(e):t==="fa"?K4e(e):W4e(e)}),Y4e=()=>"No instances yet.",X4e=()=>"还没有实例。",Z4e=()=>"هنوز نمونه‌ای وجود ندارد.",J4e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X4e():t==="fa"?Z4e():Y4e()}),e3e=()=>"Nothing running right now.",t3e=()=>"当前没有运行中的实例。",n3e=()=>"اکنون چیزی در حال اجرا نیست.",r3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t3e():t==="fa"?n3e():e3e()}),s3e=()=>"Select a project to see its history.",i3e=()=>"请选择一个项目以查看其历史记录。",a3e=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",o3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i3e():t==="fa"?a3e():s3e()}),l3e=()=>"Select a project to see its runs.",c3e=()=>"请选择一个项目以查看其运行。",u3e=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",d3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c3e():t==="fa"?u3e():l3e()}),f3e=()=>"View history",h3e=()=>"查看历史记录",_3e=()=>"مشاهدهٔ تاریخچه",p3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h3e():t==="fa"?_3e():f3e()}),m3e=e=>`View history (${e==null?void 0:e.count})`,g3e=e=>`查看历史记录(${e==null?void 0:e.count})`,v3e=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,b3e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?g3e(e):t==="fa"?v3e(e):m3e(e)}),y3e=()=>"The engine exited without producing a PDF or a log.",x3e=()=>"引擎已退出,但没有生成 PDF 或日志。",w3e=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",S3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?x3e():t==="fa"?w3e():y3e()}),k3e=()=>"Loading…",C3e=()=>"正在加载…",E3e=()=>"در حال بارگیری…",N3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?C3e():t==="fa"?E3e():k3e()}),z3e=()=>"Add local model",j3e=()=>"添加本地模型",T3e=()=>"افزودن مدل محلی",PD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?j3e():t==="fa"?T3e():z3e()}),A3e=()=>"Local server address",R3e=()=>"本地服务器地址",M3e=()=>"نشانی سرور محلی",D3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?R3e():t==="fa"?M3e():A3e()}),L3e=()=>"Find models",O3e=()=>"查找模型",I3e=()=>"یافتن مدل‌ها",B3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?O3e():t==="fa"?I3e():L3e()}),$3e=()=>"(OpenAI compatible)",P3e=()=>"(兼容 OpenAI)",F3e=()=>"(سازگار با OpenAI)",FD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P3e():t==="fa"?F3e():$3e()}),H3e=()=>"Saved, but OpenCode did not list this model. Check installed agents again. If your OpenCode config restricts enabled providers, allow this connection before using it.",q3e=()=>"已保存,但 OpenCode 未列出该模型。请重新检查已安装的智能体。如果 OpenCode 配置限制了启用的提供商,请先允许此连接。",U3e=()=>"ذخیره شد، اما OpenCode این مدل را فهرست نکرد. عامل‌های نصب‌شده را دوباره بررسی کنید. اگر پیکربندی OpenCode ارائه‌دهندگان فعال را محدود کرده، ابتدا این اتصال را مجاز کنید.",G3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?q3e():t==="fa"?U3e():H3e()}),W3e=()=>"Connected",V3e=()=>"已连接",K3e=()=>"متصل شد",Q3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V3e():t==="fa"?K3e():W3e()}),Y3e=()=>"Context window",X3e=()=>"上下文窗口",Z3e=()=>"پنجرهٔ زمینه",J3e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X3e():t==="fa"?Z3e():Y3e()}),e5e=()=>"Match the context window loaded in your model app. 32K is a useful starting point for tools; larger contexts use more memory.",t5e=()=>"请与模型应用中加载的上下文窗口保持一致。使用工具时可从 32K 开始;更大的上下文需要更多内存。",n5e=()=>"اندازهٔ زمینه را با تنظیم بارگذاری‌شده در برنامهٔ مدل هماهنگ کنید. ۳۲هزار توکن نقطهٔ شروع مناسبی برای ابزارهاست؛ زمینهٔ بزرگ‌تر حافظهٔ بیشتری مصرف می‌کند.",r5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t5e():t==="fa"?n5e():e5e()}),s5e=()=>"Custom Endpoint",i5e=()=>"自定义端点",a5e=()=>"نقطهٔ اتصال سفارشی",s6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),o5e=e=>`Disconnect ${e==null?void 0:e.name}`,l5e=e=>`断开 ${e==null?void 0:e.name}`,c5e=e=>`قطع اتصال ${e==null?void 0:e.name}`,u5e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?l5e(e):t==="fa"?c5e(e):o5e(e)}),d5e=()=>"Get OpenCode",f5e=()=>"获取 OpenCode",h5e=()=>"دریافت OpenCode",_5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Install OpenCode to run tools with your local model, then re-check installed agents. No cloud account is required.",m5e=()=>"安装 OpenCode 以使用本地模型执行工具,然后重新检查已安装的智能体。无需云端账户。",g5e=()=>"برای اجرای ابزارها با مدل محلی، OpenCode را نصب کنید و عامل‌های نصب‌شده را دوباره بررسی کنید. حساب ابری لازم نیست.",v5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),b5e=()=>"API key (optional)",y5e=()=>"API 密钥(可选)",x5e=()=>"کلید API (اختیاری)",w5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y5e():t==="fa"?x5e():b5e()}),S5e=()=>"Save model",k5e=()=>"保存模型",C5e=()=>"ذخیرهٔ مدل",E5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Model server",z5e=()=>"模型服务器",j5e=()=>"سرور مدل",XE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Local models",A5e=()=>"本地模型",R5e=()=>"مدل‌های محلی",ZE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A5e():t==="fa"?R5e():T5e()}),M5e=()=>"API token (optional)",D5e=()=>"API 令牌(可选)",L5e=()=>"توکن API (اختیاری)",O5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D5e():t==="fa"?L5e():M5e()}),I5e=()=>"Copy",B5e=()=>"复制",$5e=()=>"کپی",i6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B5e():t==="fa"?$5e():I5e()}),P5e=()=>"Copy code",F5e=()=>"复制代码",H5e=()=>"کپی کد",q5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F5e():t==="fa"?H5e():P5e()}),U5e=()=>"Download",G5e=()=>"下载",W5e=()=>"بارگیری",HD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G5e():t==="fa"?W5e():U5e()}),V5e=()=>"This browser can’t preview this media format.",K5e=()=>"此浏览器无法预览该媒体格式。",Q5e=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Y5e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?K5e():t==="fa"?Q5e():V5e()}),X5e=()=>"Add Local Model",Z5e=()=>"添加本地模型",J5e=()=>"افزودن مدل محلی",e6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Z5e():t==="fa"?J5e():X5e()}),t6e=()=>" · CLI configuration",n6e=()=>" · CLI 配置",r6e=()=>" · پیکربندی CLI",qD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),s6e=()=>"· Default",i6e=()=>"· 默认",a6e=()=>"· پیش‌فرض",UD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i6e():t==="fa"?a6e():s6e()}),o6e=()=>"Default model",l6e=()=>"默认模型",c6e=()=>"مدل پیش‌فرض",JE=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?l6e():t==="fa"?c6e():o6e()}),u6e=()=>"Detecting harnesses…",d6e=()=>"正在检测智能体工具…",f6e=()=>"در حال شناسایی ابزارهای عامل…",h6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d6e():t==="fa"?f6e():u6e()}),_6e=()=>"Effort",p6e=()=>"推理强度",m6e=()=>"میزان استدلال",g6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p6e():t==="fa"?m6e():_6e()}),v6e=()=>"Fast speed ·",b6e=()=>"快速 ·",y6e=()=>"سرعت بالا ·",x6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b6e():t==="fa"?y6e():v6e()}),w6e=()=>"Mode",S6e=()=>"模式",k6e=()=>"حالت",eN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S6e():t==="fa"?k6e():w6e()}),C6e=()=>"Model",E6e=()=>"模型",N6e=()=>"مدل",L0=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E6e():t==="fa"?N6e():C6e()}),z6e=e=>`${e==null?void 0:e.count} more — search to find`,j6e=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,T6e=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,A6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?j6e(e):t==="fa"?T6e(e):z6e(e)}),R6e=()=>"Not available",M6e=()=>"不可用",D6e=()=>"در دسترس نیست",L6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?M6e():t==="fa"?D6e():R6e()}),O6e=()=>"Search models…",I6e=()=>"搜索模型…",B6e=()=>"جست‌وجوی مدل‌ها…",GD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),$6e=()=>"Sessions keep their harness. Start a new chat to switch.",P6e=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",F6e=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",H6e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?P6e():t==="fa"?F6e():$6e()}),q6e=()=>"Speed",U6e=()=>"速度",G6e=()=>"سرعت",tN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?U6e():t==="fa"?G6e():q6e()}),W6e=()=>"Unavailable",V6e=()=>"不可用",K6e=()=>"در دسترس نیست",Ya=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?V6e():t==="fa"?K6e():W6e()}),Q6e=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Y6e=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,X6e=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Z6e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Y6e(e):t==="fa"?X6e(e):Q6e(e)}),J6e=()=>"Variant",eSe=()=>"变体",tSe=()=>"گونه",nSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eSe():t==="fa"?tSe():J6e()}),rSe=()=>"Advanced",sSe=()=>"高级",iSe=()=>"پیشرفته",aSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sSe():t==="fa"?iSe():rSe()}),oSe=()=>"Advanced · Connect GitHub",lSe=()=>"高级 · 连接 GitHub",cSe=()=>"پیشرفته · اتصال GitHub",uSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lSe():t==="fa"?cSe():oSe()}),dSe=()=>"Advanced · GitHub sync on",fSe=()=>"高级 · GitHub 同步已开启",hSe=()=>"پیشرفته · همگام‌سازی GitHub روشن است",_Se=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fSe():t==="fa"?hSe():dSe()}),pSe=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",mSe=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",gSe=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",vSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mSe():t==="fa"?gSe():pSe()}),bSe=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,ySe=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,xSe=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,wSe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ySe(e):t==="fa"?xSe(e):bSe(e)}),SSe=()=>"Choose an existing project folder",kSe=()=>"选择现有项目文件夹",CSe=()=>"انتخاب پوشهٔ موجود پروژه",nN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kSe():t==="fa"?CSe():SSe()}),ESe=()=>"Choosing…",NSe=()=>"正在选择…",zSe=()=>"در حال انتخاب…",jSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"Clone destination",ASe=()=>"克隆位置",RSe=()=>"مقصد کلون",MSe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),DSe=()=>"Clone paper project",LSe=()=>"克隆论文项目",OSe=()=>"کلون پروژهٔ مقاله",ISe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LSe():t==="fa"?OSe():DSe()}),BSe=()=>"Create project",$Se=()=>"创建项目",PSe=()=>"ایجاد پروژه",rN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Creating…",HSe=()=>"正在创建…",qSe=()=>"در حال ایجاد…",USe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HSe():t==="fa"?qSe():FSe()}),GSe=()=>"Choose a different destination. This path is a file, not a folder.",WSe=()=>"请选择其他位置。此路径是文件,不是文件夹。",VSe=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",k2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WSe():t==="fa"?VSe():GSe()}),KSe=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",QSe=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",YSe=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",sN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QSe():t==="fa"?YSe():KSe()}),XSe=()=>"Auto-apply repository topics",ZSe=()=>"自动添加仓库 topic",JSe=()=>"اعمال خودکار موضوع‌های مخزن",eke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZSe():t==="fa"?JSe():XSe()}),tke=()=>"Automatic topics add openresearch, plus arxiv-xxxx and paper-repro when the project has a paper.",nke=()=>"自动 topic 包含 openresearch,当项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",rke=()=>"موضوع‌های خودکار شامل openresearch است و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",ske=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nke():t==="fa"?rke():tke()}),ike=()=>"Blank project",ake=()=>"空白项目",oke=()=>"پروژهٔ خالی",lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ake():t==="fa"?oke():ike()}),cke=()=>"Cancel",uke=()=>"取消",dke=()=>"لغو",fke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uke():t==="fa"?dke():cke()}),hke=()=>"Change",_ke=()=>"更改",pke=()=>"تغییر",mke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Change selected paper",vke=()=>"更改所选论文",bke=()=>"تغییر مقالهٔ انتخاب‌شده",yke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vke():t==="fa"?bke():gke()}),xke=()=>"Check out a Git branch before using this folder.",wke=()=>"使用此文件夹前,请先检出一个 Git 分支。",Ske=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",kke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wke():t==="fa"?Ske():xke()}),Cke=()=>"Checking project location.",Eke=()=>"正在检查项目位置。",Nke=()=>"در حال بررسی محل پروژه.",iN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),zke=()=>"Existing folder",jke=()=>"现有文件夹",Tke=()=>"پوشهٔ موجود",Ake=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jke():t==="fa"?Tke():zke()}),Rke=()=>"Experiment branches will be pushed to the remote GitHub repository.",Mke=()=>"实验分支将推送到远程 GitHub 仓库。",Dke=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",Lke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mke():t==="fa"?Dke():Rke()}),Oke=()=>"Extra topics (comma-separated), e.g. llm, benchmark",Ike=()=>"附加 topic(逗号分隔),例如 llm, benchmark",Bke=()=>"موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark",z4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),$ke=()=>"From a paper",Pke=()=>"从论文创建",Fke=()=>"از یک مقاله",Hke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pke():t==="fa"?Fke():$ke()}),qke=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",Uke=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Gke=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Wke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uke():t==="fa"?Gke():qke()}),Vke=()=>"my-research",Kke=()=>"my-research",Qke=()=>"my-research",aN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kke():t==="fa"?Qke():Vke()}),Yke=()=>"No papers found. Try an arXiv ID, URL, or a different title.",Xke=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",Zke=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",Jke=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xke():t==="fa"?Zke():Yke()}),e7e=()=>"No public repository found on alphaXiv",t7e=()=>"在 alphaXiv 上未找到公开仓库",n7e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",r7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?t7e():t==="fa"?n7e():e7e()}),s7e=()=>"OpenResearch will start a blank project with this paper's PDF.",i7e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",a7e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",o7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?i7e():t==="fa"?a7e():s7e()}),l7e=()=>"Paper",c7e=()=>"论文",u7e=()=>"مقاله",d7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?c7e():t==="fa"?u7e():l7e()}),f7e=()=>"Project location",h7e=()=>"项目位置",_7e=()=>"محل پروژه",C2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?h7e():t==="fa"?_7e():f7e()}),p7e=()=>"Project name",m7e=()=>"项目名称",g7e=()=>"نام پروژه",oN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?m7e():t==="fa"?g7e():p7e()}),v7e=()=>"Search for a paper by arXiv ID, URL, or title",b7e=()=>"按 arXiv ID、网址或标题搜索论文",y7e=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",x7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b7e():t==="fa"?y7e():v7e()}),w7e=()=>"Sync experiments to GitHub",S7e=()=>"将实验同步到 GitHub",k7e=()=>"همگام‌سازی آزمایش‌ها با GitHub",C7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=()=>"That folder no longer exists. Choose it again.",N7e=()=>"该文件夹已不存在。请重新选择。",z7e=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",j7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N7e():t==="fa"?z7e():E7e()}),T7e=()=>"The selected folder contains an invalid Git repository.",A7e=()=>"所选文件夹包含无效的 Git 仓库。",R7e=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",M7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A7e():t==="fa"?R7e():T7e()}),D7e=()=>"The selected path is not a folder.",L7e=()=>"所选路径不是文件夹。",O7e=()=>"مسیر انتخاب‌شده پوشه نیست.",I7e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L7e():t==="fa"?O7e():D7e()}),B7e=e=>`Checking ${e==null?void 0:e.repository}.`,$7e=e=>`正在检查 ${e==null?void 0:e.repository}。`,P7e=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,F7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$7e(e):t==="fa"?P7e(e):B7e(e)}),H7e=e=>`Creates ${e==null?void 0:e.repository}.`,q7e=e=>`将创建 ${e==null?void 0:e.repository}。`,U7e=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,G7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?q7e(e):t==="fa"?U7e(e):H7e(e)}),W7e=e=>`Pushes to ${e==null?void 0:e.repository}.`,V7e=e=>`将推送到 ${e==null?void 0:e.repository}。`,K7e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Q7e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?V7e(e):t==="fa"?K7e(e):W7e(e)}),Y7e=()=>"Project location is required.",X7e=()=>"必须填写项目位置。",Z7e=()=>"محل پروژه الزامی است.",lN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),J7e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",eCe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",tCe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",cN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eCe():t==="fa"?tCe():J7e()}),nCe=()=>"A linked public code repository is cloned without credentials.",rCe=()=>"关联的公开代码仓库无需凭据即可克隆。",sCe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",iCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,oCe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,lCe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,cCe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?oCe(e):t==="fa"?lCe(e):aCe(e)}),uCe=()=>"Searching alphaXiv…",dCe=()=>"正在搜索 alphaXiv…",fCe=()=>"در حال جست‌وجوی alphaXiv…",hCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Use folder",pCe=()=>"使用文件夹",mCe=()=>"استفاده از پوشه",gCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),vCe=()=>"Can’t reach OpenResearch. This page is no longer live.",bCe=()=>"无法连接 OpenResearch。此页面已不再实时同步。",yCe=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",j4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bCe():t==="fa"?yCe():vCe()}),xCe=()=>"A workspace for your research agents",wCe=()=>"面向研究智能体的工作空间",SCe=()=>"فضای کاری برای عامل‌های پژوهشی شما",kCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wCe():t==="fa"?SCe():xCe()}),CCe=()=>"Add papers that represent your research interests, including papers by other authors.",ECe=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",NCe=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",zCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),jCe=()=>"API key",TCe=()=>"API 密钥",ACe=()=>"کلید API",a6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TCe():t==="fa"?ACe():jCe()}),RCe=()=>"AI/ML",MCe=()=>"人工智能与机器学习",DCe=()=>"هوش مصنوعی و یادگیری ماشین",LCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MCe():t==="fa"?DCe():RCe()}),OCe=()=>"Biology",ICe=()=>"生物学",BCe=()=>"زیست‌شناسی",$Ce=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),PCe=()=>"Other",FCe=()=>"其他",HCe=()=>"سایر",qCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FCe():t==="fa"?HCe():PCe()}),UCe=()=>"Physics",GCe=()=>"物理学",WCe=()=>"فیزیک",VCe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GCe():t==="fa"?WCe():UCe()}),KCe=()=>"Back",QCe=()=>"返回",YCe=()=>"بازگشت",uN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QCe():t==="fa"?YCe():KCe()}),XCe=()=>"Check failed",ZCe=()=>"检查失败",JCe=()=>"بررسی ناموفق بود",e8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZCe():t==="fa"?JCe():XCe()}),t8e=()=>"Checking",n8e=()=>"正在检查",r8e=()=>"در حال بررسی",s8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"Checking Git…",a8e=()=>"正在检查 Git…",o8e=()=>"در حال بررسی Git…",l8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Choose a coding agent",u8e=()=>"选择编程智能体",d8e=()=>"یک عامل کدنویسی انتخاب کنید",f8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Choose a coding agent to continue.",_8e=()=>"选择一个编程智能体以继续。",p8e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",m8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Choose at least one research area to continue.",v8e=()=>"请至少选择一个研究领域后再继续。",b8e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",y8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?v8e():t==="fa"?b8e():g8e()}),x8e=()=>"Choose one or more.",w8e=()=>"请选择一项或多项。",S8e=()=>"یک یا چند مورد را انتخاب کنید.",k8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?w8e():t==="fa"?S8e():x8e()}),C8e=()=>"Choose your preferred coding agent",E8e=()=>"请选择首选编程智能体",N8e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",z8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?E8e():t==="fa"?N8e():C8e()}),j8e=()=>"Consolidate your research",T8e=()=>"集中管理研究",A8e=()=>"پژوهش خود را یکپارچه کنید",R8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?T8e():t==="fa"?A8e():j8e()}),M8e=()=>"Continue",D8e=()=>"继续",L8e=()=>"ادامه",dN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?D8e():t==="fa"?L8e():M8e()}),O8e=()=>"Describe your research area to continue.",I8e=()=>"请描述你的研究领域后再继续。",B8e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",$8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=()=>"Detecting Claude Code, Codex, OpenCode, Cursor…",F8e=()=>"正在检测 Claude Code、Codex、OpenCode、Cursor…",H8e=()=>"در حال شناسایی Claude Code، Codex، OpenCode و Cursor…",q8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F8e():t==="fa"?H8e():P8e()}),U8e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",G8e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",W8e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",V8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G8e():t==="fa"?W8e():U8e()}),K8e=()=>"Everything stays local",Q8e=()=>"一切都保留在本地",Y8e=()=>"همه‌چیز محلی می‌ماند",X8e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q8e():t==="fa"?Y8e():K8e()}),Z8e=()=>"Get started",J8e=()=>"开始使用",e9e=()=>"شروع",t9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J8e():t==="fa"?e9e():Z8e()}),n9e=()=>"Git is required for local experiments. Install Git, then re-check.",r9e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",s9e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",i9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?r9e():t==="fa"?s9e():n9e()}),a9e=()=>"Ground your agents",o9e=()=>"为智能体提供可靠依据",l9e=()=>"عامل‌هایتان را به منابع متصل کنید",c9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?o9e():t==="fa"?l9e():a9e()}),u9e=()=>"Install broken",d9e=()=>"安装损坏",f9e=()=>"نصب خراب است",h9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?d9e():t==="fa"?f9e():u9e()}),_9e=()=>"Install Git to continue",p9e=()=>"请安装 Git 后再继续",m9e=()=>"برای ادامه Git را نصب کنید",g9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?p9e():t==="fa"?m9e():_9e()}),v9e=()=>"Local Git",b9e=()=>"本地 Git",y9e=()=>"Git محلی",x9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?b9e():t==="fa"?y9e():v9e()}),w9e=()=>", and ",S9e=()=>" 和 ",k9e=()=>" و ",C9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Compatible with",N9e=()=>"兼容",z9e=()=>"سازگار با",j9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),T9e=()=>"Use your own local models",A9e=()=>"使用你自己的本地模型",R9e=()=>"از مدل‌های محلی خود استفاده کنید",M9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),D9e=()=>"Not detected",L9e=()=>"未检测到",O9e=()=>"شناسایی نشد",fN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),I9e=()=>"Not found",B9e=()=>"未找到",$9e=()=>"پیدا نشد",WD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?B9e():t==="fa"?$9e():I9e()}),P9e=()=>"Not signed in",F9e=()=>"未登录",H9e=()=>"وارد نشده",q9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?F9e():t==="fa"?H9e():P9e()}),U9e=()=>"OpenResearch uses a coding agent already installed on this machine.",G9e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",W9e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",V9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G9e():t==="fa"?W9e():U9e()}),K9e=()=>"Other research area",Q9e=()=>"其他研究领域",Y9e=()=>"حوزهٔ پژوهشی دیگر",X9e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Q9e():t==="fa"?Y9e():K9e()}),Z9e=()=>"Re-check",J9e=()=>"重新检查",eEe=()=>"بررسی دوباره",VD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J9e():t==="fa"?eEe():Z9e()}),tEe=()=>"Ready",nEe=()=>"已就绪",rEe=()=>"آماده",o6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nEe():t==="fa"?rEe():tEe()}),sEe=()=>"Re-check Git before continuing",iEe=()=>"请重新检查 Git 后再继续",aEe=()=>"پیش از ادامه Git را دوباره بررسی کنید",oEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),lEe=()=>"Representative papers",cEe=()=>"代表性论文",uEe=()=>"مقاله‌های شاخص",dEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cEe():t==="fa"?uEe():lEe()}),fEe=()=>"Research background",hEe=()=>"研究背景",_Ee=()=>"پیشینهٔ پژوهشی",pEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hEe():t==="fa"?_Ee():fEe()}),mEe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",gEe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",vEe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",hN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gEe():t==="fa"?vEe():mEe()}),bEe=()=>"Search alphaXiv by title to link a paper…",yEe=()=>"按标题搜索 alphaXiv 以关联论文…",xEe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",wEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yEe():t==="fa"?xEe():bEe()}),SEe=()=>"Searching alphaXiv…",kEe=()=>"正在搜索 alphaXiv…",CEe=()=>"در حال جست‌وجوی alphaXiv…",EEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kEe():t==="fa"?CEe():SEe()}),NEe=()=>"Selected",zEe=()=>"已选择",jEe=()=>"انتخاب‌شده",TEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zEe():t==="fa"?jEe():NEe()}),AEe=()=>"Local model unavailable",REe=()=>"本地模型不可用",MEe=()=>"مدل محلی در دسترس نیست",KD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?REe():t==="fa"?MEe():AEe()}),DEe=()=>"Setting things up…",LEe=()=>"正在设置…",OEe=()=>"در حال راه‌اندازی…",IEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LEe():t==="fa"?OEe():DEe()}),BEe=()=>"Connect a local model or sign in to a coding agent to continue",$Ee=()=>"连接本地模型或登录编码智能体以继续",PEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل کدنویسی وارد شوید",FEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ee():t==="fa"?PEe():BEe()}),HEe=()=>"Connect a local model or sign in to an agent to continue.",qEe=()=>"连接本地模型或登录一个智能体以继续。",UEe=()=>"برای ادامه، یک مدل محلی متصل کنید یا به یک عامل وارد شوید.",GEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qEe():t==="fa"?UEe():HEe()}),WEe=()=>"Signed in",VEe=()=>"已登录",KEe=()=>"وارد شده",QEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VEe():t==="fa"?KEe():WEe()}),YEe=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",XEe=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",ZEe=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",JEe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XEe():t==="fa"?ZEe():YEe()}),eNe=()=>"· Step 1 of 2",tNe=()=>"· 第 1 步,共 2 步",nNe=()=>"· مرحلهٔ ۱ از ۲",rNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tNe():t==="fa"?nNe():eNe()}),sNe=()=>"· Step 2 of 2",iNe=()=>"· 第 2 步,共 2 步",aNe=()=>"· مرحلهٔ ۲ از ۲",oNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iNe():t==="fa"?aNe():sNe()}),lNe=()=>"Tell us about your research",cNe=()=>"介绍一下你的研究",uNe=()=>"از پژوهش خود بگویید",dNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cNe():t==="fa"?uNe():lNe()}),fNe=()=>"Tell us your other research area",hNe=()=>"告诉我们你的其他研究领域",_Ne=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",pNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hNe():t==="fa"?_Ne():fNe()}),mNe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",gNe=()=>"在一处跟踪实验、产物、算力、技能和代码。",vNe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",bNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gNe():t==="fa"?vNe():mNe()}),yNe=()=>"Unable to verify",xNe=()=>"无法验证",wNe=()=>"تأیید ممکن نیست",SNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xNe():t==="fa"?wNe():yNe()}),kNe=()=>"Update required",CNe=()=>"需要更新",ENe=()=>"نیازمند به‌روزرسانی",NNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CNe():t==="fa"?ENe():kNe()}),zNe=()=>"Waiting for the Git check",jNe=()=>"正在等待 Git 检查",TNe=()=>"در انتظار بررسی Git",ANe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jNe():t==="fa"?TNe():zNe()}),RNe=()=>"Waiting for the local tool checks",MNe=()=>"正在等待本地工具检查",DNe=()=>"در انتظار بررسی ابزارهای محلی",LNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MNe():t==="fa"?DNe():RNe()}),ONe=()=>"What areas are you interested in?",INe=()=>"你对哪些领域感兴趣?",BNe=()=>"به چه حوزه‌هایی علاقه دارید؟",$Ne=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?INe():t==="fa"?BNe():ONe()}),PNe=()=>"Your code, data, and experiment history stay on your machine.",FNe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",HNe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",qNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FNe():t==="fa"?HNe():PNe()}),UNe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",GNe=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",WNe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",VNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GNe():t==="fa"?WNe():UNe()}),KNe=()=>"Add cookie",QNe=()=>"添加 cookie",YNe=()=>"افزودن کوکی",XNe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QNe():t==="fa"?YNe():KNe()}),ZNe=()=>"Changed here and on Overleaf — choose which copy to keep",JNe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",eze=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",tze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JNe():t==="fa"?eze():ZNe()}),nze=()=>"Create a token ↗",rze=()=>"创建令牌 ↗",sze=()=>"ساخت توکن ↗",ize=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rze():t==="fa"?sze():nze()}),aze=()=>"Overleaf Git token",oze=()=>"Overleaf Git 令牌",lze=()=>"توکن Git در Overleaf",_N=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oze():t==="fa"?lze():aze()}),cze=()=>"Follow Overleaf as people type by adding your Overleaf session cookie.",uze=()=>"添加 Overleaf 会话 cookie,即可在他人输入时实时跟随 Overleaf。",dze=()=>"با افزودن کوکی نشست Overleaf، هنگام تایپ دیگران Overleaf را زنده دنبال کنید.",fze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uze():t==="fa"?dze():cze()}),hze=()=>"Import from browser",_ze=()=>"从浏览器导入",pze=()=>"وارد کردن از مرورگر",mze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_ze():t==="fa"?pze():hze()}),gze=()=>"In step with Overleaf",vze=()=>"已与 Overleaf 同步",bze=()=>"با Overleaf همگام است",QD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vze():t==="fa"?bze():gze()}),yze=()=>"The last sync did not finish.",xze=()=>"上次同步未完成。",wze=()=>"آخرین همگام‌سازی کامل نشد.",Sze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xze():t==="fa"?wze():yze()}),kze=()=>"Link and sync",Cze=()=>"关联并同步",Eze=()=>"پیوند و همگام‌سازی",Nze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"Connecting to Overleaf…",jze=()=>"正在连接 Overleaf…",Tze=()=>"در حال اتصال به Overleaf…",Aze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Edits are live on Overleaf",Mze=()=>"编辑已在 Overleaf 实时同步",Dze=()=>"ویرایش‌ها روی Overleaf زنده‌اند",Lze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mze():t==="fa"?Dze():Rze()}),Oze=()=>"Retry",Ize=()=>"重试",Bze=()=>"تلاش دوباره",$ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Live sync stopped.",Fze=()=>"实时同步已停止。",Hze=()=>"همگام‌سازی زنده متوقف شد.",qze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fze():t==="fa"?Hze():Pze()}),Uze=()=>"Live sync starts once the paper is in step with Overleaf.",Gze=()=>"论文与 Overleaf 同步后,实时同步即会开始。",Wze=()=>"همگام‌سازی زنده پس از هم‌گام شدن مقاله با Overleaf آغاز می‌شود.",Vze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Gze():t==="fa"?Wze():Uze()}),Kze=()=>"My projects ↗",Qze=()=>"我的项目 ↗",Yze=()=>"پروژه‌های من ↗",pN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qze():t==="fa"?Yze():Kze()}),Xze=()=>"Nothing could be synced.",Zze=()=>"没有内容可以同步。",Jze=()=>"هیچ موردی قابل همگام‌سازی نبود.",eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zze():t==="fa"?Jze():Xze()}),tje=()=>"Open Overleaf ↗",nje=()=>"打开 Overleaf ↗",rje=()=>"باز کردن Overleaf ↗",sje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"Cancel",aje=()=>"取消",oje=()=>"لغو",YD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),lje=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",cje=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",uje=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",dje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cje():t==="fa"?uje():lje()}),fje=()=>"Keep this copy",hje=()=>"保留此副本",_je=()=>"نگه داشتن این نسخه",pje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),mje=()=>"Open in Overleaf",gje=()=>"在 Overleaf 中打开",vje=()=>"باز کردن در Overleaf",bje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gje():t==="fa"?vje():mje()}),yje=()=>"Replace the Overleaf token",xje=()=>"替换 Overleaf 令牌",wje=()=>"جایگزینی توکن Overleaf",mN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xje():t==="fa"?wje():yje()}),Sje=()=>"Sync files",kje=()=>"同步文件",Cje=()=>"همگام‌سازی فایل‌ها",Eje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Unlink",zje=()=>"取消关联",jje=()=>"قطع پیوند",Tje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Aje=()=>"Upload a copy as a new project ↗",Rje=()=>"上传副本作为新项目 ↗",Mje=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",XD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rje():t==="fa"?Mje():Aje()}),Dje=()=>"Use Overleaf's",Lje=()=>"使用 Overleaf 的副本",Oje=()=>"استفاده از نسخهٔ Overleaf",Ije=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lje():t==="fa"?Oje():Dje()}),Bje=()=>"This paper stays in step with Overleaf.",$je=()=>"此论文将与 Overleaf 保持同步。",Pje=()=>"این مقاله با Overleaf همگام می‌ماند.",Fje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$je():t==="fa"?Pje():Bje()}),Hje=()=>"Paste it instead",qje=()=>"改为粘贴",Uje=()=>"به‌جایش بچسبانید",Gje=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qje():t==="fa"?Uje():Hje()}),Wje=e=>`Pulled ${e==null?void 0:e.paths}.`,Vje=e=>`已拉取 ${e==null?void 0:e.paths}。`,Kje=e=>`${e==null?void 0:e.paths} دریافت شد.`,Qje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Vje(e):t==="fa"?Kje(e):Wje(e)}),Yje=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Xje=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Zje=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,Jje=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),eTe=e=>`Pushed ${e==null?void 0:e.paths}.`,tTe=e=>`已推送 ${e==null?void 0:e.paths}。`,nTe=e=>`${e==null?void 0:e.paths} ارسال شد.`,rTe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tTe(e):t==="fa"?nTe(e):eTe(e)}),sTe=()=>"Add a fresh Overleaf session cookie to start following again.",iTe=()=>"添加新的 Overleaf 会话 cookie 即可继续实时跟随。",aTe=()=>"برای ادامهٔ دنبال کردن، کوکی نشست تازه‌ای از Overleaf اضافه کنید.",oTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iTe():t==="fa"?aTe():sTe()}),lTe=()=>"Save the file first",cTe=()=>"请先保存文件",uTe=()=>"ابتدا فایل را ذخیره کنید",dTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cTe():t==="fa"?uTe():lTe()}),fTe=()=>"Save this file to sync it with Overleaf",hTe=()=>"保存此文件以与 Overleaf 同步",_Te=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",ZD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),pTe=()=>"Save token",mTe=()=>"保存令牌",gTe=()=>"ذخیرهٔ توکن",vTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mTe():t==="fa"?gTe():pTe()}),bTe=()=>"Send this paper to Overleaf",yTe=()=>"将此论文发送到 Overleaf",xTe=()=>"ارسال مقاله به Overleaf",wTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yTe():t==="fa"?xTe():bTe()}),STe=()=>"Overleaf session cookie",kTe=()=>"Overleaf 会话 cookie",CTe=()=>"کوکی نشست Overleaf",T4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kTe():t==="fa"?CTe():STe()}),ETe=()=>"To follow Overleaf as people type, paste your Overleaf session cookie: in a browser signed in to Overleaf, open the developer tools, find the overleaf_session2 cookie, and copy its value. It stays on this machine.",NTe=()=>"要在他人输入时实时跟随 Overleaf,请粘贴你的 Overleaf 会话 cookie:在已登录 Overleaf 的浏览器中打开开发者工具,找到 overleaf_session2 cookie 并复制其值。它只保存在这台机器上。",zTe=()=>"برای دنبال کردن Overleaf هنگام تایپ دیگران، کوکی نشست Overleaf خود را بچسبانید: در مرورگری که به Overleaf وارد شده‌اید، ابزارهای توسعه‌دهنده را باز کنید، کوکی overleaf_session2 را پیدا کنید و مقدار آن را کپی کنید. این مقدار روی همین دستگاه می‌ماند.",jTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=()=>"Overleaf sync failed",ATe=()=>"Overleaf 同步失败",RTe=()=>"همگام‌سازی با Overleaf ناموفق بود",A4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ATe():t==="fa"?RTe():TTe()}),MTe=()=>"Text syncs live. This moves figures and other files, and settles conflicts.",DTe=()=>"文本会实时同步。此操作用于同步图片等其他文件,并解决冲突。",LTe=()=>"متن زنده همگام می‌شود. این کار تصویرها و دیگر فایل‌ها را جابه‌جا می‌کند و تعارض‌ها را حل می‌کند.",OTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DTe():t==="fa"?LTe():MTe()}),ITe=()=>"Syncing with Overleaf…",BTe=()=>"正在与 Overleaf 同步…",$Te=()=>"در حال همگام‌سازی با Overleaf…",JD=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BTe():t==="fa"?$Te():ITe()}),PTe=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",FTe=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",HTe=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",qTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FTe():t==="fa"?HTe():PTe()}),UTe=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",GTe=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",WTe=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",VTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GTe():t==="fa"?WTe():UTe()}),KTe=()=>"Toggle Plan mode for this chat",QTe=()=>"切换此聊天的计划模式",YTe=()=>"تغییر حالت طرح این گفت‌وگو",XTe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QTe():t==="fa"?YTe():KTe()}),ZTe=()=>"Accept and auto mode",JTe=()=>"接受并使用自动模式",eAe=()=>"پذیرش و حالت خودکار",tAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JTe():t==="fa"?eAe():ZTe()}),nAe=()=>"Accept and bypass all",rAe=()=>"接受并跳过所有审批",sAe=()=>"پذیرش و عبور از همهٔ تأییدها",iAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rAe():t==="fa"?sAe():nAe()}),aAe=()=>"Accept plan",oAe=()=>"接受计划",lAe=()=>"پذیرش طرح",cAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oAe():t==="fa"?lAe():aAe()}),uAe=e=>`${e==null?void 0:e.agent} proposed a plan`,dAe=e=>`${e==null?void 0:e.agent} 提出了一个计划`,fAe=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,hAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dAe(e):t==="fa"?fAe(e):uAe(e)}),_Ae=e=>`${e==null?void 0:e.agent} is ready to proceed`,pAe=e=>`${e==null?void 0:e.agent} 已准备好继续`,mAe=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,gAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?pAe(e):t==="fa"?mAe(e):_Ae(e)}),vAe=()=>"Back",bAe=()=>"返回",yAe=()=>"بازگشت",xAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bAe():t==="fa"?yAe():vAe()}),wAe=()=>"More approval options",SAe=()=>"更多批准选项",kAe=()=>"گزینه‌های تأیید بیشتر",CAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Open plan",NAe=()=>"打开计划",zAe=()=>"باز کردن طرح",jAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),TAe=()=>"Reject",AAe=()=>"拒绝",RAe=()=>"رد کردن",MAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),DAe=()=>"Revise",LAe=()=>"修改",OAe=()=>"بازنگری",IAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LAe():t==="fa"?OAe():DAe()}),BAe=()=>"Revise…",$Ae=()=>"修改…",PAe=()=>"بازنگری…",FAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Ae():t==="fa"?PAe():BAe()}),HAe=()=>"What should change? (optional)",qAe=()=>"需要更改什么?(可选)",UAe=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",GAe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qAe():t==="fa"?UAe():HAe()}),WAe=e=>`${e==null?void 0:e.count} active`,VAe=e=>`${e==null?void 0:e.count} 个活跃`,KAe=e=>`${e==null?void 0:e.count} فعال`,QAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?VAe(e):t==="fa"?KAe(e):WAe(e)}),YAe=e=>`${e==null?void 0:e.count} total agents`,XAe=e=>`共 ${e==null?void 0:e.count} 个智能体`,ZAe=e=>`در مجموع ${e==null?void 0:e.count} عامل`,JAe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?XAe(e):t==="fa"?ZAe(e):YAe(e)}),eRe=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,tRe=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,nRe=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,rRe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tRe(e):t==="fa"?nRe(e):eRe(e)}),sRe=()=>"Agents",iRe=()=>"智能体",aRe=()=>"عامل‌ها",gN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),oRe=()=>"arXiv paper ID:",lRe=()=>"arXiv 论文 ID:",cRe=()=>"شناسهٔ مقالهٔ arXiv:",uRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Cancel",fRe=()=>"取消",hRe=()=>"لغو",_Re=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),pRe=()=>"Created",mRe=()=>"创建时间",gRe=()=>"ایجادشده",vRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mRe():t==="fa"?gRe():pRe()}),bRe=()=>"Delete project?",yRe=()=>"删除项目?",xRe=()=>"پروژه حذف شود؟",wRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yRe():t==="fa"?xRe():bRe()}),SRe=()=>"Delete project",kRe=()=>"删除项目",CRe=()=>"حذف پروژه",ERe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kRe():t==="fa"?CRe():SRe()}),NRe=()=>"Deleting…",zRe=()=>"正在删除…",jRe=()=>"در حال حذف…",TRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zRe():t==="fa"?jRe():NRe()}),ARe=()=>"Experiments",RRe=()=>"实验",MRe=()=>"آزمایش‌ها",vN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RRe():t==="fa"?MRe():ARe()}),DRe=()=>"The local folder and linked GitHub repository are kept.",LRe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",ORe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",IRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),BRe=()=>"The local folder is kept.",$Re=()=>"本地文件夹会保留。",PRe=()=>"پوشهٔ محلی نگه داشته می‌شود.",FRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Re():t==="fa"?PRe():BRe()}),HRe=()=>"New project",qRe=()=>"新建项目",URe=()=>"پروژهٔ جدید",eL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qRe():t==="fa"?URe():HRe()}),GRe=()=>"No projects yet — create one to get started.",WRe=()=>"尚无项目——新建一个即可开始。",VRe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",KRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WRe():t==="fa"?VRe():GRe()}),QRe=()=>"Project",YRe=()=>"项目",XRe=()=>"پروژه",ZRe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YRe():t==="fa"?XRe():QRe()}),JRe=()=>"Projects",eMe=()=>"项目",tMe=()=>"پروژه‌ها",nMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eMe():t==="fa"?tMe():JRe()}),rMe=()=>"Repository",sMe=()=>"仓库",iMe=()=>"مخزن",bN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sMe():t==="fa"?iMe():rMe()}),aMe=()=>"Idle",oMe=()=>"空闲",lMe=()=>"بیکار",cMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Local",dMe=()=>"本地",fMe=()=>"محلی",l6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dMe():t==="fa"?fMe():uMe()}),hMe=()=>"1 total agent",_Me=()=>"共 1 个智能体",pMe=()=>"در مجموع ۱ عامل",mMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=e=>`${e==null?void 0:e.count} running`,vMe=e=>`${e==null?void 0:e.count} 个运行中`,bMe=e=>`${e==null?void 0:e.count} در حال اجرا`,yMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?vMe(e):t==="fa"?bMe(e):gMe(e)}),xMe=e=>`${e==null?void 0:e.count} total`,wMe=e=>`共 ${e==null?void 0:e.count} 个`,SMe=e=>`در مجموع ${e==null?void 0:e.count}`,yN=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?wMe(e):t==="fa"?SMe(e):xMe(e)}),kMe=()=>"Installing the compatible binary. This may take a few minutes.",CMe=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",EMe=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",NMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CMe():t==="fa"?EMe():kMe()}),zMe=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,jMe=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,TMe=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,AMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jMe(e):t==="fa"?TMe(e):zMe(e)}),RMe=()=>"Check again",MMe=()=>"再次检查",DMe=()=>"بررسی دوباره",xN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MMe():t==="fa"?DMe():RMe()}),LMe=()=>"Closing…",OMe=()=>"正在关闭…",IMe=()=>"در حال بستن…",BMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OMe():t==="fa"?IMe():LMe()}),$Me=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,PMe=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,FMe=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,HMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PMe(e):t==="fa"?FMe(e):$Me(e)}),qMe=()=>"Preparing your remote workspace…",UMe=()=>"正在准备远程工作区…",GMe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",WMe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UMe():t==="fa"?GMe():qMe()}),VMe=e=>`Connecting to ${e==null?void 0:e.host}`,KMe=e=>`正在连接到 ${e==null?void 0:e.host}`,QMe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,YMe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KMe(e):t==="fa"?QMe(e):VMe(e)}),XMe=()=>"Close remote host picker",ZMe=()=>"关闭远程主机选择器",JMe=()=>"بستن انتخاب‌گر میزبان راه‌دور",eDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZMe():t==="fa"?JMe():XMe()}),tDe=()=>"Choose a configured SSH host.",nDe=()=>"选择已配置的 SSH 主机。",rDe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",sDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nDe():t==="fa"?rDe():tDe()}),iDe=()=>"Connect to remote",aDe=()=>"连接到远程主机",oDe=()=>"اتصال به میزبان راه‌دور",tL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aDe():t==="fa"?oDe():iDe()}),lDe=()=>"Disconnect",cDe=()=>"断开连接",uDe=()=>"قطع اتصال",R4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Your remote work is still running. Reconnect when you’re ready.",fDe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",hDe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",_De=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=e=>`Disconnected from ${e==null?void 0:e.host}`,mDe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,gDe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,nL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?mDe(e):t==="fa"?gDe(e):pDe(e)}),vDe=e=>`Could not connect to ${e==null?void 0:e.host}`,bDe=e=>`无法连接到 ${e==null?void 0:e.host}`,yDe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,xDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bDe(e):t==="fa"?yDe(e):vDe(e)}),wDe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",SDe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",kDe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",CDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SDe():t==="fa"?kDe():wDe()}),EDe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",NDe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",zDe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",jDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NDe():t==="fa"?zDe():EDe()}),TDe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,ADe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,RDe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,MDe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ADe(e):t==="fa"?RDe(e):TDe(e)}),DDe=()=>"OpenResearch binary",LDe=()=>"OpenResearch 二进制文件",ODe=()=>"فایل اجرایی OpenResearch",IDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LDe():t==="fa"?ODe():DDe()}),BDe=()=>"OpenResearch Database",$De=()=>"OpenResearch 数据库",PDe=()=>"پایگاه دادهٔ OpenResearch",FDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",qDe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",UDe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",GDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qDe():t==="fa"?UDe():HDe()}),WDe=()=>"Install OpenResearch?",VDe=()=>"安装 OpenResearch?",KDe=()=>"OpenResearch نصب شود؟",QDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VDe():t==="fa"?KDe():WDe()}),YDe=()=>"Installing…",XDe=()=>"正在安装…",ZDe=()=>"در حال نصب…",JDe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),eLe=()=>"No matching SSH hosts",tLe=()=>"没有匹配的 SSH 主机",nLe=()=>"میزبان SSH منطبقی پیدا نشد",rLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,iLe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,aLe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,oLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=()=>"Open remote",cLe=()=>"打开远程工作区",uLe=()=>"باز کردن راه‌دور",dLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cLe():t==="fa"?uLe():lLe()}),fLe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",hLe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",_Le=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",pLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hLe():t==="fa"?_Le():fLe()}),mLe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",gLe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",vLe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",bLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gLe():t==="fa"?vLe():mLe()}),yLe=()=>"Preparing remote workspace…",xLe=()=>"正在准备远程工作区…",wLe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",SLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xLe():t==="fa"?wLe():yLe()}),kLe=()=>"Reconnect",CLe=()=>"重新连接",ELe=()=>"اتصال دوباره",wN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),NLe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",zLe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",jLe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",TLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zLe():t==="fa"?jLe():NLe()}),ALe=e=>`Reconnecting to ${e==null?void 0:e.host}`,RLe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,MLe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,DLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RLe(e):t==="fa"?MLe(e):ALe(e)}),LLe=()=>"Search SSH hosts",OLe=()=>"搜索 SSH 主机",ILe=()=>"جستجوی میزبان‌های SSH",SN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),BLe=e=>`SSH: ${e==null?void 0:e.host}`,$Le=e=>`SSH:${e==null?void 0:e.host}`,PLe=e=>`SSH: ${e==null?void 0:e.host}`,E2=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Le(e):t==="fa"?PLe(e):BLe(e)}),FLe=()=>"Start a new OpenResearch host",HLe=()=>"启动新的 OpenResearch 主机",qLe=()=>"راه‌اندازی میزبان جدید OpenResearch",ULe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HLe():t==="fa"?qLe():FLe()}),GLe=e=>`End ${e==null?void 0:e.count} pending approvals.`,WLe=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,VLe=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,KLe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?WLe(e):t==="fa"?VLe(e):GLe(e)}),QLe=()=>"Stop OpenResearch",YLe=()=>"停止 OpenResearch",XLe=()=>"توقف OpenResearch",ZLe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YLe():t==="fa"?XLe():QLe()}),JLe=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,eOe=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,tOe=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,nOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eOe(e):t==="fa"?tOe(e):JLe(e)}),rOe=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,sOe=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,iOe=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,aOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?sOe(e):t==="fa"?iOe(e):rOe(e)}),oOe=()=>"Stop OpenResearch on host",lOe=()=>"停止主机上的 OpenResearch",cOe=()=>"توقف OpenResearch روی میزبان",rL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>"This will also:",dOe=()=>"这还将:",fOe=()=>"این کار همچنین:",hOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"End 1 pending approval.",pOe=()=>"结束 1 个待审批请求。",mOe=()=>"۱ تأیید در انتظار را پایان می‌دهد.",gOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),vOe=()=>"Leave 1 submitted experiment running.",bOe=()=>"让 1 个已提交实验继续运行。",yOe=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",xOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bOe():t==="fa"?yOe():vOe()}),wOe=()=>"Disconnect 1 other client.",SOe=()=>"断开 1 个其他客户端。",kOe=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",COe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Keep 1 queued message saved.",NOe=()=>"保留 1 条排队消息。",zOe=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",jOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),TOe=()=>"Interrupt 1 active agent turn.",AOe=()=>"中断 1 个活动代理任务。",ROe=()=>"۱ نوبت فعال عامل را قطع می‌کند.",MOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AOe():t==="fa"?ROe():TOe()}),DOe=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,LOe=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,OOe=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,IOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LOe(e):t==="fa"?OOe(e):DOe(e)}),BOe=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,$Oe=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,POe=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,FOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?$Oe(e):t==="fa"?POe(e):BOe(e)}),HOe=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,qOe=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,UOe=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,GOe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qOe(e):t==="fa"?UOe(e):HOe(e)}),WOe=()=>"Stopping host…",VOe=()=>"正在停止主机…",KOe=()=>"در حال توقف میزبان…",QOe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VOe():t==="fa"?KOe():WOe()}),YOe=()=>"Update",XOe=()=>"更新",ZOe=()=>"به‌روزرسانی",kN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,eIe=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,tIe=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,nIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?eIe(e):t==="fa"?tIe(e):JOe(e)}),rIe=()=>"Update OpenResearch?",sIe=()=>"更新 OpenResearch?",iIe=()=>"OpenResearch به‌روزرسانی شود؟",aIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Updating…",lIe=()=>"正在更新…",cIe=()=>"در حال به‌روزرسانی…",uIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),dIe=()=>"Disable syncing",fIe=()=>"关闭同步",hIe=()=>"غیرفعال کردن همگام‌سازی",_Ie=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fIe():t==="fa"?hIe():dIe()}),pIe=()=>"Enable GitHub syncing",mIe=()=>"启用 GitHub 同步",gIe=()=>"فعال‌سازی همگام‌سازی GitHub",vIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mIe():t==="fa"?gIe():pIe()}),bIe=()=>"Enabling…",yIe=()=>"正在启用…",xIe=()=>"در حال فعال‌سازی…",wIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yIe():t==="fa"?xIe():bIe()}),SIe=()=>"Updating…",kIe=()=>"正在更新…",CIe=()=>"در حال به‌روزرسانی…",EIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,zIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,jIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,TIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zIe(e):t==="fa"?jIe(e):NIe(e)}),AIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,RIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,MIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,DIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?RIe(e):t==="fa"?MIe(e):AIe(e)}),LIe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,OIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,IIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,BIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?OIe(e):t==="fa"?IIe(e):LIe(e)}),$Ie=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,PIe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,FIe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,HIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?PIe(e):t==="fa"?FIe(e):$Ie(e)}),qIe=()=>"CLI is retrying…",UIe=()=>"CLI 正在重试…",GIe=()=>"CLI در حال تلاش دوباره است…",WIe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UIe():t==="fa"?GIe():qIe()}),VIe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,KIe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,QIe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,YIe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KIe(e):t==="fa"?QIe(e):VIe(e)}),XIe=()=>"Sending again…",ZIe=()=>"正在重新发送…",JIe=()=>"در حال ارسال دوباره…",eBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZIe():t==="fa"?JIe():XIe()}),tBe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,nBe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,rBe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,sBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nBe(e):t==="fa"?rBe(e):tBe(e)}),iBe=()=>"Retrying…",aBe=()=>"正在重试…",oBe=()=>"در حال تلاش دوباره…",sL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aBe():t==="fa"?oBe():iBe()}),lBe=()=>"Default speed",cBe=()=>"默认速度",uBe=()=>"سرعت پیش‌فرض",dBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cBe():t==="fa"?uBe():lBe()}),fBe=()=>"Standard",hBe=()=>"标准",_Be=()=>"استاندارد",pBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hBe():t==="fa"?_Be():fBe()}),mBe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,gBe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,vBe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,bBe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gBe(e):t==="fa"?vBe(e):mBe(e)}),yBe=()=>"Appearance",xBe=()=>"外观",wBe=()=>"ظاهر",SBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xBe():t==="fa"?wBe():yBe()}),kBe=()=>"Check",CBe=()=>"检查",EBe=()=>"بررسی",NBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CBe():t==="fa"?EBe():kBe()}),zBe=()=>"Check again",jBe=()=>"再次检查",TBe=()=>"بررسی دوباره",Qp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jBe():t==="fa"?TBe():zBe()}),ABe=()=>"Check for updates",RBe=()=>"检查更新",MBe=()=>"بررسی به‌روزرسانی",DBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RBe():t==="fa"?MBe():ABe()}),LBe=()=>"Check now",OBe=()=>"立即检查",IBe=()=>"اکنون بررسی کن",BBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OBe():t==="fa"?IBe():LBe()}),$Be=()=>"Check setup",PBe=()=>"检查设置",FBe=()=>"بررسی راه‌اندازی",HBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PBe():t==="fa"?FBe():$Be()}),qBe=()=>"orx checks a few times a day on its own.",UBe=()=>"orx 每天会自动检查几次。",GBe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",WBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UBe():t==="fa"?GBe():qBe()}),VBe=()=>"Choose a flavor",KBe=()=>"选择配置",QBe=()=>"انتخاب پیکربندی",YBe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KBe():t==="fa"?QBe():VBe()}),XBe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,ZBe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,JBe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,e$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ZBe(e):t==="fa"?JBe(e):XBe(e)}),t$e=()=>"clean",n$e=()=>"无更改",r$e=()=>"بدون تغییر",s$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?n$e():t==="fa"?r$e():t$e()}),i$e=e=>`Already linked at ${e==null?void 0:e.link}.`,a$e=e=>`已链接到 ${e==null?void 0:e.link}。`,o$e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,l$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?a$e(e):t==="fa"?o$e(e):i$e(e)}),c$e=e=>`Linked ${e==null?void 0:e.link}.`,u$e=e=>`已链接 ${e==null?void 0:e.link}。`,d$e=e=>`${e==null?void 0:e.link} پیوند شد.`,f$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?u$e(e):t==="fa"?d$e(e):c$e(e)}),h$e=()=>"Connect",_$e=()=>"连接",p$e=()=>"اتصال",c6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_$e():t==="fa"?p$e():h$e()}),m$e=()=>"Connected via GitHub CLI",g$e=()=>"已通过 GitHub CLI 连接",v$e=()=>"از طریق GitHub CLI متصل است",iL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?g$e():t==="fa"?v$e():m$e()}),b$e=()=>"Connecting…",y$e=()=>"正在连接…",x$e=()=>"در حال اتصال…",aL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?y$e():t==="fa"?x$e():b$e()}),w$e=e=>`CPU cores: ${e==null?void 0:e.count}`,S$e=e=>`${e==null?void 0:e.count} 个 CPU 核心`,k$e=e=>`${e==null?void 0:e.count} هستهٔ CPU`,C$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?S$e(e):t==="fa"?k$e(e):w$e(e)}),E$e=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",N$e=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",z$e=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",j$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"the current project",A$e=()=>"当前项目",R$e=()=>"پروژهٔ فعلی",M$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),D$e=e=>`${e==null?void 0:e.value} (custom)`,L$e=e=>`${e==null?void 0:e.value}(自定义)`,O$e=e=>`${e==null?void 0:e.value} (سفارشی)`,I$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?L$e(e):t==="fa"?O$e(e):D$e(e)}),B$e=()=>"detached",$$e=()=>"分离头指针",P$e=()=>"جدا از شاخه",u6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Disconnected",H$e=()=>"已断开连接",q$e=()=>"قطع اتصال",oL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?H$e():t==="fa"?q$e():F$e()}),U$e=()=>"Environment tab",G$e=()=>"环境标签页",W$e=()=>"زبانهٔ محیط",V$e=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?G$e():t==="fa"?W$e():U$e()}),K$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Q$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,Y$e=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,X$e=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Q$e(e):t==="fa"?Y$e(e):K$e(e)}),Z$e=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",J$e=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",ePe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",tPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?J$e():t==="fa"?ePe():Z$e()}),nPe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",rPe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",sPe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",iPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rPe():t==="fa"?sPe():nPe()}),aPe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",oPe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",lPe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",cPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oPe():t==="fa"?lPe():aPe()}),uPe=e=>`GPU × ${e==null?void 0:e.count}`,dPe=e=>`${e==null?void 0:e.count} 个 GPU`,fPe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,hPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?dPe(e):t==="fa"?fPe(e):uPe(e)}),_Pe=()=>"has changes",pPe=()=>"有更改",mPe=()=>"دارای تغییر",gPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pPe():t==="fa"?mPe():_Pe()}),vPe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,bPe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,yPe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,xPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?bPe(e):t==="fa"?yPe(e):vPe(e)}),wPe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",SPe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",kPe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",CPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?SPe():t==="fa"?kPe():wPe()}),EPe=()=>"Install",NPe=()=>"安装",zPe=()=>"نصب",jPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NPe():t==="fa"?zPe():EPe()}),TPe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,APe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,RPe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,MPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?APe(e):t==="fa"?RPe(e):TPe(e)}),DPe=e=>`Install the ${e==null?void 0:e.command} command`,LPe=e=>`安装 ${e==null?void 0:e.command} 命令`,OPe=e=>`نصب فرمان ${e==null?void 0:e.command}`,IPe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?LPe(e):t==="fa"?OPe(e):DPe(e)}),BPe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",$Pe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",PPe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",FPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Pe():t==="fa"?PPe():BPe()}),HPe=()=>"Install the new release now instead of waiting for the background update.",qPe=()=>"立即安装新版本,无需等待后台更新。",UPe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",GPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qPe():t==="fa"?UPe():HPe()}),WPe=()=>"Discard your unsaved Kubernetes changes?",VPe=()=>"要放弃未保存的 Kubernetes 更改吗?",KPe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",QPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VPe():t==="fa"?KPe():WPe()}),YPe=()=>"Key from",XPe=()=>"密钥来自",ZPe=()=>"کلید از",JPe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XPe():t==="fa"?ZPe():YPe()}),eFe=()=>"Use current kubectl context",tFe=()=>"使用当前 kubectl 上下文",nFe=()=>"استفاده از کانتکست فعلی kubectl",rFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tFe():t==="fa"?nFe():eFe()}),sFe=e=>`Use current context (${e==null?void 0:e.context})`,iFe=e=>`使用当前上下文(${e==null?void 0:e.context})`,aFe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,oFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iFe(e):t==="fa"?aFe(e):sFe(e)}),lFe=()=>"Language",cFe=()=>"语言",uFe=()=>"زبان",dFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cFe():t==="fa"?uFe():lFe()}),fFe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,hFe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,_Fe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,pFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hFe(e):t==="fa"?_Fe(e):fFe(e)}),mFe=()=>"Make default",gFe=()=>"设为默认值",vFe=()=>"پیش‌فرض شود",bFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gFe():t==="fa"?vFe():mFe()}),yFe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",xFe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",wFe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",SFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xFe():t==="fa"?wFe():yFe()}),kFe=()=>"Replace token ID",CFe=()=>"替换令牌 ID",EFe=()=>"جایگزینی شناسهٔ توکن",NFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?CFe():t==="fa"?EFe():kFe()}),zFe=()=>"Replace token secret",jFe=()=>"替换令牌密钥",TFe=()=>"جایگزینی رمز توکن",AFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jFe():t==="fa"?TFe():zFe()}),RFe=()=>"How to get a Modal token",MFe=()=>"如何获取 Modal 令牌",DFe=()=>"روش دریافت توکن Modal",LFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MFe():t==="fa"?DFe():RFe()}),OFe=()=>"Token ID",IFe=()=>"令牌 ID",BFe=()=>"شناسهٔ توکن",$Fe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Token secret",FFe=()=>"令牌密钥",HFe=()=>"رمز توکن",qFe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FFe():t==="fa"?HFe():PFe()}),UFe=e=>`${e==null?void 0:e.count} models available — ${e==null?void 0:e.models}`,GFe=e=>`${e==null?void 0:e.count} 个模型可用 — ${e==null?void 0:e.models}`,WFe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,lL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?GFe(e):t==="fa"?WFe(e):UFe(e)}),VFe=e=>`Needs ${e==null?void 0:e.tool}`,KFe=e=>`需要 ${e==null?void 0:e.tool}`,QFe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,YFe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?KFe(e):t==="fa"?QFe(e):VFe(e)}),XFe=()=>"Needs tools",ZFe=()=>"缺少工具",JFe=()=>"به ابزارها نیاز دارد",eHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZFe():t==="fa"?JFe():XFe()}),tHe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,nHe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,rHe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,sHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nHe(e):t==="fa"?rHe(e):tHe(e)}),iHe=()=>"New runs use SSH; choose a host when launching.",aHe=()=>"新运行将使用 SSH;启动时请选择主机。",oHe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",lHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"New token",uHe=()=>"新令牌",dHe=()=>"توکن جدید",fHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"No default flavor",_He=()=>"不设默认配置",pHe=()=>"بدون پیکربندی پیش‌فرض",mHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"none",vHe=()=>"无",bHe=()=>"هیچ‌کدام",d6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vHe():t==="fa"?bHe():gHe()}),yHe=()=>"Not connected",xHe=()=>"未连接",wHe=()=>"متصل نیست",cL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xHe():t==="fa"?wHe():yHe()}),SHe=()=>"not found on PATH",kHe=()=>"在 PATH 中未找到",CHe=()=>"در PATH پیدا نشد",EHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,zHe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,jHe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,THe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zHe(e):t==="fa"?jHe(e):NHe(e)}),AHe=()=>"not initialized",RHe=()=>"尚未初始化",MHe=()=>"راه‌اندازی نشده",DHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RHe():t==="fa"?MHe():AHe()}),LHe=()=>"Not set",OHe=()=>"未设置",IHe=()=>"تنظیم نشده",M4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OHe():t==="fa"?IHe():LHe()}),BHe=()=>"OAuth (subscription login)",$He=()=>"OAuth(订阅登录)",PHe=()=>"OAuth (ورود با اشتراک)",FHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$He():t==="fa"?PHe():BHe()}),HHe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,qHe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,UHe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,GHe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?qHe(e):t==="fa"?UHe(e):HHe(e)}),WHe=()=>"Setting up…",VHe=()=>"正在设置…",KHe=()=>"در حال راه‌اندازی…",QHe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VHe():t==="fa"?KHe():WHe()}),YHe=()=>"Account",XHe=()=>"账户",ZHe=()=>"حساب",f6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Add one with",eqe=()=>"使用以下命令添加:",tqe=()=>"یکی با این فرمان اضافه کنید:",nqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eqe():t==="fa"?tqe():JHe()}),rqe=()=>"Add topics automatically",sqe=()=>"自动添加 topic",iqe=()=>"افزودن خودکار موضوع‌ها",aqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>"Add variable",lqe=()=>"添加变量",cqe=()=>"افزودن متغیر",uqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),dqe=()=>"Agent models",fqe=()=>"智能体模型",hqe=()=>"مدل‌های عامل",_qe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fqe():t==="fa"?hqe():dqe()}),pqe=()=>"Anonymous usage analytics",mqe=()=>"匿名使用情况分析",gqe=()=>"تحلیل ناشناس استفاده",CN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mqe():t==="fa"?gqe():pqe()}),vqe=()=>"Auth",bqe=()=>"身份验证",yqe=()=>"احراز هویت",xqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bqe():t==="fa"?yqe():vqe()}),wqe=()=>"Authentication",Sqe=()=>"身份验证",kqe=()=>"احراز هویت",uL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sqe():t==="fa"?kqe():wqe()}),Cqe=()=>"Auto-apply GitHub topics for new projects",Eqe=()=>"为新项目自动添加 GitHub topic",Nqe=()=>"اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید",EN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eqe():t==="fa"?Nqe():Cqe()}),zqe=()=>"Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.",jqe=()=>"为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。",Tqe=()=>"مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.",dL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jqe():t==="fa"?Tqe():zqe()}),Aqe=()=>"Back to Compute",Rqe=()=>"返回算力设置",Mqe=()=>"بازگشت به رایانش",fL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rqe():t==="fa"?Mqe():Aqe()}),Dqe=()=>"Backend",Lqe=()=>"后端",Oqe=()=>"بک‌اند",Iqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"Baseline",$qe=()=>"基线",Pqe=()=>"خط مبنا",Fqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Binary",qqe=()=>"可执行文件",Uqe=()=>"فایل اجرایی",Gqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qqe():t==="fa"?Uqe():Hqe()}),Wqe=()=>"Cancel",Vqe=()=>"取消",Kqe=()=>"لغو",Ad=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vqe():t==="fa"?Kqe():Wqe()}),Qqe=()=>"Cancel new variable",Yqe=()=>"取消新变量",Xqe=()=>"لغو متغیر جدید",Zqe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Qqe()}),Jqe=()=>"Checking compute targets…",eUe=()=>"正在检查算力目标…",tUe=()=>"در حال بررسی مقصدهای رایانشی…",nUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eUe():t==="fa"?tUe():Jqe()}),rUe=()=>"Checking kubectl…",sUe=()=>"正在检查 kubectl…",iUe=()=>"در حال بررسی kubectl…",aUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sUe():t==="fa"?iUe():rUe()}),oUe=()=>"Checking Modal…",lUe=()=>"正在检查 Modal…",cUe=()=>"در حال بررسی Modal…",uUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lUe():t==="fa"?cUe():oUe()}),dUe=()=>"Choose a preset flavor",fUe=()=>"选择预设规格",hUe=()=>"یک پیکربندی آماده انتخاب کنید",NN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fUe():t==="fa"?hUe():dUe()}),_Ue=()=>"cluster default",pUe=()=>"集群默认值",mUe=()=>"پیش‌فرض خوشه",zN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pUe():t==="fa"?mUe():_Ue()}),gUe=()=>"cluster default (e.g. 4h, 30m)",vUe=()=>"集群默认值(例如 4h、30m)",bUe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",yUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vUe():t==="fa"?bUe():gUe()}),xUe=()=>"Cluster unreachable",wUe=()=>"无法连接集群",SUe=()=>"خوشه در دسترس نیست",kUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wUe():t==="fa"?SUe():xUe()}),CUe=()=>"Compute",EUe=()=>"算力",NUe=()=>"رایانش",hL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EUe():t==="fa"?NUe():CUe()}),zUe=()=>"Connect compute backends and choose where new runs execute.",jUe=()=>"连接算力后端,并选择新运行的执行位置。",TUe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",AUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jUe():t==="fa"?TUe():zUe()}),RUe=()=>"Connected",MUe=()=>"已连接",DUe=()=>"متصل",LUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?MUe():t==="fa"?DUe():RUe()}),OUe=()=>"Context",IUe=()=>"上下文",BUe=()=>"زمینه",$Ue=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),PUe=()=>"Current",FUe=()=>"当前",HUe=()=>"فعلی",qUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?FUe():t==="fa"?HUe():PUe()}),UUe=()=>"Currently off:",GUe=()=>"当前已关闭:",WUe=()=>"اکنون خاموش است:",VUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GUe():t==="fa"?WUe():UUe()}),KUe=()=>"Custom flavor",QUe=()=>"自定义规格",YUe=()=>"پیکربندی سفارشی",XUe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QUe():t==="fa"?YUe():KUe()}),ZUe=()=>"Custom flavor…",JUe=()=>"自定义规格…",eGe=()=>"پیکربندی سفارشی…",tGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?JUe():t==="fa"?eGe():ZUe()}),nGe=()=>"Data directory",rGe=()=>"数据目录",sGe=()=>"پوشهٔ داده",iGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rGe():t==="fa"?sGe():nGe()}),aGe=()=>"default",oGe=()=>"默认",lGe=()=>"پیش‌فرض",cGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oGe():t==="fa"?lGe():aGe()}),uGe=()=>"Default",dGe=()=>"默认",fGe=()=>"پیش‌فرض",_L=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dGe():t==="fa"?fGe():uGe()}),hGe=()=>"Default destination",_Ge=()=>"默认目标",pGe=()=>"مقصد پیش‌فرض",mGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Detecting hardware…",vGe=()=>"正在检测硬件…",bGe=()=>"در حال شناسایی سخت‌افزار…",yGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vGe():t==="fa"?bGe():gGe()}),xGe=()=>"Detecting harnesses…",wGe=()=>"正在检测智能体工具…",SGe=()=>"در حال شناسایی ابزارهای عامل…",kGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wGe():t==="fa"?SGe():xGe()}),CGe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",EGe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",NGe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",zGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EGe():t==="fa"?NGe():CGe()}),jGe=()=>"Effective URL",TGe=()=>"实际使用的网址",AGe=()=>"نشانی مؤثر",RGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TGe():t==="fa"?AGe():jGe()}),MGe=()=>"Enable GitHub syncing for new projects",DGe=()=>"为新项目启用 GitHub 同步",LGe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",jN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DGe():t==="fa"?LGe():MGe()}),OGe=()=>"Environment",IGe=()=>"环境",BGe=()=>"محیط",pL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IGe():t==="fa"?BGe():OGe()}),$Ge=()=>"Failed",PGe=()=>"失败",FGe=()=>"ناموفق",h6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PGe():t==="fa"?FGe():$Ge()}),HGe=()=>"General",qGe=()=>"常规",UGe=()=>"عمومی",GGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qGe():t==="fa"?UGe():HGe()}),WGe=()=>"GitHub publishing",VGe=()=>"GitHub 发布",KGe=()=>"انتشار در GitHub",QGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VGe():t==="fa"?KGe():WGe()}),YGe=()=>"Git token",XGe=()=>"Git 令牌",ZGe=()=>"توکن Git",JGe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XGe():t==="fa"?ZGe():YGe()}),eWe=()=>"Harnesses",tWe=()=>"智能体工具",nWe=()=>"ابزارهای عامل",rWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"hf_…",iWe=()=>"hf_…",aWe=()=>"hf_…",oWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",cWe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",uWe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",dWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),fWe=()=>"Initialize Git",hWe=()=>"初始化 Git",_We=()=>"راه‌اندازی Git",pWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hWe():t==="fa"?_We():fWe()}),mWe=()=>"Install",gWe=()=>"安装",vWe=()=>"نصب",mL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gWe():t==="fa"?vWe():mWe()}),bWe=()=>"Install broken",yWe=()=>"安装损坏",xWe=()=>"نصب خراب است",wWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yWe():t==="fa"?xWe():bWe()}),SWe=()=>"Install GitHub CLI",kWe=()=>"安装 GitHub CLI",CWe=()=>"نصب GitHub CLI",EWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),NWe=()=>"Install updates automatically",zWe=()=>"自动安装更新",jWe=()=>"نصب خودکار به‌روزرسانی‌ها",TN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zWe():t==="fa"?jWe():NWe()}),TWe=()=>"Instance history",AWe=()=>"实例历史",RWe=()=>"تاریخچهٔ نمونه‌ها",MWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AWe():t==="fa"?RWe():TWe()}),DWe=()=>"Invalid Token",LWe=()=>"令牌无效",OWe=()=>"توکن نامعتبر",IWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"Jobs / Dashboard URL",$We=()=>"Jobs / 控制台网址",PWe=()=>"نشانی Jobs / داشبورد",FWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$We():t==="fa"?PWe():BWe()}),HWe=()=>"kubectl not found",qWe=()=>"未找到 kubectl",UWe=()=>"kubectl پیدا نشد",GWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qWe():t==="fa"?UWe():HWe()}),WWe=()=>"Latest",VWe=()=>"最新版本",KWe=()=>"جدیدترین",QWe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VWe():t==="fa"?KWe():WWe()}),YWe=()=>"Loading…",XWe=()=>"正在加载…",ZWe=()=>"در حال بارگیری…",xu=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XWe():t==="fa"?ZWe():YWe()}),JWe=()=>"Loading Ray settings…",eVe=()=>"正在加载 Ray 设置…",tVe=()=>"در حال بارگیری تنظیمات Ray…",nVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eVe():t==="fa"?tVe():JWe()}),rVe=()=>"Loading slurm settings…",sVe=()=>"正在加载 Slurm 设置…",iVe=()=>"در حال بارگیری تنظیمات Slurm…",aVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sVe():t==="fa"?iVe():rVe()}),oVe=()=>"Loading status…",lVe=()=>"正在加载状态…",cVe=()=>"در حال بارگیری وضعیت…",uVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lVe():t==="fa"?cVe():oVe()}),dVe=()=>"Local only",fVe=()=>"仅本地",hVe=()=>"فقط محلی",_Ve=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fVe():t==="fa"?hVe():dVe()}),pVe=()=>"Local repository",mVe=()=>"本地仓库",gVe=()=>"مخزن محلی",vVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mVe():t==="fa"?gVe():pVe()}),bVe=()=>"Login node",yVe=()=>"登录节点",xVe=()=>"گرهٔ ورود",wVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yVe():t==="fa"?xVe():bVe()}),SVe=()=>"Make GitHub syncing the default?",kVe=()=>"将 GitHub 同步设为默认值?",CVe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",EVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kVe():t==="fa"?CVe():SVe()}),NVe=()=>"Missing bash/tar",zVe=()=>"缺少 bash/tar",jVe=()=>"bash/tar موجود نیست",TVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zVe():t==="fa"?jVe():NVe()}),AVe=()=>"More compute options",RVe=()=>"更多算力选项",MVe=()=>"گزینه‌های رایانشی بیشتر",DVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RVe():t==="fa"?MVe():AVe()}),LVe=()=>"Move failed:",OVe=()=>"移动失败:",IVe=()=>"انتقال ناموفق بود:",BVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OVe():t==="fa"?IVe():LVe()}),$Ve=()=>"Moved. orx is now using the new location.",PVe=()=>"已移动。orx 现在使用新位置。",FVe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",HVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PVe():t==="fa"?FVe():$Ve()}),qVe=()=>"Namespace",UVe=()=>"命名空间",GVe=()=>"فضای نام",WVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UVe():t==="fa"?GVe():qVe()}),VVe=()=>"New location",KVe=()=>"新位置",QVe=()=>"محل جدید",YVe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KVe():t==="fa"?QVe():VVe()}),XVe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",ZVe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",JVe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",eKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZVe():t==="fa"?JVe():XVe()}),tKe=()=>"New variable key",nKe=()=>"新变量键名",rKe=()=>"کلید متغیر جدید",sKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nKe():t==="fa"?rKe():tKe()}),iKe=()=>"New variable value",aKe=()=>"新变量值",oKe=()=>"مقدار متغیر جدید",lKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aKe():t==="fa"?oKe():iKe()}),cKe=()=>"No code, prompts, file contents, or account identifiers are sent.",uKe=()=>"不会发送代码、提示词、文件内容或账户标识符。",dKe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",fKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uKe():t==="fa"?dKe():cKe()}),hKe=()=>"No hosts found in ~/.ssh/config.",_Ke=()=>"在 ~/.ssh/config 中未找到主机。",pKe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",mKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_Ke():t==="fa"?pKe():hKe()}),gKe=()=>"No job-create permission",vKe=()=>"没有创建 Job 的权限",bKe=()=>"مجوز ساخت Job وجود ندارد",yKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vKe():t==="fa"?bKe():gKe()}),xKe=()=>"No Write Permissions",wKe=()=>"无写入权限",SKe=()=>"بدون مجوز نوشتن",kKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wKe():t==="fa"?SKe():xKe()}),CKe=()=>"No key on this computer to register — load a registered key with",EKe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",NKe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",zKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?EKe():t==="fa"?NKe():CKe()}),jKe=()=>"No key on this computer yet — create one with",TKe=()=>"此计算机上还没有密钥——使用以下命令创建:",AKe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",RKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TKe():t==="fa"?AKe():jKe()}),MKe=()=>"No Slurm CLI",DKe=()=>"无 Slurm CLI",LKe=()=>"بدون CLI اسلورم",OKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DKe():t==="fa"?LKe():MKe()}),IKe=()=>"None registered",BKe=()=>"未注册任何密钥",$Ke=()=>"هیچ‌کدام ثبت نشده",PKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BKe():t==="fa"?$Ke():IKe()}),FKe=()=>"Not checked",HKe=()=>"未检查",qKe=()=>"بررسی نشده",gL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HKe():t==="fa"?qKe():FKe()}),UKe=()=>"Not configured",GKe=()=>"未配置",WKe=()=>"پیکربندی نشده",tb=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GKe():t==="fa"?WKe():UKe()}),VKe=()=>"Not installed",KKe=()=>"未安装",QKe=()=>"نصب نیست",YKe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KKe():t==="fa"?QKe():VKe()}),XKe=()=>"Not now",ZKe=()=>"暂不",JKe=()=>"اکنون نه",eQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZKe():t==="fa"?JKe():XKe()}),tQe=()=>"Not on this computer",nQe=()=>"不在此计算机上",rQe=()=>"روی این رایانه نیست",sQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nQe():t==="fa"?rQe():tQe()}),iQe=()=>"Not set (pass --host per launch)",aQe=()=>"未设置(每次启动时传入 --host)",oQe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",lQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?aQe():t==="fa"?oQe():iQe()}),cQe=()=>"Not signed in",uQe=()=>"未登录",dQe=()=>"وارد نشده",vL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?uQe():t==="fa"?dQe():cQe()}),fQe=()=>"On this computer",hQe=()=>"在此计算机上",_Qe=()=>"روی این رایانه",pQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hQe():t==="fa"?_Qe():fQe()}),mQe=()=>"Open a project to inspect its repository and GitHub publication state.",gQe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",vQe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",bQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gQe():t==="fa"?vQe():mQe()}),yQe=()=>"Open job page",xQe=()=>"打开作业页面",wQe=()=>"باز کردن صفحهٔ کار",AN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xQe():t==="fa"?wQe():yQe()}),SQe=()=>"Open on GitHub",kQe=()=>"在 GitHub 上打开",CQe=()=>"باز کردن در GitHub",RN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kQe():t==="fa"?CQe():SQe()}),EQe=()=>", or create one with",NQe=()=>",或使用以下命令创建:",zQe=()=>"، یا با این فرمان یکی بسازید:",jQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"Org",AQe=()=>"组织",RQe=()=>"سازمان",MQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),DQe=()=>"Orgs",LQe=()=>"组织",OQe=()=>"سازمان‌ها",IQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LQe():t==="fa"?OQe():DQe()}),BQe=()=>"orx can't update this install",$Qe=()=>"orx 无法更新此安装",PQe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",FQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),HQe=()=>"Overleaf",qQe=()=>"Overleaf",UQe=()=>"Overleaf",bL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qQe():t==="fa"?UQe():HQe()}),GQe=()=>"Overleaf Git authentication token",WQe=()=>"Overleaf Git 身份验证令牌",VQe=()=>"توکن احراز هویت Git در Overleaf",KQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WQe():t==="fa"?VQe():GQe()}),QQe=()=>"Overridden by env",YQe=()=>"已被环境变量覆盖",XQe=()=>"بازنویسی‌شده توسط محیط",ZQe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YQe():t==="fa"?XQe():QQe()}),JQe=()=>"Partition",eYe=()=>"分区",tYe=()=>"پارتیشن",nYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eYe():t==="fa"?tYe():JQe()}),rYe=()=>"Path",sYe=()=>"路径",iYe=()=>"مسیر",aYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sYe():t==="fa"?iYe():rYe()}),oYe=()=>"Plan",lYe=()=>"方案",cYe=()=>"سطح اشتراک",uYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lYe():t==="fa"?cYe():oYe()}),dYe=()=>"Project",fYe=()=>"项目",hYe=()=>"پروژه",_Ye=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fYe():t==="fa"?hYe():dYe()}),pYe=()=>"Ray version",mYe=()=>"Ray 版本",gYe=()=>"نسخهٔ Ray",vYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mYe():t==="fa"?gYe():pYe()}),bYe=()=>"Reachable",yYe=()=>"可访问",xYe=()=>"در دسترس",wYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yYe():t==="fa"?xYe():bYe()}),SYe=()=>"Reading ~/.ssh/config…",kYe=()=>"正在读取 ~/.ssh/config…",CYe=()=>"در حال خواندن ‎~/.ssh/config…",yL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kYe():t==="fa"?CYe():SYe()}),EYe=()=>"Ready",NYe=()=>"就绪",zYe=()=>"آماده",Yp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?NYe():t==="fa"?zYe():EYe()}),jYe=()=>"Ready to move",TYe=()=>"可以移动",AYe=()=>"آمادهٔ انتقال",RYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),MYe=()=>"Configured",DYe=()=>"已配置",LYe=()=>"پیکربندی‌شده",_6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?DYe():t==="fa"?LYe():MYe()}),OYe=()=>"Refresh",IYe=()=>"刷新",BYe=()=>"تازه‌سازی",Xp=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?IYe():t==="fa"?BYe():OYe()}),$Ye=()=>"Remotes",PYe=()=>"远程仓库",FYe=()=>"مخزن‌های دوردست",HYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PYe():t==="fa"?FYe():$Ye()}),qYe=()=>"Repository",UYe=()=>"仓库",GYe=()=>"مخزن",WYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UYe():t==="fa"?GYe():qYe()}),VYe=()=>"Repository topics",KYe=()=>"仓库 topic",QYe=()=>"موضوع‌های مخزن",MN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?KYe():t==="fa"?QYe():VYe()}),YYe=()=>"Restart to finish updating",XYe=()=>"重新启动以完成更新",ZYe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",JYe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),eXe=()=>"Running instances",tXe=()=>"正在运行的实例",nXe=()=>"نمونه‌های در حال اجرا",rXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>"Runtime",iXe=()=>"运行时间",aXe=()=>"زمان اجرا",oXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>". Save it under that key if it's meant for HF Jobs.",cXe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",uXe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",dXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),fXe=()=>"Session cookie",hXe=()=>"会话 cookie",_Xe=()=>"کوکی نشست",pXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hXe():t==="fa"?_Xe():fXe()}),mXe=()=>"With a session cookie saved, a linked paper follows Overleaf as people type and sends saves straight back. Figures still move on the slower Git sync. Copy the overleaf_session2 cookie from a browser signed in to Overleaf; it stops working when that sign-in does.",gXe=()=>"保存会话 cookie 后,已关联的论文会在他人输入时实时跟随 Overleaf,并立即回传保存;图片仍通过较慢的 Git 同步传输。请从已登录 Overleaf 的浏览器复制 overleaf_session2 cookie;该登录失效后它也会失效。",vXe=()=>"با ذخیرهٔ کوکی نشست، مقالهٔ پیوندشده هنگام تایپ دیگران Overleaf را زنده دنبال می‌کند و ذخیره‌ها را مستقیماً برمی‌گرداند؛ تصویرها همچنان با همگام‌سازی کندتر Git جابه‌جا می‌شوند. کوکی overleaf_session2 را از مرورگری که به Overleaf وارد شده کپی کنید؛ با پایان آن ورود، کوکی هم از کار می‌افتد.",bXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gXe():t==="fa"?vXe():mXe()}),yXe=()=>"Settings",xXe=()=>"设置",wXe=()=>"تنظیمات",p6=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xXe():t==="fa"?wXe():yXe()}),SXe=()=>"Signed in",kXe=()=>"已登录",CXe=()=>"وارد شده",EXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kXe():t==="fa"?CXe():SXe()}),NXe=()=>"Source",zXe=()=>"来源",jXe=()=>"منبع",xL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zXe():t==="fa"?jXe():NXe()}),TXe=()=>"SSH Key",AXe=()=>"SSH 密钥",RXe=()=>"کلید SSH",MXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),DXe=()=>"Started",LXe=()=>"开始时间",OXe=()=>"آغاز",IXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LXe():t==="fa"?OXe():DXe()}),BXe=()=>"State",$Xe=()=>"状态",PXe=()=>"وضعیت",FXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),HXe=()=>"Status",qXe=()=>"状态",UXe=()=>"وضعیت",l_=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qXe():t==="fa"?UXe():HXe()}),GXe=()=>"Storage",WXe=()=>"存储",VXe=()=>"ذخیره‌سازی",KXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?WXe():t==="fa"?VXe():GXe()}),QXe=()=>"Sync",YXe=()=>"同步",XXe=()=>"همگام‌سازی",ZXe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?YXe():t==="fa"?XXe():QXe()}),JXe=()=>"Syncing off",eZe=()=>"同步已关闭",tZe=()=>"همگام‌سازی خاموش",nZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?eZe():t==="fa"?tZe():JXe()}),rZe=()=>"Test connection",sZe=()=>"测试连接",iZe=()=>"آزمایش اتصال",aZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sZe():t==="fa"?iZe():rZe()}),oZe=()=>"Testing…",lZe=()=>"正在测试…",cZe=()=>"در حال آزمایش…",uZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lZe():t==="fa"?cZe():oZe()}),dZe=()=>", then add it with",fZe=()=>",然后使用以下命令添加:",hZe=()=>"، سپس با این فرمان اضافه‌اش کنید:",_Ze=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fZe():t==="fa"?hZe():dZe()}),pZe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",mZe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",gZe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",vZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mZe():t==="fa"?gZe():pZe()}),bZe=()=>"This saved destination is not configured. Set it up below or choose another backend.",yZe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",xZe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",wZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yZe():t==="fa"?xZe():bZe()}),SZe=()=>"This value looks like a Hugging Face token — compute runs only read it from",kZe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",CZe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",EZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kZe():t==="fa"?CZe():SZe()}),NZe=()=>"Time limit",zZe=()=>"时间限制",jZe=()=>"محدودیت زمانی",TZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zZe():t==="fa"?jZe():NZe()}),AZe=()=>"Unable to verify",RZe=()=>"无法验证",MZe=()=>"تأیید ممکن نیست",D4=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RZe():t==="fa"?MZe():AZe()}),DZe=()=>"Unknown",LZe=()=>"未知",OZe=()=>"نامشخص",wL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?LZe():t==="fa"?OZe():DZe()}),IZe=()=>"Update required",BZe=()=>"需要更新",$Ze=()=>"نیازمند به‌روزرسانی",PZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?BZe():t==="fa"?$Ze():IZe()}),FZe=()=>"Updates",HZe=()=>"更新",qZe=()=>"به‌روزرسانی‌ها",DN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?HZe():t==="fa"?qZe():FZe()}),UZe=()=>"Usage analytics",GZe=()=>"使用情况分析",WZe=()=>"تحلیل استفاده",VZe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?GZe():t==="fa"?WZe():UZe()}),KZe=()=>"value",QZe=()=>"值",YZe=()=>"مقدار",SL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?QZe():t==="fa"?YZe():KZe()}),XZe=()=>"Variables available to runs and the research agent (API keys, tokens).",ZZe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",JZe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",eJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ZZe():t==="fa"?JZe():XZe()}),tJe=()=>"Version",nJe=()=>"版本",rJe=()=>"نسخه",kL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nJe():t==="fa"?rJe():tJe()}),sJe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",iJe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",aJe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",oJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iJe():t==="fa"?aJe():sJe()}),lJe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",cJe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",uJe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",dJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cJe():t==="fa"?uJe():lJe()}),fJe=()=>"Pick a login node first",hJe=()=>"请先选择登录节点",_Je=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",pJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hJe():t==="fa"?_Je():fJe()}),mJe=()=>"Providers",gJe=()=>"提供商",vJe=()=>"ارائه‌دهندگان",bJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gJe():t==="fa"?vJe():mJe()}),yJe=()=>"Reconnect",xJe=()=>"重新连接",wJe=()=>"اتصال دوباره",CL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xJe():t==="fa"?wJe():yJe()}),SJe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,kJe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,CJe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,EJe=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?kJe(e):t==="fa"?CJe(e):SJe(e)}),NJe=()=>"Reinstall with the orx installer to get automatic updates.",zJe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",jJe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",TJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zJe():t==="fa"?jJe():NJe()}),AJe=()=>"Re-link",RJe=()=>"重新链接",MJe=()=>"پیوند دوباره",DJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?RJe():t==="fa"?MJe():AJe()}),LJe=()=>"Remove cookie",OJe=()=>"移除 cookie",IJe=()=>"حذف کوکی",BJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?OJe():t==="fa"?IJe():LJe()}),$Je=()=>"Remove token",PJe=()=>"移除令牌",FJe=()=>"حذف توکن",HJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?PJe():t==="fa"?FJe():$Je()}),qJe=()=>"Removing…",UJe=()=>"正在移除…",GJe=()=>"در حال حذف…",LN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?UJe():t==="fa"?GJe():qJe()}),WJe=()=>"Replace anyway",VJe=()=>"仍要替换",KJe=()=>"به‌هرحال جایگزین کن",QJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?VJe():t==="fa"?KJe():WJe()}),YJe=()=>"Replace key",XJe=()=>"替换密钥",ZJe=()=>"جایگزینی کلید",JJe=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?XJe():t==="fa"?ZJe():YJe()}),eet=()=>"Replace token",tet=()=>"替换令牌",net=()=>"جایگزینی توکن",ret=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tet():t==="fa"?net():eet()}),set=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,iet=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,aet=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,oet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iet(e):t==="fa"?aet(e):set(e)}),cet=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,uet=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,det=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,fet=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?uet(e):t==="fa"?det(e):cet(e)}),het=()=>"Run `gh auth login` in your terminal.",_et=()=>"请在终端中运行 `gh auth login`。",pet=()=>"در پایانه `gh auth login` را اجرا کنید.",met=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_et():t==="fa"?pet():het()}),get=()=>"Saved",vet=()=>"已保存",bet=()=>"ذخیره شده",ON=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vet():t==="fa"?bet():get()}),yet=()=>"Set up",xet=()=>"设置",wet=()=>"راه‌اندازی",ket=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xet():t==="fa"?wet():yet()}),Cet=()=>"Set up SSH key",Eet=()=>"设置 SSH 密钥",Net=()=>"راه‌اندازی کلید SSH",zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Eet():t==="fa"?Net():Cet()}),jet=()=>"Sign in",Tet=()=>"登录",Aet=()=>"ورود",EL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Tet():t==="fa"?Aet():jet()}),Ret=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,Met=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,Det=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,NL=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Met(e):t==="fa"?Det(e):Ret(e)}),Let=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",Oet=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",Iet=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",Bet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oet():t==="fa"?Iet():Let()}),$et=()=>"The terminal disconnected before setup completed. Try again.",Pet=()=>"设置完成前终端连接已断开。请重试。",Fet=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",IN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pet():t==="fa"?Fet():$et()}),Het=()=>"Dark",qet=()=>"深色",Uet=()=>"تیره",Get=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qet():t==="fa"?Uet():Het()}),Wet=()=>"Theme",Vet=()=>"主题",Ket=()=>"پوسته",BN=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vet():t==="fa"?Ket():Wet()}),Qet=()=>"Light",Yet=()=>"浅色",Xet=()=>"روشن",Zet=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yet():t==="fa"?Xet():Qet()}),Jet=()=>"System",ett=()=>"系统",ttt=()=>"سیستم",ntt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ett():t==="fa"?ttt():Jet()}),rtt=()=>"Set up billing in the Tinker console",stt=()=>"在 Tinker 控制台设置账单",itt=()=>"تنظیم پرداخت در کنسول Tinker",att=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?stt():t==="fa"?itt():rtt()}),ott=()=>"Billing setup required",ltt=()=>"需要设置账单",ctt=()=>"تنظیم پرداخت لازم است",utt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ltt():t==="fa"?ctt():ott()}),dtt=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",ftt=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",htt=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",_tt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ftt():t==="fa"?htt():dtt()}),ptt=()=>"Invalid Key",mtt=()=>"密钥无效",gtt=()=>"کلید نامعتبر",vtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mtt():t==="fa"?gtt():ptt()}),btt=()=>"Token from",ytt=()=>"令牌来自",xtt=()=>"توکن از",wtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ytt():t==="fa"?xtt():btt()}),Stt=()=>"Update now",ktt=()=>"立即更新",Ctt=()=>"اکنون به‌روزرسانی کن",Ett=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ktt():t==="fa"?Ctt():Stt()}),Ntt=e=>`Update to ${e==null?void 0:e.version}`,ztt=e=>`更新到 ${e==null?void 0:e.version}`,jtt=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,Ttt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?ztt(e):t==="fa"?jtt(e):Ntt(e)}),Att=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",Rtt=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",Mtt=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",Dtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rtt():t==="fa"?Mtt():Att()}),Ltt=()=>"Updating default destination…",Ott=()=>"正在更新默认运行位置…",Itt=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",Btt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ott():t==="fa"?Itt():Ltt()}),$tt=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",Ptt=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",Ftt=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",Htt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ptt():t==="fa"?Ftt():$tt()}),qtt=()=>"Validating…",Utt=()=>"正在验证…",Gtt=()=>"در حال اعتبارسنجی…",zL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Utt():t==="fa"?Gtt():qtt()}),Wtt=()=>"View settings",Vtt=()=>"查看设置",Ktt=()=>"مشاهدهٔ تنظیمات",Qtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vtt():t==="fa"?Ktt():Wtt()}),Ytt=()=>"Skill",Xtt=()=>"技能",Ztt=()=>"مهارت",Jtt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xtt():t==="fa"?Ztt():Ytt()}),ent=()=>"Loading skill…",tnt=()=>"正在加载技能…",nnt=()=>"در حال بارگیری مهارت…",rnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tnt():t==="fa"?nnt():ent()}),snt=()=>"Personal",int=()=>"个人",ant=()=>"شخصی",ont=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?int():t==="fa"?ant():snt()}),lnt=()=>"Alternatively, tell your agent to save a reusable skill for you.",cnt=()=>"或者,请你的智能体为你保存可重复使用的技能。",unt=()=>"یا از عامل خود بخواهید یک مهارت قابل استفادهٔ مجدد برایتان ذخیره کند.",dnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cnt():t==="fa"?unt():lnt()}),fnt=e=>`Delete the “${e==null?void 0:e.name}” skill?`,hnt=e=>`删除技能“${e==null?void 0:e.name}”?`,_nt=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,pnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?hnt(e):t==="fa"?_nt(e):fnt(e)}),mnt=e=>`Delete skill ${e==null?void 0:e.name}`,gnt=e=>`删除技能 ${e==null?void 0:e.name}`,vnt=e=>`حذف مهارت ${e==null?void 0:e.name}`,bnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?gnt(e):t==="fa"?vnt(e):mnt(e)}),ynt=e=>`Delete the “${e==null?void 0:e.name}” template?`,xnt=e=>`删除模板“${e==null?void 0:e.name}”?`,wnt=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,Snt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?xnt(e):t==="fa"?wnt(e):ynt(e)}),knt=e=>`Delete template ${e==null?void 0:e.name}`,Cnt=e=>`删除模板 ${e==null?void 0:e.name}`,Ent=e=>`حذف قالب ${e==null?void 0:e.name}`,Nnt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Cnt(e):t==="fa"?Ent(e):knt(e)}),znt=()=>"Invoke skills with /name in chat. Skills from your coding agents are screened for research relevance before importing. Upload a skill to include it yourself. Alternatively, tell your OpenResearch agent to create and add a reusable skill for you.",jnt=()=>"在聊天中使用 /name 调用技能。来自编程代理的技能会先经过研究相关性筛选,再导入。您也可以自行上传技能,或让 OpenResearch 代理为您创建并添加可复用技能。",Tnt=()=>"مهارت‌ها را با /name در گفتگو فراخوانی کنید. مهارت‌های عامل‌های برنامه‌نویسی پیش از وارد شدن از نظر ارتباط با پژوهش بررسی می‌شوند. می‌توانید مهارت را خودتان بارگذاری کنید یا از عامل OpenResearch بخواهید یک مهارت قابل استفادهٔ مجدد بسازد و اضافه کند.",Ant=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jnt():t==="fa"?Tnt():znt()}),Rnt=()=>"Drop a SKILL.md or .zip here, or click to choose",Mnt=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",Dnt=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",Lnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mnt():t==="fa"?Dnt():Rnt()}),Ont=()=>"Drop a .tex or .zip here, or click to choose",Int=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",Bnt=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",$nt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Int():t==="fa"?Bnt():Ont()}),Pnt=()=>"File too large (max 20 MB).",Fnt=()=>"文件过大(最大 20 MB)。",Hnt=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",jL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fnt():t==="fa"?Hnt():Pnt()}),qnt=()=>" + 1 file",Unt=()=>" + 1 个文件",Gnt=()=>" + ۱ فایل",Wnt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Unt():t==="fa"?Gnt():qnt()}),Vnt=()=>"Customize the skills and LaTeX templates available across your projects. Upload them here, or ask an OpenResearch agent to create and add them for you.",Knt=()=>"自定义所有项目中可用的技能和 LaTeX 模板。在此上传,或让 OpenResearch 代理为您创建并添加。",Qnt=()=>"مهارت‌ها و قالب‌های LaTeX قابل استفاده در همهٔ پروژه‌ها را سفارشی کنید. آن‌ها را اینجا بارگذاری کنید یا از عامل OpenResearch بخواهید برایتان بسازد و اضافه کند.",Ynt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Knt():t==="fa"?Qnt():Vnt()}),Xnt=()=>"Remove from OpenResearch",Znt=()=>"从 OpenResearch 移除",Jnt=()=>"حذف از OpenResearch",ert=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Znt():t==="fa"?Jnt():Xnt()}),trt=e=>`Remove “${e==null?void 0:e.name}” from OpenResearch? Its source files will remain in your coding agent.`,nrt=e=>`从 OpenResearch 移除“${e==null?void 0:e.name}”?源文件将保留在你的编程智能体中。`,rrt=e=>`«${e==null?void 0:e.name}» از OpenResearch حذف شود؟ فایل‌های اصلی در عامل برنامه‌نویسی شما باقی می‌مانند.`,srt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?nrt(e):t==="fa"?rrt(e):trt(e)}),irt=e=>`Remove ${e==null?void 0:e.name} from OpenResearch`,art=e=>`从 OpenResearch 移除 ${e==null?void 0:e.name}`,ort=e=>`حذف ${e==null?void 0:e.name} از OpenResearch`,lrt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?art(e):t==="fa"?ort(e):irt(e)}),crt=e=>` + ${e==null?void 0:e.count} files`,urt=e=>` + ${e==null?void 0:e.count} 个文件`,drt=e=>` + ${e==null?void 0:e.count} فایل`,frt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?urt(e):t==="fa"?drt(e):crt(e)}),hrt=()=>"Could not load skills:",_rt=()=>"无法加载技能:",prt=()=>"بارگیری مهارت‌ها ممکن نشد:",mrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?_rt():t==="fa"?prt():hrt()}),grt=()=>"Could not load templates:",vrt=()=>"无法加载模板:",brt=()=>"بارگیری قالب‌ها ممکن نشد:",yrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?vrt():t==="fa"?brt():grt()}),xrt=()=>"Customize",wrt=()=>"自定义",Srt=()=>"سفارشی‌سازی",krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?wrt():t==="fa"?Srt():xrt()}),Crt=()=>"Delete skill",Ert=()=>"删除技能",Nrt=()=>"حذف مهارت",zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ert():t==="fa"?Nrt():Crt()}),jrt=()=>"Delete template",Trt=()=>"删除模板",Art=()=>"حذف قالب",Rrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Trt():t==="fa"?Art():jrt()}),Mrt=()=>"LaTeX templates",Drt=()=>"LaTeX 模板",Lrt=()=>"قالب‌های LaTeX",Ort=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Drt():t==="fa"?Lrt():Mrt()}),Irt=()=>"Loading skills…",Brt=()=>"正在加载技能…",$rt=()=>"در حال بارگیری مهارت‌ها…",Prt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Brt():t==="fa"?$rt():Irt()}),Frt=()=>"Loading templates…",Hrt=()=>"正在加载模板…",qrt=()=>"در حال بارگیری قالب‌ها…",Urt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Hrt():t==="fa"?qrt():Frt()}),Grt=()=>"No skills yet.",Wrt=()=>"尚无技能。",Vrt=()=>"هنوز مهارتی وجود ندارد.",Krt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Wrt():t==="fa"?Vrt():Grt()}),Qrt=()=>"No templates yet.",Yrt=()=>"尚无模板。",Xrt=()=>"هنوز قالبی وجود ندارد.",Zrt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Yrt():t==="fa"?Xrt():Qrt()}),Jrt=()=>"Skills",est=()=>"技能",tst=()=>"مهارت‌ها",nst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?est():t==="fa"?tst():Jrt()}),rst=()=>"Uploading…",sst=()=>"正在上传…",ist=()=>"در حال بارگذاری…",ast=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sst():t==="fa"?ist():rst()}),ost=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. Alternatively, tell your OpenResearch agent to create and add a LaTeX template for you. With exactly one template available, the agent uses it without asking.",lst=()=>"代理撰写论文时使用的会议格式或自定义样式,用于替代默认导言区。上传 .tex 文件或包含 .cls 和 .sty 文件的 .zip 压缩包,也可以让 OpenResearch 代理为您创建并添加 LaTeX 模板。只有一个模板可用时,代理会直接使用,无需询问。",cst=()=>"قالب کنفرانس یا سبک اختصاصی که عامل به‌جای پیش‌گفتار پیش‌فرض برای نوشتن مقاله استفاده می‌کند. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید، یا از عامل OpenResearch بخواهید قالب LaTeX بسازد و اضافه کند. اگر تنها یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",ust=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lst():t==="fa"?cst():ost()}),dst=()=>"Upload a SKILL.md file or a .zip of a skill folder.",fst=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",hst=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",_st=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fst():t==="fa"?hst():dst()}),pst=()=>"Upload a .tex file or a .zip of a template folder.",mst=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",gst=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",vst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mst():t==="fa"?gst():pst()}),bst=()=>"Close SSH config",yst=()=>"关闭 SSH 配置",xst=()=>"بستن پیکربندی SSH",wst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yst():t==="fa"?xst():bst()}),Sst=()=>"Discard your unsaved SSH config changes?",kst=()=>"要放弃未保存的 SSH 配置更改吗?",Cst=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",Est=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kst():t==="fa"?Cst():Sst()}),Nst=()=>"Loading SSH config…",zst=()=>"正在加载 SSH 配置…",jst=()=>"در حال بارگیری پیکربندی SSH…",Tst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zst():t==="fa"?jst():Nst()}),Ast=()=>"SSH config saved",Rst=()=>"SSH 配置已保存",Mst=()=>"پیکربندی SSH ذخیره شد",Dst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rst():t==="fa"?Mst():Ast()}),Lst=()=>"SSH config",Ost=()=>"SSH 配置",Ist=()=>"پیکربندی SSH",Bst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ost():t==="fa"?Ist():Lst()}),$st=()=>"Configure SSH hosts…",Pst=()=>"配置 SSH 主机…",Fst=()=>"پیکربندی میزبان‌های SSH…",TL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pst():t==="fa"?Fst():$st()}),Hst=()=>"Cancelled",qst=()=>"已取消",Ust=()=>"لغوشده",Gst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qst():t==="fa"?Ust():Hst()}),Wst=()=>"Cancelling",Vst=()=>"正在取消",Kst=()=>"در حال لغو",Qst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vst():t==="fa"?Kst():Wst()}),Yst=()=>"Done",Xst=()=>"已完成",Zst=()=>"انجام‌شده",Jst=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xst():t==="fa"?Zst():Yst()}),eit=()=>"Editing",tit=()=>"正在编辑",nit=()=>"در حال ویرایش",rit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tit():t==="fa"?nit():eit()}),sit=()=>"Failed",iit=()=>"失败",ait=()=>"ناموفق",oit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iit():t==="fa"?ait():sit()}),lit=()=>"Idle",cit=()=>"空闲",uit=()=>"بی‌کار",dit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cit():t==="fa"?uit():lit()}),fit=()=>"Running",hit=()=>"运行中",_it=()=>"در حال اجرا",pit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hit():t==="fa"?_it():fit()}),mit=()=>"Starting",git=()=>"正在启动",vit=()=>"در حال آغاز",bit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?git():t==="fa"?vit():mit()}),yit=()=>"Copying…",xit=()=>"正在复制…",wit=()=>"در حال کپی…",Sit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xit():t==="fa"?wit():yit()}),kit=()=>"Finalizing…",Cit=()=>"正在完成…",Eit=()=>"در حال نهایی‌سازی…",Nit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cit():t==="fa"?Eit():kit()}),zit=e=>`${e==null?void 0:e.size} free at target`,jit=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,Tit=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=e=>`Move all orx data to: ${e==null?void 0:e.path} -The store is copied to the new location and activated there. Active runs or chats will block the move.`,jit=e=>`将所有 orx 数据移动到: +The store is copied to the new location and activated there. Active runs or chats will block the move.`,Mit=e=>`将所有 orx 数据移动到: ${e==null?void 0:e.path} -存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,Tit=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ +存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,Dit=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ ${e==null?void 0:e.path} -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Ait=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jit(e):t==="fa"?Tit(e):zit(e)}),Rit=()=>"Move data here",Mit=()=>"将数据移动到此处",Dit=()=>"انتقال داده به اینجا",Lit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit():t==="fa"?Dit():Rit()}),Oit=()=>"Moving…",Iit=()=>"正在移动…",Bit=()=>"در حال جابه‌جایی…",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Preparing…",Fit=()=>"正在准备…",Hit=()=>"در حال آماده‌سازی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>" (same disk, instant)",Git=()=>"(同一磁盘,可立即完成)",Wit=()=>" (روی همان دیسک، فوری)",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>"default location",Qit=()=>"默认位置",Yit=()=>"محل پیش‌فرض",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"ORX_DATA_DIR environment variable",Jit=()=>"ORX_DATA_DIR 环境变量",eat=()=>"متغیر محیطی ORX_DATA_DIR",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"your saved setting",rat=()=>"已保存的设置",sat=()=>"تنظیم ذخیره‌شدهٔ شما",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"XDG_DATA_HOME",oat=()=>"XDG_DATA_HOME",lat=()=>"XDG_DATA_HOME",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"Verifying…",dat=()=>"正在验证…",fat=()=>"در حال بررسی…",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Loading…",pat=()=>"正在加载…",mat=()=>"در حال بارگیری…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"This sub-agent is no longer available.",bat=()=>"此子智能体已不可用。",yat=()=>"این عامل فرعی دیگر در دسترس نیست.",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Sat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,kat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,Cat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat(e):t==="fa"?kat(e):wat(e)}),Eat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Aat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Rat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Mat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat():t==="fa"?Rat():Tat()}),Dat=()=>", a repo for training a mini-GPT from scratch.",Lat=()=>",一个从零训练迷你 GPT 的仓库。",Oat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>"Close",$at=()=>"关闭",Pat=()=>"بستن",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Create a new project",qat=()=>"新建项目",Uat=()=>"ایجاد پروژهٔ جدید",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Demo project",Vat=()=>"演示项目",Kat=()=>"پروژهٔ نمایشی",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Explore the demo",Xat=()=>"探索演示项目",Zat=()=>"دیدن پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",tot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",not=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"nanochat",iot=()=>"nanochat",aot=()=>"nanochat",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"Couldn’t save your progress. Try again.",cot=()=>"无法保存进度。请重试。",uot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",hot=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",_ot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"Welcome to OpenResearch",got=()=>"欢迎使用 OpenResearch",vot=()=>"به OpenResearch خوش آمدید",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Baseline",xot=()=>"基线",wot=()=>"مبنا",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Experiment",Cot=()=>"实验",Eot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),Not=e=>`${e==null?void 0:e.count} experiments`,zot=e=>`${e==null?void 0:e.count} 个实验`,jot=e=>`${e==null?void 0:e.count} آزمایش`,Tot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?zot(e):t==="fa"?jot(e):Not(e)}),Aot=()=>"1 experiment",Rot=()=>"1 个实验",Mot=()=>"۱ آزمایش",Dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot():t==="fa"?Mot():Aot()}),Lot=()=>"Running",Oot=()=>"运行中",Iot=()=>"در حال اجرا",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Pot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Fot=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask the agent in chat to create and run your first experiment.",Uot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Got=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Code",Kot=()=>"代码",Qot=()=>"کد",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Logs",Zot=()=>"日志",Jot=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),elt=()=>"No experiments from the current task yet",tlt=()=>"当前任务尚无实验",nlt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",rlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tlt():t==="fa"?nlt():elt()}),slt=()=>"No experiments yet",ilt=()=>"尚无实验",alt=()=>"هنوز آزمایشی وجود ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"no runs",clt=()=>"无运行",ult=()=>"بدون اجرا",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"Open logs",hlt=()=>"打开日志",_lt=()=>"باز کردن گزارش‌ها",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"other tasks",glt=()=>"其他任务",vlt=()=>"وظایف دیگر",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"Runs",xlt=()=>"运行",wlt=()=>"اجراها",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Switch to Entire project to see all experiments",Clt=()=>"切换到“整个项目”以查看所有实验",Elt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,jlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Tlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Alt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt(e):t==="fa"?Tlt(e):zlt(e)}),Rlt=()=>"Dismiss",Mlt=()=>"关闭",Dlt=()=>"بستن",Llt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt():t==="fa"?Dlt():Rlt()}),Olt=()=>"Restart now",Ilt=()=>"立即重新启动",Blt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),$lt=e=>`Could not restart: ${e==null?void 0:e.error}`,Plt=e=>`无法重新启动:${e==null?void 0:e.error}`,Flt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Plt(e):t==="fa"?Flt(e):$lt(e)}),Hlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",qlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Ult=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Glt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qlt():t==="fa"?Ult():Hlt()}),Wlt=()=>"Restarting…",Vlt=()=>"正在重新启动…",Klt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Qlt=()=>"macOS app",Ylt=()=>"macOS 应用",Xlt=()=>"برنامهٔ macOS",Zlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ylt():t==="fa"?Xlt():Qlt()}),Jlt=()=>"Installed with cargo",ect=()=>"通过 cargo 安装",tct=()=>"نصب‌شده با cargo",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with Homebrew",sct=()=>"通过 Homebrew 安装",ict=()=>"نصب‌شده با Homebrew",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with the orx installer",lct=()=>"通过 orx 安装程序安装",cct=()=>"نصب‌شده با نصب‌کنندهٔ orx",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Managed by Nix",fct=()=>"由 Nix 管理",hct=()=>"مدیریت‌شده با Nix",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Portable orx.exe",mct=()=>"便携版 orx.exe",gct=()=>"orx.exe قابل‌حمل",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Unknown install",yct=()=>"未知安装方式",xct=()=>"روش نصب نامشخص",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Re-run your cargo install to update.",kct=()=>"重新运行 cargo 安装命令以更新。",Cct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Run brew upgrade to update.",zct=()=>"运行 brew upgrade 以更新。",jct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Update it through your Nix configuration.",Rct=()=>"通过 Nix 配置进行更新。",Mct=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Active Experiments",Oct=()=>"活跃实验",Ict=()=>"آزمایش‌های فعال",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Default compute",Pct=()=>"默认计算目标",Fct=()=>"محاسبات پیش‌فرض",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"This worktree",Uct=()=>"当前工作树",Gct=()=>"این درخت کاری",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"Workspace",Kct=()=>"工作区",Qct=()=>"فضای کاری",z2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Yct=e=>`Current worktree · ${e==null?void 0:e.branch}`,Xct=e=>`当前工作树 · ${e==null?void 0:e.branch}`,Zct=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,Jct=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Xct(e):t==="fa"?Zct(e):Yct(e)}),eut=e=>`Default branch · ${e==null?void 0:e.branch}`,tut=e=>`默认分支 · ${e==null?void 0:e.branch}`,nut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`detached at ${e==null?void 0:e.branch}`,iut=e=>`分离于 ${e==null?void 0:e.branch}`,aut=e=>`جدا در ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=()=>"Listing truncated.",cut=()=>"列表已截断。",uut=()=>"فهرست کوتاه شده است.",dut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cut():t==="fa"?uut():lut()}),fut=()=>"Loading…",hut=()=>"正在加载…",_ut=()=>"در حال بارگیری…",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"No changes yet.",gut=()=>"尚无更改。",vut=()=>"هنوز تغییری وجود ندارد.",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No files.",xut=()=>"没有文件。",wut=()=>"فایلی وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"Refresh failed:",Cut=()=>"刷新失败:",Eut=()=>"تازه‌سازی ناموفق بود:",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),j2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",m6="chat_demo_nanochat_figures_v1",g6="chat_demo_nanochat_literature_v1",zut={[O0]:"cpu_end_to_end",[m6]:"figures",[g6]:"literature"},k1="cpu-apple-silicon-pipeline-results.md",jut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class L4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new L4(s,a,i.exists)}}catch(i){if(i instanceof L4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Tut=e=>At("/api/projects",e).then(n=>n.projects),Aut=e=>At("/api/projects/activity",e).then(n=>n.activity),Rut=e=>At("/api/settings/ui-state",e),Mut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),Dut=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Lut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Out=e=>kt("/api/settings/ui-state",e),Iut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),But=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},$ut=()=>kt("/api/project-path/pick").then(e=>e.path),Put=e=>kt("/api/projects",e),Fut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Hut=e=>At("/api/github/account",e),qut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Uut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Gut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Wut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Vut=e=>kt("/api/projects/starter-prompts/prewarm",e),Kut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Qut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),Yut=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),Xut=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),Zut=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),Jut=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),edt=(e,n)=>At(`/api/runs/${e}/diff`,n),tdt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ndt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),BN=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,rdt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),sdt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,idt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),adt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),odt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ldt=e=>At("/api/latex/engine",e),cdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),udt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),ddt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),fdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),hdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),_dt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),pdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),mdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),gdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),vdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),bdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,wdt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Sdt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),rb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,kdt=e=>At("/api/settings/hf",e),Cdt=e=>kt("/api/settings/hf",{token:e}),Edt=e=>At("/api/settings/tinker",e),Ndt=e=>kt("/api/settings/tinker",{key:e}),zdt=e=>At("/api/update",e),jdt=()=>kt("/api/update/apply"),Tdt=()=>kt("/api/update/restart"),Adt=e=>kt("/api/update/auto",{enabled:e}),Rdt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Mdt=e=>At("/api/settings/k8s",e),Ddt=e=>kt("/api/settings/k8s",e),Ldt=e=>At("/api/settings/modal",e),Odt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Idt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Bdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),$dt=e=>At("/api/settings/data-dir",e),Pdt=e=>kt("/api/settings/data-dir/validate",{path:e}),Fdt=e=>kt("/api/settings/data-dir/move",{path:e}),Hdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),qdt=e=>At("/api/settings/ssh/config",e),Udt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Gdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Wdt=e=>At("/_orx/runtime",e),Vdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Kdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Qdt=e=>kt("/_orx/install",e),Ydt=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),Xdt=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Zdt=e=>At("/api/settings/slurm",e),Jdt=e=>kt("/api/settings/slurm",e),eft=e=>At("/api/settings/ray",e),tft=e=>kt("/api/settings/ray",e),nft=e=>kt("/api/settings/ray/preflight",{address:e??null}),rft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),sft=e=>kt("/api/settings/compute/default",e),ift=e=>At("/api/settings/local",e),aft=e=>At("/api/settings/openresearch",e),oft=(e,n)=>At(`/api/projects/${e}/files`,n),lft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),cft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,uft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},dft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>uft(a,Number.isFinite(s)&&s>a.byteLength))}),fft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",hft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:fft(s)?s:"download"}}),_ft=e=>At("/api/settings/profile",e),pft=e=>At("/api/settings/lit-sources",e),mft=e=>kt("/api/settings/lit-sources",e),gft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),vft=(e,n)=>At(`/api/projects/${e}/git`,n),bft=e=>kt(`/api/projects/${e}/git/init`),yft=e=>kt(`/api/projects/${e}/github`),xft=e=>kt(`/api/projects/${e}/github/disable`),wft=e=>At("/api/settings/telemetry",e),Sft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??I4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?s6():n,r=I4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const sv="default";function sb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===sv)?sv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const O4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:O4,label:pBe(),description:dBe()},...t]:[]}function iv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?O4:t!=null&&s.some(a=>a.id===t)?t:O4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=sb(e,n);return r.length===0?sv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},kft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),Cft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Eft=e=>At("/api/latex-templates",e).then(n=>n.templates),Nft=e=>kt("/api/latex-templates",e).then(n=>n.template),zft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),jft=e=>At("/api/user-skills",e),Tft=e=>kt("/api/user-skills",e).then(n=>n.skill),Aft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function I4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Rft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Mft=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Dft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(tb(e),t))),Lft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Oft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Ift=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Bft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),$ft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Pft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Fft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Hft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,$N=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),qft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Uft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Gft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Wft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Vft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Kft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),Xft=e=>kt("/api/local-models/discover",e),Zft=e=>kt("/api/local-models",e),Jft=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),eht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),PN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>kdt(e),staleTime:3e5}),FN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Edt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Mdt(e),staleTime:3e4}),qN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>Ldt(e),staleTime:3e5}),tht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>Zdt(e),staleTime:3e5}),nht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>eft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>rft(e,n),staleTime:3e4}),rht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>ift(e),staleTime:3e5}),sht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>aft(e),staleTime:3e4}),iht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Idt(e),staleTime:3e5}),aht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Hdt(e),staleTime:3e5}),oht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),UN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Gdt(e,n),staleTime:5e3}),lht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Wdt(e),staleTime:2e3}),cht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Vdt(e),staleTime:3e4}),av=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>zdt(e)),staleTime:3e4}),uht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>_ft(e),staleTime:3e5}),dht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>pft(e),staleTime:3e5}),ov=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>gft(e),staleTime:3e5}),fht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>vft(e,n),staleTime:3e4}),hht=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>wft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),_ht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>kft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),pht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>Cft(e,n,r,t),staleTime:3e5}),mht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Eft(e),refetchInterval:3e4,staleTime:3e5}),ght=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>jft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function ib(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const vht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>Yft(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Rft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>$ft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function GN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function bht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:GN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?GN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const yht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),xht=()=>ZL;function wht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=bht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Sht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(yht,xht),i=R.useMemo(()=>wht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const C1=new Map;function kht(e,n){let t=C1.get(e);return t||(t=new Set,C1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&C1.delete(e)}}function Cht(e){var n;(n=C1.get(e.runId))==null||n.forEach(t=>t(e))}const B4=new Set;function lv(e){return B4.add(e),()=>{B4.delete(e)}}function bl(e){B4.forEach(n=>n(e))}const $4=new Set;function Eht(e){return $4.add(e),()=>{$4.delete(e)}}function yl(){$4.forEach(e=>e())}const P4=new Set;function Nht(e){return P4.add(e),()=>{P4.delete(e)}}function WN(e){P4.forEach(n=>n(e))}const F4=new Set;function tO(e){return F4.add(e),()=>{F4.delete(e)}}function T2(e){F4.forEach(n=>n(e))}const H4=new Set;function zht(e){return H4.add(e),()=>{H4.delete(e)}}function VN(e){H4.forEach(n=>n(e))}const q4=new Set;function jht(e){return q4.add(e),()=>{q4.delete(e)}}function Tht(e){q4.forEach(n=>n(e))}let U4=!0;const G4=new Set;function Aht(e){return G4.add(e),()=>{G4.delete(e)}}function KN(){return U4}function QN(e){e!==U4&&(U4=e,G4.forEach(n=>n()))}const Rht=8e3,Mht=3e3;function Dht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>QN(!1),Rht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Mht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,QN(!0),a&&(bl({type:"reconnected"}),yl(),WN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&Cht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&WN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&T2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&T2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&T2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Tht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&VN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&VN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const cv=new Set;function Lht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return cv.add(t),()=>{cv.delete(t)}},[])}const YN={onRun:e=>cv.forEach(n=>n.onRun(e)),onReconnect:()=>cv.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Tut(e),Kp),staleTime:3e4}),Oht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Aut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Rut(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Mut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>But(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Fut(e,n),staleTime:3e5}),Iht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Hut(e),staleTime:3e5}),Bht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>qut(e,n),staleTime:3e4}),XN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Uut(e,n,t),staleTime:3e4}),W4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Gut(e,n),staleTime:36e5}),$ht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Kut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),V4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Xut(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>Zut(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function ZN(){const e=za();return Dht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),YN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,V4(n.projectId).queryKey,n.id),nt.setQueryData(V4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(Z5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),YN.onReconnect())}}),R.useEffect(()=>{let n;const t=Eht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=lv(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?tb(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Nht(()=>{Fn(e)&&ib(!0).catch(()=>{})}),a=jht(o=>{Fn(e)&&(Ga(nt,av().queryKey),nt.setQueryData(av().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const K4=new Set;function rO(e){if(e!==z()){uD(e,{reload:!1}),document.documentElement.lang=e;for(const n of K4)n()}}function Pht(e){return K4.add(e),()=>K4.delete(e)}function Yd(){return R.useSyncExternalStore(Pht,z,z)}const sO="orx:theme";function Fht(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Fht();const Q4=new Set;function Hht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Hht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of Q4)n()}function qht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Uht(e){return Q4.add(e),()=>Q4.delete(e)}function aO(){return[R.useSyncExternalStore(Uht,()=>Hh,()=>Hh),iO]}const Ght=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),uv="-",JN=[],Vht="arbitrary..",Kht=e=>{const n=Yht(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Qht(a);const o=a.split(uv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Ght(u,l):l:u||JN}return t[a]||JN}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(uv):e.slice(n).join(uv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Vht+r:void 0})(),Yht=e=>{const{theme:n,classGroups:t}=e;return Xht(t,n)},Xht=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){Jht(e,n,t);return}if(typeof e=="function"){e_t(e,n,t,r);return}t_t(e,n,t,r)},Jht=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},e_t=(e,n,t,r)=>{if(n_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wht(t,e))},t_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(uv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,r_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Y4="!",ez=":",s_t=[],tz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),i_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===ez){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Y4)?(p=d.slice(0,-1),m=!0):d.startsWith(Y4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return tz(i,m,p,x)};if(n){const s=n+ez,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):tz(s_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},a_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},o_t=e=>({cache:r_t(e.cacheSize),parseClassName:i_t(e),sortModifiers:a_t(e),postfixLookupClassGroupIds:l_t(e),...Kht(e)}),l_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(c_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Y4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},d_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=o_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=u_t(l,t);return s(l,_),_};return i=a,(...l)=>i(d_t(...l))},f_t=[],fs=e=>{const n=t=>t[e]||f_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,__t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p_t=/\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$/,m_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>h_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),A2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>__t.test(e),hO=()=>!0,b_t=e=>p_t.test(e)&&!m_t.test(e),w6=()=>!1,y_t=e=>g_t.test(e),x_t=e=>v_t.test(e),w_t=e=>!ht(e)&&!pt(e),S_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),k_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,b_t),rz=e=>Su(e,R_t,dn),C_t=e=>Su(e,bO,hO),E_t=e=>Su(e,vO,w6),sz=e=>Su(e,_O,w6),N_t=e=>Su(e,pO,x_t),Rg=e=>Su(e,yO,y_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),z_t=e=>Xd(e,vO),iz=e=>Xd(e,_O),j_t=e=>Xd(e,mO),T_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),A_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",R_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",az=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],H=()=>["auto","min","max","fr",pt,ht],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],F=()=>[...C(),iz,sz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",j_t,k_t,{size:[pt,ht]}],Z=()=>[A2,c0,Qu],ce=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,A2,iz,sz],oe=()=>["","none",x,pt,ht],ue=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[w_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[S_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A_t,C_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",A2,ht]}],"font-family":[{font:[z_t,E_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,rz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},T_t,N_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,rz]}],stroke:[{stroke:["none",...L()]}],"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"]}},M_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),X4(e,s,"postfixLookupClassGroups"),X4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)X4(e,n,t)},X4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},D_t=(e,...n)=>typeof e=="function"?nz(az,e,...n):nz(()=>M_t(az(),e),...n),L_t=D_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return L_t(...e)}const O_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",O_t[e],t),...r})}const I_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),B_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},$_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(I_t,B_t[e],$_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const P_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),F_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},H_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(P_t,F_t[e],H_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function ab({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const q_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Wr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",q_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const U_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ob({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",U_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const G_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(G_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function W_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=NM();const V_t=Wp(ro);function K_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Q_t=e=>{switch(e){case"success":return Z_t;case"info":return e0t;case"warning":return J_t;case"error":return t0t;default:return null}},Y_t=Array(12).fill(0),X_t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},Y_t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Z_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),e0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),t0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let s0t=1;const i0t=100,oz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:s0t++};class a0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-i0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=oz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(l0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=oz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new a0t,o0t=(e,n)=>wi.message(e,n),l0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",c0t=o0t,u0t=()=>wi.toasts,d0t=()=>wi.getActiveToasts(),f0t=Object.assign(c0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:u0t,getToasts:d0t});K_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const h0t=3,_0t="24px",p0t="16px",lz=4e3,m0t=356,g0t=14,v0t=45,b0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function y0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const x0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:H,gap:q,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,W]=Je.useState(null),[U,Z]=Je.useState(!1),[ce,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ue,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||lz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||lz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=H.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=r0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:y0t(H)},[e.swipeDirections,H]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*q+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{Z(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!U)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},b0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(X_t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||Q_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ue,"data-removed":ce,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&U),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${ce?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=v0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:n0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function cz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function w0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?p0t:_0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const S0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=h0t,toastOptions:b,dir:w=cz(),gap:y=g0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(Z=>Z.toasterId===r):T.filter(Z=>!Z.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(Z=>Z.position).map(Z=>Z.position)))),[M,i]),[B,$]=Je.useState([]),[H,q]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),W=Je.useRef(!1),U=Je.useCallback(Z=>{j(ce=>{var re;return(re=ce.find(ne=>ne.id===Z.id))!=null&&re.delete||wi.dismiss(Z.id),ce.filter(({id:ne})=>ne!==Z.id)})},[]);return Je.useEffect(()=>wi.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{j(ce=>ce.map(re=>re.id===Z.id?{...re,delete:!0}:re))});return}setTimeout(()=>{V_t.flushSync(()=>{j(ce=>{const re=ce.findIndex(ne=>ne.id===Z.id);return re!==-1?[...ce.slice(0,re),{...ce[re],...Z},...ce.slice(re+1)]:[Z,...ce]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:ce})=>{te(ce?"dark":"light")})}catch{Z.addListener(({matches:re})=>{try{te(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&q(!1)},[T]),Je.useEffect(()=>{const Z=ce=>{var re;if(a.length>0&&a.every(le=>ce[le]||ce.code===le)){var Q;q(!0),(Q=I.current)==null||Q.focus()}ce.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((Z,ce)=>{var re;const[ne,Q]=Z.split("-");return M.length?Je.createElement("ol",{key:Z,dir:w==="auto"?cz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${m0t}px`,"--gap":`${y}px`,...S,...w0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Y||q(!1)},onDragEnd:()=>q(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&ce===0||le.position===Z).map((le,oe)=>{var ue,pe;return Je.createElement(x0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ue=b==null?void 0:b.duration)!=null?ue:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:Z,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:H,swipeDirections:n.swipeDirections})})):null}))});function k0t(e){const[n]=aO();return f.jsx(S0t,{theme:n,...e})}function Qn(e,n,t){f0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const C0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function lb(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(C0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),lb(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var R2={exports:{}},uz;function E0t(){return uz||(uz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(R2)),R2.exports}var N0t=E0t(),M2={exports:{}},dz;function z0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(M2)),M2.exports}var j0t=z0t(),D2={exports:{}},fz;function T0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,Lit=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Mit(e):t==="fa"?Dit(e):Rit(e)}),Oit=()=>"Move data here",Iit=()=>"将数据移动到此处",Bit=()=>"انتقال داده به اینجا",$it=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Iit():t==="fa"?Bit():Oit()}),Pit=()=>"Moving…",Fit=()=>"正在移动…",Hit=()=>"در حال جابه‌جایی…",qit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Fit():t==="fa"?Hit():Pit()}),Uit=()=>"Preparing…",Git=()=>"正在准备…",Wit=()=>"در حال آماده‌سازی…",Vit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Git():t==="fa"?Wit():Uit()}),Kit=()=>" (same disk, instant)",Qit=()=>"(同一磁盘,可立即完成)",Yit=()=>" (روی همان دیسک، فوری)",Xit=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Qit():t==="fa"?Yit():Kit()}),Zit=()=>"default location",Jit=()=>"默认位置",eat=()=>"محل پیش‌فرض",tat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Jit():t==="fa"?eat():Zit()}),nat=()=>"ORX_DATA_DIR environment variable",rat=()=>"ORX_DATA_DIR 环境变量",sat=()=>"متغیر محیطی ORX_DATA_DIR",iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?rat():t==="fa"?sat():nat()}),aat=()=>"your saved setting",oat=()=>"已保存的设置",lat=()=>"تنظیم ذخیره‌شدهٔ شما",cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?oat():t==="fa"?lat():aat()}),uat=()=>"XDG_DATA_HOME",dat=()=>"XDG_DATA_HOME",fat=()=>"XDG_DATA_HOME",hat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?dat():t==="fa"?fat():uat()}),_at=()=>"Verifying…",pat=()=>"正在验证…",mat=()=>"در حال بررسی…",gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?pat():t==="fa"?mat():_at()}),vat=()=>"Loading…",bat=()=>"正在加载…",yat=()=>"در حال بارگیری…",xat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?bat():t==="fa"?yat():vat()}),wat=()=>"This sub-agent is no longer available.",Sat=()=>"此子智能体已不可用。",kat=()=>"این عامل فرعی دیگر در دسترس نیست.",Cat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Sat():t==="fa"?kat():wat()}),Eat=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,Nat=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,zat=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,jat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Nat(e):t==="fa"?zat(e):Eat(e)}),Tat=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,Aat=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,Rat=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,Mat=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Aat(e):t==="fa"?Rat(e):Tat(e)}),Dat=()=>"Alternatively, tell your agent to add a LaTeX template for you.",Lat=()=>"或者,请你的智能体为你添加 LaTeX 模板。",Oat=()=>"یا از عامل خود بخواهید یک قالب LaTeX برایتان اضافه کند.",Iat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Lat():t==="fa"?Oat():Dat()}),Bat=()=>", a repo for training a mini-GPT from scratch.",$at=()=>",一个从零训练迷你 GPT 的仓库。",Pat=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",Fat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?$at():t==="fa"?Pat():Bat()}),Hat=()=>"Close",qat=()=>"关闭",Uat=()=>"بستن",Gat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?qat():t==="fa"?Uat():Hat()}),Wat=()=>"Create a new project",Vat=()=>"新建项目",Kat=()=>"ایجاد پروژهٔ جدید",Qat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vat():t==="fa"?Kat():Wat()}),Yat=()=>"Demo project",Xat=()=>"演示项目",Zat=()=>"پروژهٔ نمایشی",Jat=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xat():t==="fa"?Zat():Yat()}),eot=()=>"Explore the demo",tot=()=>"探索演示项目",not=()=>"دیدن پروژهٔ نمایشی",rot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?tot():t==="fa"?not():eot()}),sot=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",iot=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",aot=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",oot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?iot():t==="fa"?aot():sot()}),lot=()=>"nanochat",cot=()=>"nanochat",uot=()=>"nanochat",dot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?cot():t==="fa"?uot():lot()}),fot=()=>"Couldn’t save your progress. Try again.",hot=()=>"无法保存进度。请重试。",_ot=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",pot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hot():t==="fa"?_ot():fot()}),mot=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",got=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",vot=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?got():t==="fa"?vot():mot()}),yot=()=>"Welcome to OpenResearch",xot=()=>"欢迎使用 OpenResearch",wot=()=>"به OpenResearch خوش آمدید",Sot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xot():t==="fa"?wot():yot()}),kot=()=>"Baseline",Cot=()=>"基线",Eot=()=>"مبنا",Not=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cot():t==="fa"?Eot():kot()}),zot=()=>"Experiment",jot=()=>"实验",Tot=()=>"آزمایش",El=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jot():t==="fa"?Tot():zot()}),Aot=e=>`${e==null?void 0:e.count} experiments`,Rot=e=>`${e==null?void 0:e.count} 个实验`,Mot=e=>`${e==null?void 0:e.count} آزمایش`,Dot=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Rot(e):t==="fa"?Mot(e):Aot(e)}),Lot=()=>"1 experiment",Oot=()=>"1 个实验",Iot=()=>"۱ آزمایش",Bot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oot():t==="fa"?Iot():Lot()}),$ot=()=>"Running",Pot=()=>"运行中",Fot=()=>"در حال اجرا",Hot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pot():t==="fa"?Fot():$ot()}),qot=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",Uot=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",Got=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",Wot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uot():t==="fa"?Got():qot()}),Vot=()=>"Ask the agent in chat to create and run your first experiment.",Kot=()=>"在聊天中让智能体创建并运行你的第一个实验。",Qot=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",Yot=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kot():t==="fa"?Qot():Vot()}),Xot=()=>"Code",Zot=()=>"代码",Jot=()=>"کد",elt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zot():t==="fa"?Jot():Xot()}),tlt=()=>"Logs",nlt=()=>"日志",rlt=()=>"گزارش‌ها",AL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?nlt():t==="fa"?rlt():tlt()}),slt=()=>"No experiments from the current task yet",ilt=()=>"当前任务尚无实验",alt=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",olt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ilt():t==="fa"?alt():slt()}),llt=()=>"No experiments yet",clt=()=>"尚无实验",ult=()=>"هنوز آزمایشی وجود ندارد",dlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?clt():t==="fa"?ult():llt()}),flt=()=>"no runs",hlt=()=>"无运行",_lt=()=>"بدون اجرا",plt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hlt():t==="fa"?_lt():flt()}),mlt=()=>"Open logs",glt=()=>"打开日志",vlt=()=>"باز کردن گزارش‌ها",blt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?glt():t==="fa"?vlt():mlt()}),ylt=()=>"other tasks",xlt=()=>"其他任务",wlt=()=>"وظایف دیگر",Slt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xlt():t==="fa"?wlt():ylt()}),klt=()=>"Runs",Clt=()=>"运行",Elt=()=>"اجراها",Nlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Clt():t==="fa"?Elt():klt()}),zlt=()=>"Switch to Entire project to see all experiments",jlt=()=>"切换到“整个项目”以查看所有实验",Tlt=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",Alt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jlt():t==="fa"?Tlt():zlt()}),Rlt=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,Mlt=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,Dlt=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,Llt=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Mlt(e):t==="fa"?Dlt(e):Rlt(e)}),Olt=()=>"Dismiss",Ilt=()=>"关闭",Blt=()=>"بستن",$lt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Ilt():t==="fa"?Blt():Olt()}),Plt=()=>"Restart now",Flt=()=>"立即重新启动",Hlt=()=>"هم‌اکنون دوباره راه‌اندازی کن",RL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Flt():t==="fa"?Hlt():Plt()}),qlt=e=>`Could not restart: ${e==null?void 0:e.error}`,Ult=e=>`无法重新启动:${e==null?void 0:e.error}`,Glt=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,ML=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?Ult(e):t==="fa"?Glt(e):qlt(e)}),Wlt=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",Vlt=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",Klt=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",Qlt=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Vlt():t==="fa"?Klt():Wlt()}),Ylt=()=>"Restarting…",Xlt=()=>"正在重新启动…",Zlt=()=>"در حال راه‌اندازی مجدد…",DL=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Xlt():t==="fa"?Zlt():Ylt()}),Jlt=()=>"macOS app",ect=()=>"macOS 应用",tct=()=>"برنامهٔ macOS",nct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?ect():t==="fa"?tct():Jlt()}),rct=()=>"Installed with cargo",sct=()=>"通过 cargo 安装",ict=()=>"نصب‌شده با cargo",act=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?sct():t==="fa"?ict():rct()}),oct=()=>"Installed with Homebrew",lct=()=>"通过 Homebrew 安装",cct=()=>"نصب‌شده با Homebrew",uct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?lct():t==="fa"?cct():oct()}),dct=()=>"Installed with the orx installer",fct=()=>"通过 orx 安装程序安装",hct=()=>"نصب‌شده با نصب‌کنندهٔ orx",_ct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?fct():t==="fa"?hct():dct()}),pct=()=>"Managed by Nix",mct=()=>"由 Nix 管理",gct=()=>"مدیریت‌شده با Nix",vct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?mct():t==="fa"?gct():pct()}),bct=()=>"Portable orx.exe",yct=()=>"便携版 orx.exe",xct=()=>"orx.exe قابل‌حمل",wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?yct():t==="fa"?xct():bct()}),Sct=()=>"Unknown install",kct=()=>"未知安装方式",Cct=()=>"روش نصب نامشخص",Ect=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?kct():t==="fa"?Cct():Sct()}),Nct=()=>"Re-run your cargo install to update.",zct=()=>"重新运行 cargo 安装命令以更新。",jct=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Tct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?zct():t==="fa"?jct():Nct()}),Act=()=>"Run brew upgrade to update.",Rct=()=>"运行 brew upgrade 以更新。",Mct=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",Dct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Rct():t==="fa"?Mct():Act()}),Lct=()=>"Update it through your Nix configuration.",Oct=()=>"通过 Nix 配置进行更新。",Ict=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",Bct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Oct():t==="fa"?Ict():Lct()}),$ct=()=>"Active Experiments",Pct=()=>"活跃实验",Fct=()=>"آزمایش‌های فعال",Hct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Pct():t==="fa"?Fct():$ct()}),qct=()=>"Default compute",Uct=()=>"默认计算目标",Gct=()=>"محاسبات پیش‌فرض",Wct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Uct():t==="fa"?Gct():qct()}),Vct=()=>"This worktree",Kct=()=>"当前工作树",Qct=()=>"این درخت کاری",Yct=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Kct():t==="fa"?Qct():Vct()}),Xct=()=>"Workspace",Zct=()=>"工作区",Jct=()=>"فضای کاری",N2=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Zct():t==="fa"?Jct():Xct()}),eut=e=>`Current worktree · ${e==null?void 0:e.branch}`,tut=e=>`当前工作树 · ${e==null?void 0:e.branch}`,nut=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,rut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?tut(e):t==="fa"?nut(e):eut(e)}),sut=e=>`Default branch · ${e==null?void 0:e.branch}`,iut=e=>`默认分支 · ${e==null?void 0:e.branch}`,aut=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,out=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?iut(e):t==="fa"?aut(e):sut(e)}),lut=e=>`detached at ${e==null?void 0:e.branch}`,cut=e=>`分离于 ${e==null?void 0:e.branch}`,uut=e=>`جدا در ${e==null?void 0:e.branch}`,dut=((e,n={})=>{const t=n.locale??z();return t==="zh-CN"?cut(e):t==="fa"?uut(e):lut(e)}),fut=()=>"Listing truncated.",hut=()=>"列表已截断。",_ut=()=>"فهرست کوتاه شده است.",put=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?hut():t==="fa"?_ut():fut()}),mut=()=>"Loading…",gut=()=>"正在加载…",vut=()=>"در حال بارگیری…",but=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?gut():t==="fa"?vut():mut()}),yut=()=>"No changes yet.",xut=()=>"尚无更改。",wut=()=>"هنوز تغییری وجود ندارد.",Sut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?xut():t==="fa"?wut():yut()}),kut=()=>"No files.",Cut=()=>"没有文件。",Eut=()=>"فایلی وجود ندارد.",Nut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?Cut():t==="fa"?Eut():kut()}),zut=()=>"Refresh failed:",jut=()=>"刷新失败:",Tut=()=>"تازه‌سازی ناموفق بود:",Aut=((e={},n={})=>{const t=n.locale??z();return t==="zh-CN"?jut():t==="fa"?Tut():zut()}),Ne=e=>`⁦${e}⁩`,Oo=e=>`⁨${e}⁩`,Wt=e=>new Intl.NumberFormat(z()).format(e),z2="demo_nanochat_v1",Wc=e=>e.startsWith("demo_"),O0="chat_demo_nanochat_v1",m6="chat_demo_nanochat_figures_v1",g6="chat_demo_nanochat_literature_v1",Rut={[O0]:"cpu_end_to_end",[m6]:"figures",[g6]:"literature"},S1="cpu-apple-silicon-pipeline-results.md",Mut="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class L4 extends Error{constructor(t,r,s){super(t);Fs(this,"currentVersion");Fs(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Wi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}const LL=new WeakMap;async function ci(e){if(!e.ok){const r=await e.text().catch(()=>"");let s=r;try{const i=JSON.parse(r);if(typeof i=="object"&&i!==null&&("error"in i&&typeof i.error=="string"&&(s=i.error),e.status===409&&"code"in i&&i.code==="fileChanged"&&"exists"in i&&typeof i.exists=="boolean")){const a="currentVersion"in i&&typeof i.currentVersion=="string"?i.currentVersion:null;throw new L4(s,a,i.exists)}}catch(i){if(i instanceof L4)throw i}throw new Error(s||`HTTP ${e.status}`)}const n=await e.json(),t=LL.get(e);if(t&&!Fn(t))throw new DOMException("Workspace changed","AbortError");return n}const At=(e,n)=>fetch(e,{signal:n}).then(t=>ci(t));async function ta(e,n){const t=za(),r=await fetch(e,n);if(!Fn(t))throw new DOMException("Workspace changed","AbortError");return LL.set(r,t),r.ok&&ZV(e,t),r}const kt=(e,n,t=!1)=>ta(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ci(r)),Qd=(e,n)=>ta(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),OL=(e,n)=>ta(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ci(t)),Dut=e=>At("/api/projects",e).then(n=>n.projects),Lut=e=>At("/api/projects/activity",e).then(n=>n.activity),Out=e=>At("/api/settings/ui-state",e),Iut=(e,n)=>At(`/api/projects/${encodeURIComponent(e)}/ui-state`,n),But=(e,n,t=!1)=>kt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),$ut=(e,n=!1)=>kt("/api/settings/ui-state",{workspace:e},n),Put=e=>kt("/api/settings/ui-state",e),Fut=(e,n)=>kt("/api/onboarding/complete",{...e,...n}),Hut=(e="",n)=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return At(`/api/project-path/status${t}`,n)},qut=()=>kt("/api/project-path/pick").then(e=>e.path),Uut=e=>kt("/api/projects",e),Gut=(e,n)=>At(`/api/papers/search?q=${encodeURIComponent(e)}`,n).then(t=>t.papers),Wut=e=>At("/api/github/account",e),Vut=(e,n)=>At(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`,n),Kut=(e,n,t)=>At(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`,t),Qut=(e,n)=>At(`/api/papers/resolve?id=${encodeURIComponent(e)}`,n).then(t=>t.paper),Yut=(e,n)=>Qd(`/api/projects/${e}`,n).then(t=>t.project),Xut=e=>kt("/api/projects/starter-prompts/prewarm",e),Zut=(e,n,t,r,s)=>At(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`,s),Jut=e=>kt(`/api/projects/${e}/open`).then(n=>n.project),edt=e=>ta(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}YV(e)}),tdt=(e,n)=>At(`/api/projects/${e}/experiments`,n).then(t=>t.experiments),ndt=(e,n)=>At(`/api/projects/${e}/runs`,n).then(t=>t.runs),IL=e=>kt(`/api/runs/${e}/cancel`).then(()=>{}),rdt=(e,n)=>At(`/api/runs/${e}/log?offset=${n}`),sdt=(e,n)=>At(`/api/runs/${e}/diff`,n),idt=(e,n)=>At(`/api/experiments/${e}/diff`,n),wu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),adt=(e,n,t={},r)=>At(`/api/projects/${e}/file?${wu(t,new URLSearchParams({path:n}))}`,r),$N=(e,n,t={})=>`/api/projects/${e}/file/raw?${wu(t,new URLSearchParams({path:n}))}`,odt=(e,n)=>At(`/api/files/abs?path=${encodeURIComponent(e)}`,n),ldt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,cdt=(e,n,t,r)=>OL(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),udt=(e,n,t,r={})=>Qd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),ddt=(e,n,t={})=>kt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),fdt=e=>At("/api/latex/engine",e),hdt=(e,n,t={})=>kt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),_dt=e=>At("/api/overleaf/settings",e),BL=e=>kt("/api/overleaf/token",{token:e}),pdt=()=>ta("/api/overleaf/token",{method:"DELETE"}).then(e=>ci(e)),$L=(e,n={})=>kt("/api/overleaf/session",{session:e,host:n.host}),mdt=()=>fetch("/api/overleaf/session",{method:"DELETE"}).then(e=>ci(e)),gdt=(e={})=>kt("/api/overleaf/session/import",{host:e.host}),vdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/live`,{path:n,sessionId:t.sessionId,retry:t.retry}),bdt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf/live?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),ydt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,r),xdt=(e,n,t)=>kt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),wdt=(e,n,t={})=>ta(`/api/projects/${e}/file/overleaf?${wu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ci(r)),Sdt=(e,n,t={})=>kt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),kdt=(e,n,t={},r)=>At(`/api/projects/${e}/file/overleaf/status?${wu(t,new URLSearchParams({path:n}))}`,r),Cdt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${wu(t,new URLSearchParams({path:n}))}`,Edt=(e,n={},t)=>{const r=wu(n).toString();return At(`/api/projects/${e}/code-tree${r?`?${r}`:""}`,t)},Ndt=(e,n)=>At(`/api/chat/sessions/${e}/worktree`,n),nb=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,zdt=e=>At("/api/settings/hf",e),jdt=e=>kt("/api/settings/hf",{token:e}),Tdt=e=>At("/api/settings/tinker",e),Adt=e=>kt("/api/settings/tinker",{key:e}),Rdt=e=>At("/api/update",e),Mdt=()=>kt("/api/update/apply"),Ddt=()=>kt("/api/update/restart"),Ldt=e=>kt("/api/update/auto",{enabled:e}),Odt=(e=!1)=>kt("/api/update/install-cli",{force:e}),Idt=e=>At("/api/settings/k8s",e),Bdt=e=>kt("/api/settings/k8s",e),$dt=e=>At("/api/settings/modal",e),Pdt=(e,n)=>kt("/api/settings/modal",{tokenId:e,tokenSecret:n}),Fdt=e=>At("/api/settings/env",e).then(n=>n.vars),PL=(e,n)=>kt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Hdt=e=>ta(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)).then(n=>n.vars),qdt=e=>At("/api/settings/data-dir",e),Udt=e=>kt("/api/settings/data-dir/validate",{path:e}),Gdt=e=>kt("/api/settings/data-dir/move",{path:e}),Wdt=e=>At("/api/settings/ssh",e).then(n=>n.hosts),Vdt=e=>At("/api/settings/ssh/config",e),Kdt=(e,n)=>OL("/api/settings/ssh/config",{content:e,previousContent:n}),Qdt=(e,n)=>At(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`,n),Ydt=e=>At("/_orx/runtime",e),Xdt=e=>At("/api/remote/sessions",e).then(n=>n.sessions),Zdt=(e,n)=>kt("/api/remote/sessions",{host:e,uiPreferences:n}),Jdt=e=>kt("/_orx/install",e),eft=()=>kt("/_orx/reconnect"),FL=()=>kt("/_orx/disconnect"),tft=()=>kt("/_orx/start-host"),HL=()=>At("/_orx/stop-host"),qL=e=>kt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),nft=e=>At("/api/settings/slurm",e),rft=e=>kt("/api/settings/slurm",e),sft=e=>At("/api/settings/ray",e),ift=e=>kt("/api/settings/ray",e),aft=e=>kt("/api/settings/ray/preflight",{address:e??null}),oft=(e,n)=>At(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`,n),lft=e=>kt("/api/settings/compute/default",e),cft=e=>At("/api/settings/local",e),uft=e=>At("/api/settings/openresearch",e),dft=(e,n)=>At(`/api/projects/${e}/files`,n),fft=(e,n)=>ta(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),hft=(e,n,t)=>Qd(`/api/projects/${e}/files`,{path:n,...t}),Fh=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,UL=512e3,_ft=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},pft=(e,n,t)=>fetch(Fh(e,n),{signal:t,headers:{Range:`bytes=0-${UL-1}`}}).then(r=>{var i;if(r.status===404)return null;if(r.status===416&&r.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=Number((i=r.headers.get("content-range"))==null?void 0:i.split("/").pop());return r.arrayBuffer().then(a=>_ft(a,Number.isFinite(s)&&s>a.byteLength))}),mft=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",gft=(e,n,t)=>fetch(Fh(e,n),{signal:t,method:"HEAD"}).then(r=>{if(r.status===404)return null;if(!r.ok)throw new Error(`HTTP ${r.status}`);const s=r.headers.get("x-openresearch-presentation");return{size:Number(r.headers.get("content-length"))||0,presentation:mft(s)?s:"download"}}),vft=e=>At("/api/settings/profile",e),bft=e=>At("/api/settings/lit-sources",e),yft=e=>kt("/api/settings/lit-sources",e),xft=e=>At("/api/settings/projects",e),GL=(e,n,t)=>kt("/api/settings/projects",{githubForNewProjects:e,...n===void 0?{}:{githubAutoTopicsForNewProjects:n},...t===void 0?{}:{githubDefaultPromptSeen:t}}),wft=(e,n)=>At(`/api/projects/${e}/git`,n),Sft=e=>kt(`/api/projects/${e}/git/init`),kft=e=>kt(`/api/projects/${e}/github`),Cft=e=>kt(`/api/projects/${e}/github/disable`),Eft=e=>At("/api/settings/telemetry",e),Nft=e=>kt("/api/settings/telemetry",{enabled:e}),Vc=e=>{kt("/api/telemetry/event",e).catch(()=>{})};function I0(e){var s;if(!e.id.startsWith("orx-local-"))return e.displayName??I4(e.id);const n=(s=e.displayName)==null?void 0:s.split(" · ").slice(1).join(" · ").replace(/ \(local\)$/,""),t=n==="OpenAI-compatible server"||n==="Custom endpoint"||n==="Custom Endpoint"?s6():n,r=I4(e.id.replace(/-(?:FP|BF)\d+$/i,""));return t?`${r} · ${t}`:r}const rv="default";function rb(e,n){var a,o,l;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===rv)?rv:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((l=r[0])==null?void 0:l.id)??null;return{choices:r,defaultId:i}}const O4="default";function WL(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:O4,label:pBe(),description:dBe()},...t]:[]}function sv(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=WL(e,n);return s.length===0?O4:t!=null&&s.some(a=>a.id===t)?t:O4}function VL(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=rb(e,n);return r.length===0?rv:t&&r.some(i=>i.id===t)?t:s}const KL=(e=!1,n=!1,t)=>{const r=new URLSearchParams;e&&r.set("refresh","1"),n&&r.set("retry","1");const s=r.size>0?`?${r.toString()}`:"";return At(`/api/harnesses${s}`,t).then(i=>i.harnesses)},zft=(e,n)=>At(`/api/skills${n?`?harness=${encodeURIComponent(n)}`:""}`,e),jft=(e,n,t,r)=>At(`/api/skills/${encodeURIComponent(e)}${`?${new URLSearchParams({...n?{project:n}:{},...r?{harness:r}:{}})}`}`,t).then(s=>s.content),Tft=e=>At("/api/latex-templates",e).then(n=>n.templates),Aft=e=>kt("/api/latex-templates",e).then(n=>n.template),Rft=e=>ta(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),Mft=e=>At("/api/user-skills",e),Dft=e=>kt("/api/user-skills",e).then(n=>n.skill),Lft=e=>ta(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n));function I4(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const Oft=(e,n)=>At(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`,n).then(t=>t.sessions),Ift=(e,n,t={})=>kt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),Bft=e=>ta(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ci(n).then(t=>(eb(e),t))),$ft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),Pft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),Fft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),Hft=(e,n)=>Qd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),qft=(e,n)=>At(`/api/chat/sessions/${e}/messages`,n).then(t=>({messages:t.messages,queued:t.queued??[],activeLeafId:t.activeLeafId??null})),Uft=(e,n)=>ta(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ci(t)),Gft=(e,n)=>kt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Wft=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,PN=(e,n,t={},r,s,i,a)=>kt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),Vft=(e,n)=>kt(`/api/chat/sessions/${e}/shell`,{command:n}),Kft=(e,n,t,r={})=>kt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Qft=(e,n,t)=>kt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Yft=(e,n)=>kt(`/api/chat/sessions/${e}/branch`,{leafId:n}),Xft=e=>kt(`/api/chat/sessions/${e}/interrupt`),Zft=(e,n)=>kt(`/api/chat/sessions/${e}/respond`,n);function $o(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(z(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return i1e({value:Wt(n)});const t=Math.floor(n/60);if(t<60)return t1e({value:Wt(t)});const r=Math.floor(t/60);return r<24?Xge({hours:Wt(r),minutes:Wt(t%60)}):Vge({days:Wt(Math.floor(r/24)),hours:Wt(r%24)})}function Dl(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rAt("/api/local-models",e),tht=e=>kt("/api/local-models/discover",e),nht=e=>kt("/api/local-models",e),rht=e=>kt(`/api/local-models/${encodeURIComponent(e)}/check`,{}),sht=e=>ta(`/api/local-models/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ci(n)),FN=()=>({queryKey:zt("getHfSettings"),queryFn:({signal:e})=>zdt(e),staleTime:3e5}),HN=()=>({queryKey:zt("getTinkerSettings"),queryFn:({signal:e})=>Tdt(e),staleTime:3e5}),qN=()=>({queryKey:zt("getK8sSettings"),queryFn:({signal:e})=>Idt(e),staleTime:3e4}),UN=()=>({queryKey:zt("getModalSettings"),queryFn:({signal:e})=>$dt(e),staleTime:3e5}),iht=()=>({queryKey:zt("getSlurmSettings"),queryFn:({signal:e})=>nft(e),staleTime:3e5}),aht=()=>({queryKey:zt("getRaySettings"),queryFn:({signal:e})=>sft(e),staleTime:3e5}),QL=e=>({queryKey:zt("getComputeSettings",e??null),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),oht=()=>({queryKey:zt("getLocalMachine"),queryFn:({signal:e})=>cft(e),staleTime:3e5}),lht=()=>({queryKey:zt("getOpenResearchSettings"),queryFn:({signal:e})=>uft(e),staleTime:3e4}),cht=()=>({queryKey:zt("getEnvVars"),queryFn:({signal:e})=>Fdt(e),staleTime:3e5}),uht=()=>({queryKey:zt("getDataDir"),queryFn:({signal:e})=>qdt(e),staleTime:3e5}),YL=()=>({queryKey:zt("getSshHosts"),queryFn:({signal:e})=>Wdt(e),staleTime:3e5}),dht=()=>({queryKey:zt("getSshConfig"),queryFn:({signal:e})=>Vdt(e),staleTime:3e5}),GN=e=>({queryKey:zt("getSshMasterStatus",e),queryFn:({signal:n})=>Qdt(e,n),staleTime:5e3}),fht=()=>({queryKey:["gateway","runtime"],queryFn:({signal:e})=>Ydt(e),staleTime:2e3}),hht=()=>({queryKey:zt("listRemoteSessions"),queryFn:({signal:e})=>Xdt(e),staleTime:3e4}),iv=()=>({queryKey:zt("getUpdateStatus"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Rdt(e)),staleTime:3e4}),_ht=()=>({queryKey:zt("getProfile"),queryFn:({signal:e})=>vft(e),staleTime:3e5}),pht=()=>({queryKey:zt("getLitSources"),queryFn:({signal:e})=>bft(e),staleTime:3e5}),av=()=>({queryKey:zt("getProjectDefaults"),queryFn:({signal:e})=>xft(e),staleTime:3e5}),mht=e=>({queryKey:zt("getProjectGitStatus",e),queryFn:({signal:n})=>wft(e,n),staleTime:3e4}),ght=()=>({queryKey:zt("getTelemetry"),queryFn:({signal:e})=>Eft(e),staleTime:3e5}),hu=()=>({queryKey:zt("getHarnesses"),queryFn:({signal:e})=>KL(!1,!1,e),staleTime:3e5}),vht=e=>({queryKey:zt("getSkills",e??null),queryFn:({signal:n})=>zft(n,e),select:n=>n.skills,refetchInterval:n=>{var t;return(t=n.state.data)!=null&&t.importing?2e3:3e4},staleTime:3e5}),bht=(e,n,t)=>({queryKey:zt("getSkillContent",e,n??null,t??null),queryFn:({signal:r})=>jft(e,n,r,t),staleTime:3e5}),yht=()=>({queryKey:zt("listLatexTemplates"),queryFn:({signal:e})=>Tft(e),refetchInterval:3e4,staleTime:3e5}),xht=()=>({queryKey:zt("listUserSkills"),queryFn:({signal:e})=>Mft(e),select:e=>e.skills,refetchInterval:e=>{var n;return(n=e.state.data)!=null&&n.importing?2e3:3e4},staleTime:3e5});async function sb(e=!1,n=!1){const t=hu();if(!e&&!n)return nt.fetchQuery(t);await nt.cancelQueries(t);const r=await KL(e,n);return Fn(t.queryKey)&&nt.setQueryData(t.queryKey,r),r}const wht=()=>({queryKey:zt("getLocalModels"),queryFn:({signal:e})=>eht(e),staleTime:3e4}),Ea=e=>({queryKey:zt("listChatSessions",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,async()=>{const s=await Oft(e,n),i=t.getQueryData(r);return s.filter(a=>!du.has(a.id)).map(a=>{var o;return{...a,contextUsage:a.contextUsage??((o=i==null?void 0:i.find(l=>l.id===a.id))==null?void 0:o.contextUsage)}})},Kp),staleTime:3e4}),Bl=e=>({queryKey:zt("getChatMessages",e),queryFn:async({signal:n,client:t,queryKey:r})=>{var _;const s=t.getQueryData(r),i=await o_(t,r,()=>qft(e,n),(d,p,m)=>{if(!p)return d;const x=new Set([...m].filter(S=>S.startsWith("message:")).map(S=>S.slice(8)));return{messages:Kp(d.messages,p.messages,x,!1),queued:m.has("queued")?p.queued:d.queued,activeLeafId:m.has("branch")||x.size?p.activeLeafId:d.activeLeafId}});n.throwIfAborted();const a=t.getQueryData(r),l=s!==void 0&&i.messages.some(d=>d.role==="user"&&!(s!=null&&s.messages.some(p=>p.id===d.id)))?[]:(a==null?void 0:a.messages.filter(d=>d.id.startsWith("local-")))??[],u=l.some(d=>d.id===(a==null?void 0:a.activeLeafId));return{...i,messages:[...i.messages,...l.filter(d=>!i.messages.some(p=>p.id===d.id))],activeLeafId:a&&(u||!((_=a.activeLeafId)!=null&&_.startsWith("local-"))&&a.activeLeafId!==(s==null?void 0:s.activeLeafId))?a.activeLeafId:i.activeLeafId}},staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),Cd="local-",XL="bash";function WN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Cd)),n]}function Sht(e,n){switch(n.type){case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Cd),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:WN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Cd}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XL,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?WN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${Cd}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}}}}let ZL=0;function JL(e){return(e.query.queryKey[2]==="listChatSessions"||e.query.queryKey[2]==="getChatMessages")&&(e.type==="removed"||e.type==="updated"&&e.action.type==="success")}nt.getQueryCache().subscribe(e=>{JL(e)&&ZL++});const kht=e=>nt.getQueryCache().subscribe(n=>{JL(n)&&e()}),Cht=()=>ZL;function Eht(e,n){const t=nt.getQueryData(Ea(e).queryKey)??[],r=new Set(t.filter(a=>a.busy).map(a=>a.id)),s={messagesBySession:{},queuedBySession:{},activeLeafBySession:{},busySessions:r},i=new Set(r);n&&i.add(n);for(const a of i){const o=nt.getQueryData(Bl(a).queryKey);o&&(s.messagesBySession[a]=o.messages,s.queuedBySession[a]=o.queued,s.activeLeafBySession[a]=o.activeLeafId)}return s}function eO(e,n,t=!1){if(n.type==="busy"){Ga(nt,Ea(e).queryKey,n.sessionId),nt.setQueryData(Ea(e).queryKey,l=>l==null?void 0:l.map(u=>u.id===n.sessionId?{...u,busy:n.busy}:u));return}const r=Bl(n.sessionId);if(du.has(n.sessionId))return;Ga(nt,r.queryKey,n.type==="upsertMessage"?`message:${n.message.id}`:n.type==="setQueued"?"queued":n.type==="activeLeaf"?"branch":"local");const s=nt.getQueryData(r.queryKey);if(t&&!s)return;const i={messagesBySession:s?{[n.sessionId]:s.messages}:{},queuedBySession:s?{[n.sessionId]:s.queued}:{},activeLeafBySession:s?{[n.sessionId]:s.activeLeafId}:{},busySessions:new Set},a=Sht(i,n),o={messages:a.messagesBySession[n.sessionId]??[],queued:a.queuedBySession[n.sessionId]??[],activeLeafId:a.activeLeafBySession[n.sessionId]??null};nt.setQueryData(r.queryKey,o)}function Nht(e,n){const t=!!n&&!du.has(n??""),r=ct({...Bl(n??""),enabled:t,subscribed:t}),s=R.useSyncExternalStore(kht,Cht),i=R.useMemo(()=>Eht(e,n),[e,n,s]),a=za()[1],o=R.useCallback(l=>{Fn(["workspace",a])&&eO(e,l)},[e,a]);return[i,o,r]}const k1=new Map;function zht(e,n){let t=k1.get(e);return t||(t=new Set,k1.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&k1.delete(e)}}function jht(e){var n;(n=k1.get(e.runId))==null||n.forEach(t=>t(e))}const B4=new Set;function ov(e){return B4.add(e),()=>{B4.delete(e)}}function bl(e){B4.forEach(n=>n(e))}const $4=new Set;function Tht(e){return $4.add(e),()=>{$4.delete(e)}}function yl(){$4.forEach(e=>e())}const P4=new Set;function Aht(e){return P4.add(e),()=>{P4.delete(e)}}function VN(e){P4.forEach(n=>n(e))}const F4=new Set;function tO(e){return F4.add(e),()=>{F4.delete(e)}}function j2(e){F4.forEach(n=>n(e))}const H4=new Set;function Rht(e){return H4.add(e),()=>{H4.delete(e)}}function KN(e){H4.forEach(n=>n(e))}const q4=new Set;function Mht(e){return q4.add(e),()=>{q4.delete(e)}}function Dht(e){q4.forEach(n=>n(e))}let U4=!0;const G4=new Set;function Lht(e){return G4.add(e),()=>{G4.delete(e)}}function QN(){return U4}function YN(e){e!==U4&&(U4=e,G4.forEach(n=>n()))}const Oht=8e3,Iht=3e3;function Bht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const l=new EventSource("/api/events");t=l,l.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>YN(!1),Oht)),l.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},Iht)))},l.onopen=()=>{var _,d;r||(window.clearTimeout(s),s=void 0,YN(!0),a&&(bl({type:"reconnected"}),yl(),VN({harness:"*",authState:"unknown"}),(d=(_=n.current).onReconnect)==null||d.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};l.addEventListener("resync.required",()=>{var _,d;bl({type:"reconnected"}),yl(),(d=(_=n.current).onReconnect)==null||d.call(_)}),l.addEventListener("run.updated",_=>{const d=u(_);d!=null&&d.run&&(yl(),n.current.onRun(d.run))}),l.addEventListener("experiment.updated",_=>{var p,m;const d=u(_);d!=null&&d.experiment&&(yl(),(m=(p=n.current).onExperiment)==null||m.call(p,d.experiment))}),l.addEventListener("project.updated",_=>{var p,m;const d=u(_);d!=null&&d.project&&(yl(),(m=(p=n.current).onProject)==null||m.call(p,d.project))}),l.addEventListener("files.updated",_=>{var p,m;const d=u(_);d!=null&&d.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,d.projectId))}),l.addEventListener("run.log",_=>{const d=u(_);d!=null&&d.runId&&jht(d)}),l.addEventListener("chat.session",_=>{const d=u(_);d!=null&&d.session&&(yl(),bl({type:"session",session:d.session}))}),l.addEventListener("chat.session.deleted",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"sessionDeleted",sessionId:d.sessionId}))}),l.addEventListener("chat.message",_=>{const d=u(_);d!=null&&d.message&&(yl(),bl({type:"message",sessionId:d.sessionId,message:d.message}))}),l.addEventListener("chat.busy",_=>{const d=u(_);d!=null&&d.sessionId&&(yl(),bl({type:"busy",sessionId:d.sessionId,busy:d.busy}))}),l.addEventListener("chat.usage",_=>{const d=u(_);d!=null&&d.sessionId&&d.usage&&bl({type:"usage",sessionId:d.sessionId,usage:d.usage})}),l.addEventListener("chat.queued",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"queued",sessionId:d.sessionId,items:d.items??[]})}),l.addEventListener("chat.branch",_=>{const d=u(_);d!=null&&d.sessionId&&bl({type:"branch",sessionId:d.sessionId,activeLeafId:d.activeLeafId??null})}),l.addEventListener("harness.auth",_=>{const d=u(_);d!=null&&d.harness&&d.authState&&VN(d)}),l.addEventListener("datadir.move.progress",_=>{const d=u(_);d&&j2({type:"progress",...d})}),l.addEventListener("datadir.move.done",_=>{const d=u(_);d&&j2({type:"done",path:d.path,oldPathLeft:d.oldPathLeft})}),l.addEventListener("datadir.move.error",_=>{const d=u(_);d&&j2({type:"error",error:d.error})}),l.addEventListener("update.status",_=>{const d=u(_);d&&Dht(d)}),l.addEventListener("overleaf.live",_=>{const d=u(_);d!=null&&d.key&&d.status&&KN({type:"live",key:d.key,status:d.status})}),l.addEventListener("overleaf.pulled",_=>{const d=u(_);d!=null&&d.key&&Array.isArray(d.paths)&&KN({type:"pulled",key:d.key,paths:d.paths})})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const lv=new Set;function $ht(e){const n=R.useRef(e);n.current=e,R.useEffect(()=>{const t={onRun:r=>n.current.onRun(r),onReconnect:()=>{var r,s;return(s=(r=n.current).onReconnect)==null?void 0:s.call(r)}};return lv.add(t),()=>{lv.delete(t)}},[])}const XN={onRun:e=>lv.forEach(n=>n.onRun(e)),onReconnect:()=>lv.forEach(e=>{var n;return(n=e.onReconnect)==null?void 0:n.call(e)})},rp=()=>({queryKey:zt("listProjects"),queryFn:({signal:e,client:n,queryKey:t})=>o_(n,t,()=>Dut(e),Kp),staleTime:3e4}),Pht=()=>({queryKey:zt("listProjectActivity"),queryFn:({signal:e})=>Lut(e),staleTime:3e4}),Zp=()=>({queryKey:zt("getUiState"),queryFn:({signal:e})=>Out(e),staleTime:3e5}),b6=e=>({queryKey:zt("getProjectUiState",e),queryFn:({signal:n})=>Iut(e,n),staleTime:3e5}),B0=(e="")=>({queryKey:zt("getProjectPathStatus",e),queryFn:({signal:n})=>Hut(e,n),staleTime:3e4}),nO=e=>({queryKey:zt("searchPapers",e),queryFn:({signal:n})=>Gut(e,n),staleTime:3e5}),Fht=()=>({queryKey:zt("githubAccount"),queryFn:({signal:e})=>Wut(e),staleTime:3e5}),Hht=e=>({queryKey:zt("githubProjectRepoPreview",e),queryFn:({signal:n})=>Vut(e,n),staleTime:3e4}),ZN=(e,n)=>({queryKey:zt("repoAccess",e,n),queryFn:({signal:t})=>Kut(e,n,t),staleTime:3e4}),W4=e=>({queryKey:zt("resolvePaper",e),queryFn:({signal:n})=>Qut(e,n),staleTime:36e5}),qht=(e,n,t,r)=>({queryKey:zt("getProjectStarterPrompts",e,n,t,r),queryFn:({signal:s})=>Zut(e,n,t,r,s),staleTime:3e5,refetchOnWindowFocus:!1,retryOnMount:!1}),V4=e=>({queryKey:zt("listExperiments",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>tdt(e,n),Kp),staleTime:3e4}),iu=e=>({queryKey:zt("listRuns",e),queryFn:({signal:n,client:t,queryKey:r})=>o_(t,r,()=>ndt(e,n),Kp),staleTime:3e4});function Ag(e,n){if(!e)return;const t=e.find(r=>r.id===n.id);return t&&t.updatedAt>n.updatedAt?e:t?e.map(r=>r.id===n.id?n:r):[...e,n]}function JN(){const e=za();return Bht({onRun(n){var r;if(!Fn(e))return;const t=(r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.find(s=>s.id===n.id);Ga(nt,iu(n.projectId).queryKey,n.id),nt.setQueryData(iu(n.projectId).queryKey,s=>Ag(s,n)),(t==null?void 0:t.commitSha)!==n.commitSha&&(xa(["getRunDiff"],e,s=>s.queryKey[3]===n.id),xa(["getExperimentDiff"],e,s=>s.queryKey[3]===n.experimentId)),XN.onRun(n)},onExperiment(n){Fn(e)&&(Ga(nt,V4(n.projectId).queryKey,n.id),nt.setQueryData(V4(n.projectId).queryKey,t=>Ag(t,n)),xa(["getProjectStarterPrompts"],e,t=>t.queryKey[3]===n.projectId),xa(["getExperimentDiff"],e,t=>t.queryKey[3]===n.id),xa(["getRunDiff"],e,t=>{var r;return((r=nt.getQueryData(iu(n.projectId).queryKey))==null?void 0:r.some(s=>s.experimentId===n.id&&s.id===t.queryKey[3]))??!1}))},onProject(n){Fn(e)&&(Ga(nt,rp().queryKey,n.id),nt.setQueryData(rp().queryKey,t=>Ag(t,n)))},onArtifacts(n){Fn(e)&&(xa(Z5,e,t=>t.queryKey[3]===n),xa(["resolvedFile"],e,t=>t.queryKey[3]===n&&t.queryKey[5]==="artifacts"))},onReconnect(){Fn(e)&&(xa(KV,e),XN.onReconnect())}}),R.useEffect(()=>{let n;const t=Tht(()=>{n??(n=setTimeout(()=>{n=void 0,xa(["listProjectActivity"],e)},100))}),r=tO(o=>{o.type==="done"&&xa(["getDataDir"],e)}),s=ov(o=>{Fn(e)&&(o.type==="session"?Ga(nt,Ea(o.session.projectId).queryKey,o.session.id):(o.type==="busy"||o.type==="usage")&&Ga(nt,[...e,"listChatSessions"],o.sessionId),(o.type==="message"||o.type==="queued"||o.type==="branch")&&eO("",o.type==="message"?{type:"upsertMessage",sessionId:o.sessionId,message:o.message}:o.type==="queued"?{type:"setQueued",sessionId:o.sessionId,items:o.items}:{type:"activeLeaf",sessionId:o.sessionId,leafId:o.activeLeafId},!0),o.type==="session"&&!du.has(o.session.id)?nt.setQueryData(Ea(o.session.projectId).queryKey,l=>{if(!l)return;const u=l.find(_=>_.id===o.session.id);return u?Ag(l,{...o.session,contextUsage:o.session.contextUsage??u.contextUsage}):[o.session,...l]}):o.type==="sessionDeleted"?eb(o.sessionId):(o.type==="busy"||o.type==="usage")&&nt.setQueriesData({queryKey:[...e,"listChatSessions"]},l=>l==null?void 0:l.map(u=>u.id!==o.sessionId?u:o.type==="busy"?{...u,busy:o.busy}:{...u,contextUsage:o.usage})))}),i=Aht(()=>{Fn(e)&&sb(!0).catch(()=>{})}),a=Mht(o=>{Fn(e)&&(Ga(nt,iv().queryKey),nt.setQueryData(iv().queryKey,o))});return()=>{clearTimeout(n),t(),r(),s(),i(),a()}},[e[1]]),null}const K4=new Set;function rO(e){if(e!==z()){dD(e,{reload:!1}),document.documentElement.lang=e;for(const n of K4)n()}}function Uht(e){return K4.add(e),()=>K4.delete(e)}function Yd(){return R.useSyncExternalStore(Uht,z,z)}const sO="orx:theme";function Ght(){try{const e=localStorage.getItem(sO);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let Hh=Ght();const Q4=new Set;function Wht(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y6(){document.documentElement.dataset.theme=Wht(Hh)}function iO(e){Hh=e;try{localStorage.setItem(sO,e)}catch{}y6();for(const n of Q4)n()}function Vht(){return Hh}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Hh==="system"&&y6()});y6();function Kht(e){return Q4.add(e),()=>Q4.delete(e)}function aO(){return[R.useSyncExternalStore(Kht,()=>Hh,()=>Hh),iO]}const Qht=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),oO=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),cv="-",ez=[],Xht="arbitrary..",Zht=e=>{const n=e_t(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Jht(a);const o=a.split(cv),l=o[0]===""&&o.length>1?1:0;return lO(o,l,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=t[a];return l?u?Qht(u,l):l:u||ez}return t[a]||ez}}},lO=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=lO(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(cv):e.slice(n).join(cv),l=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Xht+r:void 0})(),e_t=e=>{const{theme:n,classGroups:t}=e;return t_t(t,n)},t_t=(e,n)=>{const t=oO();for(const r in e){const s=e[r];x6(s,t,r,n)}return t},x6=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){r_t(e,n,t);return}if(typeof e=="function"){s_t(e,n,t,r);return}i_t(e,n,t,r)},r_t=(e,n,t)=>{const r=e===""?n:cO(n,e);r.classGroupId=t},s_t=(e,n,t,r)=>{if(a_t(e)){x6(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Yht(t,e))},i_t=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(cv),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,o_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Y4="!",tz=":",l_t=[],nz=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),c_t=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,l=0,u;const _=s.length;for(let S=0;S<_;S++){const v=s[S];if(a===0&&o===0){if(v===tz){i.push(s.slice(l,S)),l=S+1;continue}if(v==="/"){u=S;continue}}v==="["?a++:v==="]"?a--:v==="("?o++:v===")"&&o--}const d=i.length===0?s:s.slice(l);let p=d,m=!1;d.endsWith(Y4)?(p=d.slice(0,-1),m=!0):d.startsWith(Y4)&&(p=d.slice(1),m=!0);const x=u&&u>l?u-l:void 0;return nz(i,m,p,x)};if(n){const s=n+tz,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):nz(l_t,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},u_t=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},d_t=e=>({cache:o_t(e.cacheSize),parseClassName:c_t(e),sortModifiers:u_t(e),postfixLookupClassGroupIds:f_t(e),...Zht(e)}),f_t=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],l=e.trim().split(h_t);let u="";for(let _=l.length-1;_>=0;_-=1){const d=l[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}=t(d);if(p){u=d+(u.length>0?" "+u:u);continue}let b=!!v,w;if(b){const T=S.substring(0,v);w=r(T);const j=w&&a[w]?r(S):void 0;j&&j!==w&&(w=j,b=!1)}else w=r(S);if(!w){if(!b){u=d+(u.length>0?" "+u:u);continue}if(w=r(S),!w){u=d+(u.length>0?" "+u:u);continue}b=!1}const y=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?y+Y4:y,E=C+w;if(o.indexOf(E)>-1)continue;o.push(E);const N=s(w,b);for(let T=0;T0?" "+u:u)}return u},p_t=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=l=>{const u=n.reduce((_,d)=>d(_),e());return t=d_t(u),r=t.cache.get,s=t.cache.set,i=o,o(l)},o=l=>{const u=r(l);if(u)return u;const _=__t(l,t);return s(l,_),_};return i=a,(...l)=>i(p_t(...l))},m_t=[],fs=e=>{const n=t=>t[e]||m_t;return n.isThemeGetter=!0,n},dO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,g_t=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,v_t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b_t=/\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$/,y_t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,x_t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,w_t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=e=>g_t.test(e),dn=e=>!!e&&!Number.isNaN(Number(e)),bo=e=>!!e&&Number.isInteger(Number(e)),T2=e=>e.endsWith("%")&&dn(e.slice(0,-1)),xl=e=>v_t.test(e),hO=()=>!0,S_t=e=>b_t.test(e)&&!y_t.test(e),w6=()=>!1,k_t=e=>x_t.test(e),C_t=e=>w_t.test(e),E_t=e=>!ht(e)&&!pt(e),N_t=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),z_t=e=>Su(e,mO,w6),ht=e=>dO.test(e),Qu=e=>Su(e,gO,S_t),sz=e=>Su(e,O_t,dn),j_t=e=>Su(e,bO,hO),T_t=e=>Su(e,vO,w6),iz=e=>Su(e,_O,w6),A_t=e=>Su(e,pO,C_t),Rg=e=>Su(e,yO,k_t),pt=e=>fO.test(e),c0=e=>Xd(e,gO),R_t=e=>Xd(e,vO),az=e=>Xd(e,_O),M_t=e=>Xd(e,mO),D_t=e=>Xd(e,pO),Mg=e=>Xd(e,yO,!0),L_t=e=>Xd(e,bO,!0),Su=(e,n,t)=>{const r=dO.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Xd=(e,n,t=!1)=>{const r=fO.exec(e);return r?r[1]?n(r[1]):t:!1},_O=e=>e==="position"||e==="percentage",pO=e=>e==="image"||e==="url",mO=e=>e==="length"||e==="size"||e==="bg-size",gO=e=>e==="length",O_t=e=>e==="number",vO=e=>e==="family-name",bO=e=>e==="number"||e==="weight",yO=e=>e==="shadow",oz=()=>{const e=fs("color"),n=fs("font"),t=fs("text"),r=fs("font-weight"),s=fs("tracking"),i=fs("leading"),a=fs("breakpoint"),o=fs("container"),l=fs("spacing"),u=fs("radius"),_=fs("shadow"),d=fs("inset-shadow"),p=fs("text-shadow"),m=fs("drop-shadow"),x=fs("blur"),S=fs("perspective"),v=fs("aspect"),b=fs("ease"),w=fs("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),pt,ht],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[pt,ht,l],M=()=>[Ic,"full","auto",...j()],O=()=>[bo,"none","subgrid",pt,ht],B=()=>["auto",{span:["full",bo,pt,ht]},bo,pt,ht],$=()=>[bo,"auto",pt,ht],H=()=>["auto","min","max","fr",pt,ht],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[Ic,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],te=()=>[Ic,"screen","full","dvw","lvw","svw","min","max","fit",...j()],I=()=>[Ic,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,pt,ht],F=()=>[...C(),az,iz,{position:[pt,ht]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",M_t,z_t,{size:[pt,ht]}],Z=()=>[T2,c0,Qu],ce=()=>["","none","full",u,pt,ht],re=()=>["",dn,c0,Qu],ne=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[dn,T2,az,iz],oe=()=>["","none",x,pt,ht],ue=()=>["none",dn,pt,ht],pe=()=>["none",dn,pt,ht],Se=()=>[dn,pt,ht],ye=()=>[Ic,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xl],breakpoint:[xl],color:[hO],container:[xl],"drop-shadow":[xl],ease:["in","out","in-out"],font:[E_t],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xl],shadow:[xl],spacing:["px",dn],text:[xl],"text-shadow":[xl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ic,ht,pt,v]}],container:["container"],"container-type":[{"@container":["","normal","size",pt,ht]}],"container-named":[N_t],columns:[{columns:[dn,ht,pt,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[bo,"auto",pt,ht]}],basis:[{basis:[Ic,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dn,Ic,"auto","initial","none",ht]}],grow:[{grow:["",dn,pt,ht]}],shrink:[{shrink:["",dn,pt,ht]}],order:[{order:[bo,"first","last","none",pt,ht]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,c0,Qu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,L_t,j_t]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",T2,ht]}],"font-family":[{font:[R_t,T_t,n]}],"font-features":[{"font-features":[ht]}],"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:[s,pt,ht]}],"line-clamp":[{"line-clamp":[dn,"none",pt,sz]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",pt,ht]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pt,ht]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[dn,"from-font","auto",pt,Qu]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dn,"auto",pt,ht]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[bo,pt,ht]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt,ht]}],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",pt,ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bo,pt,ht],radial:["",pt,ht],conic:[bo,pt,ht]},D_t,A_t]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dn,pt,ht]}],"outline-w":[{outline:["",dn,c0,Qu]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,Mg,Rg]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,Mg,Rg]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dn,Qu]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Mg,Rg]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dn,pt,ht]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[dn]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[pt,ht]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[dn]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pt,ht]}],filter:[{filter:["","none",pt,ht]}],blur:[{blur:oe()}],brightness:[{brightness:[dn,pt,ht]}],contrast:[{contrast:[dn,pt,ht]}],"drop-shadow":[{"drop-shadow":["","none",m,Mg,Rg]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dn,pt,ht]}],"hue-rotate":[{"hue-rotate":[dn,pt,ht]}],invert:[{invert:["",dn,pt,ht]}],saturate:[{saturate:[dn,pt,ht]}],sepia:[{sepia:["",dn,pt,ht]}],"backdrop-filter":[{"backdrop-filter":["","none",pt,ht]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[dn,pt,ht]}],"backdrop-contrast":[{"backdrop-contrast":[dn,pt,ht]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dn,pt,ht]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dn,pt,ht]}],"backdrop-invert":[{"backdrop-invert":["",dn,pt,ht]}],"backdrop-opacity":[{"backdrop-opacity":[dn,pt,ht]}],"backdrop-saturate":[{"backdrop-saturate":[dn,pt,ht]}],"backdrop-sepia":[{"backdrop-sepia":["",dn,pt,ht]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pt,ht]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dn,"initial",pt,ht]}],ease:[{ease:["linear","initial",b,pt,ht]}],delay:[{delay:[dn,pt,ht]}],animate:[{animate:["none",w,pt,ht]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,pt,ht]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[pt,ht,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],zoom:[{zoom:[bo,pt,ht]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",pt,ht]}],"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":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",pt,ht]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dn,c0,Qu,sz]}],stroke:[{stroke:["none",...L()]}],"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"]}},I_t=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Xf(e,"cacheSize",n),Xf(e,"prefix",t),Xf(e,"experimentalParseClassName",r),Dg(e.theme,i.theme),Dg(e.classGroups,i.classGroups),Dg(e.conflictingClassGroups,i.conflictingClassGroups),Dg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Xf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Xf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),Lg(e.theme,s.theme),Lg(e.classGroups,s.classGroups),Lg(e.conflictingClassGroups,s.conflictingClassGroups),Lg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),X4(e,s,"postfixLookupClassGroups"),X4(e,s,"orderSensitiveModifiers"),e),Xf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Dg=(e,n)=>{if(n)for(const t in n)Xf(e,t,n[t])},Lg=(e,n)=>{if(n)for(const t in n)X4(e,n,t)},X4=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},B_t=(e,...n)=>typeof e=="function"?rz(oz,e,...n):rz(()=>I_t(oz(),e),...n),$_t=B_t({extend:{theme:{text:["menu"]}}});function Ds(...e){return $_t(...e)}const P_t={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Pt({variant:e="default",size:n="default",className:t,...r}){return f.jsx("span",{className:Ds("badge inline-flex items-center rounded-full border py-px font-sans",n==="small"?"px-1.5 text-xs font-normal":"px-2 text-sm font-medium",P_t[e],t),...r})}const F_t=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),H_t={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},q_t={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function xO(e,n,t,r){return Ds(F_t,H_t[e],q_t[n],t&&"active",r)}function Le({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:xO(n,t,e,r),...s})}function qh({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:xO(n,t,e,r),...s})}const U_t=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),G_t={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},W_t={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function wO(e,n,t,r){return Ds(U_t,G_t[e],W_t[n],t&&"active",r)}const Qt=R.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return f.jsx("button",{ref:a,className:wO(r,t,n,s),...i})});function ib({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:wO(t,n,e,r),...s})}const V_t={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Wr({variant:e="default",className:n,...t}){return f.jsx("input",{className:Ds("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",V_t[e],n),...t})}function or({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:Ds("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function It({className:e,...n}){return f.jsx("span",{className:Ds("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function ss({className:e,...n}){return f.jsx("div",{className:Ds("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const K_t={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function ab({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:Ds("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:Ds("h-[7px] w-[7px] shrink-0 rounded-full bg-current",K_t[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const Q_t=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function SO(e,n){return Ds(Q_t,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function sp({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:SO(e,n),...r,children:t??f.jsx("span",{})})}function Y_t({checked:e=!1,className:n,...t}){return f.jsx("span",{className:SO(e,n),...t,children:f.jsx("span",{})})}var ro=zM();const X_t=Wp(ro);function Z_t(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const J_t=e=>{switch(e){case"success":return n0t;case"info":return s0t;case"warning":return r0t;case"error":return i0t;default:return null}},e0t=Array(12).fill(0),t0t=({visible:e,className:n})=>Je.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},e0t.map((t,r)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),n0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),r0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),s0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),i0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),a0t=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),o0t=()=>{const[e,n]=Je.useState(document.hidden);return Je.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let l0t=1;const c0t=100,lz=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:l0t++};class u0t{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-c0t;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=lz(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Je.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(f0t(u)&&!u.ok){i=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof d=="object"&&!Je.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,d=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Je.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:d,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),l=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(n,t)=>{const r=lz(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const wi=new u0t,d0t=(e,n)=>wi.message(e,n),f0t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",h0t=d0t,_0t=()=>wi.toasts,p0t=()=>wi.getActiveToasts(),m0t=Object.assign(h0t,{success:wi.success,info:wi.info,warning:wi.warning,error:wi.error,custom:wi.custom,message:wi.message,promise:wi.promise,dismiss:wi.dismiss,loading:wi.loading},{getHistory:_0t,getToasts:p0t});Z_t("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Og(e){return e.label!==void 0}const g0t=3,v0t="24px",b0t="16px",cz=4e3,y0t=356,x0t=14,w0t=45,S0t=200;function yo(...e){return e.filter(Boolean).join(" ")}function k0t(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const C0t=e=>{var n,t,r,s,i,a,o,l,u;const{invert:_,toast:d,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:v,index:b,toasts:w,expanded:y,removeToast:C,defaultRichColors:E,closeButton:N,style:T,cancelButtonStyle:j,actionButtonStyle:M,className:O="",descriptionClassName:B="",duration:$,position:H,gap:q,expandByDefault:Y,classNames:G,icons:X,closeButtonAriaLabel:te="Close toast"}=e,[I,L]=Je.useState(null),[F,W]=Je.useState(null),[U,Z]=Je.useState(!1),[ce,re]=Je.useState(!1),[ne,Q]=Je.useState(!1),[le,oe]=Je.useState(!1),[ue,pe]=Je.useState(!1),[Se,ye]=Je.useState(0),[qe,Ie]=Je.useState(0),Te=Je.useRef(d.duration||$||cz),vt=Je.useRef(null),Dt=Je.useRef(null),Ut=b===0,Ft=b+1<=S,mt=d.type,rt=mt??"default",ut=d.dismissible!==!1,Ct=d.className||"",we=d.descriptionClassName||"",Re=Je.useMemo(()=>v.findIndex(bt=>bt.toastId===d.id)||0,[v,d.id]),Ze=Je.useMemo(()=>{var bt;return(bt=d.closeButton)!=null?bt:N},[d.closeButton,N]),_t=Je.useMemo(()=>d.duration||$||cz,[d.duration,$]),wt=Je.useRef(0),Zt=Je.useRef(0),We=Je.useRef(0),Gt=Je.useRef(null),[an,yn]=H.split("-"),Vt=Je.useMemo(()=>v.reduce((bt,fn,Cn)=>Cn>=Re?bt:bt+fn.height,0),[v,Re]),Yn=o0t(),ln=Je.useMemo(()=>{var bt;return(bt=e.swipeDirections)!=null?bt:k0t(H)},[e.swipeDirections,H]),cn=d.invert||_,br=mt==="loading";Zt.current=Je.useMemo(()=>Re*q+Vt,[Re,Vt]),Je.useEffect(()=>{Te.current=_t},[_t]),Je.useEffect(()=>{Z(!0)},[]),Je.useEffect(()=>{const bt=Dt.current;if(bt){const fn=bt.getBoundingClientRect().height;return Ie(fn),x(Cn=>[{toastId:d.id,height:fn,position:d.position},...Cn]),()=>x(Cn=>Cn.filter(tn=>tn.toastId!==d.id))}},[x,d.id]),Je.useLayoutEffect(()=>{if(!U)return;const bt=Dt.current,fn=bt.style.height;bt.style.height="auto";const Cn=bt.getBoundingClientRect().height;bt.style.height=fn,Ie(Cn),x(tn=>tn.find(un=>un.toastId===d.id)?tn.map(un=>un.toastId===d.id?{...un,height:Cn}:un):[{toastId:d.id,height:Cn,position:d.position},...tn])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const Xn=Je.useCallback(()=>{re(!0),ye(Zt.current),x(bt=>bt.filter(fn=>fn.toastId!==d.id)),setTimeout(()=>{C(d)},S0t)},[d,C,x,Zt]);Je.useEffect(()=>{if(d.promise&&mt==="loading"||d.duration===1/0||d.type==="loading")return;let bt;return y||m||Yn?(()=>{if(We.current{Te.current!==1/0&&(wt.current=new Date().getTime(),bt=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Xn()},Te.current))})(),()=>clearTimeout(bt)},[y,m,d,mt,Yn,Xn]),Je.useEffect(()=>{d.delete&&(Xn(),d.onDismiss==null||d.onDismiss.call(d,d))},[Xn,d.delete]);function Zn(){var bt;if(X!=null&&X.loading){var fn;return Je.createElement("div",{className:yo(G==null?void 0:G.loader,d==null||(fn=d.classNames)==null?void 0:fn.loader,"sonner-loader"),"data-visible":mt==="loading"},X.loading)}return Je.createElement(t0t,{className:yo(G==null?void 0:G.loader,d==null||(bt=d.classNames)==null?void 0:bt.loader),visible:mt==="loading"})}const Rn=d.icon||(X==null?void 0:X[mt])||J_t(mt);var Rr,Nr;return Je.createElement("li",{tabIndex:0,ref:Dt,className:yo(O,Ct,G==null?void 0:G.toast,d==null||(n=d.classNames)==null?void 0:n.toast,G==null?void 0:G[rt],d==null||(t=d.classNames)==null?void 0:t[rt]),"data-sonner-toast":"","data-rich-colors":(Rr=d.richColors)!=null?Rr:E,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ue,"data-removed":ce,"data-visible":Ft,"data-y-position":an,"data-x-position":yn,"data-index":b,"data-front":Ut,"data-swiping":ne,"data-dismissible":ut,"data-type":mt,"data-invert":cn,"data-swipe-out":le,"data-swipe-direction":F,"data-expanded":!!(y||Y&&U),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${ce?Se:Zt.current}px`,"--initial-height":Y?"auto":`${qe}px`,...T,...d.style},onDragEnd:()=>{Q(!1),L(null),Gt.current=null},onPointerDown:bt=>{bt.button!==2&&(br||!ut||(vt.current=new Date,ye(Zt.current),bt.target.setPointerCapture(bt.pointerId),bt.target.tagName!=="BUTTON"&&(Q(!0),Gt.current={x:bt.clientX,y:bt.clientY})))},onPointerUp:()=>{var bt,fn,Cn;if(le||!ut)return;Gt.current=null;const tn=Number(((bt=Dt.current)==null?void 0:bt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((fn=Dt.current)==null?void 0:fn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),un=new Date().getTime()-((Cn=vt.current)==null?void 0:Cn.getTime()),Mn=I==="x"?tn:nr,on=Math.abs(Mn)/un;if((I==="x"?ln.includes(tn>0?"right":"left"):ln.includes(nr>0?"bottom":"top"))&&(Math.abs(Mn)>=w0t||on>.11)){ye(Zt.current),d.onDismiss==null||d.onDismiss.call(d,d),W(I==="x"?tn>0?"right":"left":nr>0?"down":"up"),Xn(),oe(!0);return}else{var En,Ve;(En=Dt.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(Ve=Dt.current)==null||Ve.style.setProperty("--swipe-amount-y","0px")}pe(!1),Q(!1),L(null)},onPointerMove:bt=>{var fn,Cn,tn;if(!Gt.current||!ut||((fn=window.getSelection())==null?void 0:fn.toString().length)>0)return;const un=bt.clientY-Gt.current.y,Mn=bt.clientX-Gt.current.x;!I&&(Math.abs(Mn)>1||Math.abs(un)>1)&&L(Math.abs(Mn)>Math.abs(un)?"x":"y");let on={x:0,y:0};const rr=En=>1/(1.5+Math.abs(En)/20);if(I==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&un<0||ln.includes("bottom")&&un>0)on.y=un;else{const En=un*rr(un);on.y=Math.abs(En)0)on.x=Mn;else{const En=Mn*rr(Mn);on.x=Math.abs(En)0||Math.abs(on.y)>0)&&pe(!0),(Cn=Dt.current)==null||Cn.style.setProperty("--swipe-amount-x",`${on.x}px`),(tn=Dt.current)==null||tn.style.setProperty("--swipe-amount-y",`${on.y}px`)}},Ze&&!d.jsx&&mt!=="loading"?Je.createElement("button",{"aria-label":te,"data-disabled":br,"data-close-button":!0,onClick:br||!ut?()=>{}:()=>{Xn(),d.onDismiss==null||d.onDismiss.call(d,d)},className:yo(G==null?void 0:G.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Nr=X==null?void 0:X.close)!=null?Nr:a0t):null,(mt||d.icon||d.promise)&&d.icon!==null&&((X==null?void 0:X[mt])!==null||d.icon)?Je.createElement("div",{"data-icon":"",className:yo(G==null?void 0:G.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},mt==="loading"?d.icon||Zn():d.promise?Zn():null,mt!=="loading"?Rn:null):null,Je.createElement("div",{"data-content":"",className:yo(G==null?void 0:G.content,d==null||(i=d.classNames)==null?void 0:i.content)},Je.createElement("div",{"data-title":"",className:yo(G==null?void 0:G.title,d==null||(a=d.classNames)==null?void 0:a.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Je.createElement("div",{"data-description":"",className:yo(B,we,G==null?void 0:G.description,d==null||(o=d.classNames)==null?void 0:o.description)},typeof d.description=="function"?d.description():d.description):null),Je.isValidElement(d.cancel)?d.cancel:d.cancel&&Og(d.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:bt=>{Og(d.cancel)&&ut&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,bt),Xn())},className:yo(G==null?void 0:G.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,Je.isValidElement(d.action)?d.action:d.action&&Og(d.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||M,onClick:bt=>{Og(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,bt),!bt.defaultPrevented&&Xn())},className:yo(G==null?void 0:G.actionButton,d==null||(u=d.classNames)==null?void 0:u.actionButton)},d.action.label):null)};function uz(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function E0t(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?b0t:v0t;function l(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),t}const N0t=Je.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:_,mobileOffset:d,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:v=g0t,toastOptions:b,dir:w=uz(),gap:y=x0t,icons:C,customAriaLabel:E,containerAriaLabel:N="Notifications"}=n,[T,j]=Je.useState([]),M=Je.useMemo(()=>r?T.filter(Z=>Z.toasterId===r):T.filter(Z=>!Z.toasterId),[T,r]),O=Je.useMemo(()=>Array.from(new Set([i].concat(M.filter(Z=>Z.position).map(Z=>Z.position)))),[M,i]),[B,$]=Je.useState([]),[H,q]=Je.useState(!1),[Y,G]=Je.useState(!1),[X,te]=Je.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=Je.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=Je.useRef(null),W=Je.useRef(!1),U=Je.useCallback(Z=>{j(ce=>{var re;return(re=ce.find(ne=>ne.id===Z.id))!=null&&re.delete||wi.dismiss(Z.id),ce.filter(({id:ne})=>ne!==Z.id)})},[]);return Je.useEffect(()=>wi.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{j(ce=>ce.map(re=>re.id===Z.id?{...re,delete:!0}:re))});return}setTimeout(()=>{X_t.flushSync(()=>{j(ce=>{const re=ce.findIndex(ne=>ne.id===Z.id);return re!==-1?[...ce.slice(0,re),{...ce[re],...Z},...ce.slice(re+1)]:[Z,...ce]})})})}),[]),Je.useEffect(()=>{if(p!=="system"){te(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:ce})=>{te(ce?"dark":"light")})}catch{Z.addListener(({matches:re})=>{try{te(re?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),Je.useEffect(()=>{T.length<=1&&q(!1)},[T]),Je.useEffect(()=>{const Z=ce=>{var re;if(a.length>0&&a.every(le=>ce[le]||ce.code===le)){var Q;q(!0),(Q=I.current)==null||Q.focus()}ce.code==="Escape"&&(document.activeElement===I.current||(re=I.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[a]),Je.useEffect(()=>{if(I.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,W.current=!1)}},[I.current]),Je.createElement("section",{ref:t,"aria-label":E??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((Z,ce)=>{var re;const[ne,Q]=Z.split("-");return M.length?Je.createElement("ol",{key:Z,dir:w==="auto"?uz():w,tabIndex:-1,ref:I,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ne,"data-x-position":Q,style:{"--front-toast-height":`${((re=B[0])==null?void 0:re.height)||0}px`,"--width":`${y0t}px`,"--gap":`${y}px`,...S,...E0t(_,d)},onBlur:le=>{W.current&&!le.currentTarget.contains(le.relatedTarget)&&(W.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||W.current||(W.current=!0,F.current=le.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Y||q(!1)},onDragEnd:()=>q(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},M.filter(le=>!le.position&&ce===0||le.position===Z).map((le,oe)=>{var ue,pe;return Je.createElement(C0t,{key:le.id,icons:C,index:oe,toast:le,defaultRichColors:m,duration:(ue=b==null?void 0:b.duration)!=null?ue:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(pe=b==null?void 0:b.closeButton)!=null?pe:l,interacting:Y,position:Z,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:M.filter(Se=>Se.position==le.position),heights:B.filter(Se=>Se.position==le.position),setHeights:$,expandByDefault:o,gap:y,expanded:H,swipeDirections:n.swipeDirections})})):null}))});function z0t(e){const[n]=aO();return f.jsx(N0t,{theme:n,...e})}function Qn(e,n,t){m0t[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function S6({content:e,children:n,className:t}){const r=R.useRef(null),s=R.useRef(null);function i(){const o=r.current,l=s.current;if(!o||!l)return;l.matches(":popover-open")||l.showPopover();const u=o.getBoundingClientRect(),_=l.getBoundingClientRect(),d=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));l.style.left=`${d}px`,l.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,l;(o=r.current)!=null&&o.matches(":hover, :focus")||(l=s.current)==null||l.hidePopover()}return R.useEffect(()=>{const o=()=>{var l;return(l=s.current)==null?void 0:l.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:Ds("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var l;o.key==="Escape"&&((l=s.current)!=null&&l.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const j0t='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ob(e,n,t="[data-initial-focus]"){const r=R.useRef(n);r.current=n,R.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(j0t)];(s.querySelector(t)??a()[0]??s).focus();const o=l=>{if(l.key==="Escape"){if(s.querySelector(":popover-open"))return;l.preventDefault(),l.stopPropagation(),r.current();return}if(l.key!=="Tab")return;const u=a(),_=u[0],d=u.at(-1);!_||!d?(l.preventDefault(),s.focus()):l.shiftKey&&document.activeElement===_?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function kO({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=R.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),l=[];return n.activeTurnCount>0&&l.push(n.activeTurnCount===1?MOe():GOe({count:Wt(n.activeTurnCount)})),n.pendingPermissionCount>0&&l.push(n.pendingPermissionCount===1?gOe():KLe({count:Wt(n.pendingPermissionCount)})),o>0&&l.push(o===1?COe():IOe({count:Wt(o)})),n.queuedMessageCount>0&&l.push(n.queuedMessageCount===1?jOe():FOe({count:Wt(n.queuedMessageCount)})),n.activeRunCount>0&&l.push(n.activeRunCount===1?xOe():aOe({count:Wt(n.activeRunCount)})),ob(a,s),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:f.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":l.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:nOe({host:Ne(e)})}),l.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:hOe()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:l.map(u=>f.jsx("li",{children:u},u))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(Le,{disabled:r,onClick:s,children:Ad()}),f.jsx(Le,{variant:"danger",disabled:r,onClick:i,children:r?QOe():ZLe()})]})]})}),document.body)}var A2={exports:{}},dz;function T0t(){return dz||(dz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),d=l-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),t})()))})(A2)),A2.exports}var A0t=T0t(),R2={exports:{}},fz;function R0t(){return fz||(fz=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function l(_){try{const d=new URL(_),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,d,p,m={}){this._terminal=_,this._regex=d,this._handler=p,this._options=m}provideLinks(_,d){const p=u.computeLink(_,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(_){return _.map((d=>(d.leave=this._options.leave,d.hover=(p,m)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,m,x)}},d)))}};class u{static computeLink(d,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[v,b]=u._getWindowedLineStrings(d-1,m),w=v.join("");let y;const C=[];for(;y=S.exec(w);){const E=y[0];if(!l(E))continue;const[N,T]=u._mapStrIdx(m,b,0,y.index),[j,M]=u._mapStrIdx(m,N,T,E.length);if(N===-1||T===-1||j===-1||M===-1)continue;const O={start:{x:T+1,y:N+1},end:{x:M,y:j+1}};C.push({range:O,text:E,activate:x})}return C}static _getWindowedLineStrings(d,p){let m,x=d,S=d,v=0,b="";const w=[];if(m=p.buffer.active.getLine(d)){const y=m.translateToString(!0);if(m.isWrapped&&y[0]!==" "){for(v=0;(m=p.buffer.active.getLine(--x))&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),m.isWrapped&&b.indexOf(" ")===-1););w.reverse()}for(w.push(y),v=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&v<2048&&(b=m.translateToString(!0),v+=b.length,w.push(b),b.indexOf(" ")===-1););}return[w,x]}static _mapStrIdx(d,p,m,x){const S=d.buffer.active,v=S.getNullCell();let b=m;for(;x;){const w=S.getLine(p);if(!w)return[-1,-1];for(let y=b;y{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,d={}){this._handler=_,this._options=d}activate(_){this._terminal=_;const d=this._options,p=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(R2)),R2.exports}var M0t=R0t(),M2={exports:{}},hz;function D0t(){return hz||(hz=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),p=l(9924),m=l(844),x=l(4725),S=l(2585),v=l(3656);let b=o.AccessibilityManager=class extends m.Disposable{constructor(w,y,C,E){super(),this._terminal=w,this._coreBrowserService=C,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(w){for(let y=0;y0?this._charsToConsume.shift()!==w&&(this._charsToAnnounce+=w):this._charsToAnnounce+=w,w===` `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(w){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(w)||this._charsToConsume.push(w)}_refreshRows(w,y){this._liveRegionDebouncer.refresh(w,y,this._terminal.rows)}_renderRows(w,y){const C=this._terminal.buffer,E=C.lines.length.toString();for(let N=w;N<=y;N++){const T=C.lines.get(C.ydisp+N),j=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,j))||"",O=(C.ydisp+N+1).toString(),B=this._rowElements[N];B&&(M.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=M,this._rowColumns.set(B,j)),B.setAttribute("aria-posinset",O),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,y){const C=w.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==E)return;let N,T;if(y===0?(N=C,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(N=this._rowElements.shift(),T=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const j=this._createAccessibilityTreeNode();this._rowElements.unshift(j),this._rowContainer.insertAdjacentElement("afterbegin",j)}else{const j=this._createAccessibilityTreeNode();this._rowElements.push(j),this._rowContainer.appendChild(j)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),w.preventDefault(),w.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const w=document.getSelection();if(!w)return;if(w.isCollapsed)return void(this._rowContainer.contains(w.anchorNode)&&this._terminal.clearSelection());if(!w.anchorNode||!w.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:w.anchorNode,offset:w.anchorOffset},C={node:w.focusNode,offset:w.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:O,offset:B})=>{const $=O instanceof Text?O.parentNode:O;let H=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const q=this._rowColumns.get($);if(!q)return console.warn("columns is null. Race condition?"),null;let Y=B=this._terminal.cols&&(++H,Y=0),{row:H,column:Y}},T=N(y),j=N(C);if(T&&j){if(T.row>j.row||T.row===j.row&&T.column>=j.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(j.row-T.row)*this._terminal.cols-T.column+j.column)}}_handleResize(w){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yw;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const w=this._coreBrowserService.mainDocument.createElement("div");return w.setAttribute("role","listitem"),w.tabIndex=-1,this._refreshRowDimensions(w),w}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let w=0;w{function l(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=l(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function d(p,m,x){const S=x.getBoundingClientRect(),v=p.clientX-S.left-10,b=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${v}px`,m.style.top=`${b}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,m,x,S,v){d(p,m,x),v&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=l(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,d,p){this._css.set(_,d,p)}getCss(_,d){return this._css.get(_,d)}setColor(_,d,p){this._color.set(_,d,p)}getColor(_,d){return this._color.get(_,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,u,_,d){l.addEventListener(u,_,d);let p=!1;return{dispose:()=>{p||(p=!0,l.removeEventListener(u,_,d))}}}},3551:function(a,o,l){var u=this&&this.__decorate||function(b,w,y,C){var E,N=arguments.length,T=N<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,y,C);else for(var j=b.length-1;j>=0;j--)(E=b[j])&&(T=(N<3?E(T):N>3?E(w,y,T):E(w,y))||T);return N>3&&T&&Object.defineProperty(w,y,T),T},_=this&&this.__param||function(b,w){return function(y,C){w(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),p=l(8460),m=l(844),x=l(2585),S=l(4725);let v=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(b,w,y,C,E){super(),this._element=b,this._mouseService=w,this._renderService=y,this._bufferService=C,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!w)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,T]of this._linkProviderService.linkProviders.entries())w?(E=this._activeProviderReplies)!=null&&E.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):T.provideLinks(b.y,(j=>{var O,B;if(this._isMouseOut)return;const M=j==null?void 0:j.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(N,M),y=this._checkLinkProviderResult(N,b,y),((B=this._activeProviderReplies)==null?void 0:B.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,w){const y=new Set;for(let C=0;Cb?this._bufferService.cols:T.link.range.end.x;for(let O=j;O<=M;O++){if(y.has(O)){E.splice(N--,1);break}y.add(O)}}}}_checkLinkProviderResult(b,w,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let E=!1;for(let T=0;Tthis._linkAtPosition(j.link,w)));T&&(y=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let T=0;Tthis._linkAtPosition(M.link,w)));if(j){y=!0,this._handleNewLink(j);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const w=this._positionFromMouseEvent(b,this._element,this._mouseService);w&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,w)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,w){this._currentLink&&this._lastMouseEvent&&(!b||!w||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=w)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._linkAtPosition(b.link,w)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,E,N;(C=this._currentLink)!=null&&C.state&&((N=(E=this._currentLink)==null?void 0:E.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(C,E),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),w.hover&&w.hover(y,w.text)}_fireUnderlineEvent(b,w){const y=b.range,C=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,w,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(w,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),w.leave&&w.leave(y,w.text)}_linkAtPosition(b,w){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,E=w.y*this._bufferService.cols+w.x;return y<=E&&E<=C}_positionFromMouseEvent(b,w,y){const C=y.getCoords(b,w,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,w,y,C,E){return{x1:b,y1:w,x2:y,y2:C,cols:this._bufferService.cols,fg:E}}};o.Linkifier=v=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var u=this&&this.__decorate||function(S,v,b,w){var y,C=arguments.length,E=C<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(S,v,b,w);else for(var N=S.length-1;N>=0;N--)(y=S[N])&&(E=(C<3?y(E):C>3?y(v,b,E):y(v,b))||E);return C>3&&E&&Object.defineProperty(v,b,E),E},_=this&&this.__param||function(S,v){return function(b,w){v(b,w,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),p=l(2585);let m=o.OscLinkProvider=class{constructor(S,v,b){this._bufferService=S,this._optionsService=v,this._oscLinkService=b}provideLinks(S,v){var M;const b=this._bufferService.buffer.lines.get(S-1);if(!b)return void v(void 0);const w=[],y=this._optionsService.rawOptions.linkHandler,C=new d.CellData,E=b.getTrimmedLength();let N=-1,T=-1,j=!1;for(let O=0;Oy?y.activate(q,Y,$):x(0,Y),hover:(q,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,q,Y,$)},leave:(q,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,q,Y,$)}})}j=!1,C.hasExtendedAttrs()&&C.extended.urlId?(T=O,N=C.extended.urlId):(T=-1,N=-1)}}v(w)}};function x(S,v){if(confirm(`Do you want to navigate to ${v}? @@ -85,7 +85,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) `:` `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(j){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&j&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(j){const M=this._getMouseBufferCoords(j),O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(O&&B&&M)&&this._areCoordsInSelection(M,O,B)}isCellInSelection(j,M){const O=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!O||!B)&&this._areCoordsInSelection([j,M],O,B)}_areCoordsInSelection(j,M,O){return j[1]>M[1]&&j[1]=M[0]&&j[0]=M[0]}_selectWordAtCursor(j,M){var $,H;const O=(H=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:H.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(j);return!!B&&(this._selectWordAt(B,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(j,M){this._model.clearSelection(),j=Math.max(j,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,j],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(j){this._model.handleTrim(j)&&this.refresh()}_getMouseBufferCoords(j){const M=this._mouseService.getCoords(j,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(j){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,j,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(j){return b.isMac?j.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:j.shiftKey}handleMouseDown(j){if(this._mouseDownTimeStamp=j.timeStamp,(j.button!==2||!this.hasSelection)&&j.button===0){if(!this._enabled){if(!this.shouldForceSelection(j))return;j.stopPropagation()}j.preventDefault(),this._dragScrollAmount=0,this._enabled&&j.shiftKey?this._handleIncrementalClick(j):j.detail===1?this._handleSingleClick(j):j.detail===2?this._handleDoubleClick(j):j.detail===3&&this._handleTripleClick(j),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(j){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(j))}_handleSingleClick(j){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(j)?3:0,this._model.selectionStart=this._getMouseBufferCoords(j),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(j){this._selectWordAtCursor(j,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(j){const M=this._getMouseBufferCoords(j);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(j){return j.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(j){if(j.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(j),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(j.ydisp+this._bufferService.rows,j.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=j.ydisp),this.refresh()}}_handleMouseUp(j){const M=j.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&j.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(j,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const B=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const j=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!j||!M||j[0]===M[0]&&j[1]===M[1]);O?j&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&j[0]===this._oldSelectionStart[0]&&j[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(j,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(j,M,O)}_fireOnSelectionChange(j,M,O){this._oldSelectionStart=j,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(j){this.clearSelection(),this._trimListener.dispose(),this._trimListener=j.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(j,M){let O=M;for(let B=0;M>=B;B++){const $=j.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&M!==B&&(O+=$-1)}return O}setSelection(j,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[j,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(j){this._isClickInSelection(j)||(this._selectWordAtCursor(j,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(j,M,O=!0,B=!0){if(j[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,H=$.lines.get(j[1]);if(!H)return;const q=$.translateBufferLineToString(j[1],!1);let Y=this._convertViewportColToCharacterIndex(H,j[0]),G=Y;const X=j[0]-Y;let te=0,I=0,L=0,F=0;if(q.charAt(Y)===" "){for(;Y>0&&q.charAt(Y-1)===" ";)Y--;for(;G1&&(F+=re-1,G+=re-1);Z>0&&Y>0&&!this._isCharWordSeparator(H.loadCell(Z-1,this._workCell));){H.loadCell(Z-1,this._workCell);const ne=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,Z--):ne>1&&(L+=ne-1,Y-=ne-1),Y--,Z--}for(;ce1&&(F+=ne-1,G+=ne-1),G++,ce++}}G++;let W=Y+X-te+L,U=Math.min(this._bufferService.cols,G-Y+te+I-L-F);if(M||q.slice(Y,G).trim()!==""){if(O&&W===0&&H.getCodePoint(0)!==32){const Z=$.lines.get(j[1]-1);if(Z&&H.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,j[1]-1],!1,!0,!1);if(ce){const re=this._bufferService.cols-ce.start;W-=re,U+=re}}}if(B&&W+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const Z=$.lines.get(j[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const ce=this._getWordAt([0,j[1]+1],!1,!1,!0);ce&&(U+=ce.length)}}return{start:W,length:U}}}_selectWordAt(j,M){const O=this._getWordAt(j,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,j[1]--;this._model.selectionStart=[O.start,j[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(j){const M=this._getWordAt(j,!0);if(M){let O=j[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(j){return j.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(j.getChars())>=0}_selectLineAt(j){const M=this._bufferService.buffer.getWrappedRangeForLine(j),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,w.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=T=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=l(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,l){var u=this&&this.__decorate||function(T,j,M,O){var B,$=arguments.length,H=$<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(T,j,M,O);else for(var q=T.length-1;q>=0;q--)(B=T[q])&&(H=($<3?B(H):$>3?B(j,M,H):B(j,M))||H);return $>3&&H&&Object.defineProperty(j,M,H),H},_=this&&this.__param||function(T,j){return function(M,O){j(M,O,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),p=l(8055),m=l(8460),x=l(844),S=l(2585),v=p.css.toColor("#ffffff"),b=p.css.toColor("#000000"),w=p.css.toColor("#ffffff"),y=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=j[M/36%6|0],B=j[M/6%6|0],$=j[M%6];T.push({css:p.channels.toCss(O,B,$),rgba:p.channels.toRgba(O,B,$)})}for(let M=0;M<24;M++){const O=8+10*M;T.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return T})());let E=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:w,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const j=this._colors;if(j.foreground=N(T.foreground,v),j.background=N(T.background,b),j.cursor=N(T.cursor,w),j.cursorAccent=N(T.cursorAccent,y),j.selectionBackgroundTransparent=N(T.selectionBackground,C),j.selectionBackgroundOpaque=p.color.blend(j.background,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundTransparent=N(T.selectionInactiveBackground,j.selectionBackgroundTransparent),j.selectionInactiveBackgroundOpaque=p.color.blend(j.background,j.selectionInactiveBackgroundTransparent),j.selectionForeground=T.selectionForeground?N(T.selectionForeground,p.NULL_COLOR):void 0,j.selectionForeground===p.NULL_COLOR&&(j.selectionForeground=void 0),p.color.isOpaque(j.selectionBackgroundTransparent)&&(j.selectionBackgroundTransparent=p.color.opacity(j.selectionBackgroundTransparent,.3)),p.color.isOpaque(j.selectionInactiveBackgroundTransparent)&&(j.selectionInactiveBackgroundTransparent=p.color.opacity(j.selectionInactiveBackgroundTransparent,.3)),j.ansi=o.DEFAULT_ANSI_COLORS.slice(),j.ansi[0]=N(T.black,o.DEFAULT_ANSI_COLORS[0]),j.ansi[1]=N(T.red,o.DEFAULT_ANSI_COLORS[1]),j.ansi[2]=N(T.green,o.DEFAULT_ANSI_COLORS[2]),j.ansi[3]=N(T.yellow,o.DEFAULT_ANSI_COLORS[3]),j.ansi[4]=N(T.blue,o.DEFAULT_ANSI_COLORS[4]),j.ansi[5]=N(T.magenta,o.DEFAULT_ANSI_COLORS[5]),j.ansi[6]=N(T.cyan,o.DEFAULT_ANSI_COLORS[6]),j.ansi[7]=N(T.white,o.DEFAULT_ANSI_COLORS[7]),j.ansi[8]=N(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),j.ansi[9]=N(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),j.ansi[10]=N(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),j.ansi[11]=N(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),j.ansi[12]=N(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),j.ansi[13]=N(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),j.ansi[14]=N(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),j.ansi[15]=N(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(j.ansi.length-16,T.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;v--)this._array[this._getCyclicIndex(v+S.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+S.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let b=x-1;b>=0;b--)this.set(m+b+S,this.get(m+b));const v=m+x+S-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(u,_=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const p in u)d[p]=_<=1?u[p]:u[p]&&l(u[p],_-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,u=0,_=0,d=0;var p,m,x,S,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function w(y,C){return y>>0},y.toColor=function(C,E,N,T){return{css:y.toCss(C,E,N,T),rgba:y.toRgba(C,E,N,T)}}})(p||(o.channels=p={})),(function(y){function C(E,N){return d=Math.round(255*N),[l,u,_]=v.toChannels(E.rgba),{css:p.toCss(l,u,_,d),rgba:p.toRgba(l,u,_,d)}}y.blend=function(E,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const T=N.rgba>>24&255,j=N.rgba>>16&255,M=N.rgba>>8&255,O=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return l=O+Math.round((T-O)*d),u=B+Math.round((j-B)*d),_=$+Math.round((M-$)*d),{css:p.toCss(l,u,_),rgba:p.toRgba(l,u,_)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,N,T){const j=v.ensureContrastRatio(E.rgba,N.rgba,T);if(j)return p.toColor(j>>24&255,j>>16&255,j>>8&255)},y.opaque=function(E){const N=(255|E.rgba)>>>0;return[l,u,_]=v.toChannels(N),{css:p.toCss(l,u,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(E,N){return d=255&E.rgba,C(E,d*N/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(o.color=m={})),(function(y){let C,E;try{const N=document.createElement("canvas");N.width=1,N.height=1;const T=N.getContext("2d",{willReadFrequently:!0});T&&(C=T,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),p.toColor(l,u,_);case 5:return l=parseInt(N.slice(1,2).repeat(2),16),u=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),p.toColor(l,u,_,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const T=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return l=parseInt(T[1]),u=parseInt(T[2]),_=parseInt(T[3]),d=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),p.toColor(l,u,_,d);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[l,u,_,d]=C.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(l,u,_,d),css:N}}})(x||(o.css=x={})),(function(y){function C(E,N,T){const j=E/255,M=N/255,O=T/255;return .2126*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}y.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=C})(S||(o.rgb=S={})),(function(y){function C(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y0||H>0||q>0);)$-=Math.max(0,Math.ceil(.1*$)),H-=Math.max(0,Math.ceil(.1*H)),q-=Math.max(0,Math.ceil(.1*q)),Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));return($<<24|H<<16|q<<8|255)>>>0}function E(N,T,j){const M=N>>24&255,O=N>>16&255,B=N>>8&255;let $=T>>24&255,H=T>>16&255,q=T>>8&255,Y=w(S.relativeLuminance2($,H,q),S.relativeLuminance2(M,O,B));for(;Y>>0}y.blend=function(N,T){if(d=(255&T)/255,d===1)return T;const j=T>>24&255,M=T>>16&255,O=T>>8&255,B=N>>24&255,$=N>>16&255,H=N>>8&255;return l=B+Math.round((j-B)*d),u=$+Math.round((M-$)*d),_=H+Math.round((O-H)*d),p.toRgba(l,u,_)},y.ensureContrastRatio=function(N,T,j){const M=S.relativeLuminance(N>>8),O=S.relativeLuminance(T>>8);if(w(M,O)>8));if(qw(M,S.relativeLuminance(Y>>8))?H:Y}return H}const B=E(N,T,j),$=w(M,S.relativeLuminance(B>>8));if($w(M,S.relativeLuminance(H>>8))?B:H}return B}},y.reduceLuminance=C,y.increaseLuminance=E,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=w},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=l(844),_=l(2585),d=l(4348),p=l(7866),m=l(744),x=l(7302),S=l(6975),v=l(8460),b=l(1753),w=l(1480),y=l(7994),C=l(9282),E=l(5435),N=l(5981),T=l(2660);let j=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((B=>{var $;($=this._onScrollApi)==null||$.fire(B.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(B){for(const $ in B)this.optionsService.options[$]=B[$]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(B)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(w.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer((($,H)=>this._inputHandler.parse($,H)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,$){this._writeBuffer.write(B,$)}writeSync(B,$){this._logService.logLevel<=_.LogLevelEnum.WARN&&!j&&(this._logService.warn("writeSync is unreliable and will be removed soon."),j=!0),this._writeBuffer.writeSync(B,$)}input(B,$=!0){this.coreService.triggerDataEvent(B,$)}resize(B,$){isNaN(B)||isNaN($)||(B=Math.max(B,m.MINIMUM_COLS),$=Math.max($,m.MINIMUM_ROWS),this._bufferService.resize(B,$))}scroll(B,$=!1){this._bufferService.scroll(B,$)}scrollLines(B,$,H){this._bufferService.scrollLines(B,$,H)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const $=B-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(B,$){return this._inputHandler.registerEscHandler(B,$)}registerDcsHandler(B,$){return this._inputHandler.registerDcsHandler(B,$)}registerCsiHandler(B,$){return this._inputHandler.registerCsiHandler(B,$)}registerOscHandler(B,$){return this._inputHandler.registerOscHandler(B,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?B=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const $ of B)$.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(l,u){return u(void 0),l((_=>u(_)))}},5435:function(a,o,l){var u=this&&this.__decorate||function(te,I,L,F){var W,U=arguments.length,Z=U<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,L):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(te,I,L,F);else for(var ce=te.length-1;ce>=0;ce--)(W=te[ce])&&(Z=(U<3?W(Z):U>3?W(I,L,Z):W(I,L))||Z);return U>3&&Z&&Object.defineProperty(I,L,Z),Z},_=this&&this.__param||function(te,I){return function(L,F){I(L,F,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),p=l(7116),m=l(2015),x=l(844),S=l(482),v=l(8437),b=l(8460),w=l(643),y=l(511),C=l(3734),E=l(2585),N=l(1480),T=l(6242),j=l(6351),M=l(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function $(te,I){if(te>24)return I.setWinLines||!1;switch(te){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var H;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let q=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,F,W,U,Z,ce,re,ne=new m.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=F,this._logService=W,this._optionsService=U,this._oscLinkService=Z,this._coreMouseService=ce,this._unicodeService=re,this._parser=ne,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((Q=>this._activeBuffer=Q.activeBuffer))),this._parser.setCsiHandlerFallback(((Q,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Q),params:le.toArray()})})),this._parser.setEscHandlerFallback((Q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Q)})})),this._parser.setExecuteHandlerFallback((Q=>{this._logService.debug("Unknown EXECUTE code: ",{code:Q})})),this._parser.setOscHandlerFallback(((Q,le,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Q,action:le,data:oe})})),this._parser.setDcsHandlerFallback(((Q,le,oe)=>{le==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Q),action:le,payload:oe})})),this._parser.setPrintHandler(((Q,le,oe)=>this.print(Q,le,oe))),this._parser.registerCsiHandler({final:"@"},(Q=>this.insertChars(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(Q=>this.scrollLeft(Q))),this._parser.registerCsiHandler({final:"A"},(Q=>this.cursorUp(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(Q=>this.scrollRight(Q))),this._parser.registerCsiHandler({final:"B"},(Q=>this.cursorDown(Q))),this._parser.registerCsiHandler({final:"C"},(Q=>this.cursorForward(Q))),this._parser.registerCsiHandler({final:"D"},(Q=>this.cursorBackward(Q))),this._parser.registerCsiHandler({final:"E"},(Q=>this.cursorNextLine(Q))),this._parser.registerCsiHandler({final:"F"},(Q=>this.cursorPrecedingLine(Q))),this._parser.registerCsiHandler({final:"G"},(Q=>this.cursorCharAbsolute(Q))),this._parser.registerCsiHandler({final:"H"},(Q=>this.cursorPosition(Q))),this._parser.registerCsiHandler({final:"I"},(Q=>this.cursorForwardTab(Q))),this._parser.registerCsiHandler({final:"J"},(Q=>this.eraseInDisplay(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(Q=>this.eraseInDisplay(Q,!0))),this._parser.registerCsiHandler({final:"K"},(Q=>this.eraseInLine(Q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(Q=>this.eraseInLine(Q,!0))),this._parser.registerCsiHandler({final:"L"},(Q=>this.insertLines(Q))),this._parser.registerCsiHandler({final:"M"},(Q=>this.deleteLines(Q))),this._parser.registerCsiHandler({final:"P"},(Q=>this.deleteChars(Q))),this._parser.registerCsiHandler({final:"S"},(Q=>this.scrollUp(Q))),this._parser.registerCsiHandler({final:"T"},(Q=>this.scrollDown(Q))),this._parser.registerCsiHandler({final:"X"},(Q=>this.eraseChars(Q))),this._parser.registerCsiHandler({final:"Z"},(Q=>this.cursorBackwardTab(Q))),this._parser.registerCsiHandler({final:"`"},(Q=>this.charPosAbsolute(Q))),this._parser.registerCsiHandler({final:"a"},(Q=>this.hPositionRelative(Q))),this._parser.registerCsiHandler({final:"b"},(Q=>this.repeatPrecedingCharacter(Q))),this._parser.registerCsiHandler({final:"c"},(Q=>this.sendDeviceAttributesPrimary(Q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(Q=>this.sendDeviceAttributesSecondary(Q))),this._parser.registerCsiHandler({final:"d"},(Q=>this.linePosAbsolute(Q))),this._parser.registerCsiHandler({final:"e"},(Q=>this.vPositionRelative(Q))),this._parser.registerCsiHandler({final:"f"},(Q=>this.hVPosition(Q))),this._parser.registerCsiHandler({final:"g"},(Q=>this.tabClear(Q))),this._parser.registerCsiHandler({final:"h"},(Q=>this.setMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(Q=>this.setModePrivate(Q))),this._parser.registerCsiHandler({final:"l"},(Q=>this.resetMode(Q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(Q=>this.resetModePrivate(Q))),this._parser.registerCsiHandler({final:"m"},(Q=>this.charAttributes(Q))),this._parser.registerCsiHandler({final:"n"},(Q=>this.deviceStatus(Q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(Q=>this.deviceStatusPrivate(Q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(Q=>this.softReset(Q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(Q=>this.setCursorStyle(Q))),this._parser.registerCsiHandler({final:"r"},(Q=>this.setScrollRegion(Q))),this._parser.registerCsiHandler({final:"s"},(Q=>this.saveCursor(Q))),this._parser.registerCsiHandler({final:"t"},(Q=>this.windowOptions(Q))),this._parser.registerCsiHandler({final:"u"},(Q=>this.restoreCursor(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(Q=>this.insertColumns(Q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(Q=>this.deleteColumns(Q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(Q=>this.selectProtected(Q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(Q=>this.requestMode(Q,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((Q=>(this.setTitle(Q),this.setIconName(Q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((Q=>this.setIconName(Q)))),this._parser.registerOscHandler(2,new T.OscHandler((Q=>this.setTitle(Q)))),this._parser.registerOscHandler(4,new T.OscHandler((Q=>this.setOrReportIndexedColor(Q)))),this._parser.registerOscHandler(8,new T.OscHandler((Q=>this.setHyperlink(Q)))),this._parser.registerOscHandler(10,new T.OscHandler((Q=>this.setOrReportFgColor(Q)))),this._parser.registerOscHandler(11,new T.OscHandler((Q=>this.setOrReportBgColor(Q)))),this._parser.registerOscHandler(12,new T.OscHandler((Q=>this.setOrReportCursorColor(Q)))),this._parser.registerOscHandler(104,new T.OscHandler((Q=>this.restoreIndexedColor(Q)))),this._parser.registerOscHandler(110,new T.OscHandler((Q=>this.restoreFgColor(Q)))),this._parser.registerOscHandler(111,new T.OscHandler((Q=>this.restoreBgColor(Q)))),this._parser.registerOscHandler(112,new T.OscHandler((Q=>this.restoreCursorColor(Q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const Q in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:Q},(()=>this.selectCharset("("+Q))),this._parser.registerEscHandler({intermediates:")",final:Q},(()=>this.selectCharset(")"+Q))),this._parser.registerEscHandler({intermediates:"*",final:Q},(()=>this.selectCharset("*"+Q))),this._parser.registerEscHandler({intermediates:"+",final:Q},(()=>this.selectCharset("+"+Q))),this._parser.registerEscHandler({intermediates:"-",final:Q},(()=>this.selectCharset("-"+Q))),this._parser.registerEscHandler({intermediates:".",final:Q},(()=>this.selectCharset("."+Q))),this._parser.registerEscHandler({intermediates:"/",final:Q},(()=>this.selectCharset("/"+Q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((Q=>(this._logService.error("Parsing error: ",Q),Q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler(((Q,le)=>this.requestStatusString(Q,le))))}_preserveStack(I,L,F,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=F,this._parseStack.position=W}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let F,W=this._activeBuffer.x,U=this._activeBuffer.y,Z=0;const ce=this._parseStack.paused;if(ce){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(F),F;W=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(Z=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(Q=>String.fromCharCode(Q))).join("")}"`),typeof I=="string"?I.split("").map((Q=>Q.charCodeAt(0))):I),this._parseBuffer.lengthB)for(let Q=Z;Q0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let ue=this._parser.precedingJoinState;for(let pe=L;pere){if(ne){const Ie=oe;let Te=this._activeBuffer.x-qe;for(this._activeBuffer.x=qe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),qe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(Ie,Te,0,qe,!1);Te=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(Q&&(oe.insertCells(this._activeBuffer.x,U-qe,this._activeBuffer.getNullCell(le)),oe.getWidth(re-1)===2&&oe.setCellFromCodepoint(re-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,le)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,U,le),U>0)for(;--U;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=ue,this._activeBuffer.x0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(F=>!$(F.params[0],this._optionsService.rawOptions.windowOptions)||L(F)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new j.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new T.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var I;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,F,W=!1,U=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.replaceCells(L,F,this._activeBuffer.getNullCell(this._eraseAttrData()),U),W&&(Z.isWrapped=!1)}_resetBufferLine(I,L=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),F.isWrapped=!1)}eraseInDisplay(I,L=!1){let F;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,L);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let ne=re;for(let Q=1;Q0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;Lye?1:2,ue=I.params[0];return pe=ue,Se=L?ue===2?4:ue===4?oe(Z.modes.insertMode):ue===12?3:ue===20?oe(le.convertEol):0:ue===1?oe(F.applicationCursorKeys):ue===3?le.windowOptions.setWinLines?re===80?2:re===132?1:0:0:ue===6?oe(F.origin):ue===7?oe(F.wraparound):ue===8?3:ue===9?oe(W==="X10"):ue===12?oe(le.cursorBlink):ue===25?oe(!Z.isCursorHidden):ue===45?oe(F.reverseWraparound):ue===66?oe(F.applicationKeypad):ue===67?4:ue===1e3?oe(W==="VT200"):ue===1002?oe(W==="DRAG"):ue===1003?oe(W==="ANY"):ue===1004?oe(F.sendFocus):ue===1005?4:ue===1006?oe(U==="SGR"):ue===1015?4:ue===1016?oe(U==="SGR_PIXELS"):ue===1048?1:ue===47||ue===1047||ue===1049?oe(ne===Q):ue===2004?oe(F.bracketedPasteMode):0,Z.triggerDataEvent(`${d.C0.ESC}[${L?"":"?"}${pe};${Se}$y`),!0;var pe,Se}_updateAttrColor(I,L,F,W,U){return L===2?(I|=50331648,I&=-16777216,I|=C.AttributeData.fromColorRGB([F,W,U])):L===5&&(I&=-50331904,I|=33554432|255&F),I}_extractColor(I,L,F){const W=[0,0,-1,0,0,0];let U=0,Z=0;do{if(W[Z+U]=I.params[L+Z],I.hasSubParams(L+Z)){const ce=I.getSubParams(L+Z);let re=0;do W[1]===5&&(U=1),W[Z+re+1+U]=ce[re];while(++re=2||W[1]===2&&Z+U>=5)break;W[1]&&(U=1)}while(++Z+L5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let F;const W=this._curAttrData;for(let U=0;U=30&&F<=37?(W.fg&=-50331904,W.fg|=16777216|F-30):F>=40&&F<=47?(W.bg&=-50331904,W.bg|=16777216|F-40):F>=90&&F<=97?(W.fg&=-50331904,W.fg|=16777224|F-90):F>=100&&F<=107?(W.bg&=-50331904,W.bg|=16777224|F-100):F===0?this._processSGR0(W):F===1?W.fg|=134217728:F===3?W.bg|=67108864:F===4?(W.fg|=268435456,this._processUnderline(I.hasSubParams(U)?I.getSubParams(U)[0]:1,W)):F===5?W.fg|=536870912:F===7?W.fg|=67108864:F===8?W.fg|=1073741824:F===9?W.fg|=2147483648:F===2?W.bg|=134217728:F===21?this._processUnderline(2,W):F===22?(W.fg&=-134217729,W.bg&=-134217729):F===23?W.bg&=-67108865:F===24?(W.fg&=-268435457,this._processUnderline(0,W)):F===25?W.fg&=-536870913:F===27?W.fg&=-67108865:F===28?W.fg&=-1073741825:F===29?W.fg&=2147483647:F===39?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?U+=this._extractColor(I,U,W):F===53?W.bg|=1073741824:F===55?W.bg&=-1073741825:F===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):F===100?(W.fg&=-67108864,W.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${L};${F}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${L};${F}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const L=I.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const F=L%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(I){const L=I.params[0]||1;let F;return(I.length<2||(F=I.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(I){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],F=I.split(";");for(;F.length>1;){const W=F.shift(),U=F.shift();if(/^\d+$/.exec(W)){const Z=parseInt(W);if(X(Z))if(U==="?")L.push({type:0,index:Z});else{const ce=(0,M.parseColor)(U);ce&&L.push({type:1,index:Z,color:ce})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const F=I.split(":");let W;const U=F.findIndex((Z=>Z.startsWith("id=")));return U!==-1&&(W=F[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const F=I.split(";");for(let W=0;W=this._specialColors.length);++W,++L)if(F[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const U=(0,M.parseColor)(F[W]);U&&this._onColor.fire([{type:1,index:this._specialColors[L],color:U}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],F=I.split(";");for(let W=0;W=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${d.C0.ESC}${U}${d.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}o.InputHandler=Y;let G=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){tethis.end&&(this.end=te)}markRangeDirty(te,I){te>I&&(q=te,te=I,I=q),tethis.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(te){return 0<=te&&te<256}G=u([_(0,E.IBufferService)],G)},844:(a,o)=>{function l(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=l,o.getDisposeArrayDisposable=function(u){return{dispose:()=>l(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(_,d,p){this._data[_]||(this._data[_]={}),this._data[_][d]=p}get(_,d){return this._data[_]?this._data[_][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(u,_,d,p,m){this._data.get(u,_)||this._data.set(u,_,new l),this._data.get(u,_).set(d,p,m)}get(u,_,d,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(d,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=l.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(l=this._search(this._getKey(u)),this._array.splice(l,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(l=this._search(_),l===-1)||this._getKey(this._array[l])!==_)return!1;do if(this._array[l]===u)return this._array.splice(l,1),!0;while(++l=this._array.length)&&this._getKey(this._array[l])===u))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===u))do _(this._array[l]);while(++l=_;){let p=_+d>>1;const m=this._getKey(this._array[p]);if(m>u)d=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=l(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ib)return v-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-x))}ms`),void this._start();v=b}this.clear()}}class d extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=l(643);o.updateWindowsModeWrappedState=function(_){const d=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=d==null?void 0:d.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=l;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=l(6349),_=l(7226),d=l(3734),p=l(8437),m=l(4634),x=l(511),S=l(643),v=l(4863),b=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(w,y,C){this._hasScrollback=w,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(w){return w?(this._nullCell.fg=w.fg,this._nullCell.bg=w.bg,this._nullCell.extended=w.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(w){return w?(this._whitespaceCell.fg=w.fg,this._whitespaceCell.bg=w.bg,this._whitespaceCell.extended=w.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(w,y){return new p.BufferLine(this._bufferService.cols,this.getNullCell(w),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const w=this.ybase+this.y-this.ydisp;return w>=0&&wo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=p.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(w))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(w,y){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(w,C)));else for(let j=this._rows;j>y;j--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(j),this.ybase=Math.max(this.ybase-j,0),this.ydisp=Math.max(this.ydisp-j,0),this.savedY=Math.max(this.savedY-j,0)),this.lines.maxLength=N}this.x=Math.min(this.x,w-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(w,y),this._cols>w))for(let T=0;T.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let w=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,w=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return w}get _isReflowEnabled(){const w=this._optionsService.rawOptions.windowsPty;return w&&w.buildNumber?this._hasScrollback&&w.backend==="conpty"&&w.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(w,y){this._cols!==w&&(w>this._cols?this._reflowLarger(w,y):this._reflowSmaller(w,y))}_reflowLarger(w,y){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(w,y,E.countRemoved)}}_reflowLargerAdjustViewport(w,y,C){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){let j=this.lines.get(T);if(!j||!j.isWrapped&&j.getTrimmedLength()<=w)continue;const M=[j];for(;j.isWrapped&&T>0;)j=this.lines.get(--T),M.unshift(j);const O=this.ybase+this.y;if(O>=T&&O0&&(E.push({start:T+M.length+N,newLines:Y}),N+=Y.length),M.push(...Y);let G=$.length-1,X=$[G];X===0&&(G--,X=$[G]);let te=M.length-H-1,I=B;for(;te>=0;){const F=Math.min(I,X);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[te],I-F,X-F,F,!0),X-=F,X===0&&(G--,X=$[G]),I-=F,I===0){te--;const W=Math.max(te,0);I=(0,m.getWrappedLineTrimmedLength)(M,W,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const T=[],j=[];for(let G=0;G=0;G--)if($&&$.start>O+H){for(let X=$.newLines.length-1;X>=0;X--)this.lines.set(G--,$.newLines[X]);G++,T.push({index:O+1,amount:$.newLines.length}),H+=$.newLines.length,$=E[++B]}else this.lines.set(G,j[O--]);let q=0;for(let G=T.length-1;G>=0;G--)T[G].index+=q,this.lines.onInsertEmitter.fire(T[G]),q+=T[G].amount;const Y=Math.max(0,M+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(w,y,C=0,E){const N=this.lines.get(w);return N?N.translateToString(y,C,E):""}getWrappedRangeForLine(w){let y=w,C=w;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return w>=this._cols?this._cols-1:w<0?0:w}nextStop(w){for(w==null&&(w=this.x);!this.tabs[++w]&&w=this._cols?this._cols-1:w<0?0:w}clearMarkers(w){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=l(3734),_=l(511),d=l(643),p=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(v,b,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):w]}set(v,b){this._data[3*v+1]=b[d.CHAR_DATA_ATTR_INDEX],b[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,p.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return m=3*v,b.content=this._data[m+0],b.fg=this._data[m+1],b.bg=this._data[m+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,w,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|w<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,w){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,p.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,p.stringFromCodePoint)(2097151&y)+(0,p.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,w&&(y&=-12582913,y|=w<<22),this._data[3*v+0]=y}insertCells(v,b,w){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,w),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{const y=new Uint32Array(w);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let E=0;E=v&&delete this._extendedAttrs[N]}}return this.length=v,4*w*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,w,y,C){const E=v._data;if(C)for(let T=y-1;T>=0;T--){for(let j=0;j<3;j++)this._data[3*(w+T)+j]=E[3*(b+T)+j];268435456&E[3*(b+T)+2]&&(this._extendedAttrs[w+T]=v._extendedAttrs[b+T])}else for(let T=0;T=b&&(this._combined[j-b+w]=v._combined[j])}}translateToString(v,b,w,y){b=b??0,w=w??this.length,v&&(w=Math.min(w,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,u){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return u*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(u,_,d){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(d-1)&&u[_].getWidth(d-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,d,p,m){const x=[];for(let S=0;S=S&&p0&&(j>y||w[j].getTrimmedLength()===0);j--)T++;T>0&&(x.push(S+w.length-T),x.push(T)),S+=w.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const d=[];let p=0,m=_[p],x=0;for(let S=0;Sl(u,w,_))).reduce(((b,w)=>b+w));let x=0,S=0,v=0;for(;vb&&(x-=b,S++);const w=u[S].getWidth(x-1)===2;w&&x--;const y=w?d-1:d;p.push(y),v+=y}return p},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=l(8460),_=l(844),d=l(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=l(482),_=l(643),d=l(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=l(8460),_=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(o.C0=l={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(u||(o.C1=u={})),(function(d){d.ST=`${l.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,m,x){const S={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(S.key=u.C0.ESC+"[1;"+(v+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=v?u.C0.ESC+"[3;"+(v+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=v?u.C0.ESC+"[1;"+(v+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=v?u.C0.ESC+"[1;"+(v+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(v+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(v+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=v?u.C0.ESC+"[1;"+(v+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=v?u.C0.ESC+"[1;"+(v+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=v?u.C0.ESC+"[1;"+(v+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=v?u.C0.ESC+"[1;"+(v+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=v?u.C0.ESC+"[15;"+(v+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=v?u.C0.ESC+"[17;"+(v+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=v?u.C0.ESC+"[18;"+(v+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=v?u.C0.ESC+"[19;"+(v+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=v?u.C0.ESC+"[20;"+(v+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=v?u.C0.ESC+"[21;"+(v+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=v?u.C0.ESC+"[23;"+(v+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=v?u.C0.ESC+"[24;"+(v+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!x||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const b=_[d.keyCode],w=b==null?void 0:b[d.shiftKey?1:0];if(w)S.key=u.C0.ESC+w;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let C=String.fromCharCode(y);d.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),S.key=u.C0.ESC+y,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,_=l.length){let d="";for(let p=u;p<_;++p){let m=l[p];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const _=l.length;if(!_)return 0;let d=0,p=0;if(this._interim){const m=l.charCodeAt(p++);56320<=m&&m<=57343?u[d++]=1024*(this._interim-55296)+m-56320+65536:(u[d++]=this._interim,u[d++]=m),this._interim=0}for(let m=p;m<_;++m){const x=l.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,d;const S=l.charCodeAt(m);56320<=S&&S<=57343?u[d++]=1024*(x-55296)+S-56320+65536:(u[d++]=x,u[d++]=S)}else x!==65279&&(u[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const _=l.length;if(!_)return 0;let d,p,m,x,S=0,v=0,b=0;if(this.interim[0]){let C=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let N,T=0;for(;(N=63&this.interim[++T])&&T<4;)E<<=6,E|=N;const j=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=j-T;for(;b=_)return 0;if(N=l[b++],(192&N)!=128){b--,C=!0;break}this.interim[T++]=N,E<<=6,E|=63&N}C||(j===2?E<128?b--:u[S++]=E:j===3?E<2048||E>=55296&&E<=57343||E===65279||(u[S++]=E):E<65536||E>1114111||(u[S++]=E)),this.interim.fill(0)}const w=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(v=(31&d)<<6|63&p,v<128){y--;continue}u[S++]=v}else if((240&d)==224){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(v=(15&d)<<12|(63&p)<<6|63&m,v<2048||v>=55296&&v<=57343||v===65279)continue;u[S++]=v}else if((248&d)==240){if(y>=_)return this.interim[0]=d,S;if(p=l[y++],(192&p)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,S;if(m=l[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=m,S;if(x=l[y++],(192&x)!=128){y--;continue}if(v=(7&d)<<18|(63&p)<<12|(63&m)<<6|63&x,v<65536||v>1114111)continue;u[S++]=v}}return S}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let v,b=0,w=S.length-1;if(xS[w][1])return!1;for(;w>=b;)if(v=b+w>>1,x>S[v][1])b=v+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),v=S===0&&x!==0;if(v){const b=u.UnicodeService.extractWidth(x);b===0?v=!1:b>S&&(S=b)}return u.UnicodeService.createPropertyValue(0,S,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),_=l(844);class d extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,x);if(b){const y=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(d,p){const m=d.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=l.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const v=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?v<<4:m===2?v:m===3?v>>4:v>>8}return x}},o.toRgbString=function(d,p=16){const[m,x,S]=d;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),_=l(8742),d=l(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const v=this._handlers[x];return v.push(S),{dispose:()=>{const b=v.indexOf(S);b!==-1&&v.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,S,v);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,v))}unhook(x,S=!0){if(this._active.length){let v=!1,b=this._active.length-1,w=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=S,w=this._stack.fallThrough,this._stack.paused=!1),!w&&v===!1){for(;b>=0&&(v=this._active[b].unhook(x),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,v){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((v=>(this._params=m,this._data="",this._hitLimit=!1,v)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),_=l(8742),d=l(6242),p=l(6351);class m{constructor(b){this.table=new Uint8Array(b)}setDefault(b,w){this.table.fill(b<<4|w)}add(b,w,y,C){this.table[w<<8|b]=y<<4|C}addMany(b,w,y,C){for(let E=0;Ej)),w=(T,j)=>b.slice(T,j),y=w(32,127),C=w(0,24);C.push(25),C.push.apply(C,w(28,32));const E=w(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),E)v.addMany([24,26,153,154],N,3,0),v.addMany(w(128,144),N,3,0),v.addMany(w(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(w(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(w(64,127),3,7,0),v.addMany(w(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(w(48,60),4,8,4),v.addMany(w(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(w(32,64),6,0,6),v.add(127,6,0,6),v.addMany(w(64,127),6,0,0),v.addMany(w(32,48),3,9,5),v.addMany(w(32,48),5,9,5),v.addMany(w(48,64),5,0,6),v.addMany(w(64,127),5,7,0),v.addMany(w(32,48),4,9,5),v.addMany(w(32,48),1,9,2),v.addMany(w(32,48),2,9,2),v.addMany(w(48,127),2,10,0),v.addMany(w(48,80),1,10,0),v.addMany(w(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(w(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(w(28,32),9,0,9),v.addMany(w(32,48),9,9,12),v.addMany(w(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(w(32,128),11,0,11),v.addMany(w(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(w(28,32),10,0,10),v.addMany(w(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(w(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(w(28,32),12,0,12),v.addMany(w(32,48),12,9,12),v.addMany(w(48,64),12,0,11),v.addMany(w(64,127),12,12,13),v.addMany(w(64,127),10,12,13),v.addMany(w(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(x,0,2,0),v.add(x,8,5,8),v.add(x,6,0,6),v.add(x,11,0,11),v.add(x,13,13,13),v})();class S extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(w,y,C)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,y)=>{},this._escHandlerFb=w=>{},this._errorHandlerFb=w=>w,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,w=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;EN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(w[0]>C||C>w[1])throw new Error(`final must be in range ${w[0]} .. ${w[1]}`);return y<<=8,y|=C,y}identToString(b){const w=[];for(;b;)w.push(String.fromCharCode(255&b)),b>>=8;return w.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,w){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,w){this._executeHandlers[b.charCodeAt(0)]=w}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,w){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(w),{dispose:()=>{const E=C.indexOf(w);E!==-1&&C.splice(E,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,w){return this._dcsParser.registerHandler(this._identifier(b),w)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,w){return this._oscParser.registerHandler(b,w)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,w,y,C,E){this._parseStack.state=b,this._parseStack.handlers=w,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=E}parse(b,w,y){let C,E=0,N=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const j=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(C=j[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(E=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=b[this._parseStack.chunkPos],C=this._oscParser.end(E!==24&&E!==26,y),C)return C;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let j=T;j>4){case 2:for(let H=j+1;;++H){if(H>=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=w||(E=b[H])<32||E>126&&E=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,N,j),C;O<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++j47&&E<60);j--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let $=B?B.length-1:-1;for(;$>=0&&(C=B[$](),C!==!0);$--)if(C instanceof Promise)return this._preserveStack(4,B,$,N,j),C;$<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let H=j+1;;++H)if(H>=w||(E=b[H])===24||E===26||E===27||E>127&&E=w||(E=b[H])<32||E>127&&E{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),_=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,v=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,v=this._stack.fallThrough,this._stack.paused=!1),!v&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(d){const p=new u;if(!d.length)return p;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,x))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const d={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(d[p]=this._subParams.slice(m,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+d,l):d}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),_=l(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,d){if(!(_<0||_>=this._line.length))return d?(this._line.loadCell(_,d),d):this._line.loadCell(_,new u.CellData)}translateToString(_,d,p){return this._line.translateToString(_,d,p)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),_=l(8460),d=l(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(_=>u(_.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((_,d)=>u(_,d.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),p=l(844),m=l(5295),x=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const w=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=w.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=w.ybase+w.scrollTop,E=w.ybase+w.scrollBottom;if(w.scrollTop===0){const N=w.lines.isFull;E===w.lines.length-1?N?w.lines.recycle().copyFrom(y):w.lines.push(y.clone()):w.lines.splice(E+1,0,y.clone()),N?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{const N=E-C+1;w.lines.shiftElements(C+1,N-1,-1),w.lines.set(E,y.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(v,b,w){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(a,o,l){var u=this&&this.__decorate||function(y,C,E,N){var T,j=arguments.length,M=j<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,E,N);else for(var O=y.length-1;O>=0;O--)(T=y[O])&&(M=(j<3?T(M):j>3?T(C,E,M):T(C,E))||M);return j>3&&M&&Object.defineProperty(C,E,M),M},_=this&&this.__param||function(y,C){return function(E,N){C(E,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),p=l(8460),m=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,C){let E=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(E|=64,E|=y.action):(E|=3&y.button,4&y.button&&(E|=64),8&y.button&&(E|=128),y.action===32?E|=32:y.action!==0||C||(E|=3)),E}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[S(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${C}`}};let w=o.CoreMouseService=class extends m.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(x))this.addProtocol(E,x[E]);for(const E of Object.keys(b))this.addEncoding(E,b[E]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,E){if(E){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=w=u([_(0,d.IBufferService),_(1,d.ICoreService)],w)},6975:function(a,o,l){var u=this&&this.__decorate||function(w,y,C,E){var N,T=arguments.length,j=T<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,y,C,E);else for(var M=w.length-1;M>=0;M--)(N=w[M])&&(j=(T<3?N(j):T>3?N(y,C,j):N(y,C))||j);return T>3&&j&&Object.defineProperty(y,C,j),j},_=this&&this.__param||function(w,y){return function(C,E){y(C,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),p=l(8460),m=l(844),x=l(2585),S=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends m.Disposable{constructor(w,y,C){super(),this._bufferService=w,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(w,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,(()=>w.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,(()=>w.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(w))}};o.CoreService=b=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],b)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),_=l(8460),d=l(844),p=l(6106);let m=0,x=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((w=>w==null?void 0:w.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(w){if(w.marker.isDisposed)return;const y=new v(w);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,y,C){let E=0,N=0;for(const T of this._decorations.getKeyIterator(y))E=T.options.x??0,N=E+(T.options.width??1),w>=E&&w{m=N.options.x??0,x=m+(N.options.width??1),w>=m&&w{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),_=l(8343);class d{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((b,w)=>b.index-w.index)),S=[];for(const b of x){const w=this._services.get(b.id);if(!w)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${b.id}.`);S.push(w)}const v=x.length>0?x[0].index:m.length;if(m.length!==v)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${v+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,l){var u=this&&this.__decorate||function(v,b,w,y){var C,E=arguments.length,N=E<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,w,y);else for(var T=v.length-1;T>=0;T--)(C=v[T])&&(N=(E<3?C(N):E>3?C(b,w,N):C(b,w))||N);return E>3&&N&&Object.defineProperty(b,w,N),N},_=this&&this.__param||function(v,b){return function(w,y){b(w,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),p=l(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const E=y.apply(this,C);return x.trace(`GlyphRenderer#${y.name} return`,E),E}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),_=l(844),d=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in S)if(b in v)try{const w=S[b];v[b]=this._sanitizeAndValidateOption(b,w)}catch(w){console.error(w)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,v){return this.onOptionChange((b=>{b===S&&v(this.rawOptions[S])}))}onMultipleOptionChange(S,v){return this.onOptionChange((b=>{S.indexOf(b)!==-1&&v()}))}_setupOptions(){const S=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,w)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);w=this._sanitizeAndValidateOption(b,w),this.rawOptions[b]!==w&&(this.rawOptions[b]=w,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const w={get:S.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,w)}}_sanitizeAndValidateOption(S,v){switch(S){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[S]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${S}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=p.includes(v)?v:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${S} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${S} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=m},2660:function(a,o,l){var u=this&&this.__decorate||function(m,x,S,v){var b,w=arguments.length,y=w<3?x:v===null?v=Object.getOwnPropertyDescriptor(x,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,x,S,v);else for(var C=m.length-1;C>=0;C--)(b=m[C])&&(y=(w<3?b(y):w>3?b(x,S,y):b(x,S))||y);return w>3&&y&&Object.defineProperty(x,S,y),y},_=this&&this.__param||function(m,x){return function(S,v){x(S,v,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),E={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(E,C))),this._dataByLinkId.set(E.id,E),E.id}const S=m,v=this._getEntryIdKey(S),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,x.ybase+x.y),b.id;const w=x.addMarker(x.ybase+x.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(y,w))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((v=>v.line!==x))){const v=this._bufferService.buffer.addMarker(x);S.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(S,v)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,d.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const d=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,v,b){v[l]===v?v[u].push({id:S,index:b}):(v[u]=[{id:S,index:b}],v[l]=v)})(d,p,x)};return d.toString=()=>_,o.serviceRegistry.set(_,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),_=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const v=m.length;for(let b=0;b=v)return x+this.wcwidth(w);const E=m.charCodeAt(b);56320<=E&&E<=57343?w=1024*(w-55296)+E-56320+65536:x+=this.wcwidth(E)}const y=this.charProperties(w,S);let C=d.extractWidth(y);d.extractShouldJoin(y)&&(C-=d.extractWidth(S)),x+=C,S=y}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=d}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,s),l.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),l=s(3236),u=s(844),_=s(5741),d=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(b){super(),this._core=this.register(new l.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const w=C=>this._core.options[C],y=(C,E)=>{this._checkReadonlyOptions(C),this._core.options[C]=E};for(const C in this._core.options){const E={get:w.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,E)}}_checkReadonlyOptions(b){if(x.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let w="none";switch(this._core.coreMouseService.activeProtocol){case"X10":w="x10";break;case"VT200":w="vt200";break;case"DRAG":w="drag";break;case"ANY":w="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:w,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const w in b)this._publicOptions[w]=b[w]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,w=!0){this._core.input(b,w)}resize(b,w){this._verifyIntegers(b,w),this._core.resize(b,w)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,w,y){this._verifyIntegers(b,w,y),this._core.select(b,w,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,w){this._verifyIntegers(b,w),this._core.selectLines(b,w)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,w){this._core.write(b,w)}writeln(b,w){this._core.write(b),this._core.write(`\r -`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(D2)),D2.exports}var A0t=T0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new A0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new N0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new j0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function R0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function M0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function D0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&R0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&M0t(e.result)?{backend:"slurm",result:e.result}:null}function L0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=D0t(o);return l?(s(l),!0):!1}})}function O0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=L0t(M);O&&E(O)},b.onerror=()=>E(ON()),b.onclose=()=>{!w&&!y&&E(ON())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function I0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const B0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],$0t=e=>B0t.some(n=>n===e),P0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!P0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&$0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function cb(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function E1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const hz=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let dv=null,C0=0;const N6=()=>dv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await Lut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void ub.retry()}})})}let N1=TO();function F0t(){C0++,dv=null,N1=TO()}const ub={flush:(e=!1)=>N1.flush(e),retry:()=>N1.retry(),queue(e,n=0){const t=dv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(dv=e,N1.queue(e,n))}};window.addEventListener("pagehide",()=>void ub.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function H0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const L2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function q0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:k1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===g6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,fv=new Map,Z4=new Set,J4=()=>{for(const e of Z4)e()},U0t=e=>(Z4.add(e),()=>{Z4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function G0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),fv.clear(),J4()}function W0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function V0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await Dut(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&fv.delete(e)&&J4()},r=>{t===Va&&(fv.set(e,r instanceof Error?r.message:String(r)),J4())}),ip.set(e,n)}return n}function O2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=cb(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),V0t(e).queue(l,u?250:0)}function _z(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function K0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(hz()),m=R.useSyncExternalStore(U0t,()=>n?fv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const q=j.current;if(!q)return;const Y=_z({...M.current,state:q.state,pane:q.pane},cu(Ka.get(q.projectId),q.taskKey),q.projectId,q.taskKey);O2(q.projectId,q.location,q.taskKey,Y)},[]);R.useEffect(()=>{let q=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!q||Y!==Va||(Ka.set(n,G??hz()),y(n))}).catch(G=>{q&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{q=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const q=Ka.get(n);if(!q)return;if(p.current=q,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(q,t)??(Wc(n)?T6(t,a):void 0);l(H0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(O2(n,r,t,_z({state:Y,pane:s,getScroll:u,sourceModes:_},cu(q,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):O2(n,r),p.current=Ka.get(n)??q},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const q=Va,Y=X=>{if(q===Va){$();for(const te of ip.values())te.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const H=R.useCallback(()=>{var q;n&&(x?b(Y=>Y+1):(q=ip.get(n))==null||q.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:H,capture:$,workspace:p}}const Q0t="data:image/svg+xml,"+encodeURIComponent(''),e3=R.createContext(null);function Y0t(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(e3);if(!e)throw new Error("Runtime is not connected");return e}function X0t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Q0t:"/favicon.svg")}function pz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Z0t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!pz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!pz("orx:locale")&&t&&dD(t)&&rO(t)}function J0t(e){return e.includes("ssh ")&&e.includes("failed")}function mz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function gz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Qdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await Ydt()}catch(H){Qn(H instanceof Error?H.message:String(H),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await Xdt()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&J0t(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,H])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[H,f.jsx(Wr,{value:i[$],onChange:q=>a({...i,[$]:q.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:R4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:R4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function ept({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function tpt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{F0t(),G0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...lht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=Y0t(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,Z0t(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";X0t(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(e3,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(mz,{host:n.session.host}):f.jsx(gz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(e3,{value:n,children:[f.jsx(ZN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(ept,{children:r?f.jsx(mz,{host:n.session.host,overlay:!0}):f.jsx(gz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const db=TV()({component:tpt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function npt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function rpt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function spt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=cb((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function ipt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=cb(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return E1(e,(a==null?void 0:a.id)??null,u)}/** +`,w)}paste(b){this._core.paste(b)}refresh(b,w){this._verifyIntegers(b,w),this._core.refresh(b,w)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const w of b)if(w===1/0||isNaN(w)||w%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const w of b)if(w&&(w===1/0||isNaN(w)||w%1!=0||w<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(M2)),M2.exports}var L0t=D0t();function k6(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new L0t.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new A0t.FitAddon;s.loadAddon(i),t&&s.loadAddon(new M0t.WebLinksAddon((l,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const EO="overflow-hidden rounded-md bg-terminal p-2";function Jp(e){return typeof e=="object"&&e!==null}function NO(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function O0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||NO(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function I0t(e){return Jp(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&NO(e.partitions)&&(e.error===null||typeof e.error=="string")}function B0t(e){return!Jp(e)||e.type!=="complete"?null:e.backend==="ssh"&&O0t(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&I0t(e.result)?{backend:"slurm",result:e.result}:null}function $0t(e){return Jp(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function C6({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return f.jsx(zO,{path:`${t}?${a}`,label:NL({host:Ne(e)}),active:r,onError:i,onComplete:o=>{const l=B0t(o);return l?(s(l),!0):!1}})}function P0t({login:e,onComplete:n,onError:t}){return f.jsx(zO,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!Jp(r)||r.type!=="complete"?!1:(n(),!0)})}function zO({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(s),u=R.useRef(i),[_,d]=R.useState(null);return l.current=s,u.current=i,R.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=k6(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${S}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let w=!1,y=!1,C=!1;const E=j=>{var M;y||(y=!0,C||m.writeln(j),m.options.disableStdin=!0,m.blur(),d(j),(M=u.current)==null||M.call(u,j))},N=m.onData(j=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(j))}),T=m.onResize(({cols:j,rows:M})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:j,rows:M}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},b.onmessage=j=>{if(j.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(j.data));return}if(typeof j.data!="string")return;let M;try{M=JSON.parse(j.data)}catch{return}if(l.current(M)){w=!0,b.close();return}const O=$0t(M);O&&E(O)},b.onerror=()=>E(IN()),b.onclose=()=>{!w&&!y&&E(IN())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),T.dispose(),b.close(),o.current=null,x()}},[e]),R.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${EO}`,role:"group","aria-label":n,children:f.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function F0t({host:e,transcript:n}){const t=R.useRef(null);return R.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=k6(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${EO}`,role:"group","aria-label":NL({host:Ne(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function cu(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const H0t=["settings","harnesses","projects","compute","instances","environment","git","storage"],q0t=e=>H0t.some(n=>n===e),U0t=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$i=e=>typeof e=="string"&&e.length>0,Ig=e=>e==null||$i(e);function E6(e){if(!U0t(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&$i(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Ig(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...$i(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&$i(e.path)&&Ig(e.sessionId)&&Ig(e.ref)&&Ig(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...$i(e.sessionId)?{sessionId:e.sessionId}:{},...$i(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...$i(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&$i(e.experimentId)&&$i(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&$i(e.sessionId)&&$i(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&$i(e.sessionId)&&$i(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Rd(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&q0t(r)?{kind:"settings",projectId:t,section:r}:null:null}function lb(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Rd(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!E6(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function C1(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const _z=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function jO(e,n){let t,r,s=!1,i=!1,a;async function o(l=!1){if(clearTimeout(a),i||(i=l),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(d){r=u,n(d)}finally{s=!1,t!==void 0&&o()}}return{queue(l,u=0){t=l,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let uv=null,C0=0;const N6=()=>uv;function TO(){const e=C0;return jO(async(n,t)=>{if(e!==C0)return;const r=await $ut(n,t);e===C0&&nt.setQueryData(Zp().queryKey,s=>s?{...s,workspace:r.workspace}:r)},n=>{e===C0&&Qn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Gi(),onClick:()=>void cb.retry()}})})}let E1=TO();function G0t(){C0++,uv=null,E1=TO()}const cb={flush:(e=!1)=>E1.flush(e),retry:()=>E1.retry(),queue(e,n=0){const t=uv;t&&t.lastLocation===e.lastLocation&&t.railOpen===e.railOpen&&t.panelWidth===e.panelWidth&&t.experimentsView===e.experimentsView||(uv=e,E1.queue(e,n))}};window.addEventListener("pagehide",()=>void cb.flush(!0));function Ll(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function Wa(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function AO(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[Et(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=Et(e.rightTab);return{tabs:[...r,...a].map(u=>Ll(u,Et(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Ll(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?Et(e.previewTab):null,history:e.tabHistory.map(Et),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[Et(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax,treeViewport:e.treeViewport}}function W0t(e,n){const t=j6();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax,t.treeViewport=e.treeViewport??null);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>Et(Wa(a))===Et(Wa(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=Wa(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[Et(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(Et(a))}const s=new Map(r.map(i=>{const a=Wa(i);return[Et(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?Wa(n):e!=null&&e.active?Wa(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,MO(t,n)}const D2=(e,n)=>e.id===n.id&&e.view===n.view,Yu=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,z6=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,Ms=(e,n,t)=>`${e}:${n??""}:${z6(t)}`,RO=e=>({...e,lineScrollRequest:void 0});function Bg(e){return typeof e=="object"&&"path"in e?RO(e):e}const qf=(e,n)=>e.branch===n.branch;function Et(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${z6(e)}`:`experiment:${e.id}:${e.view}`}function u0(e,n){const t=e.filter(r=>Et(r)!==n);return t.length===e.length?e:t}function V0t(e){return e!==void 0}function j6(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1,treeViewport:null};if(e===O0&&n){const r={path:S1,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Et(r)],panelOpen:!0}}if(e===m6){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}if(e===g6){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Et),panelOpen:!0}}return t}function T6(e,n){const t=j6(e,n);return t.panelOpen?AO(t,{},{}):void 0}function MO(e,n){if(!n)return e;const t=Wa(n),r=Et(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(l=>Et(l)===r),i=(l,u)=>{const _=l.findIndex(d=>Et(d)===r);return _<0?[...l,u]:JSON.stringify(Ll(l[_]))===JSON.stringify(Ll(u))?l:l.map((d,p)=>p===_?{...d,...u}:d)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&Et(o)===r&&JSON.stringify(Ll(o))===JSON.stringify(Ll(t))||(a.tabHistory=[...e.tabHistory.filter(l=>Et(l)!==r),t]),a}let Va=0;const ip=new Map,dv=new Map,Z4=new Set,J4=()=>{for(const e of Z4)e()},K0t=e=>(Z4.add(e),()=>{Z4.delete(e)}),ap=new Map,Ka=new Map,DO=e=>Ka.get(e);function Q0t(){Va++,Ka.clear(),ap.clear(),ip.clear(),dv.clear(),J4()}function Y0t(e,n){const t=Ka.get(e);if(!(t!=null&&t.tasks.new)||cu(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const l=Wa(o);if(typeof l=="string"||!("path"in l))return[];const u=Ms(e,null,l);return u in a?[[Ms(e,n,l),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,ap.set(e,n),Ka.set(e,{...t,tasks:i})}function X0t(e){let n=ip.get(e);if(!n){const t=Va;n=jO(async(r,s)=>{if(t!==Va)return;const i=await But(e,r,s);t===Va&&nt.setQueryData(b6(e).queryKey,i),t===Va&&dv.delete(e)&&J4()},r=>{t===Va&&(dv.set(e,r instanceof Error?r.message:String(r)),J4())}),ip.set(e,n)}return n}function L2(e,n,t,r){const s=Ka.get(e);if(!s||t==="new"&&ap.has(e))return;const i=lb(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?cu(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const l={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});Ka.set(e,l),X0t(e).queue(l,u?250:0)}function pz(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>Ms(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=AO(e.state,i,a),l=e.pane??(n==null?void 0:n.active),u=l?Et(Wa(l)):null;return o.active=o.tabs.find(_=>Et(Wa(_))===u)??null,o}function Z0t(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:l,getScroll:u,sourceModes:_,revision:d}=e,p=R.useRef(_z()),m=R.useSyncExternalStore(K0t,()=>n?dv.get(n)??null:null),[x,S]=R.useState(null),[v,b]=R.useState(0),[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useRef(null),T=R.useRef(null),j=R.useRef(null),M=R.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),B=JSON.stringify(s??null),$=R.useCallback(()=>{const q=j.current;if(!q)return;const Y=pz({...M.current,state:q.state,pane:q.pane},cu(Ka.get(q.projectId),q.taskKey),q.projectId,q.taskKey);L2(q.projectId,q.location,q.taskKey,Y)},[]);R.useEffect(()=>{let q=!0;const Y=Va;if(S(null),y(null),!!n)return Ka.has(n)?y(n):nt.fetchQuery(b6(n)).then(G=>{!q||Y!==Va||(Ka.set(n,G??_z()),y(n))}).catch(G=>{q&&Y===Va&&S(G instanceof Error?G.message:String(G))}),()=>{q=!1}},[n,v]),R.useLayoutEffect(()=>{if(j.current&&j.current.scope!==O){const G=j.current.projectId;$(),ap.get(G)===t&&ap.delete(G),j.current=null}if(!n||w!==n)return;const q=Ka.get(n);if(!q)return;if(p.current=q,N.current!==O){if(N.current=O,T.current=B,i){const G=cu(q,t)??(Wc(n)?T6(t,a):void 0);l(W0t(G,s),G,!0)}E(O);return}if(C!==O)return;let Y=o;T.current!==B&&(T.current=B,i&&s&&(Y=MO(o,s),l(Y,void 0,!1))),i?(L2(n,r,t,pz({state:Y,pane:s,getScroll:u,sourceModes:_},cu(q,t),n,t)),j.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):L2(n,r),p.current=Ka.get(n)??q},[n,t,r,s,B,i,a,o,l,u,_,d,w,O,C,$]),R.useEffect(()=>{const q=Va,Y=X=>{if(q===Va){$();for(const te of ip.values())te.flush(X)}},G=()=>Y(!0);return window.addEventListener("pagehide",G),()=>{window.removeEventListener("pagehide",G),Y(!1)}},[$]);const H=R.useCallback(()=>{var q;n&&(x?b(Y=>Y+1):(q=ip.get(n))==null||q.retry())},[n,x]);return{ready:n===null||w===n&&C===O,loaded:n===null||w===n,error:x??m,retry:H,capture:$,workspace:p}}const J0t="data:image/svg+xml,"+encodeURIComponent(''),e3=R.createContext(null);function ept(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function LO(){const e=R.useContext(e3);if(!e)throw new Error("Runtime is not connected");return e}function tpt(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?J0t:"/favicon.svg")}function mz(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function npt(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!mz("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&iO(n),!mz("orx:locale")&&t&&fD(t)&&rO(t)}function rpt(e){return e.includes("ssh ")&&e.includes("failed")}function gz({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:nL({host:Ne(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j4()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:CDe()})]})})}function vz({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,B;const{session:s}=e,[i,a]=R.useState(s.installPaths),[o,l]=R.useState(!1),[u,_]=R.useState(null);R.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(B=s.installPaths)==null?void 0:B.cache]);async function d(){if(i){l(!0);try{await Jdt(i)}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function p($=!1){r($?s.error:null),l(!0);try{await eft()}catch(H){Qn(H instanceof Error?H.message:String(H),"error")}finally{l(!1)}}async function m(){l(!0);try{await FL()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function x(){l(!0);try{_(await HL())}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}async function S(){if(u){l(!0);try{await qL(u),_(null)}catch($){_(null),Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}}async function v(){l(!0);try{await tft()}catch($){Qn($ instanceof Error?$.message:String($),"error")}finally{l(!1)}}const b=s.status==="applying"||o,w=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&w,E=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&rpt(s.error)&&t!==s.error&&!s.canStartNewHost,T=w?QDe():y?aIe():s.status==="applying"?AMe({host:Ne(s.host)}):s.status==="reconnecting"?DLe({host:Ne(s.host)}):s.status==="disconnected"?s.error?xDe({host:Ne(s.host)}):s.canStartNewHost?MDe({host:Ne(s.host)}):nL({host:Ne(s.host)}):YMe({host:Ne(s.host)}),j=s.error??(s.canStartNewHost?jDe():w?oLe({user:Ne(s.user??""),host:Ne(s.host)}):y?nIe({host:Ne(s.host)}):s.status==="applying"?NMe():s.status==="reconnecting"?TLe():s.status==="disconnected"?_De():WMe());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[E&&f.jsx(It,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:T}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:j})]})]}),N&&f.jsx(C6,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:GDe()}),[["binary",IDe()],["database",FDe()]].map(([$,H])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[H,f.jsx(Wr,{value:i[$],onChange:q=>a({...i,[$]:q.target.value}),disabled:b,dir:"ltr"})]},$)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",JDe()]}):y?kN():mL()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(Le,{variant:"primary",disabled:b,onClick:()=>void d(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",uIe()]}):kN()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(It,{}):null,s.error?wN():ULe()]}):f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,wN()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(Le,{disabled:o,onClick:()=>void m(),children:R4()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(Le,{disabled:o,onClick:()=>void m(),children:R4()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?f.jsx(It,{}):null,xN()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?f.jsx(It,{}):null,rL()]})]}),w&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(Le,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?f.jsx(It,{}):null,xN()]})})]})}),u&&f.jsx(kO,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function spt({children:e}){const n=R.useRef(null);return R.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function ipt(){R.useSyncExternalStore(_9,HG),R.useEffect(()=>_9(()=>{G0t(),Q0t()}),[]);const e=VV({select:x=>x.pathname==="/remote-launch"}),[n,t]=R.useState(null),[r,s]=R.useState(null),i=R.useRef(!1),a=R.useRef(!1),o=R.useRef(!1),l=R.useRef(null),[u,_]=R.useState(null),d=ct({...fht(),enabled:!e,refetchInterval:x=>{var S;return x.state.status==="error"||((S=x.state.data)==null?void 0:S.kind)==="ssh"?2e3:!1},refetchIntervalInBackground:!0});if(R.useEffect(()=>{var v,b;if(e)return;const x=d.data;if(!x){s(((v=d.error)==null?void 0:v.message)??null);return}const S=ept(x);qG(S),l.current!==null&&l.current!==S&&(i.current=!1,a.current=!1,o.current=!1),l.current=S,x.kind==="ssh"&&(o.current||(o.current=!0,npt(x)),x.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):x.session.status==="disconnected"&&x.session.error===null&&(a.current=!1)),t(x),s(((b=d.error)==null?void 0:b.message)??null)},[e,d.data,d.error]),R.useEffect(()=>{const x=(n==null?void 0:n.kind)==="ssh";tpt(x),x&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(It,{})," ",SLe()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(Le,{onClick:()=>location.reload(),children:Gi()})]}):f.jsx(It,{})});if(n.kind==="local")return f.jsxs(e3,{value:n,children:[f.jsx(JN,{}),f.jsx(Z0,{})]},za()[1]);if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(gz,{host:n.session.host}):f.jsx(vz,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const m=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:m,children:f.jsxs(e3,{value:n,children:[f.jsx(JN,{}),f.jsx(Z0,{})]},za()[1])}),m&&f.jsx(spt,{children:r?f.jsx(gz,{host:n.session.host,overlay:!0}):f.jsx(vz,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const ub=TV()({component:ipt}),A6="orx:demo-read-sessions";function OO(){try{const e=JSON.parse(sessionStorage.getItem(A6)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function apt(e){try{const n=OO();n.add(e),sessionStorage.setItem(A6,JSON.stringify([...n]))}catch{}}function opt(){try{sessionStorage.removeItem(A6)}catch{}}function IO(e,n){const t=Rd(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function lpt(e=nt){var i;const[n,t]=await Promise.all([e.fetchQuery(Zp()),e.fetchQuery(rp())]),r=lb((i=N6()??n.workspace)==null?void 0:i.lastLocation);if(!r)return"/projects";const s=Rd(r.split("?")[0]);return!(s!=null&&s.projectId)||!t.some(a=>a.id===s.projectId)||s.sessionId&&!IO(r,await e.fetchQuery(Ea(s.projectId)))?"/projects":r}async function cpt(e,n=nt){var _;const[t,r]=await Promise.all([n.fetchQuery(b6(e)),n.fetchQuery(Ea(e))]),s=DO(e)??t,i=lb(s==null?void 0:s.lastLocation);if(i&&((_=Rd(i.split("?")[0]))==null?void 0:_.projectId)===e&&IO(i,r))return i;const a=r.find(d=>!d.archived),o=Wc(e)?T6(a==null?void 0:a.id,!(await n.fetchQuery(Zp())).tourCompleted):void 0,l=cu(s,(a==null?void 0:a.id)??"new"),u=l?l.active:o==null?void 0:o.active;return C1(e,(a==null?void 0:a.id)??null,u)}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -95,445 +95,445 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b) * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const apt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const upt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const opt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** + */const dpt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vz=e=>{const n=opt(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** + */const bz=e=>{const n=dpt(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var I2={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"};/** + */var O2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lpt=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cpt=R.createContext({}),upt=()=>R.useContext(cpt),dpt=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=upt()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...I2,width:n??u??I2.width,height:n??u??I2.height,stroke:e??p,strokeWidth:x,className:BO("lucide",m,s),...!i&&!lpt(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** + */const fpt=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},hpt=R.createContext({}),_pt=()=>R.useContext(hpt),ppt=R.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:m=""}=_pt()??{},x=r??d?Number(t??_)*24/Number(n??u):t??_;return R.createElement("svg",{ref:l,...O2,width:n??u??O2.width,height:n??u??O2.height,stroke:e??p,strokeWidth:x,className:BO("lucide",m,s),...!i&&!fpt(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,v])=>R.createElement(S,v)),...Array.isArray(i)?i:[i]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const it=(e,n)=>{const t=R.forwardRef(({className:r,...s},i)=>R.createElement(dpt,{ref:i,iconNode:n,className:BO(`lucide-${apt(vz(e))}`,`lucide-${e}`,r),...s}));return t.displayName=vz(e),t};/** + */const it=(e,n)=>{const t=R.forwardRef(({className:r,...s},i)=>R.createElement(ppt,{ref:i,iconNode:n,className:BO(`lucide-${upt(bz(e))}`,`lucide-${e}`,r),...s}));return t.displayName=bz(e),t};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fpt=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],hpt=it("arrow-down",fpt);/** + */const mpt=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],gpt=it("arrow-down",mpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _pt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],op=it("arrow-left",_pt);/** + */const vpt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],op=it("arrow-left",vpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ppt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],z1=it("arrow-right",ppt);/** + */const bpt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],N1=it("arrow-right",bpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mpt=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],gpt=it("arrow-up-right",mpt);/** + */const ypt=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],xpt=it("arrow-up-right",ypt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vpt=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],$O=it("blocks",vpt);/** + */const wpt=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],$O=it("blocks",wpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bpt=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],PO=it("book-open",bpt);/** + */const Spt=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],PO=it("book-open",Spt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ypt=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],xpt=it("calendar-days",ypt);/** + */const kpt=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Cpt=it("calendar-days",kpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wpt=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],Spt=it("chart-spline",wpt);/** + */const Ept=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],Npt=it("chart-spline",Ept);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kpt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Na=it("check",kpt);/** + */const zpt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Na=it("check",zpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cpt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Uo=it("chevron-down",Cpt);/** + */const jpt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Uo=it("chevron-down",jpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ept=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],FO=it("chevron-left",Ept);/** + */const Tpt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],FO=it("chevron-left",Tpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Npt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ta=it("chevron-right",Npt);/** + */const Apt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ta=it("chevron-right",Apt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],HO=it("circle-alert",zpt);/** + */const Rpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],HO=it("circle-alert",Rpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jpt=[["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"}]],Tpt=it("circle-question-mark",jpt);/** + */const Mpt=[["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"}]],Dpt=it("circle-question-mark",Mpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Apt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],qO=it("circle-stop",Apt);/** + */const Lpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],qO=it("circle-stop",Lpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],UO=it("circle-x",Rpt);/** + */const Opt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],UO=it("circle-x",Opt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Dpt=it("clock-3",Mpt);/** + */const Ipt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Bpt=it("clock-3",Ipt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lpt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Opt=it("clock",Lpt);/** + */const $pt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Ppt=it("clock",$pt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ipt=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Bpt=it("cloud-upload",Ipt);/** + */const Fpt=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Hpt=it("cloud-upload",Fpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $pt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],t3=it("code",$pt);/** + */const qpt=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],t3=it("code",qpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ppt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],fb=it("copy",Ppt);/** + */const Upt=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],db=it("copy",Upt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fpt=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],GO=it("corner-down-left",Fpt);/** + */const Gpt=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],GO=it("corner-down-left",Gpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hpt=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],WO=it("cpu",Hpt);/** + */const Wpt=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],WO=it("cpu",Wpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qpt=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Upt=it("download",qpt);/** + */const Vpt=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Kpt=it("download",Vpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gpt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],R6=it("ellipsis",Gpt);/** + */const Qpt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],R6=it("ellipsis",Qpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wpt=[["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"}]],Md=it("external-link",Wpt);/** + */const Ypt=[["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"}]],Md=it("external-link",Ypt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vpt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],VO=it("file-code",Vpt);/** + */const Xpt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],VO=it("file-code",Xpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kpt=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Qpt=it("file-output",Kpt);/** + */const Zpt=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Jpt=it("file-output",Zpt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ypt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],hb=it("file-text",Ypt);/** + */const emt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],fb=it("file-text",emt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xpt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],_b=it("flask-conical",Xpt);/** + */const tmt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],hb=it("flask-conical",tmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zpt=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],KO=it("folder-git-2",Zpt);/** + */const nmt=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],KO=it("folder-git-2",nmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jpt=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Dd=it("folder-open",Jpt);/** + */const rmt=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Dd=it("folder-open",rmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const emt=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],tmt=it("folder-plus",emt);/** + */const smt=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],imt=it("folder-plus",smt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nmt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],pb=it("folder-tree",nmt);/** + */const amt=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],_b=it("folder-tree",amt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rmt=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],smt=it("funnel",rmt);/** + */const omt=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],lmt=it("funnel",omt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const imt=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],amt=it("gauge",imt);/** + */const cmt=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],umt=it("gauge",cmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const omt=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],em=it("git-branch",omt);/** + */const dmt=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],em=it("git-branch",dmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lmt=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],cmt=it("git-commit-horizontal",lmt);/** + */const fmt=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],hmt=it("git-commit-horizontal",fmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const umt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],dmt=it("globe",umt);/** + */const _mt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],pmt=it("globe",_mt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fmt=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],hmt=it("history",fmt);/** + */const mmt=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],gmt=it("history",mmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _mt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],M6=it("info",_mt);/** + */const vmt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],M6=it("info",vmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pmt=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],mmt=it("laptop",pmt);/** + */const bmt=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],ymt=it("laptop",bmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gmt=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],vmt=it("lightbulb",gmt);/** + */const xmt=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],wmt=it("lightbulb",xmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bmt=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],QO=it("link-2",bmt);/** + */const Smt=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],QO=it("link-2",Smt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ymt=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],YO=it("list-checks",ymt);/** + */const kmt=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],YO=it("list-checks",kmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xmt=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],bz=it("lock",xmt);/** + */const Cmt=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],yz=it("lock",Cmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wmt=[["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"}]],Smt=it("maximize-2",wmt);/** + */const Emt=[["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"}]],Nmt=it("maximize-2",Emt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kmt=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],XO=it("message-square-quote",kmt);/** + */const zmt=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],XO=it("message-square-quote",zmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cmt=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Emt=it("minimize-2",Cmt);/** + */const jmt=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Tmt=it("minimize-2",jmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nmt=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],zmt=it("monitor",Nmt);/** + */const Amt=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Rmt=it("monitor",Amt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jmt=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Tmt=it("moon",jmt);/** + */const Mmt=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Dmt=it("moon",Mmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Amt=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Rmt=it("mouse-pointer-click",Amt);/** + */const Lmt=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Omt=it("mouse-pointer-click",Lmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mmt=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],D6=it("package",Mmt);/** + */const Imt=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],D6=it("package",Imt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dmt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ZO=it("panel-left",Dmt);/** + */const Bmt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ZO=it("panel-left",Bmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lmt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],JO=it("panel-right",Lmt);/** + */const $mt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],JO=it("panel-right",$mt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Omt=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Imt=it("paperclip",Omt);/** + */const Pmt=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Fmt=it("paperclip",Pmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bmt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],L6=it("pencil",Bmt);/** + */const Hmt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],L6=it("pencil",Hmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $mt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tm=it("plus",$mt);/** + */const qmt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tm=it("plus",qmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pmt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Aa=it("refresh-cw",Pmt);/** + */const Umt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Aa=it("refresh-cw",Umt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fmt=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Hmt=it("rotate-cw",Fmt);/** + */const Gmt=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Wmt=it("rotate-cw",Gmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qmt=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],O6=it("scroll-text",qmt);/** + */const Vmt=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],O6=it("scroll-text",Vmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Umt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],eI=it("search",Umt);/** + */const Kmt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],eI=it("search",Kmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gmt=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],yz=it("server",Gmt);/** + */const Qmt=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],xz=it("server",Qmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wmt=[["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"}]],tI=it("settings",Wmt);/** + */const Ymt=[["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"}]],tI=it("settings",Ymt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vmt=[["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"}]],nI=it("sliders-horizontal",Vmt);/** + */const Xmt=[["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"}]],nI=it("sliders-horizontal",Xmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kmt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],c_=it("square-terminal",Kmt);/** + */const Zmt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],c_=it("square-terminal",Zmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qmt=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ymt=it("sun",Qmt);/** + */const Jmt=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],egt=it("sun",Jmt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xmt=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Uh=it("terminal",Xmt);/** + */const tgt=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Uh=it("terminal",tgt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zmt=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Jmt=it("toggle-right",Zmt);/** + */const ngt=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],rgt=it("toggle-right",ngt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const egt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Zd=it("trash-2",egt);/** + */const sgt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Zd=it("trash-2",sgt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tgt=[["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"}]],I6=it("triangle-alert",tgt);/** + */const igt=[["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"}]],I6=it("triangle-alert",igt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ngt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],rgt=it("upload",ngt);/** + */const agt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ogt=it("upload",agt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sgt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],B6=it("users",sgt);/** + */const lgt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],B6=it("users",lgt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const igt=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],rI=it("wand-sparkles",igt);/** + */const cgt=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],rI=it("wand-sparkles",cgt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const agt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gr=it("x",agt);/** + */const ugt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gr=it("x",ugt);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ogt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],lgt=it("zap",ogt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function B2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function cgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():i6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(fb,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(cgt,{cmd:n},t):n):null}function n3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ugt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",ugt[e],n),...t})}const xz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),wz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),dgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],fgt=["welcome","environment","profile"];function hgt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Iut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=fgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),U=(oe,ue=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([ib(oe,ue),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&oe.some(ye=>ye.id===ue))return ue;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(uht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ue=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const Z=oe=>{const ue=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:kz(oe.title)}]),O(""),$([]),ue||nt.fetchQuery(W4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=oe=>j(ue=>ue.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ue=>ue.includes(oe)?ue.filter(pe=>pe!==oe):[...ue,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ue=pgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(B2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(z1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:xz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:xz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(vgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:wz,children:hN()}):f.jsx("p",{className:wz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(ggt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(z1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(B2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:dgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>Z(oe),disabled:u,children:[f.jsx(lp,{children:kz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>ce(oe.paperId),disabled:u,children:f.jsx(Gr,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(z1,{size:13})]})})]}),m===null&&f.jsx("p",{className:Sz,children:VNe()}),d&&f.jsx("p",{className:Sz,children:d})]})})})}function kz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function _gt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?o6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function pgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:sb(e,n).defaultId}}function mgt({harness:e}){return f.jsx(n3,{harness:e,size:26})}function ggt({h:e,selected:n,onSelect:t}){var u;const r=_gt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(mgt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ob,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??a6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function vgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ob,{tone:e?"success":n||e===null?"danger":"warning",children:e?o6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const bgt="/assets/slurm-logo-aGSXVZcE.svg",ygt="/assets/thinking-machines-BOdslTfm.png";function xgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return RD();case"tinker_job":return"Tinker";default:return e||"—"}}function wgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Sgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function kgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Cgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Ngt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:ygt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function zgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:bgt,width:e,height:e,alt:"","aria-hidden":"true"})}function mb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Sgt,{size:n});case"hf_job":return f.jsx(wgt,{size:n});case"k8s_job":return f.jsx(kgt,{size:n});case"ssh_job":return f.jsx(yz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(zgt,{size:n});case"ray_job":return f.jsx(Cgt,{size:n});case"openresearch_job":return f.jsx(Egt,{size:n});case"tinker_job":return f.jsx(Ngt,{size:n});case"local_job":return f.jsx(mmt,{size:n,strokeWidth:1.5});default:return f.jsx(yz,{size:n})}}function P6({backend:e}){const n=v6(e),t=Qft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:xgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function $2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function jgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Tgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Agt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Rgt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Mgt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Agt(H==null?void 0:H.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?F:r==="paper"&&H&&!d?W:u,Z=$2(U.trim(),200),ce=ct({...B0(Z),enabled:!!Z&&Z===U.trim()}),re=Z===U.trim()?ce.data??null:null,ne=Z===U.trim()?((rr=ce.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(Z!==U.trim()||ce.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Iht()),ue=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(ov()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=$2(i.trim(),150),qe=ct({...Bht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...XN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=$2(B.trim(),350),mt=jgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...W4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Put});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(W4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await $ut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(C2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...XN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,...E?{githubAutoTopicsEnabled:T,githubTopics:Tgt(M)}:{},locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Vut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?C2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?C2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ue=="string"&&!Te&&!Dt),un=Ut??`github.com/${ue??"you"}/${Ie}`,Mn=ue===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Rgt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:E2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ue===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ue===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:GD(),"aria-label":S1(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ue===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Mgt,{onCancel:e,onCreated:n,remote:t})]})})}function Dgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Cz(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Lgt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Oht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await Yut(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):l6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?d6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":E4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Cz,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Cz,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":tv({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(mb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Dgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Aht,KN,KN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":j4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:j4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},j1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...vht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=j1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:Xft}),M=mn({mutationFn:async I=>{var W;const L=await Zft(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:eht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),$D()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Ogt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Igt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:j1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?s6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})]}),renderIcon:I=>{var F;const L=(F=j1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Wr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Wr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:UD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Wr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Ogt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await Jft(e.id)}finally{await ib(!0)}}}),l=j1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?s6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:PD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Igt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return lb(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:$D()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Ez=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Bgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:iv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:sb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function $gt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ue,pe,Se;const{data:_=Pgt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:iv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):I4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ue=t.find(ye=>ye.id===q))==null?void 0:ue.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=iv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},Z=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",qD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(lgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(n3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[Z(L0(),B,"models"),i.length>0&&Z(G,H,"reasoning"),te.length>0&&Z(tN(),L,"speed"),t.length>0&&Z(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:UD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(n3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(bz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:HD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Ez,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Ez,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(bz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(tN()),re(te,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,U=F.top-12,Z=Math.min(380,X.scrollHeight),ce=i?W>=Z||W>=U:UU;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?W:U))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===sv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:HD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",qD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Pgt=[];function r3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function hv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():R4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(r3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:N2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":N2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:N2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=av(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Pr(n.queryKey,s)}}const Fgt=6e4,Hgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=av(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Tdt(),u())return;const _=Date.now()+Fgt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Hgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Glt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Alt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":Llt(),disabled:s,onClick:()=>t(r),children:f.jsx(Gr,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function qgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Jv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=X5({from:"__root__"}),t=Zv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?ipt(e,n):spt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Ugt(){return f.jsx(pI,{})}function Ggt({projectId:e}){return f.jsx(pI,{projectId:e})}function Wgt(){const e=LO(),n=Zv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&ub.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(hgt,{preferredAgent:a.preferredAgent,onDone:d=>{rpt(),_(d.id)}}):f.jsx(Lgt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Pr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]})}const Vgt=qo()({component:Ugt}),Kgt=qo()({component:Z0}),Qgt=qo()({}),Ygt=qo()({component:Wgt}),Xgt=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>edt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>tdt(e,n),staleTime:3e4}),_v=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>ndt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>rdt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>wdt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),pv=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Sdt(e,n),staleTime:3e4}),Zgt=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>oft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>dft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>hft(e,n,t),staleTime:2e3}),Jgt=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>ldt(e),staleTime:3e5}),e1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>udt(e),staleTime:3e5}),t1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>mdt(e,n,t,r),staleTime:3e5}),n1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(_v(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(_v(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function r1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[_v(e,n,{sessionId:r,ref:s}).queryKey,_v(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function s1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const Nz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function i1t(e){return Nz[e]??Nz.idle}const a1t={done:Qst,failed:rit,running:dit,starting:pit,cancelling:Gst,cancelled:Fst,editing:Jst,idle:oit};function G6(e){const n=a1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=i1t(e);return f.jsx(ob,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:RD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function zz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||gb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||gb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return i3(n)})(e)||SI(e)||gb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gb(e,n){if(e){if(typeof e=="string")return i3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i3(e,n):void 0}}function i3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. + */const dgt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],fgt=it("zap",dgt);function $6(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function I2(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx($6,{}),"OpenResearch"]})}function hgt({cmd:e}){const[n,t]=R.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?tp():UK({value:Ne(e)}),title:n?tp():i6(),children:n?f.jsx(Na,{size:11,strokeWidth:3}):f.jsx(db,{size:11})})]})}function nm(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(hgt,{cmd:n},t):n):null}function n3({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):e==="cursor"?f.jsxs("svg",{className:t,width:n,height:n,viewBox:"388 395 191 191",fill:"none","aria-hidden":"true",children:[f.jsx("path",{fill:"#72716D",d:"M483.395 490.5L566 538.297C565.493 539.178 564.757 539.93 563.845 540.456L486.636 585.13C484.632 586.29 482.159 586.29 480.154 585.13L402.945 540.456C402.034 539.93 401.297 539.178 400.79 538.297L483.395 490.5Z"}),f.jsx("path",{fill:"#55544F",d:"M483.395 395V490.5L400.79 538.297C400.282 537.416 400 536.398 400 535.346V445.654C400 443.545 401.122 441.6 402.945 440.544L480.15 395.87C481.154 395.29 482.273 395 483.391 395H483.395Z"}),f.jsx("path",{fill:"#43413C",d:"M565.996 442.703C565.489 441.822 564.752 441.07 563.841 440.544L486.632 395.87C485.632 395.29 484.513 395 483.395 395V490.5L566 538.297C566.507 537.416 566.789 536.398 566.789 535.346V445.654C566.789 444.598 566.511 443.588 566 442.703H565.996Z"}),f.jsx("path",{fill:"#D6D5D2",d:"M560.218 446.049C560.686 446.858 560.751 447.896 560.218 448.82L485.235 578.974C484.732 579.855 483.392 579.493 483.392 578.479V492.713C483.392 492.029 483.209 491.37 482.877 490.794L560.215 446.045H560.218V446.049Z"}),f.jsx("path",{fill:"#FFFFFF",d:"M560.218 446.049L482.88 490.797C482.552 490.224 482.073 489.737 481.48 489.394L407.369 446.511C406.49 446.006 406.851 444.663 407.862 444.663H557.824C558.889 444.663 559.754 445.239 560.218 446.049Z"})]}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const sI="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%20179.2C0%20116.474%200%2085.1112%2012.2073%2061.1531C22.9451%2040.0789%2040.0789%2022.9451%2061.1531%2012.2073C85.1112%200%20116.474%200%20179.2%200H332.8C395.526%200%20426.889%200%20450.847%2012.2073C471.921%2022.9451%20489.055%2040.0789%20499.793%2061.1531C512%2085.1112%20512%20116.474%20512%20179.2V332.8C512%20395.526%20512%20426.889%20499.793%20450.847C489.055%20471.921%20471.921%20489.055%20450.847%20499.793C426.889%20512%20395.526%20512%20332.8%20512H179.2C116.474%20512%2085.1112%20512%2061.1531%20499.793C40.0789%20489.055%2022.9451%20471.921%2012.2073%20450.847C0%20426.889%200%20395.526%200%20332.8V179.2Z'%20fill='url(%23paint0_linear_496_292)'/%3e%3crect%20opacity='0.25'%20x='128'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='64'%20y='84'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='224'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='160'%20y='144'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='168'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='104'%20y='204'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='112'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='48'%20y='264'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='176'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='112'%20y='324'%20width='224'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20opacity='0.25'%20x='304'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3crect%20x='240'%20y='384'%20width='152'%20height='44'%20rx='22'%20fill='white'%20style='fill:white;fill-opacity:1;'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_496_292'%20x1='-219.792'%20y1='229.426'%20x2='239.06'%20y2='702.601'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236E7EF3'%20style='stop-color:%236E7EF3;stop-color:color(display-p3%200.4303%200.4946%200.9515);stop-opacity:1;'/%3e%3cstop%20offset='1'%20stop-color='%234F13BE'%20style='stop-color:%234F13BE;stop-color:color(display-p3%200.3079%200.0763%200.7470);stop-opacity:1;'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",iI="/assets/ollama-logo-Bt9O-2K_.png",aI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20viewBox='0%200%20160%20160'%3e%3cdefs%3e%3cfilter%20id='shadow'%20x='-10%25'%20y='-10%25'%20width='130%25'%20height='130%25'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='6'%20flood-color='%23000'%20flood-opacity='0.15'/%3e%3c/filter%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='0'%20y2='1'%3e%3cstop%20offset='0%25'%20stop-color='%23ffffff'/%3e%3cstop%20offset='100%25'%20stop-color='%23f0f0f0'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='10'%20y='10'%20width='140'%20height='140'%20rx='32'%20fill='url(%23bg)'%20filter='url(%23shadow)'/%3e%3cg%20transform='translate(25,%2025)%20scale(0.0221)'%3e%3cg%20transform='translate(0,4970)%20scale(1,-1)'%20fill='%23000000'%20stroke='none'%3e%3cpath%20d='M2275%204349%20c-408%20-39%20-769%20-207%20-1056%20-492%20-196%20-194%20-333%20-428%20-418%20-715%20-47%20-158%20-67%20-281%20-101%20-617%20-66%20-662%20-116%20-944%20-245%20-1387%20-102%20-352%20-271%20-774%20-420%20-1051%20-19%20-35%20-35%20-70%20-35%20-76%200%20-8%2050%20-11%20163%20-11%20l164%200%2080%20168%20c168%20348%20303%20739%20408%201175%2073%20307%20109%20532%20155%20982%2052%20500%2072%20627%20122%20785%20162%20507%20570%20860%201096%20951%20155%2026%20389%2026%20544%200%20221%20-38%20440%20-129%20620%20-258%2045%20-32%20152%20-126%20237%20-209%2086%20-82%20178%20-165%20204%20-183%20106%20-72%20312%20-150%20495%20-186%20l32%20-7%20-86%20-54%20c-110%20-69%20-170%20-117%20-267%20-212%20-93%20-91%20-143%20-154%20-191%20-243%20-105%20-191%20-130%20-406%20-75%20-623%2029%20-115%2081%20-239%20217%20-516%20234%20-480%20343%20-769%20411%20-1091%2036%20-172%2048%20-252%2057%20-381%20l7%20-98%20158%200%20158%200%20-4%2028%20c-2%2015%20-6%2066%20-9%20113%20-14%20218%20-95%20560%20-201%20849%20-81%20220%20-165%20407%20-363%20810%20-120%20245%20-147%20320%20-161%20443%20-38%20338%20202%20621%20766%20906%20131%2065%20166%20126%20106%20183%20-33%2031%20-86%2047%20-288%2088%20-177%2036%20-274%2061%20-370%2097%20-140%2052%20-190%2088%20-377%20270%20-140%20137%20-202%20189%20-300%20254%20-378%20250%20-782%20351%20-1233%20308z%20M3050%203391%20c-57%20-11%20-122%20-53%20-154%20-99%20-41%20-57%20-49%20-158%20-18%20-218%2029%20-56%2066%20-92%20120%20-117%20153%20-69%20323%2037%20325%20203%201%20147%20-131%20259%20-273%20231z%20M1985%201391%20c-68%20-31%20-70%20-40%20-66%20-271%201%20-114%20-2%20-243%20-9%20-290%20-40%20-307%20-124%20-555%20-255%20-754%20-25%20-38%20-45%20-71%20-45%20-72%200%20-2%2079%20-4%20176%20-4%20l175%200%2054%20113%20c117%20247%20182%20512%20201%20812%207%20126%20-9%20319%20-32%20374%20-26%2063%20-86%20111%20-136%20111%20-13%200%20-41%20-9%20-63%20-19z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",_gt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function lp({variant:e="list",className:n,...t}){return f.jsx("span",{className:Ds("title",_gt[e],n),...t})}const wz=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),cp=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),Sz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),oI=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),kz=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),pgt=[{id:"AI/ML",label:LCe},{id:"Biology",label:$Ce},{id:"Physics",label:VCe},{id:"Other",label:qCe}],mgt=["welcome","environment","profile"];function ggt({onDone:e,preferredAgent:n}){var le;const t=mn({mutationFn:oe=>Fut(...oe)}),[r,s]=R.useState(0);R.useEffect(()=>{const oe=mgt[r];oe&&Vc({name:"onboarding_step_viewed",step:oe})},[r]);const i=ct(hu()),a=ct(B0()),o=i.data??null,l=(le=a.data)==null?void 0:le.gitVersion,[u,_]=R.useState(!1),[d,p]=R.useState(null),[m,x]=R.useState(null),[S,v]=R.useState(!1),[b,w]=R.useState([]),[y,C]=R.useState(""),[E,N]=R.useState(""),[T,j]=R.useState([]),[M,O]=R.useState(""),[B,$]=R.useState([]),[H,q]=R.useState(!1),Y=R.useRef(0),[G,X]=R.useState(!1),[te,I]=R.useState(!1),L=(o==null?void 0:o.some(oe=>oe.agentReady))??!1,F=l!=null,W=R.useRef(0),U=(oe,ue=!1)=>{const pe=++W.current;v(!0),X(!1),I(!1);const Se=()=>pe===W.current;Promise.allSettled([sb(oe,ue),nt.fetchQuery({...B0(),staleTime:oe?0:3e4})]).then(([ye,qe])=>{Se()&&(ye.status==="rejected"&&X(!0),qe.status==="rejected"&&I(!0))}).finally(()=>Se()&&v(!1))};R.useEffect(()=>U(!1),[]),R.useEffect(()=>{if(o===null)return;const oe=o.filter(ue=>ue.agentReady);x(ue=>{var Se;if(ue&&oe.some(ye=>ye.id===ue))return ue;const pe=n&&oe.find(ye=>ye.id===n.harness);return(pe==null?void 0:pe.id)??((Se=oe[0])==null?void 0:Se.id)??null})},[o,n]),R.useEffect(()=>X(i.isError),[i.isError,i.dataUpdatedAt]),R.useEffect(()=>I(a.isError),[a.isError,a.dataUpdatedAt]),R.useEffect(()=>{nt.fetchQuery(_ht()).then(oe=>{w(oe.researchAreas),C(oe.otherArea??""),N(oe.background??""),j(oe.papers)}).catch(()=>{})},[]),R.useEffect(()=>{const oe=M.trim();if(oe.length<3){$([]),q(!1);return}const ue=++Y.current;q(!0);const pe=setTimeout(()=>{nt.fetchQuery(nO(oe)).then(Se=>ue===Y.current&&$(Se)).catch(()=>ue===Y.current&&$([])).finally(()=>ue===Y.current&&q(!1))},350);return()=>clearTimeout(pe)},[M]);const Z=oe=>{const ue=T.some(pe=>pe.paperId===oe.paperId);j(pe=>pe.some(Se=>Se.paperId===oe.paperId)?pe:[...pe,{paperId:oe.paperId,title:Cz(oe.title)}]),O(""),$([]),ue||nt.fetchQuery(W4(oe.paperId)).then(pe=>{var ye;const Se=(ye=pe.title)==null?void 0:ye.trim();Se&&j(qe=>qe.map(Ie=>Ie.paperId===oe.paperId?{...Ie,title:Se}:Ie))}).catch(()=>{})},ce=oe=>j(ue=>ue.filter(pe=>pe.paperId!==oe)),re=oe=>{w(ue=>ue.includes(oe)?ue.filter(pe=>pe!==oe):[...ue,oe])},ne=b.length>0&&(!b.includes("Other")||y.trim().length>0),Q=async()=>{var pe;const oe=o==null?void 0:o.find(Se=>Se.id===m&&Se.agentReady);if(!oe||u)return;const ue=bgt(oe,((pe=oe.models[0])==null?void 0:pe.id)??null);_(!0),p(null);try{const Se=await t.mutateAsync([ue,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:E||null,papers:T}]);e(Se.project,Se.selection)}catch(Se){p(Se instanceof Error?Se.message:String(Se))}finally{_(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${r===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${r===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:r===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(I2,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:kCe()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:R8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:bNe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:c9e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:JEe()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:X8e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qNe()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(Le,{variant:"primary",size:"large",onClick:()=>s(1),children:[dN()," ",f.jsx(N1,{size:20})]})})]}):r===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(I2,{}),f.jsx("span",{children:rNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:f8e()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:V9e()}),o!==null&&!L&&f.jsx("p",{className:wz,children:GEe()}),o!==null&&L&&m===null&&f.jsx("p",{className:wz,children:m8e()}),(l===null||te)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(wgt,{gitVersion:l,error:te}),te?f.jsx("p",{className:Sz,children:hN()}):f.jsx("p",{className:Sz,children:i9e()})]}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:o!==null?o.map(oe=>f.jsx(xgt,{h:oe,selected:m===oe.id,onSelect:()=>x(oe.id)},oe.id)):G?f.jsx("div",{className:cp,children:hN()}):f.jsxs(ss,{className:"py-2",children:[f.jsx(It,{})," ",q8e()]})}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(0),children:[f.jsx(op,{size:12})," ",uN()]}),f.jsxs(Le,{variant:"ghost",onClick:()=>U(!0,!0),disabled:S,children:[f.jsx(Aa,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",VD()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(Le,{variant:"primary",onClick:()=>s(2),disabled:S||!L||m===null||!F,title:S?LNe():L?m===null?z8e():te?oEe():l===void 0?ANe():l===null?g9e():void 0:FEe(),children:[dN()," ",f.jsx(N1,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(I2,{}),f.jsx("span",{children:oNe()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:dNe()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:oI,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:$Ne()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:k8e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:pgt.map(oe=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:b.includes(oe.id),onChange:()=>re(oe.id),disabled:u}),f.jsx("span",{children:oe.label()})]},oe.id))}),b.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:oe=>C(oe.target.value),disabled:u,placeholder:pNe(),"aria-label":X9e()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:pEe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:E,onChange:oe=>N(oe.target.value),disabled:u,rows:4,placeholder:V8e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:dEe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:zCe()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:M,onChange:oe=>O(oe.target.value),disabled:u,placeholder:wEe()}),H?f.jsx("div",{className:cp,children:EEe()}):B.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:B.map(oe=>f.jsxs("button",{type:"button",onClick:()=>Z(oe),disabled:u,children:[f.jsx(lp,{children:Cz(oe.title)}),f.jsx("span",{className:"id",children:oe.paperId})]},oe.paperId))}):null]}),T.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:T.map(oe=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(lp,{children:oe.title||oe.paperId}),f.jsx("span",{className:"id",children:oe.paperId}),f.jsx("button",{type:"button","aria-label":sY({name:Ne(oe.paperId)}),onClick:()=>ce(oe.paperId),disabled:u,children:f.jsx(Gr,{size:12})})]},oe.paperId))})]})}),!ne&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?y8e():$8e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(Le,{variant:"ghost",onClick:()=>s(1),disabled:u,children:[f.jsx(op,{size:12})," ",uN()]}),f.jsx("div",{className:"flex-1"}),f.jsx(Le,{variant:"primary",onClick:()=>void Q(),disabled:u||m===null||!ne,children:u?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",IEe()]}):f.jsxs(f.Fragment,{children:[t9e()," ",f.jsx(N1,{size:13})]})})]}),m===null&&f.jsx("p",{className:kz,children:VNe()}),d&&f.jsx("p",{className:kz,children:d})]})})})}function Cz(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function vgt(e){return e.agentReady?{tone:"success",label:e.authMethod==="local"?o6():QEe()}:e.installed?e.installBroken?{tone:"warning",label:h9e()}:e.authMethod==="local"?{tone:"warning",label:KD()}:e.authState==="unknown"?{tone:"warning",label:SNe()}:e.authState==="unsupported"?{tone:"warning",label:NNe()}:e.installed?{tone:"warning",label:q9e()}:{tone:"neutral",label:fN()}:{tone:"neutral",label:fN()}}function bgt(e,n){var t;return{harness:e.id,model:n,permissionMode:((t=e.options)==null?void 0:t.defaultPermissionMode)??null,reasoningLevel:rb(e,n).defaultId}}function ygt({harness:e}){return f.jsx(n3,{harness:e,size:26})}function xgt({h:e,selected:n,onSelect:t}){var u;const r=vgt(e),s=n?{tone:"success",label:TEe()}:r,i=(u=e.version)==null?void 0:u.replace(/\s*\(.*\)$/,""),a=[e.id==="opencode"&&e.account!=="opencode"&&e.account,e.id==="opencode"&&e.plan,i,e.models.length>0&&lL({count:Wt(e.models.length),models:new Intl.ListFormat(z()).format(e.models.map(_=>Ne(I0(_))))})].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(ygt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(ab,{tone:s.tone,children:s.label})]}),l=e.id==="opencode"&&f.jsxs("div",{className:"space-y-1 text-sm text-text",children:[f.jsx("div",{className:"font-medium",children:M9e()}),f.jsxs("div",{children:[j9e()," ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:sI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"LM Studio"]}),", ",f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:iI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain dark:invert"}),"Ollama"]}),C9e(),f.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap align-baseline",children:[f.jsx("img",{src:aI,alt:"",width:14,height:14,className:"size-3.5 shrink-0 object-contain"}),"oMLX"]}),"."]})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,e.id!=="opencode"&&f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??a6(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${cp} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a}),l]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:cp,children:nm(e.agentNote)}),l]})}function wgt({gitVersion:e,error:n}){return f.jsxs("div",{className:oI,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:x9e()}),f.jsx(ab,{tone:e?"success":n||e===null?"danger":"warning",children:e?o6():n?e8e():e===null?WD():s8e()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:cp,children:e??l8e()})]})}const Sgt="/assets/slurm-logo-aGSXVZcE.svg",kgt="/assets/thinking-machines-BOdslTfm.png";function Cgt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return MD();case"tinker_job":return"Tinker";default:return e||"—"}}function Egt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Ngt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function zgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function jgt({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Tgt({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function Agt({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:kgt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function Rgt({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:Sgt,width:e,height:e,alt:"","aria-hidden":"true"})}function pb({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function u_({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Ngt,{size:n});case"hf_job":return f.jsx(Egt,{size:n});case"k8s_job":return f.jsx(zgt,{size:n});case"ssh_job":return f.jsx(xz,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(Rgt,{size:n});case"ray_job":return f.jsx(jgt,{size:n});case"openresearch_job":return f.jsx(Tgt,{size:n});case"tinker_job":return f.jsx(Agt,{size:n});case"local_job":return f.jsx(ymt,{size:n,strokeWidth:1.5});default:return f.jsx(xz,{size:n})}}function P6({backend:e}){const n=v6(e),t=Jft(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(u_,{kind:n}),f.jsx("span",{className:"backend-name",children:Cgt(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function B2(e,n){const[t,r]=R.useState(e);return R.useEffect(()=>{const s=setTimeout(()=>r(e),n);return()=>clearTimeout(s)},[e,n]),t}function $g(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function Mgt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Dgt(e){return e.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function Lgt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function Ogt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Igt({onCreated:e,onCancel:n,remote:t=!1}){var rr,En,Ve,xt;const[r,s]=R.useState("blank"),[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(!1),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(""),[B,$]=R.useState(""),[H,q]=R.useState(null),[Y,G]=R.useState(!1),X=R.useRef(0),te=R.useRef(0),I=R.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),L=r==="paper"?Lgt(H==null?void 0:H.repoUrl):null,F=i.trim()?`~/OpenResearch/${$g(i,48)}`:"",W=`~/OpenResearch/${$g(i||(H==null?void 0:H.title)||(H==null?void 0:H.paperId)||"")}`,U=r==="blank"&&!d?F:r==="paper"&&H&&!d?W:u,Z=B2(U.trim(),200),ce=ct({...B0(Z),enabled:!!Z&&Z===U.trim()}),re=Z===U.trim()?ce.data??null:null,ne=Z===U.trim()?((rr=ce.error)==null?void 0:rr.message)??null:null,Q=!!U.trim()&&(Z!==U.trim()||ce.isFetching),le=L??(r==="folder"&&(re!=null&&re.githubOwner)&&re.githubRepo?{owner:re.githubOwner,repo:re.githubRepo}:null),oe=ct(Fht()),ue=((En=oe.data)==null?void 0:En.login)??(oe.isPending?void 0:null),pe=ct(av()),Se=R.useRef(!1);R.useEffect(()=>{Se.current||!pe.data||(Se.current=!0,N(pe.data.githubForNewProjects),j(pe.data.githubAutoTopicsForNewProjects))},[pe.data]);const ye=B2(i.trim(),150),qe=ct({...Hht(ye),enabled:ye===i.trim()}),Ie=ye===i.trim()?((Ve=qe.data)==null?void 0:Ve.repo)??$g(i,48):$g(i,48),Te=ye!==i.trim()||qe.isFetching,vt=ct({...ZN((le==null?void 0:le.owner)??"",(le==null?void 0:le.repo)??""),enabled:!!le,subscribed:!!le}),Dt=!!le&&vt.isFetching,Ut=le&&((xt=vt.data)!=null&&xt.canPush)?`github.com/${le.owner}/${le.repo}`:null,Ft=B2(B.trim(),350),mt=Mgt(Ft),rt=r==="paper"&&!H&&Ft===B.trim(),ut=ct({...nO(Ft),enabled:rt&&!mt&&Ft.length>=3,subscribed:rt&&!mt&&Ft.length>=3}),Ct=ct({...W4(mt??""),enabled:rt&&!!mt,subscribed:rt&&!!mt}),we=rt&&!mt?ut.data??[]:[],Re=rt&&ut.isSuccess?Ft:"",Ze=Y||r==="paper"&&!H&&(Ft!==B.trim()||(mt?Ct.isFetching:ut.isFetching));R.useEffect(()=>{var lt;!rt||!mt||!Ct.data||(q(Ct.data),o||a(((lt=Ct.data.title)==null?void 0:lt.trim())||Ct.data.paperId))},[rt,mt,Ct.data,o]),R.useEffect(()=>{const lt=mt?Ct.error:ut.error;rt&<&&w(lt.message)},[rt,mt,Ct.error,ut.error]);const _t=mn({mutationFn:Uut});async function wt(lt){var jt;const ft=++X.current;G(!0),w(null);try{const xn=await nt.fetchQuery(W4(lt));if(ft!==X.current)return;q(xn),o||a(((jt=xn.title)==null?void 0:jt.trim())||xn.paperId)}catch(xn){ft===X.current&&w(xn instanceof Error?xn.message:String(xn))}finally{ft===X.current&&G(!1)}}function Zt(){X.current+=1,te.current+=1,q(null),$(""),G(!1),x(!1),_(""),p(!1),I.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function We(lt){if(lt===r)return;X.current+=1,te.current+=1,I.current[r]={name:i,nameTouched:o,path:u,pathTouched:d};const ft=I.current[lt];s(lt),w(null),G(!1),x(!1),a(ft.name),l(ft.nameTouched),_(ft.path),p(ft.pathTouched)}async function Gt(){if(m)return;const lt=++te.current;x(!0),w(null);try{const ft=await qut();if(lt!==te.current||!ft)return;if(p(!0),_(ft),nt.invalidateQueries(B0(ft)),r==="folder"&&!o){const jt=ft.replace(/[\\/]+$/,"").split(/[\\/]/).pop();jt&&a(jt)}}catch(ft){lt===te.current&&w(ft instanceof Error?ft.message:String(ft))}finally{lt===te.current&&x(!1)}}async function an(lt){if(lt.preventDefault(),!!nr){v(!0),w(null);try{const ft=await nt.fetchQuery({...B0(U.trim()),staleTime:0});if(ft.exists&&ft.directory===!1)throw new Error(k2());if(r==="blank"&&ft.exists)throw new Error(sN());if(r==="paper"&&ft.empty===!1)throw new Error(cN());E&&le&&await nt.fetchQuery({...ZN(le.owner,le.repo),staleTime:0}).catch(()=>null);const jt=await _t.mutateAsync({name:i.trim(),path:U.trim(),creationMode:r,createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:E,...E?{githubAutoTopicsEnabled:T,githubTopics:Dgt(M)}:{},locale:z(),...r==="paper"&&H?{paperId:H.paperId,cloneUrl:H.repoUrl??void 0}:{}});e(jt.project,jt.githubPublicationError)}catch(ft){w(ft instanceof Error?ft.message:String(ft))}finally{v(!1)}}}const yn=i.trim(),Vt=r==="paper"&&H&&!H.repoUrl?H.paperId:null,Yn=r==="folder"&&(re==null?void 0:re.gitState)==="ready"?re.resolvedPath??null:null,ln=yn!==""&&(r==="blank"||Vt!==null||Yn!==null);R.useEffect(()=>{if(!ln)return;const lt=window.setTimeout(()=>{Xut({name:yn,paperId:Vt??void 0,path:Yn??void 0,locale:z()}).catch(()=>{})},1200);return()=>window.clearTimeout(lt)},[ln,yn,Vt,Yn]);const cn=(re==null?void 0:re.gitVersion)===null,br=r==="folder"&&!!U.trim()&&re!==null&&re.exists===!1,Xn=r==="blank"&&(re==null?void 0:re.exists)===!0,Zn=!!U.trim()&&(re==null?void 0:re.exists)===!0&&re.directory===!1,Rn=r==="paper"&&!!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Rr=r==="paper"&&!!H&&!(H!=null&&H.repoUrl)&&(re==null?void 0:re.empty)===!1,Nr=r==="folder"&&((re==null?void 0:re.gitState)==="detached"||(re==null?void 0:re.gitState)==="invalid"),bt=d&&!U.trim()||Zn||Rn||Rr,fn=d&&!U.trim()||Zn||Xn,Cn=d&&!U.trim()?lN():Zn?k2():Xn?sN():null,tn=d&&!U.trim()?lN():Zn?k2():Rn?cN():Rr?vSe():null,nr=!!(i.trim()&&U.trim())&&!S&&!m&&!Q&&re!==null&&!ne&&!cn&&!br&&!Xn&&!Zn&&!Rn&&!Rr&&!Nr&&(r!=="paper"||!!H)&&(!E||typeof ue=="string"&&!Te&&!Dt),un=Ut??`github.com/${ue??"you"}/${Ie}`,Mn=ue===void 0||Te||Dt,on=r==="paper"&&!H&&B.trim().length>=3&&Re===B.trim()&&!Ze&&we.length===0&&!b;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:an,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>We("blank"),children:lke()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>We("folder"),children:Ake()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>We("paper"),children:Hke()})]}),r==="paper"&&!H&&f.jsxs("label",{className:"!font-normal",children:[d7e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:B,onChange:lt=>{w(null),$(lt.target.value)},placeholder:x7e()}),!on&&f.jsx("span",{className:"repo-hint",children:Ze?hCe():iCe()}),on&&f.jsx("span",{className:"project-path-notice block",children:Jke()}),we.length>0&&f.jsx("div",{className:"paper-results",children:we.map(lt=>f.jsxs("button",{type:"button",onClick:()=>void wt(lt.paperId),children:[f.jsx(lp,{children:lt.title}),f.jsx("span",{className:"id",children:lt.paperId})]},lt.paperId))})]}),H&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(lp,{className:"block",children:H.title||H.paperId}),H.repoUrl&&f.jsx("div",{className:"id",children:Ogt(H.repoUrl)})]}),f.jsx(Le,{size:"small",type:"button","aria-label":yke(),onClick:Zt,children:mke()})]}),!H.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(HO,{size:16})," ",r7e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:o7e()})]})]}),(r!=="paper"||H)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:H!=null&&H.repoUrl?MSe():C2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},"aria-describedby":bt?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),bt&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:tn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?wSe({path:Ne(u)}):nN(),disabled:m,title:u||void 0,onClick:()=>void Gt(),children:[f.jsx(Dd,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:u?"text-sm":"placeholder",children:m?jSe():u||nN()}),f.jsx(Ta,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:C2()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:C2()}),f.jsx("input",{className:"text-sm font-normal",value:U,onChange:lt=>{p(!0),_(lt.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":fn?"blank-destination-description":void 0,spellCheck:!1}),Q&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:iN()}),fn&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Cn})]}):null,r!=="blank"&&U&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:oN()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:lt=>{l(!0),a(lt.target.value)},placeholder:aN()})]}),cn&&f.jsx("div",{className:"project-path-notice error",children:Wke()}),!cn&&r==="folder"&&u.trim()&&!Q&&(re==null?void 0:re.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:j7e()}),!cn&&r==="folder"&&u.trim()&&!Q&&Zn&&f.jsx("div",{className:"project-path-notice error",children:I7e()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:kke()}),!cn&&r==="folder"&&!Q&&(re==null?void 0:re.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:M7e()}),ne&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:ne})]}),b&&f.jsx("div",{className:"error",role:"alert",children:b}),(r!=="paper"||H)&&U&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${E&&ue===null?" text-accent-red":" text-text"}`,"aria-expanded":y,"aria-controls":"new-project-advanced-settings",onClick:()=>C(lt=>!lt),children:[E?ue===null?uSe():_Se():aSe(),f.jsx(Uo,{className:y?"rotate-180":"",size:16})]}),y&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:E,onChange:lt=>N(lt.target.checked),disabled:S}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:C7e()})]}),E&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"mt-1 flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:T,onChange:lt=>j(lt.target.checked),disabled:S}),f.jsx("span",{className:"text-sm font-medium leading-[1.3] text-text",children:eke()})]}),f.jsx("span",{className:"text-xs text-muted",children:ske()}),f.jsx("input",{className:"text-sm font-normal",value:M,onChange:lt=>O(lt.target.value),placeholder:z4(),"aria-label":z4(),disabled:S})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:Mn?F7e({repository:Ne(un)}):Ut?Q7e({repository:Ne(un)}):G7e({repository:Ne(un)})}),f.jsx("span",{children:Lke()}),ue===null&&f.jsx("span",{children:cCe({command:Ne("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(Le,{type:"button",onClick:n,children:fke()}),f.jsx(Le,{variant:"primary",className:"ms-auto",disabled:!nr,children:S?USe():r==="paper"?H!=null&&H.repoUrl?ISe():rN():r==="folder"?gCe():rN()})]})]})}function lI({onClose:e,onCreated:n,remote:t=!1}){const r=R.useRef(null),s=R.useRef(e);return s.current=e,R.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const l=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const d=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===d?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),d.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),a==null||a.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:eL()}),f.jsx(Igt,{onCancel:e,onCreated:n,remote:t})]})})}function Bgt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=R.useRef(null),a=R.useRef(r),o=R.useRef(n);a.current=r,o.current=n,R.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,d=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(d()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=d();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],v=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const l=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:wRe()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:rRe({name:Oo(e.name)})}),f.jsx("p",{className:"m-0",children:l?IRe():FRe()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(Le,{disabled:n,onClick:r,children:_Re()}),f.jsx(Le,{variant:"danger",disabled:n,onClick:s,children:n?TRe():ERe()})]})]})})}function Ez(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function $gt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=R.useState(!1),[o,l]=R.useState(null),[u,_]=R.useState(null),[d,p]=R.useState(null),m=ct(Pht()),x=Object.fromEntries((m.data??[]).map(v=>[v.projectId,v]));async function S(v){l(v.id),_(null);try{await edt(v.id),_(null),p(null),r(v.id)}catch(b){_(b instanceof Error?b.message:String(b))}finally{l(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:nMe()}),f.jsxs(Le,{onClick:()=>a(!0),children:[f.jsx(tm,{size:15})," ",eL()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:ZRe()}),f.jsx("span",{children:gN()}),f.jsx("span",{children:vN()}),f.jsx("span",{children:bN()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:KRe()}):[...e].sort((v,b)=>{var C,E;const w=((C=x[v.id])==null?void 0:C.lastMessageAt)??v.createdAt;return(((E=x[b.id])==null?void 0:E.lastMessageAt)??b.createdAt)-w||v.name.localeCompare(b.name)}).map(v=>{const b=x[v.id],w=v.githubEnabled?v.githubUrl??(v.githubOwner&&v.githubRepo?`https://github.com/${v.githubOwner}/${v.githubRepo}`:null):null,y=w?v.githubOwner&&v.githubRepo?`${v.githubOwner}/${v.githubRepo}`:w.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):l6(),C=b?b.activeAgents>0?QAe({count:Wt(b.activeAgents)}):cMe():"—",E=b?b.totalAgents===1?mMe():JAe({count:Wt(b.totalAgents)}):"—",N=b?b.runningExperiments>0?yMe({count:Wt(b.runningExperiments)}):b.totalExperiments===0?d6():yN({count:Wt(b.totalExperiments)}):"—",T=b&&b.runningExperiments>0?yN({count:Wt(b.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":AQ({name:Oo(v.name)}),onClick:()=>n(v.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:v.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[vRe()," ",$o(v.createdAt)]}),v.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),v.paperId&&f.jsxs("span",{children:[uRe()," ",Ne(v.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":C4({name:Oo(v.name)}),disabled:o===v.id,onClick:j=>{j.stopPropagation(),_(null),p(v)},children:f.jsx(Zd,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:gN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.activeAgents>0&&f.jsx(Ez,{}),C]}),f.jsx("span",{className:"text-xs text-muted",children:E})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:vN()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[b&&b.runningExperiments>0&&f.jsx(Ez,{}),N]}),T&&f.jsx("span",{className:"text-xs text-muted",children:T})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:bN()}),w?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:w,target:"_blank",rel:"noreferrer","aria-label":ev({name:Oo(v.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(pb,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ne(y)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:y})]})]},v.id)})]})})]}),i&&f.jsx(lI,{remote:s,onClose:()=>a(!1),onCreated:(v,b)=>{a(!1),t(v,b)}}),d&&f.jsx(Bgt,{project:d,deleting:o===d.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void S(d)})]})}function cI(){const e=R.useSyncExternalStore(Lht,QN,QN);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":j4()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(HO,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:j4()})]})]})}const uI={id:"lmstudio",label:"LM Studio",icon:sI,url:"http://127.0.0.1:1234/v1"},z1=[uI,{id:"omlx",label:"oMLX",icon:aI,url:"http://127.0.0.1:8000/v1"},{id:"ollama",label:"Ollama",icon:iI,url:"http://127.0.0.1:11434/v1"},{id:"openai-compatible",label:"Custom Endpoint",icon:null,url:"http://127.0.0.1:8000/v1"}];function dI({installed:e,onConnected:n,dialogOnly:t=!1,onClose:r}){var X,te;const s=a_(),i=ct({...wht(),enabled:!t}),a=ct(hu()),o=(X=a.data)==null?void 0:X.find(I=>I.id==="opencode"),[l,u]=R.useState(t),_=()=>{u(!1),r==null||r()},[d,p]=R.useState("lmstudio"),m=z1.find(I=>I.id===d)??uI,[x,S]=R.useState({}),v=x[m.id]??{baseUrl:m.url,apiKey:"",models:[],model:null,contextWindow:"32768",error:null},{baseUrl:b,models:w,model:y,contextWindow:C,error:E}=v,N=m.id==="ollama"?"":v.apiKey,T=I=>{S(L=>({...L,[m.id]:{...L[m.id]??v,...I}}))},j=mn({mutationFn:tht}),M=mn({mutationFn:async I=>{var W;const L=await nht(I);if(!((W=(await s.fetchQuery({...hu(),staleTime:0})).find(U=>U.id==="opencode"))!=null&&W.models.some(U=>U.id===L.model)))throw new Error(G3e());return L}}),O=mn({mutationFn:sht}),B=Number(C),$=j.isPending||M.isPending,H=(I={})=>T({models:[],model:null,error:null,...I}),q=async()=>{H();try{const I=await j.mutateAsync({baseUrl:b.trim(),apiKey:N});T({models:I.models,model:I.models[0]??null})}catch(I){T({error:I instanceof Error?I.message:String(I)})}},Y=async()=>{if(y){T({error:null});try{const I=await M.mutateAsync({name:m.label,baseUrl:b.trim(),apiKey:N,model:y,contextWindow:B});_(),n==null||n(I.model)}catch(I){T({error:I instanceof Error?I.message:String(I)})}}},G=async I=>{try{await O.mutateAsync(I)}catch(L){Qn(L instanceof Error?L.message:String(L),"error")}};return f.jsxs(f.Fragment,{children:[!t&&f.jsxs("section",{className:"mt-4 space-y-3 border-t border-border pt-4","aria-label":ZE(),children:[f.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[f.jsx("h3",{className:"text-base font-medium",children:ZE()}),f.jsxs(Le,{disabled:$,onClick:()=>u(!0),"aria-haspopup":"dialog",children:[f.jsx(tm,{size:14}),PD()]})]}),i.error&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:i.error.message}),f.jsx("div",{className:"space-y-3",children:(te=i.data)==null?void 0:te.map(I=>f.jsx(Pgt,{connection:I,harnessReady:(o==null?void 0:o.agentReady)??!1,availableModels:(o==null?void 0:o.models.map(L=>L.id))??[],checking:a.isFetching,unknown:a.isError||!a.data,disabled:$||O.isPending,onRemove:()=>void G(I.id)},I.id))})]}),l&&f.jsx(Fgt,{busy:$,onClose:_,footer:f.jsxs(Le,{variant:"primary",disabled:$||!e||w.length>0&&(!y||!Number.isSafeInteger(B)||B<4096),onClick:()=>void(w.length>0?Y():q()),children:[$&&f.jsx(It,{}),w.length>0?E5e():B3e()]}),children:f.jsxs("div",{className:"space-y-4",children:[!e&&f.jsxs("div",{className:"text-sm text-text",children:[f.jsx("p",{children:v5e()}),f.jsx(qh,{href:"https://opencode.ai/docs/#install",target:"_blank",rel:"noreferrer",children:_5e()})]}),f.jsx(Ld,{choices:z1,value:d,title:XE(),header:XE(),variant:"field",floating:!0,dropDown:!0,disabled:$,renderLabel:I=>f.jsxs(f.Fragment,{children:[I.id==="openai-compatible"?s6():I.label,I.id==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:FD()})]}),renderIcon:I=>{var F;const L=(F=z1.find(W=>W.id===I.id))==null?void 0:F.icon;return L?f.jsx("img",{src:L,alt:"",width:14,height:14,className:`size-3.5 shrink-0 object-contain${I.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:14,className:"shrink-0"})},onSelect:p}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:D3e()}),f.jsx(Wr,{value:b,disabled:$,onChange:I=>{H({baseUrl:I.target.value})}})]}),m.id!=="ollama"&&f.jsxs("details",{className:"text-sm text-text",children:[f.jsx("summary",{className:"cursor-pointer",children:uL()}),f.jsxs("label",{className:"block space-y-1 mt-3 text-sm text-subtext",children:[f.jsx("span",{children:m.id==="lmstudio"?O5e():w5e()}),f.jsx(Wr,{type:"password",autoComplete:"off",value:N,disabled:$,onChange:I=>H({apiKey:I.target.value})})]})]},m.id),w.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(Ld,{choices:w.map(I=>({id:I,label:I})),value:y,searchPlaceholder:GD(),title:L0(),header:L0(),variant:"field",floating:!0,dropDown:!0,disabled:$,onSelect:I=>{T({model:I})}}),f.jsxs("label",{className:"block space-y-1 text-sm text-subtext",children:[f.jsx("span",{children:J3e()}),f.jsx(Wr,{type:"number",min:4096,step:1024,value:C,disabled:$,onChange:I=>{T({contextWindow:I.target.value})}})]}),f.jsx("p",{className:"text-sm text-subtext",children:r5e()})]}),E&&f.jsx("p",{className:"text-sm text-accent-red",role:"alert",children:E})]})})]})}function Pgt({connection:e,harnessReady:n,availableModels:t,checking:r,unknown:s,disabled:i,onRemove:a}){const o=mn({mutationFn:async()=>{try{await rht(e.id)}finally{await sb(!0)}}}),l=z1.find(x=>x.label===e.name||x.id==="openai-compatible"&&["OpenAI-compatible server","Custom endpoint"].includes(e.name)),u=Object.keys(e.models),_=u.length>0&&n&&u.every(x=>t.includes(`${e.id}/${x}`)),d=o.isPending||r,p=s,m=_;return f.jsxs("div",{className:"@container min-w-0 px-4 py-4",children:[f.jsxs("div",{className:"flex flex-col items-stretch gap-3 @sm:flex-row @sm:items-center @sm:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l!=null&&l.icon?f.jsx("img",{src:l.icon,alt:"",width:20,height:20,className:`mt-0.5 size-5 shrink-0 object-contain${l.id==="ollama"?" dark:invert":""}`}):f.jsx(QO,{size:20,className:"mt-0.5 shrink-0"}),f.jsxs("div",{className:"min-w-0 space-y-1",children:[f.jsx("div",{className:"text-base font-medium break-words",children:u.join(", ")}),f.jsxs("div",{className:"text-sm text-subtext break-all",children:[(l==null?void 0:l.id)==="openai-compatible"?s6():(l==null?void 0:l.label)??e.name,(l==null?void 0:l.id)==="openai-compatible"&&f.jsx("span",{className:"ml-1 text-xs font-normal text-subtext",children:FD()})," · ",e.baseUrl]})]})]}),f.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1 self-end @sm:self-auto @lg:flex-row @lg:items-center @lg:gap-2",children:[f.jsx("span",{role:"status",children:f.jsx(Pt,{variant:d||p?"default":m?"success":"warning",children:d?Xi():p?wL():m?Q3e():Ya()})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Le,{variant:"ghost",disabled:i||o.isPending,onClick:()=>o.mutate(),children:[f.jsx(Aa,{size:14}),VD()]}),f.jsx(Qt,{"aria-label":u5e({name:e.name}),disabled:i||o.isPending,onClick:a,children:f.jsx(Zd,{size:14})})]})]})]}),o.error&&!m&&f.jsx("p",{className:"mt-2 text-sm text-accent-red",role:"alert",children:o.error.message})]})}function Fgt({busy:e,onClose:n,footer:t,children:r}){const s=R.useRef(null),i=()=>{e||n()};return ob(s,i,"input"),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:a=>{a.target===a.currentTarget&&i()},children:f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"local-model-dialog-title",tabIndex:-1,className:"relative flex max-h-full w-140 max-w-full flex-col rounded-xl border border-border bg-background shadow-modal",children:[f.jsx("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:f.jsx("h2",{id:"local-model-dialog-title",className:"m-0 text-xl font-medium",children:PD()})}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Ad(),onClick:i,disabled:e,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"min-h-0 overflow-y-auto px-6 pb-2",children:r}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2 px-6 py-4",children:[f.jsx(Le,{onClick:i,disabled:e,children:Ad()}),t]})]})}),document.body)}const fI=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),Nz=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),E0={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode",cursor:"Cursor"};function Hgt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:sv(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:rb(n,t).defaultId}}function so(e){const[n,t]=R.useState(!1),r=R.useRef(null);return R.useEffect(()=>{if(!n)return;const s=a=>{var o,l;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((l=e==null?void 0:e.current)!=null&&l.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function qgt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,lockHarness:l=!1,className:u}){var ne,Q,le,oe,ue,pe,Se;const{data:_=Ugt}=ct(hu()),d=a_(),[p,m]=R.useState(!1),x=R.useRef(null),S=R.useRef(null),{open:v,setOpen:b,ref:w}=so(x),[y,C]=R.useState(""),[E,N]=R.useState("root"),T=()=>{b(!1),N("root"),C("")};R.useEffect(()=>{var ye;v&&(E==="reasoning"||E==="speed"||E==="permissions")&&((ye=S.current)==null||ye.focus())},[v,E]);const j=R.useMemo(()=>{const ye=y.trim().toLowerCase();return(l&&e?_.filter(Ie=>Ie.id===e.harness):_).map(Ie=>{let Te=Ie.models;return ye?Te=Te.filter(vt=>`${vt.id} ${I0(vt)}`.toLowerCase().includes(ye)):(Ie.id==="opencode"||Ie.id==="cursor")&&(Te=Te.slice(0,5)),{harness:Ie,models:Te,hidden:ye?0:Ie.models.length-Te.length}})},[_,y,l,e]),M=(ye,qe)=>{var Te;const Ie=(e==null?void 0:e.harness)===ye.id;n({harness:ye.id,model:qe,serviceTier:sv(ye,qe,Ie?e==null?void 0:e.serviceTier:null),permissionMode:Ie?e.permissionMode:((Te=ye.options)==null?void 0:Te.defaultPermissionMode)??null,reasoningLevel:VL(ye,qe,Ie?e.reasoningLevel:null)}),T()},O=(e==null?void 0:e.model)!=null?(ne=_.find(ye=>ye.id===e.harness))==null?void 0:ne.models.find(ye=>ye.id===e.model):void 0,B=e?e.model?O?I0(O):I4(e.model):JE():L0(),$=(e==null?void 0:e.reasoningLevel)??a??((Q=i[0])==null?void 0:Q.id),H=(le=i.find(ye=>ye.id===$))==null?void 0:le.label,q=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),Y=(ue=t.find(ye=>ye.id===q))==null?void 0:ue.label,G=(e==null?void 0:e.harness)==="opencode"?nSe():g6e(),X=_.find(ye=>ye.id===(e==null?void 0:e.harness)),te=WL(X,e==null?void 0:e.model),I=sv(X,e==null?void 0:e.model,e==null?void 0:e.serviceTier),L=(pe=te.find(ye=>ye.id===I))==null?void 0:pe.label,F=ye=>{o==null||o(ye),T()},W=ye=>{s==null||s(ye),T()},U=ye=>{e&&n({...e,serviceTier:ye}),T()},Z=(ye,qe,Ie)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>N(Ie),children:[f.jsx("span",{className:"flex-1",children:ye}),qe&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:qe}),f.jsx(Ta,{size:14,className:"shrink-0 text-muted"})]}),ce=ye=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{N("root"),C("")},children:[f.jsx(FO,{size:15}),ye]}),re=(ye,qe,Ie,Te)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ye.map(vt=>f.jsxs(or,{onClick:()=>Te(vt.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[vt.label,vt.id===Ie&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",UD()]})]}),vt.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:vt.description})]}),vt.id===qe&&f.jsx(Na,{size:13})]},vt.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:w,children:[f.jsxs("button",{ref:x,type:"button",className:Ds("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",u),title:zK({label:`${B}${H?` · ${H}`:""}${L?` · ${L}`:""}`}),"aria-haspopup":"menu","aria-expanded":v,onClick:()=>{v?T():(N("root"),b(!0))},children:[I==="priority"?f.jsx(fgt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(n3,{harness:e.harness,size:14}):null,I==="priority"&&f.jsxs("span",{className:"sr-only",children:[x6e()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[B,H&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),f.jsx(Uo,{size:14,className:"shrink-0 text-muted"})]}),v&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[E==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[Z(L0(),B,"models"),i.length>0&&Z(G,H,"reasoning"),te.length>0&&Z(tN(),L,"speed"),t.length>0&&Z(eN(),Y,"permissions")]}),E==="models"&&f.jsxs(f.Fragment,{children:[ce(L0()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:GD(),value:y,onChange:ye=>C(ye.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[j.map(({harness:ye,models:qe,hidden:Ie})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:fI,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(n3,{harness:ye.id,size:14}),ye.name]}),!ye.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(yz,{size:10})," ",Ya()]})]}),ye.agentReady?f.jsxs(f.Fragment,{children:[ye.models.length===0&&f.jsxs(or,{onClick:()=>M(ye,null),children:[f.jsxs("span",{children:[JE(),f.jsx("span",{className:"model-id",children:qD()})]}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===null&&f.jsx(Na,{size:13})]}),qe.map(Te=>f.jsxs(or,{title:Te.id,onClick:()=>M(ye,Te.id),children:[f.jsx("span",{children:I0(Te)}),(e==null?void 0:e.harness)===ye.id&&(e==null?void 0:e.model)===Te.id&&f.jsx(Na,{size:13})]},Te.id)),y.trim().length>0&&!ye.models.some(Te=>Te.id===y.trim())&&f.jsx(or,{onClick:()=>M(ye,y.trim()),children:f.jsx("span",{children:Z6e({id:Ne(y.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ye.agentNote?nm(ye.agentNote):L6e()}),ye.id==="opencode"&&f.jsx(or,{type:"button",className:"font-medium","aria-haspopup":"dialog",onClick:()=>{var Te;T(),(Te=x.current)==null||Te.focus(),m(!0)},children:f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e6e(),f.jsx(tm,{size:14,"aria-hidden":"true"})]})}),ye.agentReady&&Ie>0&&f.jsx("div",{className:Nz,children:A6e({count:Wt(Ie)})})]},ye.id)),_.length===0&&f.jsx("div",{className:Nz,children:h6e()})]}),l&&e&&_.length>1&&f.jsxs("div",{className:"model-locked-note py-[7px] px-3 text-sm text-muted border-t border-t-border-variant",children:[f.jsx(yz,{size:11,className:"inline-block align-baseline me-1","aria-hidden":"true"}),H6e()]})]}),E==="reasoning"&&f.jsxs(f.Fragment,{children:[ce(G),re(i,$,a,F)]}),E==="permissions"&&f.jsxs(f.Fragment,{children:[ce(eN()),re(t,q,r,W)]}),E==="speed"&&f.jsxs(f.Fragment,{children:[ce(tN()),re(te,I??void 0,"default",U)]})]}),p&&f.jsx(dI,{dialogOnly:!0,installed:((Se=_.find(ye=>ye.id==="opencode"))==null?void 0:Se.installed)??!1,onClose:()=>m(!1),onConnected:ye=>{var Ie;const qe=(Ie=d.getQueryData(hu().queryKey))==null?void 0:Ie.find(Te=>Te.id==="opencode");qe&&(!l||(e==null?void 0:e.harness)==="opencode")&&M(qe,ye)}})]})}function Ld({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:l,numbered:u=!1,searchPlaceholder:_,renderIcon:d,renderLabel:p,floating:m=!1,onSelect:x,className:S}){var Y,G;const v=R.useRef(null),{open:b,setOpen:w,ref:y}=so(v),C=R.useRef(null),[E,N]=R.useState("");if(R.useLayoutEffect(()=>{var L;const X=C.current,te=y.current;if(!b||!m||!X||!te)return;X.matches(":popover-open")||(X.showPopover(),(L=X.querySelector("input"))==null||L.focus());const I=()=>{const F=te.getBoundingClientRect(),W=window.innerHeight-F.bottom-12,U=F.top-12,Z=Math.min(380,X.scrollHeight),ce=i?W>=Z||W>=U:UU;X.style.width=`${F.width}px`,X.style.minWidth="0",X.style.maxHeight=`${Math.max(0,Math.min(380,ce?W:U))}px`,X.style.left=`${F.left}px`,X.style.top=`${ce?F.bottom+4:F.top-X.getBoundingClientRect().height-4}px`};return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[b,m,i,E,e.length,y]),e.length===0)return null;const T=n??t??((Y=e[0])==null?void 0:Y.id)??null,j=e.find(X=>X.id===T),M=e.find(X=>X.id===t),O=o==="bare"&&(M==null?void 0:M.id)===rv?M:void 0,$=(O?e.filter(X=>X.id!==O.id):e).filter(X=>`${X.label} ${X.id}`.toLowerCase().includes(E.toLowerCase())),H=(j==null?void 0:j.label)??((G=e[0])==null?void 0:G.label)??"",q=X=>{var te;x(X),w(!1),(te=v.current)==null||te.focus()};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:y,children:[f.jsxs("button",{ref:v,type:"button",className:Ds(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,S),title:l,"aria-haspopup":"menu","aria-expanded":b,disabled:a,onClick:()=>{N(""),w(X=>!X)},children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[j&&(d==null?void 0:d(j)),f.jsx("span",{className:"truncate",children:j?(p==null?void 0:p(j))??H:H})]}),f.jsx(Uo,{size:12})]}),b&&f.jsxs("div",{ref:C,popover:m?"manual":void 0,style:m?{position:"fixed",inset:"auto",margin:0}:void 0,className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(X=>X.description)?"min-w-80":""} ${o==="field"?"min-w-full text-text":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:fI,children:r}),_&&f.jsx("input",{autoFocus:!0,"aria-label":_,placeholder:_,value:E,onChange:X=>N(X.target.value),className:"shrink-0 border-b border-border bg-background px-2 py-2 text-sm outline-none"}),f.jsxs("div",{className:"min-h-0 overflow-y-auto",children:[O&&f.jsxs(f.Fragment,{children:[f.jsxs(or,{type:"button",onClick:()=>q(O.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[d==null?void 0:d(O),f.jsxs("span",{children:[(p==null?void 0:p(O))??O.label,f.jsx("span",{className:"option-default text-muted font-normal",children:qD()})]})]}),T===O.id&&f.jsx(Na,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),$.map((X,te)=>f.jsxs(or,{type:"button",onClick:()=>q(X.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[d==null?void 0:d(X),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[(p==null?void 0:p(X))??X.label,!O&&X.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",UD()]})]}),X.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:X.description})]})]}),T===X.id?f.jsx(Na,{size:13}):u&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:te+1})]},X.id))]})]})]})}const Ugt=[];function r3({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function fv({runtime:e,corner:n=!1}){const[t,r]=R.useState(!1),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=so();async function d(){if(l){o(!0);try{await qL(l),u(null)}catch(p){u(null),Qn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:HMe({host:Ne(e.session.host),user:Ne(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(or,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await FL(),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?BMe():R4()}),f.jsx(S6,{content:pLe(),className:"me-2 shrink-0 text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx(or,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await HL()),_.setOpen(!1)}catch(p){Qn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:rL()})]}),n?f.jsxs(Le,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[f.jsx(r3,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:E2({host:Ne(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":E2({host:Ne(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:E2({host:Ne(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(e.session.version??"…")]})]})]})]}),l&&f.jsx(kO,{host:e.session.host,preview:l,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void d()})]})}function F6(e=!0){var r;const n=iv(),t=ct({...n,enabled:e});return{status:t.data??null,error:((r=t.error)==null?void 0:r.message)??null,apply:s=>Pr(n.queryKey,s)}}const Ggt=6e4,Wgt=500;function hI(e){const[n,t]=R.useState(!1),[r,s]=R.useState(null),i=R.useRef(!1);R.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{if(!a||n)return;const l=iv(),u=()=>i.current||!Fn(l.queryKey);t(!0),s(null),(async()=>{try{if(await Ddt(),u())return;const _=Date.now()+Ggt;for(;Date.now()<_;){if(await new Promise(p=>setTimeout(p,Wgt)),u())return;const d=await nt.fetchQuery({...l,staleTime:0}).catch(()=>null);if(u())return;if(d&&d.instance!==a){window.location.reload();return}}throw new Error(Qlt())}catch(_){if(u())return;s(_ instanceof Error?_.message:String(_)),t(!1)}})()}}}function _I({status:e}){const[n,t]=R.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=hI(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(Aa,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?ML({error:i}):Llt({version:Ne(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(Le,{type:"button",size:"small",disabled:s,onClick:a,children:s?DL():RL()}),f.jsx(Qt,{type:"button",size:"small",className:"ms-auto","aria-label":$lt(),disabled:s,onClick:()=>t(r),children:f.jsx(Gr,{size:13})})]})}function H6(){return f.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:f.jsx(It,{})})}function Vgt(){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{children:Ya()}),f.jsx(Zv,{to:"/projects",children:D0()})]})}function q6({error:e,reset:n}){return f.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[f.jsx("p",{role:"alert",children:e.message}),f.jsx(Le,{onClick:n,children:Gi()}),f.jsx(Zv,{to:"/projects",children:D0()})]})}function pI({projectId:e}){const{queryClient:n}=X5({from:"__root__"}),t=Xv(),[r,s]=R.useState(null),[i,a]=R.useState(0);return R.useEffect(()=>{let o=!0;return s(null),(e?cpt(e,n):lpt(n)).then(l=>{o&&t({href:l,replace:!0})}).catch(l=>{o&&(EG(l)?a(u=>u+1):s(l instanceof Error?l:new Error(String(l))))}),()=>{o=!1}},[e,i,t,n]),r?f.jsx(q6,{error:r,reset:()=>a(o=>o+1)}):f.jsx(H6,{})}function Kgt(){return f.jsx(pI,{})}function Qgt({projectId:e}){return f.jsx(pI,{projectId:e})}function Ygt(){const e=LO(),n=Xv(),t=rp(),r=ct(t),s=ct(Zp()),i=r.data,a=s.data,o=r.error??s.error,l=()=>{r.refetch(),s.refetch()},{status:u}=F6(e.kind==="local");R.useEffect(()=>{document.title="OpenResearch",a&&cb.queue({...N6()??a.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"})},[a]);const _=d=>void n({to:"/projects/$projectId",params:{projectId:d}});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsxs(f.Fragment,{children:[f.jsx(cI,{}),f.jsx(_I,{status:u})]}),o&&(!i||!a)?f.jsx(q6,{error:o,reset:l}):!i||!a?f.jsx(H6,{}):i.length===0&&!a.onboardingCompleted?f.jsx(ggt,{preferredAgent:a.preferredAgent,onDone:d=>{opt(),_(d.id)}}):f.jsx($gt,{remote:e.kind==="ssh",projects:i,onOpen:_,onCreated:(d,p)=>{p?(Qn(p,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:d.id,tab:"git"}})):_(d.id)},onDeleted:d=>Pr(t.queryKey,p=>p==null?void 0:p.filter(m=>m.id!==d))}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]})}const Xgt=qo()({component:Kgt}),Zgt=qo()({component:Z0}),Jgt=qo()({}),e1t=qo()({component:Ygt}),t1t=e=>({queryKey:zt("getRunDiff",e),queryFn:({signal:n})=>sdt(e,n),staleTime:3e4}),mI=e=>({queryKey:zt("getExperimentDiff",e),queryFn:({signal:n})=>idt(e,n),staleTime:3e4}),hv=(e,n,t={})=>({queryKey:zt("getProjectFile",e,n,{...t}),queryFn:({signal:r})=>adt(e,n,t,r),staleTime:t.ref?Ph(t.ref)?1/0:3e4:1/0,refetchOnMount:t.ref?!0:"always",refetchOnWindowFocus:t.ref?!0:"always"}),gI=e=>({queryKey:zt("getAbsoluteFile",e),queryFn:({signal:n})=>odt(e,n),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),vI=(e,n={})=>({queryKey:zt("getCodeTree",e,{...n}),queryFn:({signal:t})=>Edt(e,n,t),staleTime:n.ref&&Ph(n.ref)?1/0:3e4}),_v=e=>({queryKey:zt("getSessionWorktree",e),queryFn:({signal:n})=>Ndt(e,n),staleTime:3e4}),n1t=e=>({queryKey:zt("getArtifacts",e),queryFn:({signal:n})=>dft(e,n),staleTime:3e4}),U6=(e,n)=>({queryKey:zt("getArtifactFileText",e,n),queryFn:({signal:t})=>pft(e,n,t),staleTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:"always"}),bI=(e,n)=>({queryKey:zt("getArtifactFileMetadata",e,n),queryFn:({signal:t})=>gft(e,n,t),staleTime:2e3}),r1t=()=>({queryKey:zt("getLatexEngine"),queryFn:({signal:e})=>fdt(e),staleTime:3e5}),s1t=()=>({queryKey:zt("getOverleafSettings"),queryFn:({signal:e})=>_dt(e),staleTime:3e5}),i1t=(e,n,t={})=>({queryKey:zt("getOverleafState",e,n,{...t}),queryFn:({signal:r})=>ydt(e,n,t,r),staleTime:3e5}),a1t=(e,n,t={})=>({queryKey:zt("getOverleafStatus",e,n,{...t}),queryFn:({signal:r})=>kdt(e,n,t,r),staleTime:3e4}),yI=(e,n,t,r,s)=>({queryKey:zt("resolvedFile",e,n,t,r??null,s??null),staleTime:s&&!Ph(s)?3e4:1/0,refetchOnMount:s?!0:"always",refetchOnWindowFocus:s?!0:"always",queryFn:async({signal:i,client:a})=>{const o=async m=>{i.throwIfAborted();const x=await a.fetchQuery({...m,staleTime:s?m.staleTime:0});return i.throwIfAborted(),x},l=t==="abs",u=t==="artifacts",_=async()=>{const m=await o(bI(e,n)),x=(m==null?void 0:m.presentation)==="text"||(m==null?void 0:m.presentation)==="unknown",S=m&&x?await o(U6(e,n)):null,v=m===null||x&&S===null;return{path:n,content:(S==null?void 0:S.content)??"",truncated:(S==null?void 0:S.truncated)??!1,binary:(S==null?void 0:S.binary)??(m==null?void 0:m.presentation)==="download",notFound:v,presentation:S?S.binary?"download":"text":(m==null?void 0:m.presentation)??"download"}},d=async()=>{for(const m of[`artifacts/${n}`,n]){const x=await o(hv(e,m,{sessionId:r})).catch(()=>(i.throwIfAborted(),null));if(x&&!x.notFound)return x}return null},p=await(l?o(gI(n)).then(m=>({source:"absolute",file:m})):u?_().then(async m=>{if(!m.notFound)return{source:"artifact",file:m};const x=await d();return x?{source:"checkout",file:x}:{source:"artifact",file:m}}):o(hv(e,n,{sessionId:r,ref:s})).then(m=>m.notFound&&!s?_().then(x=>x.notFound?{source:"checkout",file:m}:{source:"artifact",file:x,checkoutRoot:m.root}):{source:"checkout",file:m}));return i.throwIfAborted(),p}});async function o1t(e,n,t,r,s){if(Ph(s))return;const i=yI(e,n,t,r,s),a=[i.queryKey,...t==="abs"?[gI(n).queryKey]:[hv(e,n,{sessionId:r,ref:s}).queryKey,hv(e,`artifacts/${n}`,{sessionId:r}).queryKey,U6(e,n).queryKey,bI(e,n).queryKey]];await Promise.all(a.map(o=>nt.cancelQueries({queryKey:o,exact:!0}))),await Promise.all(a.map(o=>nt.invalidateQueries({queryKey:o,exact:!0,refetchType:"none"}))),await nt.invalidateQueries({queryKey:i.queryKey,exact:!0})}function l1t(e,n,t){return t?n.flatMap(r=>{if(r.status!=="starting"&&r.status!=="running")return[];const s=e.find(i=>i.id===r.experimentId&&i.chatSessionId===t);return s?[{experiment:s,run:r}]:[]}):[]}const zz={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function c1t(e){return zz[e]??zz.idle}const u1t={done:Jst,failed:oit,running:pit,starting:bit,cancelling:Qst,cancelled:Gst,editing:rit,idle:dit};function G6(e){const n=u1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function $l({status:e,label:n,className:t}){const r=c1t(e);return f.jsx(ab,{tone:r.tone,live:r.live,className:t,children:n??G6(e)})}const Od={local:MD,tinker:ege,hf:Sme,modal:Dme,k8s:Nme,ssh:Yme,slurm:Wme,ray:Hme,openresearch:Bme};function jz(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Hn(e){for(var n=1;n=0||(_[l]=a[l]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function kn(e,n){return wI(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,l,u=[],_=!0,d=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){d=!0,a=p}finally{try{if(!_&&s.return!=null&&(l=s.return(),Object(l)!==l))return}finally{if(d)throw a}}return u}})(e,n)||mb(e,n)||kI()}function xI(e){return wI(e)||SI(e)||mb(e)||kI()}function Vi(e){return(function(n){if(Array.isArray(n))return i3(n)})(e)||SI(e)||mb(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wI(e){if(Array.isArray(e))return e}function SI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mb(e,n){if(e){if(typeof e=="string")return i3(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i3(e,n):void 0}}function i3(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var l=t.next();return a=l.done,l},e:function(l){o=!0,i=l},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var Pg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rm(e,n){return e(n={exports:{}},n.exports),n.exports}var Ui=rm((function(e){/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),H={content:v.slice(1)};switch($){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=u,u++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=l,l++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=l,H.newLineNumber=u,l++,u++;break;case"\\":var q=o.changes[o.changes.length-1];q.isDelete||(a.newEndingNewLine=!1),q.isInsert||(a.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function u1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function a3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` +*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var E=b.slice(y+1);E.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=E.slice(10));break;case"similarity":a.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),T=N[0].split("..");a.oldRevision=T[0],a.newRevision=T[1],N[1]&&(a.oldMode=a.newMode=N[1]);break;case"copy":case"rename":var j=b.slice(y+1);j.indexOf("from")===0?a.oldPath=j.slice(5):a.newPath=j.slice(3),w=C;break;case"---":var M=b.slice(y+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),w="add"):O==="/dev/null"?(M=M.slice(2),w="delete"):(w="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=w||"modify"}else if(v.indexOf("Binary")===0)a.isBinary=!0,a.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(v.indexOf("@@")===0){var B=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:B[1]-0,newStart:B[4]-0,oldLines:B[3]-0||1,newLines:B[6]-0||1,changes:[]},a.hunks.push(o),l=o.oldStart,u=o.newStart}else{var $=v.slice(0,1),H={content:v.slice(1)};switch($){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=u,u++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=l,l++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=l,H.newLineNumber=u,l++,u++;break;case"\\":var q=o.changes[o.changes.length-1];q.isDelete||(a.newEndingNewLine=!1),q.isInsert||(a.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}S++}return d}};e.exports=s})()}));function ku(e){return e.type==="insert"}function Ki(e){return e.type==="delete"}function Hl(e){return e.type==="normal"}function _1t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var l=kn(i,3),u=l[0],_=l[1],d=l[2];return _?ku(a)&&d>=0?(u.splice(d+1,0,a),[u,a,d+2]):(u.push(a),[u,a,Ki(a)&&Ki(_)?d:o]):(u.push(a),[u,a,Ki(a)?o:-1])}),[[],null,-1]);return kn(s,1)[0]})(e.changes):e.changes;return Hn(Hn({},e),{},{isPlain:!1,changes:t})}function a3(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` `),i=r.indexOf(` `,s+1),a=r.slice(0,s),o=r.slice(s+1,i),l=a.split(" ").slice(1,-3).join(" "),u=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(l," b/").concat(u),"index 1111111..2222222 100644","--- a/".concat(l),"+++ b/".concat(u),r.slice(i+1)].join(` -`)})(e.trimStart());return c1t.parse(t).map((function(r){return(function(s,i){var a=s.hunks.map((function(o){return u1t(o,i)}));return Hn(Hn({},s),{},{hunks:a})})(r,n)}))}function d1t(e){return e[0]}function f1t(e){return e[e.length-1]}function o3(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function up(e){return e==="old"?function(n){return ku(n)?-1:Hl(n)?n.oldLineNumber:n.lineNumber}:function(n){return Ki(n)?-1:Hl(n)?n.newLineNumber:n.lineNumber}}function EI(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},y1t=function(e,n){var t=this.__data__,r=vb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new rvt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var bvt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},yvt=function(e){return function(n){return e(n)}},Oz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Iz=Oz&&Oz.isTypedArray,Q6=Iz?yvt(Iz):bvt,xvt=Object.prototype.hasOwnProperty,wvt=function(e,n){var t=Zi(e),r=!t&&wb(e),s=!t&&!r&&mv(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?_vt(e.length,String):[],l=o.length;for(var u in e)!xvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Svt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Svt)},kvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),Cvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return kvt(e);var n=[];for(var t in Object(e))Cvt.call(e,t)&&t!="constructor"&&n.push(t);return n},Sb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return Sb(e)?wvt(e):II(e)},Bz=function(e){return cvt(e,Y6,hvt)},Evt=Object.prototype.hasOwnProperty,Nvt=function(e,n,t,r,s,i){var a=1&t,o=Bz(e),l=o.length;if(l!=Bz(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Evt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function pbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,hbt),a=s?function(o,l){return s(o,qz,l)}:qz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?_bt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(pbt);function WI(e,n){return function(){var t=n==="old"?zb(e):jb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function gv(e,n){return n?function(t){e(),n(t)}:e}function Uz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=gv(t,s.onMouseEnter),s.onMouseLeave=gv(r,s.onMouseLeave),s}),[e,t,r,n])}function Gz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function mbt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Uz(d,O,j,M),$=Uz(p,O,j,M),H=S(s),q=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:H,className:Ui("diff-line",q),children:[!m&&Gz(Y,s,C,"old",x,H,B,T,b),!m&&Gz(Y,s,C,"new",x,H,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var gbt=R.memo(mbt);function vbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var bbt=["hideGutter","selectedChanges","tokens","lineClassName"],ybt=["hunk","widgets","className"];function xbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,ybt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,bbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?zb(p):jb(p),C=S?S[w][y-1]:null;return f.jsx(gbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(vbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=gv(s,a.onMouseEnter),a.onMouseLeave=gv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function H2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),s3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),s3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function wbt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),H={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},q=Hn(Hn({},H),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},H),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:H2(t?q:Y)});var G=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[H2(q),H2(Y)]})}var Sbt=R.memo(wbt);function kbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var Cbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Ebt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Nbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Ebt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=s&&r=i&&s-1},k1t=function(e,n){var t=this.__data__,r=gb(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Zf(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var d=-1,p=!0,m=2&t?new ovt:void 0;for(i.set(e,n),i.set(n,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},vr={};vr["[object Float32Array]"]=vr["[object Float64Array]"]=vr["[object Int8Array]"]=vr["[object Int16Array]"]=vr["[object Int32Array]"]=vr["[object Uint8Array]"]=vr["[object Uint8ClampedArray]"]=vr["[object Uint16Array]"]=vr["[object Uint32Array]"]=!0,vr["[object Arguments]"]=vr["[object Array]"]=vr["[object ArrayBuffer]"]=vr["[object Boolean]"]=vr["[object DataView]"]=vr["[object Date]"]=vr["[object Error]"]=vr["[object Function]"]=vr["[object Map]"]=vr["[object Number]"]=vr["[object Object]"]=vr["[object RegExp]"]=vr["[object Set]"]=vr["[object String]"]=vr["[object WeakMap]"]=!1;var Svt=function(e){return Gh(e)&&K6(e.length)&&!!vr[d_(e)]},kvt=function(e){return function(n){return e(n)}},Iz=rm((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&jI.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),Bz=Iz&&Iz.isTypedArray,Q6=Bz?kvt(Bz):Svt,Cvt=Object.prototype.hasOwnProperty,Evt=function(e,n){var t=Zi(e),r=!t&&xb(e),s=!t&&!r&&pv(e),i=!t&&!r&&!s&&Q6(e),a=t||r||s||i,o=a?vvt(e.length,String):[],l=o.length;for(var u in e)!Cvt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LI(u,l))||o.push(u);return o},Nvt=Object.prototype,OI=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Nvt)},zvt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),jvt=Object.prototype.hasOwnProperty,II=function(e){if(!OI(e))return zvt(e);var n=[];for(var t in Object(e))jvt.call(e,t)&&t!="constructor"&&n.push(t);return n},wb=function(e){return e!=null&&K6(e.length)&&!AI(e)},Y6=function(e){return wb(e)?Evt(e):II(e)},$z=function(e){return hvt(e,Y6,gvt)},Tvt=Object.prototype.hasOwnProperty,Avt=function(e,n,t,r,s,i){var a=1&t,o=$z(e),l=o.length;if(l!=$z(n).length&&!a)return!1;for(var u=l;u--;){var _=o[u];if(!(a?_ in n:Tvt.call(n,_)))return!1}var d=i.get(e),p=i.get(n);if(d&&p)return d==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=kn(e,1)[0];return n.type==="text"&&!n.value}return!0}function bbt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=_u(e,gbt),a=s?function(o,l){return s(o,Uz,l)}:Uz;return f.jsx("td",Hn(Hn({},i),{},{"data-change-key":n,children:r?vbt(r)?" ":r.map(a):t||" "}))}var GI=R.memo(bbt);function WI(e,n){return function(){var t=n==="old"?Nb(e):zb(e);return t===-1?void 0:t}}function VI(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function mv(e,n){return n?function(t){e(),n(t)}:e}function Gz(e,n,t,r){return R.useMemo((function(){var s=UI(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=mv(t,s.onMouseEnter),s.onMouseLeave=mv(r,s.onMouseLeave),s}),[e,t,r,n])}function Wz(e,n,t,r,s,i,a,o,l){var u={change:n,side:r,inHoverState:o,renderDefault:WI(n,r),wrapInAnchor:VI(s,i)};return f.jsx("td",Hn(Hn({className:e},a),{},{"data-change-key":t,children:l(u)}))}function ybt(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,l=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,w=s.type,y=s.content,C=uu(s),E=(n=kn(R.useState(!1),2),t=n[0],r=n[1],[t,R.useCallback((function(){return r(!0)}),[]),R.useCallback((function(){return r(!1)}),[])]),N=kn(E,3),T=N[0],j=N[1],M=N[2],O=R.useMemo((function(){return{change:s}}),[s]),B=Gz(d,O,j,M),$=Gz(p,O,j,M),H=S(s),q=l({changes:[s],defaultGenerate:function(){return o}}),Y=Ui("diff-gutter","diff-gutter-".concat(w),u,{"diff-gutter-selected":i}),G=Ui("diff-code","diff-code-".concat(w),_,{"diff-code-selected":i});return f.jsxs("tr",{id:H,className:Ui("diff-line",q),children:[!m&&Wz(Y,s,C,"old",x,H,B,T,b),!m&&Wz(Y,s,C,"new",x,H,B,T,b),f.jsx(GI,Hn({className:G,changeKey:C,text:y,tokens:a,renderToken:v},$))]})}var xbt=R.memo(ybt);function wbt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var Sbt=["hideGutter","selectedChanges","tokens","lineClassName"],kbt=["hunk","widgets","className"];function Cbt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,kbt),i=(function(a,o){return a.reduce((function(l,u){var _=uu(u);l.push(["change",_,u]);var d=o[_];return d&&l.push(["widget",_,d]),l}),[])})(n.changes,t);return f.jsx("tbody",{className:Ui("diff-hunk",r),children:i.map((function(a){return(function(o,l){var u=kn(o,3),_=u[0],d=u[1],p=u[2],m=l.hideGutter,x=l.selectedChanges,S=l.tokens,v=l.lineClassName,b=_u(l,Sbt);if(_==="change"){var w=Ki(p)?"old":"new",y=Ki(p)?Nb(p):zb(p),C=S?S[w][y-1]:null;return f.jsx(xbt,Hn({className:v,change:p,hideGutter:m,selected:x.includes(d),tokens:C},b),"change".concat(d))}return _==="widget"?f.jsx(wbt,{hideGutter:m,element:p},"widget".concat(d)):null})(a,s)}))})}var KI=0;function Hg(e,n,t,r){var s=R.useCallback((function(){return n(e)}),[e,n]),i=R.useCallback((function(){return n("")}),[n]);return R.useMemo((function(){var a=UI(r,(function(o){return function(l){return o&&o({side:e,change:t},l)}}));return a.onMouseEnter=mv(s,a.onMouseEnter),a.onMouseLeave=mv(i,a.onMouseLeave),a}),[t,r,s,e,i])}function F2(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,l=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,d=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var v=Ui("diff-gutter","diff-gutter-omit",i),b=Ui("diff-code","diff-code-omit",a);return[!p&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var w=n.type,y=n.content,C=uu(n),E=t===KI?"old":"new",N=Hn({id:u||void 0,className:Ui("diff-gutter","diff-gutter-".concat(w),s3({"diff-gutter-selected":r},"diff-line-hover-"+E,m),i),children:S({change:n,side:E,inHoverState:m,renderDefault:WI(n,E),wrapInAnchor:VI(_,d)})},o),T=Ui("diff-code","diff-code-".concat(w),s3({"diff-code-selected":r},"diff-line-hover-"+E,m),a);return[!p&&f.jsx("td",Hn(Hn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(GI,Hn({className:T,changeKey:C,text:y,tokens:s,renderToken:x},l),"code")]}function Ebt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,l=e.monotonous,u=e.gutterClassName,_=e.codeClassName,d=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,w=e.renderGutter,y=kn(R.useState(""),2),C=y[0],E=y[1],N=Hg("old",E,t,d),T=Hg("new",E,r,d),j=Hg("old",E,t,p),M=Hg("new",E,r,p),O=t&&x(t),B=r&&x(r),$=S({changes:[t,r],defaultGenerate:function(){return n}}),H={monotonous:l,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:d,codeEvents:p,renderToken:b,renderGutter:w},q=Hn(Hn({},H),{},{change:t,side:KI,selected:s,tokens:a,gutterEvents:N,codeEvents:j,anchorID:O,gutterAnchor:v,gutterAnchorTarget:O,hover:C==="old"}),Y=Hn(Hn({},H),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:T,codeEvents:M,anchorID:t===r?null:B,gutterAnchor:v,gutterAnchorTarget:t===r?O:B,hover:C==="new"});if(l)return f.jsx("tr",{className:Ui("diff-line",$),children:F2(t?q:Y)});var G=(function(X,te){return X&&!te?"diff-line-old-only":!X&&te?"diff-line-new-only":X===te?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:Ui("diff-line",G,$),children:[F2(q),F2(Y)]})}var Nbt=R.memo(Ebt);function zbt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var jbt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],Tbt=["hunk","widgets","className"];function qg(e,n){return(e?uu(e):"00")+(n?uu(n):"00")}function Abt(e){var n=e.hunk,t=e.widgets,r=e.className,s=_u(e,Tbt),i=(function(a,o){for(var l=function(b){if(!b)return null;var w=uu(b);return o[w]||null},u=[],_=0;_=(i==null?void 0:i.value.length))return[e];var o=function(d,p){var m=i.value.slice(d,p);return[].concat(Vi(s),[Hn(Hn({},i),{},{value:m})])};if(n>0){var l=o(0,n);a.push(sh(l))}var u=o(Math.max(n,0),t);if(a.push(r?(function(d,p){return[p].concat(Vi(sh(d)))})(u,r):sh(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=_u(e,Vbt);t.push(s);var i,a=W6(r);try{for(a.s();!(i=a.n()).done;)ZI(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(sh([].concat(Vi(t.slice(1)),[e])));return n}function Kbt(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(l){var u=tS(l);return u.value.includes(` +`)})(n.oldSource,e),r=n.highlight?function(l){return n.refractor.highlight(l,n.language)}:function(l){return[{type:"text",value:l}]};return[Ug(r(n.oldSource)),Ug(r(t))]}var s=kn(Wbt(e),2),i=s[0],a=s[1],o=n.highlight?function(l){return Ug(n.refractor.highlight(l,n.language))}:function(l){return Ug([{type:"text",value:l}])};return[o(i),o(a)]}function sh(e){return e.map((function(n){return Hn({},n)}))}function Kbt(e,n){return[].concat(Vi(sh(e.slice(0,-1))),[n])}function Qbt(e){return e.type==="text"}function tS(e){var n=e[e.length-1];if(Qbt(n))return n;throw new Error("Invalid token path with leaf of type ".concat(n.type))}function Ybt(e,n,t,r){var s=e.slice(0,-1),i=tS(e),a=[];if(t<=0||n>=(i==null?void 0:i.value.length))return[e];var o=function(d,p){var m=i.value.slice(d,p);return[].concat(Vi(s),[Hn(Hn({},i),{},{value:m})])};if(n>0){var l=o(0,n);a.push(sh(l))}var u=o(Math.max(n,0),t);if(a.push(r?(function(d,p){return[p].concat(Vi(sh(d)))})(u,r):sh(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=_u(e,Xbt);t.push(s);var i,a=W6(r);try{for(a.s();!(i=a.n()).done;)ZI(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(sh([].concat(Vi(t.slice(1)),[e])));return n}function Zbt(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(l){var u=tS(l);return u.value.includes(` `)?u.value.split(` -`).map((function(_){return Ubt(l,Hn(Hn({},u),{},{value:_}))})):[l]})(t),i=xI(s),a=i[0],o=i.slice(1);return[].concat(Vi(n.slice(0,-1)),[[].concat(Vi(r),[a])],Vi(o.map((function(l){return[l]}))))}),[[]])}function Qz(e){return Kbt(ZI(e))}var Qbt=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?kb(e,n,void 0,t):!!r},Ybt=function(e,n){return kb(e,n)},Xbt=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function Zbt(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=Xbt(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&Qbt(t,r,(function(i,a,o){return o==="chlidren"||Ybt(i,a)}))))?e.children[e.children.length-1]=(function(i,a){return"value"in i&&"value"in a?Hn(Hn({},i),{},{value:"".concat(i.value).concat(a.value)}):i})(s,n):e.children.push(n),e.children[e.children.length-1]}function Yz(e){var n,t={type:"root",children:[]},r=W6(e);try{var s=function(){var i=n.value;i.reduce((function(a,o,l){return Zbt(a,l===i.length-1?Hn({},o):Hn(Hn({},o),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(i){r.e(i)}finally{r.f()}return t}var Jbt=Object.prototype.hasOwnProperty,eyt=YI((function(e,n,t){Jbt.call(e,t)?e[t].push(n):J6(e,t,[n])})),tyt=Object.prototype.hasOwnProperty,nyt=function(e){if(e==null)return!0;if(Sb(e)&&(Zi(e)||typeof e=="string"||typeof e.splice=="function"||mv(e)||Q6(e)||wb(e)))return!e.length;var n=f3(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(OI(e))return!II(e).length;for(var t in e)if(tyt.call(e,t))return!1;return!0},ryt=function(e,n){var t=n.start,r=n.length,s=t+r,i=e.reduce((function(a,o){var l=kn(a,2),u=l[0],_=l[1],d=_+tS(o).value.length;if(_>s||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(j=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=l+T,O=(j=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(j=i-j))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;ps||dr.length?t:r,l=t.length>r.length?r:t,u=o.indexOf(l);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,l),new n.Diff(1,o.substring(u+l.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(l.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var d=_[0],p=_[1],m=_[2],x=_[3],S=_[4],v=this.diff_main(d,m,s,i),b=this.diff_main(p,x,s,i);return v.concat([new n.Diff(0,S)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var l=0,u=0,_=0,d="",p="";l=1&&_>=1){o.splice(l-u-_,u+_),l=l-u-_;for(var m=this.diff_main(d,p,!1,s),x=m.length-1;x>=0;x--)o.splice(l,0,m[x]);l+=m.length}_=0,u=0,d="",p=""}l++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),l=o,u=2*o,_=new Array(u),d=new Array(u),p=0;ps);y++){for(var C=-y+S;C<=y-v;C+=2){for(var E=l+C,N=(B=C==-y||C!=y&&_[E-1]<_[E+1]?_[E+1]:_[E-1]+1)-C;Bi)v+=2;else if(N>a)S+=2;else if(x&&(M=l+m-C)>=0&&M=(j=i-d[M]))return this.diff_bisectSplit_(t,r,B,N,s)}for(var T=-y+b;T<=y-w;T+=2){for(var j,M=l+T,O=(j=T==-y||T!=y&&d[M-1]i)w+=2;else if(O>a)b+=2;else if(!x&&(E=l+m-T)>=0&&E=(j=i-j))return this.diff_bisectSplit_(t,r,B,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),l=r.substring(0,i),u=t.substring(s),_=r.substring(i),d=this.diff_main(o,l,!1,a),p=this.diff_main(u,_,!1,a);return d.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",d=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=S.length?[w,y,C,E,j]:null}var l,u,_,d,p,m=o(s,i,Math.ceil(s.length/4)),x=o(s,i,Math.ceil(s.length/2));return m||x?(l=x?m&&m[4].length>x[4].length?m:x:m,t.length>r.length?(u=l[0],_=l[1],d=l[2],p=l[3]):(d=l[0],p=l[1],u=l[2],_=l[3]),[u,_,d,p,l[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=0,u=0,_=0,d=0;o0?s[i-1]:-1,l=0,u=0,_=0,d=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=S?(x>=p.length/2||x>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,x))),t[o-1][1]=p.substring(0,p.length-x),t[o+1][1]=m.substring(x),o++):(S>=p.length/2||S>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,S))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-S),t[o+1][0]=-1,t[o+1][1]=p.substring(S),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(S,v){if(!S||!v)return 6;var b=S.charAt(S.length-1),w=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=w.match(n.nonAlphaNumericRegex_),E=y&&b.match(n.whitespaceRegex_),N=C&&w.match(n.whitespaceRegex_),T=E&&b.match(n.linebreakRegex_),j=N&&w.match(n.linebreakRegex_),M=T&&S.match(n.blanklineEndRegex_),O=j&&v.match(n.blanklineStartRegex_);return M||O?5:T||j?4:y&&!E&&N?3:E||N?2:y||C?1:0}for(var s=1;s=m&&(m=x,_=i,d=a,p=o)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=d,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,l=!1,u=!1,_=!1,d=!1;o0?s[i-1]:-1,_=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",l="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(l,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=l.substring(0,r):(t.splice(0,0,new n.Diff(0,l.substring(0,r))),s++),l=l.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(l,o))!==0&&(t[s][1]=l.substring(l.length-r)+t[s][1],l=l.substring(0,l.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),l.length&&(t.splice(s,0,new n.Diff(1,l)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",l=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,l=a;return t.length!=s&&t[s][0]===-1?l:l+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,l=0;l");switch(u){case 1:r[l]=''+_+"";break;case-1:r[l]=''+_+"";break;case 0:r[l]=""+_+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(N,T){var j=N/r.length,M=Math.abs(s-T);return a.Match_Distance?j+M/a.Match_Distance:M?1:j}var l=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(l=Math.min(o(0,u),l),(u=t.lastIndexOf(r,s+r.length))!=-1&&(l=Math.min(o(0,u),l)));var _,d,p=1<=v;y--){var C=i[t.charAt(y-1)];if(w[y]=S===0?(w[y+1]<<1|1)&C:(w[y+1]<<1|1)&C|(m[y+1]|m[y])<<1|1|m[y+1],w[y]&p){var E=o(S,y-1);if(E<=l){if(l=E,!((u=y-1)>s))break;v=Math.max(1,2*s-u)}}}if(o(S+1,s)>l)break;m=w}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],l=new n.patch_obj,u=0,_=0,d=0,p=i,m=i,x=0;x=2*this.Patch_Margin&&u&&(this.patch_addContext_(l,p),o.push(l),l=new n.patch_obj,u=0,p=m,_=d)}S!==1&&(_+=v.length),S!==-1&&(d+=v.length)}return u&&(this.patch_addContext_(l,p),o.push(l)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(l=this.match_main(r,d.substring(0,this.Match_MaxBits),_))!=-1&&((p=this.match_main(r,d.substring(d.length-this.Match_MaxBits),_+d.length-this.Match_MaxBits))==-1||l>=p)&&(l=-1):l=this.match_main(r,d,_),l==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=l-_,d==(u=p==-1?r.substring(l,l+d.length):r.substring(l,p+this.Match_MaxBits)))r=r.substring(0,l)+this.diff_text2(t[o].diffs)+r.substring(l+d.length);else{var m=this.diff_main(d,u,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(m)/d.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var x,S=0,v=0;vo[0][1].length){var l=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=l,a.start2-=l,a.length1+=l,a.length2+=l}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(l=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,l),a.length1+=l,a.length2+=l),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,_=!1,u.diffs.push(new n.Diff(d,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,d===0?(u.length2+=p.length,o+=p.length):_=!1,u.diffs.push(new n.Diff(d,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(u.diffs)).substring(l.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),_||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?cyt:uyt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return syt(Zz(i),Zz(a))}var fyt=["enhancers"],nj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(qbt(e,_u(t,fyt)),2),a=i[0],o=i[1],l=[Qz(a),Qz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Yz),p.map(Yz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Ab.displayName="cpp";Ab.aliases=[];function Ab(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(Ab),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,U){return"(?:"+F[+U]+")"})}function r(L,F,W){return RegExp(t(L,F),"")}function s(L,F){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var q=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,q]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,q]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,q]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +`:"")+_.content]}),["",""]),t=kn(n,2),r=kn(eB(t[0],t[1]),2),s=r[0],i=r[1];if(s.length===0&&i.length===0)return[[],[]];var a=function(u){if(u&&!Hl(u))return u.lineNumber},o=a(e.find(Ki)),l=a(e.find(ku));if(o===void 0||l===void 0)throw new Error("Could not find start line number for edit");return[nj(tj(s),o),nj(tj(i),l)]}function _yt(e){var n=e.reduce((function(r,s){var i=kn(r,3),a=i[0],o=i[1],l=i[2];if(!l||!Ki(l)||!ku(s))return[a,o,s];var u=kn(eB(l.content,s.content),2),_=u[0],d=u[1];return[a.concat(h3(_,l.lineNumber)),o.concat(h3(d,s.lineNumber)),s]}),[[],[],null]),t=kn(n,2);return[t[0],t[1]]}function pyt(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?hyt:_yt,r=eS(e.map((function(o){return o.changes})),JI).map(t).reduce((function(o,l){var u=kn(o,2),_=u[0],d=u[1],p=kn(l,2),m=p[0],x=p[1];return[_.concat(m),d.concat(x)]}),[[],[]]),s=kn(r,2),i=s[0],a=s[1];return lyt(Jz(i),Jz(a))}var myt=["enhancers"],rj=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=kn(Vbt(e,_u(t,myt)),2),a=i[0],o=i[1],l=[Yz(a),Yz(o)],u=(n=[l[0],l[1]],s.reduce((function(S,v){return v(S)}),n)),_=kn(u,2),d=_[0],p=_[1],m=[d.map(Xz),p.map(Xz)],x=m[1];return{old:m[0].map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]})),new:x.map((function(S){var v;return(v=S.children)!==null&&v!==void 0?v:[]}))}};Go.displayName="clike";Go.aliases=[];function Go(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}sm.displayName="c";sm.aliases=[];function sm(e){e.register(Go),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Tb.displayName="cpp";Tb.aliases=[];function Tb(e){e.register(sm),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}nS.displayName="arduino";nS.aliases=["ino"];function nS(e){e.register(Tb),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}rS.displayName="bash";rS.aliases=["sh","shell"];function rS(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(W,U){return"(?:"+F[+U]+")"})}function r(L,F,W){return RegExp(t(L,F),"")}function s(L,F){for(var W=0;W>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),l=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),d=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,d]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,v]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,p,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,S,v]),E={keyword:l,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,T=/"(?:\\.|[^\\"\r\n])*"/.source,j=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[j]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:E},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:E},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:E},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:E},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:E}],keyword:l,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:E},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:E,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:E,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,d]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(d),alias:"class-name",inside:E}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,l.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:l,"class-name":{pattern:RegExp(C),greedy:!0,inside:E},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=T+"|"+N,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),B=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),$=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,B]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[$,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[$]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[B]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var q=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),G=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,q]),X=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),te=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,q]);function I(L,F){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[F,q]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:I(G,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[te]),lookbehind:!0,greedy:!0,inside:I(te,X)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}im.displayName="markup";im.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function im(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}f_.displayName="css";f_.aliases=[];function f_(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}iS.displayName="diff";iS.aliases=[];function iS(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}aS.displayName="go";aS.aliases=[];function aS(e){e.register(Go),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Mb.displayName="markup-templating";Mb.aliases=[];function Mb(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Mb),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Rb),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Db.displayName="basic";Db.aliases=[];function Db(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Db),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let hyt=0;const Kt=tf(),ts=tf(),_3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++hyt}const p3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:_3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),q2=Object.keys(p3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),rj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&vyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(sj,yyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!sj.test(i)){let a=i.replace(gyt,byt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function byt(e){return"-"+e.toLowerCase()}function yyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,_yt,iB,aB,oB],"html"),Lb=tB([nB,pyt,iB,aB,oB],"svg");function ij(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function xyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const aj=/[#.]/g;function wyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Ayt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Ryt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function uj(e){return Ryt(e)||fB(e)}const dj=document.createElement("i");function pp(e){const n="&"+e+";";dj.innerHTML=n;const t=dj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Myt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Dyt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const H=e.charCodeAt(C);H===88||H===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?uj:E==="decimal"?fB:Ayt;for(C--;++C<=e.length;){const H=e.charCodeAt(C);if(!M(H))break;j+=String.fromCharCode(H),E==="named"&&Tyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const H=E==="named"?pp(j):!1;H&&(N=j,T=H)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const H=N?1:3;if(t.attribute){const q=e.charCodeAt(C);q===61?(S(H,B),T=""):uj(q)?T="":S(H,B)}else S(H,B)}$=T}else{O||S(2,B);let H=Number.parseInt(j,E==="hexadecimal"?16:10);if(Lyt(H))S(7,B),$="�";else if(H in cj)S(6,B),$=cj[H];else{let q="";Oyt(H)&&S(6,B),H>65535&&(H-=65536,q+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),$=q+String.fromCharCode(H)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const H=x();H.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:H},e.slice(w-1,C)),p=H}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Myt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Lyt(e){return e>=55296&&e<=57343||e>1114111}function Oyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Iyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Iyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Byt;return R1(s,s.head,e),hB(e,s,n,s.head,0),Pyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function fj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=fj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var H=v.prev;O&&(H=R1(n,H,O),b+=O.length),$yt(n,H,y);var q=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=R1(n,H,q),B&&R1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Byt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function R1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function $yt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Yyt=2e3,Xyt={highlight(e,n){return Tt.highlight(e,n).children}};function Zyt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Ob(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function Jyt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function y3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function ext(e){const n=[dyt(e.hunks,{type:"line"})],t=AS(Jyt(e));return t&&Tt.registered(t)?nj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Xyt}):nj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:a3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:a3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const txt=({change:e,side:n})=>n==="old"?null:Zyt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Ob(e),[e]),a=t&&s+i<=Yyt,o=R.useMemo(()=>{if(a)try{return ext(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:y3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Mbt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:txt,tokens:o,viewType:"unified"})}))]})}function nxt({files:e,className:n}){return f.jsx("div",{className:n?`${b3} ${n}`:b3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function rxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Ob(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?BD():ID({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(nxt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:rxt(m.file)}),f.jsx("code",{title:y3(m.file),children:y3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${b3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function sxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=s1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():M4(),w=[{id:"files",label:N4(),Icon:Dd,onClick:d},{id:"artifacts",label:gD(),Icon:D6,onClick:p},{id:"experiments",label:vD(),Icon:_b,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":z2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:z2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Hct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Wct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),N4()]})}),l&&f.jsx(ixt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ob,{tone:"success",live:!0})}),f.jsx("span",{children:Bct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":z2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function ixt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({...pv(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Ob).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??u6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:ND()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?BD():ID({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function axt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function hj(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const oxt=(e,n)=>Math.abs(e-n)<1.01,lxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const U2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},_j=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},cxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(_j(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(_j(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},vv={passive:!0},dxt=typeof window>"u"?!0:"onscrollend"in window,fxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&dxt;let a=0;const o=i?null:lxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,vv),i&&r.addEventListener("scrollend",_,vv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},hxt=(e,n)=>fxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),_xt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},pxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},mxt=pxt;class gxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:cxt,rangeExtractor:yB,onChange:()=>{},measureElement:_xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!U2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,vv),i.addEventListener("touchend",o,vv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(U2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let H=1;Hthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=bxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>hj(r[o]).start,t);return hj(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(U2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&oxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function vxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function bxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=vxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const G2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function yxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new gxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),G2(()=>u._didMount(),[]),G2(()=>(a(u),u._willUpdate())),G2(()=>{o(u)}),u}function xxt(e){return yxt({observeElementRect:uxt,observeElementOffset:hxt,scrollToFn:mxt,...e})}function wxt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Sxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function kxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Sxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function Cxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Ext(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Nxt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function x3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function zxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function jxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Txt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Axt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function pj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Rxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}oS.displayName="ini";oS.aliases=[];function oS(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}lS.displayName="java";lS.aliases=[];function lS(e){e.register(Go),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}cS.displayName="regex";cS.aliases=[];function cS(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}uS.displayName="json";uS.aliases=["webmanifest"];function uS(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}dS.displayName="kotlin";dS.aliases=["kt","kts"];function dS(e){e.register(Go),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}fS.displayName="less";fS.aliases=[];function fS(e){e.register(f_),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}hS.displayName="lua";hS.aliases=[];function hS(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}_S.displayName="makefile";_S.aliases=[];function _S(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}pS.displayName="yaml";pS.aliases=["yml"];function pS(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(l,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return l});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}mS.displayName="markdown";mS.aliases=["md"];function mS(e){e.register(im),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(l){o!==l&&(n.languages.markdown[o].inside.content.inside[l]=n.languages.markdown[l])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function l(u){if(!(!u||typeof u=="string"))for(var _=0,d=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}vS.displayName="perl";vS.aliases=[];function vS(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Rb.displayName="markup-templating";Rb.aliases=[];function Rb(e){e.register(im),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(l){if(typeof a=="function"&&!a(l))return l;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=l,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(l){for(var u=0;u=a.length);u++){var _=l[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var d=a[i],p=r.tokenStack[d],m=typeof _=="string"?_:_.content,x=t(s,d),S=m.indexOf(x);if(S>-1){++i;var v=m.substring(0,S),b=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),w=m.substring(S+x.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),w&&y.push.apply(y,o([w])),typeof _=="string"?l.splice.apply(l,[u,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return l}o(r.tokens)}}})})(e)}bS.displayName="php";bS.aliases=[];function bS(e){e.register(Rb),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}yS.displayName="python";yS.aliases=["py"];function yS(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}xS.displayName="r";xS.aliases=[];function xS(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}wS.displayName="ruby";wS.aliases=["rb"];function wS(e){e.register(Go),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}SS.displayName="rust";SS.aliases=[];function SS(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}kS.displayName="sass";kS.aliases=[];function kS(e){e.register(f_),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}CS.displayName="scss";CS.aliases=[];function CS(e){e.register(f_),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}ES.displayName="sql";ES.aliases=[];function ES(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}NS.displayName="swift";NS.aliases=[];function NS(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}zS.displayName="typescript";zS.aliases=["ts"];function zS(e){e.register(Ab),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Mb.displayName="basic";Mb.aliases=[];function Mb(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}jS.displayName="vbnet";jS.aliases=[];function jS(e){e.register(Mb),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}class am{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}am.prototype.normal={};am.prototype.property={};am.prototype.space=void 0;function tB(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new am(t,r,n)}function _p(e){return e.toLowerCase()}class Ni{constructor(n,t){this.attribute=t,this.property=n}}Ni.prototype.attribute="";Ni.prototype.booleanish=!1;Ni.prototype.boolean=!1;Ni.prototype.commaOrSpaceSeparated=!1;Ni.prototype.commaSeparated=!1;Ni.prototype.defined=!1;Ni.prototype.mustUseProperty=!1;Ni.prototype.number=!1;Ni.prototype.overloadedBoolean=!1;Ni.prototype.property="";Ni.prototype.spaceSeparated=!1;Ni.prototype.space=void 0;let gyt=0;const Kt=tf(),ts=tf(),_3=tf(),Qe=tf(),ar=tf(),Ed=tf(),Pi=tf();function tf(){return 2**++gyt}const p3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Kt,booleanish:ts,commaOrSpaceSeparated:Pi,commaSeparated:Ed,number:Qe,overloadedBoolean:_3,spaceSeparated:ar},Symbol.toStringTag,{value:"Module"})),H2=Object.keys(p3);class TS extends Ni{constructor(n,t,r,s){let i=-1;if(super(n,t),sj(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&wyt.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(ij,kyt);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!ij.test(i)){let a=i.replace(xyt,Syt);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=TS}return new s(r,n)}function Syt(e){return"-"+e.toLowerCase()}function kyt(e){return e.charAt(1).toUpperCase()}const cB=tB([nB,vyt,iB,aB,oB],"html"),Db=tB([nB,byt,iB,aB,oB],"svg");function aj(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function Cyt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const oj=/[#.]/g;function Eyt(e,n){const t=e||"",r={};let s=0,i,a;for(;s=48&&n<=57}function Lyt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Oyt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function dj(e){return Oyt(e)||fB(e)}const fj=document.createElement("i");function pp(e){const n="&"+e+";";fj.innerHTML=n;const t=fj.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Iyt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Byt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",l,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,l=t.position.start):l=t.position);let _=(l?l.line:0)||1,d=(l?l.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(d=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(m),d++;continue}const w=i+1;let y=w,C=w,E;if(b===35){C=++y;const H=e.charCodeAt(C);H===88||H===120?(E="hexadecimal",C=++y):E="decimal"}else E="named";let N="",T="",j="";const M=E==="named"?dj:E==="decimal"?fB:Lyt;for(C--;++C<=e.length;){const H=e.charCodeAt(C);if(!M(H))break;j+=String.fromCharCode(H),E==="named"&&Dyt.includes(j)&&(N=j,T=pp(j))}let O=e.charCodeAt(C)===59;if(O){C++;const H=E==="named"?pp(j):!1;H&&(N=j,T=H)}let B=1+C-w,$="";if(!(!O&&t.nonTerminated===!1))if(!j)E!=="named"&&S(4,B);else if(E==="named"){if(O&&!T)S(5,1);else if(N!==j&&(C=y+N.length,B=1+C-y,O=!1),!O){const H=N?1:3;if(t.attribute){const q=e.charCodeAt(C);q===61?(S(H,B),T=""):dj(q)?T="":S(H,B)}else S(H,B)}$=T}else{O||S(2,B);let H=Number.parseInt(j,E==="hexadecimal"?16:10);if($yt(H))S(7,B),$="�";else if(H in uj)S(6,B),$=uj[H];else{let q="";Pyt(H)&&S(6,B),H>65535&&(H-=65536,q+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),$=q+String.fromCharCode(H)}}if($){v(),p=x(),i=C-1,d+=C-w+1,s.push($);const H=x();H.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,$,{start:p,end:H},e.slice(w-1,C)),p=H}else j=e.slice(w-1,C),o+=j,d+=j.length,i=C-1}else m===10&&(_++,a++,d=0),Number.isNaN(m)?v():(o+=String.fromCharCode(m),d++);return s.join("");function x(){return{line:_,column:d,offset:i+((l?l.offset:0)||0)}}function S(b,w){let y;t.warning&&(y=x(),y.column+=w,y.offset+=w,t.warning.call(t.warningContext||void 0,Iyt[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function $yt(e){return e>=55296&&e<=57343||e>1114111}function Pyt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Fyt=0,Gg={},Ss={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Fyt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Ss.util.type(n)){case"Object":if(s=Ss.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Ss.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:Gg,plaintext:Gg,text:Gg,txt:Gg,extend:function(e,n){var t=Ss.util.clone(Ss.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Ss.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var l=r[e];return r[e]=i,Ss.languages.DFS(Ss.languages,function(u,_){_===l&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Ss.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],l=Ss.util.type(o);l==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):l==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Ss.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Ss.tokenize(r.code,r.grammar),Ss.hooks.run("after-tokenize",r),$0.stringify(Ss.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Hyt;return A1(s,s.head,e),hB(e,s,n,s.head,0),Uyt(s)},hooks:{all:{},add:function(e,n){var t=Ss.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Ss.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:$0};function $0(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function hj(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function hB(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var l=0;l=i.reach);b+=v.value.length,v=v.next){var w=v.value;if(n.length>e.length)return;if(!(w instanceof $0)){var y=1,C;if(p){if(C=hj(S,b,e,d),!C||C.index>=e.length)break;var j=C.index,E=C.index+C[0].length,N=b;for(N+=v.value.length;j>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof $0)continue;for(var T=v;T!==n.tail&&(Ni.reach&&(i.reach=$);var H=v.prev;O&&(H=A1(n,H,O),b+=O.length),qyt(n,H,y);var q=new $0(a,_?Ss.tokenize(M,_):M,m,M);if(v=A1(n,H,q),B&&A1(n,v,B),y>1){var Y={cause:a+","+l,reach:$};hB(e,n,t,v.prev,b,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Hyt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function A1(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function qyt(e,n,t){for(var r=n.next,s=0;s_td:first-child]:p-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[7ch]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:ps-[2ch] [&_.openresearch-diff-file_.diff-code]:pe-4","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),ext=2e3,txt={highlight(e,n){return Tt.highlight(e,n).children}};function nxt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Lb(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function rxt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function y3(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function sxt(e){const n=[pyt(e.hunks,{type:"line"})],t=AS(rxt(e));return t&&Tt.registered(t)?rj(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:txt}):rj(e.hunks,{enhancers:n,highlight:!1})}function mB(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:a3(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:a3(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const ixt=({change:e,side:n})=>n==="old"?null:nxt(e);function gB({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:uwe()}),f.jsx("p",{children:Fwe({limit:Ne(Dl(n)),read:Ne(Dl(e))})})]})}function vB({file:e,defaultExpanded:n}){const[t,r]=R.useState(n),{additions:s,deletions:i}=R.useMemo(()=>Lb(e),[e]),a=t&&s+i<=ext,o=R.useMemo(()=>{if(a)try{return sxt(e)}catch{return}},[e,a]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-medium [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(l=>!l),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Uo,{size:14}):f.jsx(Ta,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:y3(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:Ewe()}):f.jsx("div",{className:"diff-file-body min-w-0 py-3.5 bg-background",children:f.jsx(Ibt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:ixt,tokens:o,viewType:"unified"})}))]})}function axt({files:e,className:n}){return f.jsx("div",{className:n?`${b3} ${n}`:b3,children:e.map((t,r)=>f.jsx(vB,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function oxt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function bB({diff:e,partial:n=!1}){var p;const t=R.useMemo(()=>mB(e,n),[e,n]),r=t.files,s=R.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:Lb(m)})),[r]),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,d=s.find(m=>m.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?wwe():Iwe()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:vwe()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{className:"font-medium",children:n?s.length===1?Mwe():_we({count:Wt(s.length)}):s.length===1?$D():BD({count:Wt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>l(m=>!m),children:u?J2e():Gwe()})]}),u?f.jsx(axt,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":awe(),children:s.map(m=>f.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:oxt(m.file)}),f.jsx("code",{title:y3(m.file),children:y3(m.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),f.jsx("div",{className:`${b3} diff-explorer-preview min-w-0`,children:d&&f.jsx(vB,{file:d.file,defaultExpanded:!0},d.key)})]})]})}function lxt({expanded:e,experiments:n,runs:t,onOpenExperiment:r,rightOffset:s,activeView:i,projectId:a,onCompute:o,sessionId:l,busy:u,onChanges:_,onFiles:d,onArtifacts:p,onExperiments:m}){var y,C;const x=l1t(n,t,l),S=ct({...QL(a),enabled:e}),v=((y=S.data)==null?void 0:y.configuredDefaultBackend)??((C=S.data)==null?void 0:C.defaultBackend),b=v?Od[v]():S.isPending?"…":S.isError?Ya():M4(),w=[{id:"files",label:E4(),Icon:Dd,onClick:d},{id:"artifacts",label:vD(),Icon:D6,onClick:p},{id:"experiments",label:bD(),Icon:hb,onClick:m}];return f.jsx("div",{className:"workspace-tools absolute end-3.5 top-7 z-30",style:{insetInlineEnd:s},children:e?f.jsxs("nav",{"aria-label":N2(),className:"workspace-tools-card flex w-60 flex-col gap-0.5 rounded-xl border border-border bg-background px-1.5 py-2 shadow-elevated",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:N2()}),w.filter(E=>E.id!=="files").map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(or,{className:"min-h-7 py-1","data-onboarding":E==="artifacts"?"nav-artifacts":void 0,onClick:j,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(T,{size:15}),N]})},E)),f.jsx(or,{className:"py-1",onClick:o,children:f.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[f.jsxs("span",{className:"flex items-center gap-4 text-sm text-text",children:[f.jsx(WO,{size:15,className:"shrink-0"}),Wct()]}),f.jsxs("span",{className:"flex items-center gap-1.5 ps-[31px] text-menu text-subtext",children:[v&&f.jsx(u_,{kind:`${v}_job`,size:12}),f.jsx("span",{className:"wrap-anywhere",children:b})]})]})}),f.jsxs("div",{className:"mt-2 border-t border-border/50 pt-3",children:[f.jsx("h2",{className:"m-0 px-2 pt-1 pb-2 text-sm font-normal text-subtext",children:Yct()}),f.jsx(or,{className:"min-h-7 py-1",onClick:d,children:f.jsxs("span",{className:"flex items-center gap-4",children:[f.jsx(Dd,{size:15}),E4()]})}),l&&f.jsx(cxt,{sessionId:l,busy:u,onChanges:_},l),x.length>0&&f.jsxs("div",{children:[f.jsxs("h2",{className:"m-0 flex items-center gap-4 px-2 py-1 text-sm font-normal text-text",children:[f.jsx("span",{className:"flex w-[15px] shrink-0 justify-center",children:f.jsx(ab,{tone:"success",live:!0})}),f.jsx("span",{children:Hct()})]}),x.map(E=>f.jsx(or,{className:"min-h-7 py-1",onClick:()=>r(E.experiment.id,E.run.id),children:f.jsx("span",{className:"min-w-0 truncate ps-[31px] text-menu text-subtext",title:`${E.experiment.title||E.experiment.slug} · ${G6(Wi(E.run))}`,children:E.experiment.title||E.experiment.slug})},E.run.id))]})]})]}):f.jsx("nav",{"aria-label":N2(),className:"flex items-center justify-end gap-3",children:w.map(({id:E,label:N,Icon:T,onClick:j})=>f.jsx(Qt,{active:i===E,className:"text-text [&.active]:text-text","data-tip":N,"data-tip-align":E==="experiments"?"end":void 0,"aria-label":N,"aria-pressed":i===E,onClick:j,children:f.jsx(T,{size:15})},E))})})}function cxt({sessionId:e,busy:n,onChanges:t}){var l,u;const r=ct({..._v(e),refetchInterval:n?5e3:!1}),s=R.useRef(n),{refetch:i}=r;R.useEffect(()=>{s.current&&!n&&i(),s.current=n},[n,i]);const a=r.data,o=R.useMemo(()=>{if(!(a!=null&&a.diff)||a.diff.truncated)return null;const _=mB(a.diff.diff,!1);return _.failed?null:_.files.map(Lb).reduce((d,p)=>({additions:d.additions+p.additions,deletions:d.deletions+p.deletions}),{additions:0,deletions:0})},[a==null?void 0:a.diff]);return a!=null&&a.exists?f.jsxs(or,{className:"min-h-7 py-1",onClick:t,title:a.branch??u6(),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-4",children:[f.jsx(em,{size:15,className:"shrink-0"}),f.jsx("span",{children:zD()})]}),o?f.jsxs("span",{className:"flex shrink-0 gap-1 text-xs tabular-nums",children:[f.jsxs("span",{className:"text-accent-green",children:["+",Wt(o.additions)]}),f.jsxs("span",{className:"text-accent-red",children:["−",Wt(o.deletions)]})]}):f.jsx("span",{className:"shrink-0 text-xs text-subtext",children:((l=a.files)==null?void 0:l.length)===1?$D():BD({count:Wt(((u=a.files)==null?void 0:u.length)??0)})})]}):null}function uxt(e,n,t){const r=new Array(e);return new Proxy(r,{get(s,i,a){if(typeof i=="string"){const o=i.charCodeAt(0);if(o>=48&&o<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&lr[_]!==u))&&(r=o,s=n(...o),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return a.updateDeps=o=>{r=o},a}function _j(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const dxt=(e,n)=>Math.abs(e-n)<1.01,fxt=(e,n,t)=>{let r;return Object.assign(function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)},{cancel:()=>{e.clearTimeout(r)}})};let f0;const q2=()=>{if(f0!==void 0)return f0;if(typeof navigator>"u")return f0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return f0=!0;const e=navigator.maxTouchPoints;return f0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},pj=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},hxt=e=>e,yB=e=>{const n=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(r);for(let i=0;i{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(pj(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(pj(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},gv={passive:!0},pxt=typeof window>"u"?!0:"onscrollend"in window,mxt=(e,n,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const i=e.options.useScrollendEvent&&pxt;let a=0;const o=i?null:fxt(s,()=>n(a,!1),e.options.isScrollingResetDelay),l=d=>()=>{a=t(r),o==null||o(),n(a,d)},u=l(!0),_=l(!1);return r.addEventListener("scroll",u,gv),i&&r.addEventListener("scrollend",_,gv),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",_),o==null||o.cancel()}},gxt=(e,n)=>mxt(e,n,t=>{const{horizontal:r,isRtl:s}=e.options;return r?t.scrollLeft*(s&&-1||1):t.scrollTop}),vxt=(e,n,t)=>{if(t.options.useCachedMeasurements){const r=t.indexFromElement(e),s=t.options.getItemKey(r);return t.itemSizeCache.get(s)??t.options.estimateSize(r)}if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const r=t.indexFromElement(e),s=t.options.getItemKey(r),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},bxt=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:e+n,behavior:t})},yxt=bxt;class xxt{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var t,r,s;return((s=(r=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{const o=i.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);for(const[u,_]of this.elementsCache)if(_===o){this.elementsCache.delete(u);break}return}this.isIndexInRange(l)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var r,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hxt,rangeExtractor:yB,onChange:()=>{},measureElement:vxt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in t){const m=t[p];m!==void 0&&(i[p]=m)}const a=this.options;let o=null,l=null,u=!1;if(a!==void 0&&a.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=a.count,m=i.count,x=this.getMeasurements(),S=p>0?((r=x[0])==null?void 0:r.key)??a.getItemKey(0):null,v=p>0?((s=x[p-1])==null?void 0:s.key)??a.getItemKey(p-1):null;if(m!==p||p>0&&m>0&&(i.getItemKey(0)!==S||i.getItemKey(m-1)!==v)){u=!0;const y=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;y&&(o=[y.key,this.getScrollOffset()-y.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&m>p&&this.isAtEnd(a.scrollEndThreshold)&&(p===0||i.getItemKey(m-1)!==v)&&(l=C)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let _=!1,d=0;if(o&&this.scrollOffset!==null){const[p,m]=o,x=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let b=0;for(;b{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Uf(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const o=this.getScrollOffset();this.scrollDirection=a?o===i?this.scrollDirection:o{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},o=()=>{this._iosTouching=!1,!(!q2()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,gv),i.addEventListener("touchend",o,gv),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",o),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,a,o,l]=s;i!==null&&!o&&(q2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:t,maxAtWrite:r}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>r+.5&&(this._clampedAdjustment=t>s+.5?{target:t,maxAtWrite:s}:null,this._scrollToOffset(t,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),r=this.getMaxScrollOffset();if(t<0||t>r)return;if(this._iosDeferredAdjustment<0&&t>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Uf(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,r,s,i,a,o,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u}),{key:!1}),this.isIndexInRange=t=>t>=0&&t[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o,laneAssignmentMode:l,gap:u},_)=>{const d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const p=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),o===1){const b=t*2;let w=this._flatMeasurements;if(!w||w.length0&&E.set(w.subarray(0,p*2)),w=E,this._flatMeasurements=w}let y;if(p===0)y=r+s;else{const E=p-1;y=w[E*2]+w[E*2+1]+u}for(let E=p;E1){C=y;const O=x[C],B=O!==void 0?m[O]:void 0;E=B?B.end+u:r+s}else if(v===o){let O=0,B=S[0],$=x[0];for(let H=1;Hthis.options.debug}),this.calculateRange=Uf(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>t.length===0||r===0?(this.range=null,null):(this.range=Sxt(t,r,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Uf(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-i),o=Math.min(this.options.count-1,s+i);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const r=this.indexFromElement(t);if(!this.isIndexInRange(r))return;const s=this.options.getItemKey(r),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,r)=>{var s,i;if(!this.isIndexInRange(t))return;let a,o,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(t),o=u[t*2],a=u[t*2+1];else{const p=this.measurementsCache[t];if(!p)return;l=p.key,o=p.start,a=p.size}const _=this.itemSizeCache.get(l)??a,d=r-_;if(d!==0){const p=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=p?this.getTotalSize():0,x=this.getScrollOffset()+this.scrollAdjustments,v=!this.itemSizeCache.has(l)?o[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,a=xB(0,r.length-1,i?o=>s[o*2]:o=>_j(r[o]).start,t);return _j(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(r==="auto")if(a.end>=i+s-this.options.scrollPaddingEnd)r="end";else if(a.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,a.size),r]},this.scrollToOffset=(t,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(t,r),a=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,r);if(!i)return;const[a,o]=i,l=this.now();this.scrollState={index:t,align:o,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,a=this._flatMeasurements;a!=null?s=a[i*2]+a[i*2+1]:s=((t=r[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=t+(r??0),this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){if(n===0)return!1;if(q2()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=n,!1;{const r=this.getScrollOffset()+this.scrollAdjustments+n,s=this.scrollElement,i=s!==null&&("scrollHeight"in s||"document"in s)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&r>i+.5?{target:r,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,i=1,a=s!==this.scrollState.lastTargetOffset;if(!a&&dxt(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const o=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>o;this.scrollState.lastTargetOffset=s,u||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const xB=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(ir)n=s-1;else return s}return e>0?e-1:0};function wxt(e,n,t){let r=0;for(;r<=n;){const s=(r+n)/2|0,i=e[s*2];if(it)n=s-1;else return s}return r>0?r-1:0}function Sxt(e,n,t,r,s){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&s!==null){const u=wxt(s,i,t);let _=u;const d=t+n;for(;_e[u].start,t),l=o;if(r===1)for(;l1){const u=Array(r).fill(0);for(;ld=0&&_.some(d=>d>=t);){const d=e[o];_[d.lane]=d.start,o--}o=Math.max(0,o-o%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:o,endIndex:l}}const U2=typeof document<"u"?R.useLayoutEffect:R.useEffect;function kxt({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...r}){const s=R.useReducer(_=>_+1,0)[1],i=R.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const a=_=>{const d=i.current;if(!d.enabled||!d.container)return;const p=_.getTotalSize();if(p!==d.lastSize){d.lastSize=p;const m=_.options.horizontal?"width":"height";d.container.style[m]=`${p}px`}},o=_=>{const d=i.current;if(!d.enabled||!d.container)return;a(_);const p=!!_.options.horizontal,m=d.mode==="transform",x=p?"left":"top",S=_.options.scrollMargin,v=_.getVirtualItems();for(const b of v){const w=b.start-S,y=_.elementsCache.get(b.key);y&&d.lastPositions.get(y)!==w&&(d.lastPositions.set(y,w),m?y.style.transform=p?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:y.style[x]=`${w}px`)}},l={...r,onChange:(_,d)=>{var p;const m=i.current;let x=!0;if(m.enabled){o(_);const S=_.range,v=m.prevRange;x=!v||v.isScrolling!==_.isScrolling||v.startIndex!==(S==null?void 0:S.startIndex)||v.endIndex!==(S==null?void 0:S.endIndex),x&&(m.prevRange=S?{startIndex:S.startIndex,endIndex:S.endIndex,isScrolling:_.isScrolling}:null)}x&&(e&&d?ro.flushSync(s):s()),(p=r.onChange)==null||p.call(r,_,d)}},[u]=R.useState(()=>{const _=new xxt(l);return Object.assign(_,{containerRef:d=>{const p=i.current;if(p.container=d,p.lastSize=null,d&&p.enabled){const m=_.getTotalSize();p.lastSize=m;const x=_.options.horizontal?"width":"height";d.style[x]=`${m}px`}}})});return u.setOptions(l),U2(()=>u._didMount(),[]),U2(()=>(a(u),u._willUpdate())),U2(()=>{o(u)}),u}function Cxt(e){return kxt({observeElementRect:_xt,observeElementOffset:gxt,scrollToFn:yxt,...e})}function Ext(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Nxt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function zxt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,d=a.get(_);d?d.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),l=new Map;for(const u of t){const _=Nxt(u,i,a),d=_.findIndex(p=>o.has(p.id));l.set(u.id,{count:_.length,index:d,prevId:d>0?_[d-1].id:void 0,nextId:d<_.length-1?_[d+1].id:void 0})}return l}function Wh(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function om(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function wB(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||om(r)||!Wh(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function SB(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=wB(n.parts);return t?{messageId:n.id,toolId:t}:null}function jxt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||om(r)))return r.type==="text"&&!!r.text}return!1}function Txt(e,n,t,r,s){const i=[...n].filter(o=>!t.has(o)&&r.some(l=>l.id===o)&&o!==s);if(i.length===0&&!(s&&e.has(s)))return e;const a=new Set(e);for(const o of i)a.add(o);return s&&a.delete(s),a}function Axt(e,n){if(e.some(r=>{var s;return r.type==="prompt"&&!((s=r.prompt)!=null&&s.resolved)}))return{work:[],answer:e};let t=e.findIndex(r=>r.type==="text"&&r.phase==="final_answer");if(t<0&&!n&&!e.some(r=>r.phase))for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type!=="reasoning"){if(s.type!=="text")break;s.text&&(t=r)}}return t<0||!n&&!e.slice(t).some(r=>Wh(r))||!e.slice(0,t).some(r=>Wh(r))?{work:[],answer:e}:{work:e.slice(0,t),answer:e.slice(t)}}function kB(e){var n,t;return e.type==="tool"&&e.tool==="error"&&/^(?:ActionRequiredError:\s*)?Named models unavailable\b/i.test(((t=(n=e.state)==null?void 0:n.error)==null?void 0:t.trim())??"")}function x3(e){var t,r,s;if(kB(e)||((r=(t=e.state)==null?void 0:t.input)==null?void 0:r.errorKind)==="claude_usage_limit")return!0;const n=e.type==="text"?e.text:e.tool==="error"?(s=e.state)==null?void 0:s.error:null;return e.type==="tool"&&e.tool==="error"&&n&&/usageLimitExceeded|rateLimitExceeded|insufficient_quota|(?:usage|rate|session) limit|(?:exceeded|exhausted) (?:your |the |current )*quota|insufficient (?:credits|balance)|(?:credit|quota)[ _-](?:exhausted|exceeded)/i.test(n)?!0:!!(n&&(/^(?:claude: )?you(?:'ve| have) reached your .+ limit\./i.test(n.trim())&&n.includes("claude.ai/settings/usage")||/^(?:claude: )?you(?:'ve| have) hit your session limit · resets /i.test(n.trim())))}const wo=e=>new Intl.NumberFormat(z()).format(e);function Rxt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?WIe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?BIe({attempt:wo(e.attempt),maximum:wo(e.maximum),seconds:wo(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?DIe({attempt:wo(e.attempt),maximum:wo(e.maximum)}):typeof e.attempt=="number"&&t!=null?HIe({attempt:wo(e.attempt),seconds:wo(t)}):typeof e.attempt=="number"?TIe({attempt:wo(e.attempt)}):t!=null?YIe({seconds:wo(t)}):sL()}function Mxt(e,n){if(typeof e!="number")return eBe();const t=Math.max(0,Math.ceil((e-n)/1e3));return sBe({seconds:wo(t)})}function CB(e){return e==="retry"||e==="continue"?e:null}function Dxt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Lxt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function mj(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Oxt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function RS(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Mxt(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=RS(e);if(t.length===1)return t[0]}return e}function Dxt(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function Vh(e){return Dxt(typeof e=="string"?RS(e):e)}function Lxt(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function Oxt(e,n){const t=Vh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function Ixt(e){var l;const n=Vh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u +`&&(t+=l,r=!0);continue}if(s){o===s?s=null:t+=o,r=!0;continue}if(o==='"'||o==="'"){s=o,r=!0;continue}if(o==="|"||o===";"||o===">"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Ixt(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=RS(e);if(t.length===1)return t[0]}return e}function Bxt(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function Vh(e){return Bxt(typeof e=="string"?RS(e):e)}function $xt(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function Pxt(e,n){const t=Vh(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function Fxt(e){var l;const n=Vh(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u -`,$xt='',Pxt=` +`,qxt='',Uxt=` -`,EB={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},Fxt={alphaxiv:Bxt,openalex:Pxt,biorxiv:$xt};function NB({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":EB[e]},dangerouslySetInnerHTML:{__html:Fxt[e]}})}function Hxt(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function qxt(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=Hxt(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const Uxt=["alphaxiv","openalex","biorxiv"];function Gxt(){const e=dht(),{data:n}=ct(e),t=mn({mutationFn:mft,onSuccess:i=>Pr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:Uxt.map(i=>{const a=n[i];return f.jsxs(or,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(NB,{source:i,size:16,decorative:!0}),EB[i]]}),f.jsx(W_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:N3e()})}function W2(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Wxt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Vxt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` -`}]}function Kxt(e,n){const t=n.value?n.value+` -`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Qxt(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Yxt(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),Xxt=Cu(/[#-'*+\--9=?A-Z^-~]/);function bv(e){return e!==null&&(e<32||e===127)}const w3=Cu(/\d/),Zxt=Cu(/[\dA-Fa-f]/),Jxt=Cu(/[!-/:-@[-`{-~]/);function St(e){return e!==null&&e<-2}function lr(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const Ib=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function e2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function t2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function n2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function zB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function r2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function s2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function i2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function a2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function o2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function l2t(e,n,t){const r=e.all(n),s=t?c2t(t):jB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++oPr(e.queryKey,i)}),r=t.isPending,s=i=>{n&&!r&&t.mutate({...n,[i]:!n[i]})};return n?f.jsx("div",{className:"flex flex-col",children:Kxt.map(i=>{const a=n[i];return f.jsxs(or,{type:"button",role:"switch","aria-checked":a,disabled:r,onClick:()=>s(i),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(NB,{source:i,size:16,decorative:!0}),EB[i]]}),f.jsx(Y_t,{checked:a,"aria-hidden":"true"})]},i)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:N3e()})}function G2(e,n){if(!e)throw new Error("Assertion Error")}function Xu(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Yxt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Xxt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` +`}]}function Zxt(e,n){const t=n.value?n.value+` +`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Jxt(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function e2t(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ai=Cu(/[A-Za-z]/),Vs=Cu(/[\dA-Za-z]/),t2t=Cu(/[#-'*+\--9=?A-Z^-~]/);function vv(e){return e!==null&&(e<32||e===127)}const w3=Cu(/\d/),n2t=Cu(/[\dA-Fa-f]/),r2t=Cu(/[!-/:-@[-`{-~]/);function St(e){return e!==null&&e<-2}function lr(e){return e!==null&&(e<0||e===32)}function gn(e){return e===-2||e===-1||e===32}const Ob=Cu(new RegExp("\\p{P}|\\p{S}","u")),Id=Cu(/\s/);function Cu(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function __(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function s2t(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=__(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(n,u),e.applyData(n,u)}function i2t(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function a2t(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function zB(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function o2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={src:__(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function l2t(e,n){const t={src:__(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function c2t(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function u2t(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return zB(e,n);const s={href:__(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function d2t(e,n){const t={href:__(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function f2t(e,n,t){const r=e.all(n),s=t?h2t(t):jB(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let d;_&&_.type==="element"&&_.tagName==="p"?d=_:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function u2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function _2t(e){const n=MS(e),t=TB(e);if(n&&t)return{start:n,end:t}}function p2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=MS(n.children[1]),l=TB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function m2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(vj(n.slice(s),s>0,!1)),i.join("")}function vj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===mj||i===gj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===mj||i===gj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function b2t(e,n){const t={type:"text",value:v2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function y2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const x2t={blockquote:Wxt,break:Vxt,code:Kxt,delete:Qxt,emphasis:Yxt,footnoteReference:e2t,heading:t2t,html:n2t,imageReference:r2t,image:s2t,inlineCode:i2t,linkReference:a2t,link:o2t,listItem:l2t,list:u2t,paragraph:d2t,root:f2t,strong:h2t,table:p2t,tableCell:g2t,tableRow:m2t,text:b2t,thematicBreak:y2t,toml:Wg,yaml:Wg,definition:Wg,footnoteDefinition:Wg};function Wg(){}const RB=-1,Bb=0,P0=1,yv=2,DS=3,LS=4,OS=5,IS=6,MB=7,DB=8,w2t=typeof self=="object"?self:globalThis,bj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new w2t[e](n)},S2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Bb:case RB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case yv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case DS:return t(new Date(a),s);case LS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case OS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case IS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case MB:{const{name:o,message:l}=a;return t(bj(o,l),s)}case DB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(bj(i,a),s)};return r},yj=e=>S2t(new Map,e)(0),nd="",{toString:k2t}={},{keys:C2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Bb,n];const t=k2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[yv,nd];case"Date":return[DS,nd];case"RegExp":return[LS,nd];case"Map":return[OS,nd];case"Set":return[IS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[MB,t]:[yv,t]},Vg=([e,n])=>e===Bb&&(n==="function"||n==="symbol"),E2t=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Bb:{let _=a;switch(l){case"bigint":o=DB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([RB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case yv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of C2t(a))(e||!Vg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case DS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case LS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case OS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Vg(h0(p))||Vg(h0(m))))&&_.push([i(p),i(m)]);return d}case IS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Vg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},xj=(e,{json:n,lossy:t}={})=>{const r=[];return E2t(!(n||t),!!n,new Map,r)(e),r},xv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?yj(xj(e,n)):structuredClone(e):(e,n)=>yj(xj(e,n));function N2t(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function z2t(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function j2t(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||N2t,r=e.options.footnoteBackLabel||z2t,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...xv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(n,u),e.applyData(n,u)}function h2t(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r1}function _2t(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function v2t(e){const n=MS(e),t=TB(e);if(n&&t)return{start:n,end:t}}function b2t(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=MS(n.children[1]),l=TB(n.children[n.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function y2t(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(bj(n.slice(s),s>0,!1)),i.join("")}function bj(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===gj||i===vj;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===gj||i===vj;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function S2t(e,n){const t={type:"text",value:w2t(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function k2t(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const C2t={blockquote:Yxt,break:Xxt,code:Zxt,delete:Jxt,emphasis:e2t,footnoteReference:s2t,heading:i2t,html:a2t,imageReference:o2t,image:l2t,inlineCode:c2t,linkReference:u2t,link:d2t,listItem:f2t,list:_2t,paragraph:p2t,root:m2t,strong:g2t,table:b2t,tableCell:x2t,tableRow:y2t,text:S2t,thematicBreak:k2t,toml:Wg,yaml:Wg,definition:Wg,footnoteDefinition:Wg};function Wg(){}const RB=-1,Ib=0,P0=1,bv=2,DS=3,LS=4,OS=5,IS=6,MB=7,DB=8,E2t=typeof self=="object"?self:globalThis,yj=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new E2t[e](n)},N2t=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Ib:case RB:return t(a,s);case P0:{const o=t([],s);for(const l of a)o.push(r(l));return o}case bv:{const o=t({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case DS:return t(new Date(a),s);case LS:{const{source:o,flags:l}=a;return t(new RegExp(o,l),s)}case OS:{const o=t(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case IS:{const o=t(new Set,s);for(const l of a)o.add(r(l));return o}case MB:{const{name:o,message:l}=a;return t(yj(o,l),s)}case DB:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(yj(i,a),s)};return r},xj=e=>N2t(new Map,e)(0),nd="",{toString:z2t}={},{keys:j2t}=Object,h0=e=>{const n=typeof e;if(n!=="object"||!e)return[Ib,n];const t=z2t.call(e).slice(8,-1);switch(t){case"Array":return[P0,nd];case"Object":return[bv,nd];case"Date":return[DS,nd];case"RegExp":return[LS,nd];case"Map":return[OS,nd];case"Set":return[IS,nd];case"DataView":return[P0,t]}return t.includes("Array")?[P0,t]:t.includes("Error")?[MB,t]:[bv,t]},Vg=([e,n])=>e===Ib&&(n==="function"||n==="symbol"),T2t=(e,n,t,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return t.set(o,l),l},i=a=>{if(t.has(a))return t.get(a);let[o,l]=h0(a);switch(o){case Ib:{let _=a;switch(l){case"bigint":o=DB,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);_=null;break;case"undefined":return s([RB],a)}return s([o,_],a)}case P0:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const _=[],d=s([o,_],a);for(const p of a)_.push(i(p));return d}case bv:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],d=s([o,_],a);for(const p of j2t(a))(e||!Vg(h0(a[p])))&&_.push([i(p),i(a[p])]);return d}case DS:return s([o,isNaN(a.getTime())?nd:a.toISOString()],a);case LS:{const{source:_,flags:d}=a;return s([o,{source:_,flags:d}],a)}case OS:{const _=[],d=s([o,_],a);for(const[p,m]of a)(e||!(Vg(h0(p))||Vg(h0(m))))&&_.push([i(p),i(m)]);return d}case IS:{const _=[],d=s([o,_],a);for(const p of a)(e||!Vg(h0(p)))&&_.push(i(p));return d}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},wj=(e,{json:n,lossy:t}={})=>{const r=[];return T2t(!(n||t),!!n,new Map,r)(e),r},yv=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?xj(wj(e,n)):structuredClone(e):(e,n)=>xj(wj(e,n));function A2t(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function R2t(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function M2t(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||A2t,r=e.options.footnoteBackLabel||R2t,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&x.push({type:"text",value:" "});let w=typeof t=="string"?t:t(l,m);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else _.push(...x);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...yv(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const lm=(function(e){if(e==null)return M2t;if(typeof e=="function")return $b(e);if(typeof e=="object")return Array.isArray(e)?T2t(e):A2t(e);if(typeof e=="string")return R2t(e);throw new Error("Expected function, string, or object as test")});function T2t(e){const n=[];let t=-1;for(;++t":""))+")"})}return p;function p(){let m=LB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=O2t(t(l,_)),m[0]===S3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==OB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S":""))+")"})}return p;function p(){let m=LB,x,S,v;if((!n||i(l,u,_[_.length-1]||void 0))&&(m=P2t(t(l,_)),m[0]===S3))return m;if("children"in l&&l.children){const b=l;if(b.children&&m[0]!==OB)for(S=(r?b.children.length:-1)+a,v=_.concat(b);S>-1&&S0&&t.push({type:"text",value:` -`}),t}function wj(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Sj(e,n){const t=B2t(e,n),r=t.one(e,void 0),s=j2t(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function wv(e,n){return e&&"run"in e?async function(t,r){const s=Sj(t,{file:r,...n});await e.run(s,r)}:function(t,r){return Sj(t,{file:r,...e||n})}}function kj(e){if(e)throw e}var V2,Cj;function q2t(){if(Cj)return V2;Cj=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},i=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var _=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!_&&!d)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return V2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ej(e.position):"start"in e||"end"in e?Ej(e):"line"in e||"column"in e?E3(e):""}function E3(e){return Nj(e&&e.line)+":"+Nj(e&&e.column)}function Ej(e){return E3(e&&e.start)+"-"+E3(e&&e.end)}function Nj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:V2t,dirname:K2t,extname:Q2t,join:Y2t,sep:"/"};function V2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function K2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Q2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Y2t(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Z2t(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J2t={cwd:ewt};function ewt(){return"/"}function N3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function twt(e){if(typeof e=="string")e=new URL(e);else if(!N3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nwt(e)}function nwt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];C3(S)&&C3(m)&&(m=K2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function Z2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function J2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ew(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jj(e){if(!C3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Tj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return awt(e)?e:new IB(e)}function awt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function owt(e){return typeof e=="string"||lwt(e)}function lwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Aj=Object.prototype.hasOwnProperty;function Rj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Rj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Rj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Aj.call(e,t)&&++r&&!Aj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const cwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uwt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dwt={};function Mj(e,n){return(dwt.jsx?uwt:cwt).test(e)}const fwt=/[ \t\n\f\r]/g;function hwt(e){return typeof e=="object"?e.type==="text"?Dj(e.value):!1:Dj(e)}function Dj(e){return e.replace(fwt,"")===""}var Gf={},tw,Lj;function _wt(){if(Lj)return tw;Lj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` -`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(q){var Y=q.match(n);Y&&(w+=Y.length);var G=q.lastIndexOf(l);y=~G?q.length-G:y+q.length}function E(){var q={line:w,column:y};return function(Y){return Y.position=new N(q),M(),Y}}function N(q){this.start=q,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(q){var Y=new Error(b.source+":"+w+":"+y+": "+q);if(Y.reason=q,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(q){var Y=q.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(q){var Y;for(q=q||[];Y=B();)Y!==!1&&q.push(Y);return q}function B(){var q=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,q({type:p,comment:G})}}function $(){var q=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=q({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function H(){var q=[];O(q);for(var Y;Y=$();)Y!==!1&&(q.push(Y),O(q));return q}return M(),H()}function S(v){return v?v.replace(o,d):d}return tw=x,tw}var Oj;function pwt(){if(Oj)return Gf;Oj=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(_wt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Ij;function mwt(){if(Ij)return _0;Ij=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,Bj;function gwt(){if(Bj)return p0;Bj=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(pwt()),t=mwt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var vwt=gwt();const bwt=Wp(vwt),HS={}.hasOwnProperty,ywt=new Map,xwt=/[A-Z]/g,wwt=new Set(["table","tbody","thead","tfoot","tr"]),Swt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Awt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Twt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Lb:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return kwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Cwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Nwt(e,n,t);if(n.type==="mdxjsEsm")return Ewt(e,n);if(n.type==="root")return zwt(e,n,t);if(n.type==="text")return jwt(e,n)}function kwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Lb,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Rwt(e,n);let o=US(e,n);return wwt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!hwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Cwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Ewt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Nwt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Lb,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Mwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function zwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function jwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Twt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Awt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Rwt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Dwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Swt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Mwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:ywt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Hwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&$wt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Pwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Hwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Pj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Xwt(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Ib(e))return 2}function Pb(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};Hj(d,-l),Hj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,Pb(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(qj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),H(Y)):j(Y)}function H(Y){return Y===o?(M++,N.consume(Y),H):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,q,"whitespace")(Y):q(Y)):j(Y)}function q(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function c4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const nw={name:"codeIndented",tokenize:d4t},u4t={partial:!0,tokenize:f4t};function d4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(u4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function f4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const h4t={name:"codeText",previous:p4t,resolve:_4t,tokenize:m4t};function _4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||bv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const k4t={name:"definition",tokenize:E4t},C4t={partial:!0,tokenize:N4t};function E4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(C4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function N4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const z4t={name:"hardBreakEscape",tokenize:j4t};function j4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const T4t={name:"headingAtx",resolve:A4t,tokenize:R4t};function A4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function R4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const M4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gj=["pre","script","style","textarea"],D4t={concrete:!0,name:"htmlFlow",resolveTo:I4t,tokenize:B4t},L4t={partial:!0,tokenize:P4t},O4t={partial:!0,tokenize:$4t};function I4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function B4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(U){return _(U)}function _(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),p):U===47?(e.consume(U),i=!0,S):U===63?(e.consume(U),s=3,r.interrupt?n:L):ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function p(U){return U===45?(e.consume(U),s=2,m):U===91?(e.consume(U),s=5,o=0,x):ai(U)?(e.consume(U),s=4,r.interrupt?n:L):t(U)}function m(U){return U===45?(e.consume(U),r.interrupt?n:L):t(U)}function x(U){const Z="CDATA[";return U===Z.charCodeAt(o++)?(e.consume(U),o===Z.length?r.interrupt?n:$:x):t(U)}function S(U){return ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function v(U){if(U===null||U===47||U===62||lr(U)){const Z=U===47,ce=a.toLowerCase();return!Z&&!i&&Gj.includes(ce)?(s=1,r.interrupt?n(U):$(U)):M4t.includes(a.toLowerCase())?(s=6,Z?(e.consume(U),b):r.interrupt?n(U):$(U)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(U):i?w(U):y(U))}return U===45||Vs(U)?(e.consume(U),a+=String.fromCharCode(U),v):t(U)}function b(U){return U===62?(e.consume(U),r.interrupt?n:$):t(U)}function w(U){return gn(U)?(e.consume(U),w):O(U)}function y(U){return U===47?(e.consume(U),O):U===58||U===95||ai(U)?(e.consume(U),C):gn(U)?(e.consume(U),y):O(U)}function C(U){return U===45||U===46||U===58||U===95||Vs(U)?(e.consume(U),C):E(U)}function E(U){return U===61?(e.consume(U),N):gn(U)?(e.consume(U),E):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(e.consume(U),l=U,T):gn(U)?(e.consume(U),N):j(U)}function T(U){return U===l?(e.consume(U),l=null,M):U===null||St(U)?t(U):(e.consume(U),T)}function j(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||lr(U)?E(U):(e.consume(U),j)}function M(U){return U===47||U===62||gn(U)?y(U):t(U)}function O(U){return U===62?(e.consume(U),B):t(U)}function B(U){return U===null||St(U)?$(U):gn(U)?(e.consume(U),B):t(U)}function $(U){return U===45&&s===2?(e.consume(U),G):U===60&&s===1?(e.consume(U),X):U===62&&s===4?(e.consume(U),F):U===63&&s===3?(e.consume(U),L):U===93&&s===5?(e.consume(U),I):St(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(L4t,W,H)(U)):U===null||St(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),$)}function H(U){return e.check(O4t,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),Y}function Y(U){return U===null||St(U)?H(U):(e.enter("htmlFlowData"),$(U))}function G(U){return U===45?(e.consume(U),L):$(U)}function X(U){return U===47?(e.consume(U),a="",te):$(U)}function te(U){if(U===62){const Z=a.toLowerCase();return Gj.includes(Z)?(e.consume(U),F):$(U)}return ai(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),te):$(U)}function I(U){return U===93?(e.consume(U),L):$(U)}function L(U){return U===62?(e.consume(U),F):U===45&&s===2?(e.consume(U),L):$(U)}function F(U){return U===null||St(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),F)}function W(U){return e.exit("htmlFlow"),n(U)}}function $4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function P4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const F4t={name:"htmlText",tokenize:H4t};function H4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,H):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),q)}function H(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=H,X(L)):(e.consume(L),H)}function q(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),q)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:W4t,resolveTo:V4t,tokenize:K4t},q4t={tokenize:Q4t},U4t={tokenize:Y4t},G4t={tokenize:X4t};function W4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:o3t},exit:c3t,name:"list",tokenize:a3t},s3t={partial:!0,tokenize:u3t},i3t={partial:!0,tokenize:l3t};function a3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:w3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(M1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return w3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(s3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function o3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(i3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function l3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function c3t(e){e.exit(this.containerState.type)}function u3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Wj={name:"setextUnderline",resolveTo:d3t,tokenize:f3t};function d3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function f3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const h3t={tokenize:_3t};function _3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(b4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const p3t={resolveAll:t$()},m3t=e$("string"),g3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?v3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function A3t(e,n){let t=-1;const r=[];let s;for(;++t"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return W2=function l(){var u,_,d,p,m,x,S=arguments[0],v=1,b=arguments.length,w=!1;for(typeof S=="boolean"&&(w=S,S=arguments[1]||{},v=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});va.length;let l;o&&a.push(s);try{l=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function F0(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nj(e.position):"start"in e||"end"in e?Nj(e):"line"in e||"column"in e?E3(e):""}function E3(e){return zj(e&&e.line)+":"+zj(e&&e.column)}function Nj(e){return E3(e&&e.start)+"-"+E3(e&&e.end)}function zj(e){return e&&typeof e=="number"?e:1}class Qs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=F0(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qs.prototype.file="";Qs.prototype.name="";Qs.prototype.reason="";Qs.prototype.message="";Qs.prototype.stack="";Qs.prototype.column=void 0;Qs.prototype.line=void 0;Qs.prototype.ancestors=void 0;Qs.prototype.cause=void 0;Qs.prototype.fatal=void 0;Qs.prototype.place=void 0;Qs.prototype.ruleId=void 0;Qs.prototype.source=void 0;const So={basename:X2t,dirname:Z2t,extname:J2t,join:ewt,sep:"/"};function X2t(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');cm(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function Z2t(e){if(cm(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function J2t(e){cm(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function ewt(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function nwt(e,n){let t="",r=0,s=-1,i=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=t.lastIndexOf("/"),l!==t.length-1){l<0?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function cm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rwt={cwd:swt};function swt(){return"/"}function N3(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function iwt(e){if(typeof e=="string")e=new URL(e);else if(!N3(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return awt(e)}function awt(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];C3(S)&&C3(m)&&(m=V2(!0,S,m)),r[p]=[u,m,...x]}}}}const FS=new PS().freeze();function X2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Z2(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function J2(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Tj(e){if(!C3(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Aj(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Kg(e){return uwt(e)?e:new IB(e)}function uwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dwt(e){return typeof e=="string"||fwt(e)}function fwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Rj=Object.prototype.hasOwnProperty;function Mj(e,n,t){for(t of e.keys())if(H0(t,n))return t}function H0(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&H0(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=Mj(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=Mj(n,s),!s)||!H0(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(Rj.call(e,t)&&++r&&!Rj.call(n,t)||!(t in n)||!H0(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}const hwt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_wt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pwt={};function Dj(e,n){return(pwt.jsx?_wt:hwt).test(e)}const mwt=/[ \t\n\f\r]/g;function gwt(e){return typeof e=="object"?e.type==="text"?Lj(e.value):!1:Lj(e)}function Lj(e){return e.replace(mwt,"")===""}var Gf={},ew,Oj;function vwt(){if(Oj)return ew;Oj=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=` +`,u="/",_="*",d="",p="comment",m="declaration";function x(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var w=1,y=1;function C(q){var Y=q.match(n);Y&&(w+=Y.length);var G=q.lastIndexOf(l);y=~G?q.length-G:y+q.length}function E(){var q={line:w,column:y};return function(Y){return Y.position=new N(q),M(),Y}}function N(q){this.start=q,this.end={line:w,column:y},this.source=b.source}N.prototype.content=v;function T(q){var Y=new Error(b.source+":"+w+":"+y+": "+q);if(Y.reason=q,Y.filename=b.source,Y.line=w,Y.column=y,Y.source=v,!b.silent)throw Y}function j(q){var Y=q.exec(v);if(Y){var G=Y[0];return C(G),v=v.slice(G.length),Y}}function M(){j(t)}function O(q){var Y;for(q=q||[];Y=B();)Y!==!1&&q.push(Y);return q}function B(){var q=E();if(!(u!=v.charAt(0)||_!=v.charAt(1))){for(var Y=2;d!=v.charAt(Y)&&(_!=v.charAt(Y)||u!=v.charAt(Y+1));)++Y;if(Y+=2,d===v.charAt(Y-1))return T("End of comment missing");var G=v.slice(2,Y-2);return y+=2,C(G),v=v.slice(Y),y+=2,q({type:p,comment:G})}}function $(){var q=E(),Y=j(r);if(Y){if(B(),!j(s))return T("property missing ':'");var G=j(i),X=q({type:m,property:S(Y[0].replace(e,d)),value:G?S(G[0].replace(e,d)):d});return j(a),X}}function H(){var q=[];O(q);for(var Y;Y=$();)Y!==!1&&(q.push(Y),O(q));return q}return M(),H()}function S(v){return v?v.replace(o,d):d}return ew=x,ew}var Ij;function bwt(){if(Ij)return Gf;Ij=1;var e=Gf&&Gf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.default=t;const n=e(vwt());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:_}=l;o?s(u,_,l):_&&(i=i||{},i[u]=_)}),i}return Gf}var _0={},Bj;function ywt(){if(Bj)return _0;Bj=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},l=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return _0.camelCase=l,_0}var p0,$j;function xwt(){if($j)return p0;$j=1;var e=p0&&p0.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(bwt()),t=ywt();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,l){o&&l&&(a[(0,t.camelCase)(o,i)]=l)}),a}return r.default=r,p0=r,p0}var wwt=xwt();const Swt=Wp(wwt),HS={}.hasOwnProperty,kwt=new Map,Cwt=/[A-Z]/g,Ewt=new Set(["table","tbody","thead","tfoot","tr"]),Nwt=new Set(["td","th"]),BB="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $B(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Lwt(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Dwt(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Db:cB,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=PB(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function PB(e,n,t){if(n.type==="element")return zwt(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return jwt(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Awt(e,n,t);if(n.type==="mdxjsEsm")return Twt(e,n);if(n.type==="root")return Rwt(e,n,t);if(n.type==="text")return Mwt(e,n)}function zwt(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Db,e.schema=s),e.ancestors.push(n);const i=HB(e,n.tagName,!1),a=Owt(e,n);let o=US(e,n);return Ewt.has(n.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!gwt(l):!0})),FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function jwt(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mp(e,n.position)}function Twt(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);mp(e,n.position)}function Awt(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Db,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:HB(e,n.name,!0),a=Iwt(e,n),o=US(e,n);return FB(e,a,i,n),qS(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function Rwt(e,n,t){const r={};return qS(r,US(e,n)),e.create(n,e.Fragment,r,t)}function Mwt(e,n){return n.value}function FB(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function qS(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Dwt(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function Lwt(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),l=MS(r);return n(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Owt(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&HS.call(n.properties,s)){const i=Bwt(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Nwt.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Iwt(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else mp(e,n.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else mp(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function US(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:kwt;for(;++ry.key).filter(y=>y!==void 0));let u=0;for(;u=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(E=((b=s[N])==null?void 0:b.key)??E);E&&l.has(E)&&((w=s[N])==null?void 0:w.key)!==E;)E=`${E}+`;E&&l.add(E);const T=qB(C,s[N]??null,t,E);i.push(T),T.react!==void 0&&a.push(T.react)}const d=n!==null&&Wwt(e,n.node);if(n&&n.key===r&&d&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const p=e.type==="element"&&qwt.has(e.tagName)?a.filter(y=>typeof y!="string"||!Uwt.test(y)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=d?n==null?void 0:n.shell:null;if(!x){const y=$B({...e,children:[]},t);x={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(x.type,{...x.props,children:m},r),shell:x}}function Wwt(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return H0(s,o)}function fh(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(Qi(e,e.length,0,n),e):n}const Fj={}.hasOwnProperty;function GB(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function hn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return gn(l)?(e.enter(t),o(l)):n(l)}function o(l){return gn(l)&&i++a))return;const T=n.events.length;let j=T,M,O;for(;j--;)if(n.events[j][0]==="exit"&&n.events[j][1].type==="chunkFlow"){if(M){O=n.events[j][1].end;break}M=!0}for(b(r),N=T;Ny;){const E=t[C];n.containerState=E[1],E[0].exit.call(n,e)}t.length=y}function w(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function t4t(e,n,t){return hn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kh(e){if(e===null||lr(e)||Id(e))return 1;if(Ob(e))return 2}function $b(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[t][1].start};qj(d,-l),qj(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Sa(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Sa(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Sa(u,$b(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Sa(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Sa(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,Qi(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&gn(N)?hn(e,w,"linePrefix",i+1)(N):w(N)}function w(N){return N===null||St(N)?e.check(Uj,S,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||St(N)?(e.exit("codeFlowValue"),w(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function E(N,T,j){let M=0;return O;function O(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),B}function B(Y){return N.enter("codeFencedFence"),gn(Y)?hn(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):$(Y)}function $(Y){return Y===o?(N.enter("codeFencedFenceSequence"),H(Y)):j(Y)}function H(Y){return Y===o?(M++,N.consume(Y),H):M>=a?(N.exit("codeFencedFenceSequence"),gn(Y)?hn(N,q,"whitespace")(Y):q(Y)):j(Y)}function q(Y){return Y===null||St(Y)?(N.exit("codeFencedFence"),T(Y)):j(Y)}}}function h4t(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const tw={name:"codeIndented",tokenize:p4t},_4t={partial:!0,tokenize:m4t};function p4t(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),hn(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?l(u):St(u)?e.attempt(_4t,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||St(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),n(u)}}function m4t(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):hn(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):St(a)?s(a):t(a)}}const g4t={name:"codeText",previous:b4t,resolve:v4t,tokenize:y4t};function v4t(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&m0(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),m0(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),m0(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function XB(e,n,t,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let _=0;return d;function d(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),p):b===null||b===32||b===41||vv(b)?t(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function p(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(e.exit("chunkString"),e.exit(o),p(b)):b===null||b===60||St(b)?t(b):(e.consume(b),b===92?x:m)}function x(b){return b===60||b===62||b===92?(e.consume(b),m):m(b)}function S(b){return!_&&(b===null||b===41||lr(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(b)):_999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):St(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||St(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),l||(l=!gn(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function JB(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,l):t(p)}function l(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),l(a)):p===null?t(p):St(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||St(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:_)}function d(p){return p===a||p===92?(e.consume(p),_):_(p)}}function q0(e,n){let t;return r;function r(s){return St(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):gn(s)?hn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const z4t={name:"definition",tokenize:T4t},j4t={partial:!0,tokenize:A4t};function T4t(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return ZB.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):t(m)}function l(m){return lr(m)?q0(e,u)(m):u(m)}function u(m){return XB(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(j4t,d,d)(m)}function d(m){return gn(m)?hn(e,p,"whitespace")(m):p(m)}function p(m){return m===null||St(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function A4t(e,n,t){return r;function r(o){return lr(o)?q0(e,s)(o):t(o)}function s(o){return JB(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return gn(o)?hn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||St(o)?n(o):t(o)}}const R4t={name:"hardBreakEscape",tokenize:M4t};function M4t(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return St(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const D4t={name:"headingAtx",resolve:L4t,tokenize:O4t};function L4t(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},Qi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function O4t(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||lr(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),l(_)):_===null||St(_)?(e.exit("atxHeading"),n(_)):gn(_)?hn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function l(_){return _===35?(e.consume(_),l):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||lr(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const I4t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Wj=["pre","script","style","textarea"],B4t={concrete:!0,name:"htmlFlow",resolveTo:F4t,tokenize:H4t},$4t={partial:!0,tokenize:U4t},P4t={partial:!0,tokenize:q4t};function F4t(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function H4t(e,n,t){const r=this;let s,i,a,o,l;return u;function u(U){return _(U)}function _(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),p):U===47?(e.consume(U),i=!0,S):U===63?(e.consume(U),s=3,r.interrupt?n:L):ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function p(U){return U===45?(e.consume(U),s=2,m):U===91?(e.consume(U),s=5,o=0,x):ai(U)?(e.consume(U),s=4,r.interrupt?n:L):t(U)}function m(U){return U===45?(e.consume(U),r.interrupt?n:L):t(U)}function x(U){const Z="CDATA[";return U===Z.charCodeAt(o++)?(e.consume(U),o===Z.length?r.interrupt?n:$:x):t(U)}function S(U){return ai(U)?(e.consume(U),a=String.fromCharCode(U),v):t(U)}function v(U){if(U===null||U===47||U===62||lr(U)){const Z=U===47,ce=a.toLowerCase();return!Z&&!i&&Wj.includes(ce)?(s=1,r.interrupt?n(U):$(U)):I4t.includes(a.toLowerCase())?(s=6,Z?(e.consume(U),b):r.interrupt?n(U):$(U)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(U):i?w(U):y(U))}return U===45||Vs(U)?(e.consume(U),a+=String.fromCharCode(U),v):t(U)}function b(U){return U===62?(e.consume(U),r.interrupt?n:$):t(U)}function w(U){return gn(U)?(e.consume(U),w):O(U)}function y(U){return U===47?(e.consume(U),O):U===58||U===95||ai(U)?(e.consume(U),C):gn(U)?(e.consume(U),y):O(U)}function C(U){return U===45||U===46||U===58||U===95||Vs(U)?(e.consume(U),C):E(U)}function E(U){return U===61?(e.consume(U),N):gn(U)?(e.consume(U),E):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(e.consume(U),l=U,T):gn(U)?(e.consume(U),N):j(U)}function T(U){return U===l?(e.consume(U),l=null,M):U===null||St(U)?t(U):(e.consume(U),T)}function j(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||lr(U)?E(U):(e.consume(U),j)}function M(U){return U===47||U===62||gn(U)?y(U):t(U)}function O(U){return U===62?(e.consume(U),B):t(U)}function B(U){return U===null||St(U)?$(U):gn(U)?(e.consume(U),B):t(U)}function $(U){return U===45&&s===2?(e.consume(U),G):U===60&&s===1?(e.consume(U),X):U===62&&s===4?(e.consume(U),F):U===63&&s===3?(e.consume(U),L):U===93&&s===5?(e.consume(U),I):St(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check($4t,W,H)(U)):U===null||St(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),$)}function H(U){return e.check(P4t,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),Y}function Y(U){return U===null||St(U)?H(U):(e.enter("htmlFlowData"),$(U))}function G(U){return U===45?(e.consume(U),L):$(U)}function X(U){return U===47?(e.consume(U),a="",te):$(U)}function te(U){if(U===62){const Z=a.toLowerCase();return Wj.includes(Z)?(e.consume(U),F):$(U)}return ai(U)&&a.length<8?(e.consume(U),a+=String.fromCharCode(U),te):$(U)}function I(U){return U===93?(e.consume(U),L):$(U)}function L(U){return U===62?(e.consume(U),F):U===45&&s===2?(e.consume(U),L):$(U)}function F(U){return U===null||St(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),F)}function W(U){return e.exit("htmlFlow"),n(U)}}function q4t(e,n,t){const r=this;return s;function s(a){return St(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function U4t(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(um,n,t)}}const G4t={name:"htmlText",tokenize:W4t};function W4t(e,n,t){const r=this;let s,i,a;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),u):L===47?(e.consume(L),E):L===63?(e.consume(L),y):ai(L)?(e.consume(L),j):t(L)}function u(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,x):ai(L)?(e.consume(L),w):t(L)}function _(L){return L===45?(e.consume(L),m):t(L)}function d(L){return L===null?t(L):L===45?(e.consume(L),p):St(L)?(a=d,X(L)):(e.consume(L),d)}function p(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?G(L):L===45?p(L):d(L)}function x(L){const F="CDATA[";return L===F.charCodeAt(i++)?(e.consume(L),i===F.length?S:x):t(L)}function S(L){return L===null?t(L):L===93?(e.consume(L),v):St(L)?(a=S,X(L)):(e.consume(L),S)}function v(L){return L===93?(e.consume(L),b):S(L)}function b(L){return L===62?G(L):L===93?(e.consume(L),b):S(L)}function w(L){return L===null||L===62?G(L):St(L)?(a=w,X(L)):(e.consume(L),w)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):St(L)?(a=y,X(L)):(e.consume(L),y)}function C(L){return L===62?G(L):y(L)}function E(L){return ai(L)?(e.consume(L),N):t(L)}function N(L){return L===45||Vs(L)?(e.consume(L),N):T(L)}function T(L){return St(L)?(a=T,X(L)):gn(L)?(e.consume(L),T):G(L)}function j(L){return L===45||Vs(L)?(e.consume(L),j):L===47||L===62||lr(L)?M(L):t(L)}function M(L){return L===47?(e.consume(L),G):L===58||L===95||ai(L)?(e.consume(L),O):St(L)?(a=M,X(L)):gn(L)?(e.consume(L),M):G(L)}function O(L){return L===45||L===46||L===58||L===95||Vs(L)?(e.consume(L),O):B(L)}function B(L){return L===61?(e.consume(L),$):St(L)?(a=B,X(L)):gn(L)?(e.consume(L),B):M(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,H):St(L)?(a=$,X(L)):gn(L)?(e.consume(L),$):(e.consume(L),q)}function H(L){return L===s?(e.consume(L),s=void 0,Y):L===null?t(L):St(L)?(a=H,X(L)):(e.consume(L),H)}function q(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||lr(L)?M(L):(e.consume(L),q)}function Y(L){return L===47||L===62||lr(L)?M(L):t(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),te}function te(L){return gn(L)?hn(e,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return e.enter("htmlTextData"),a(L)}}const WS={name:"labelEnd",resolveAll:Y4t,resolveTo:X4t,tokenize:Z4t},V4t={tokenize:J4t},K4t={tokenize:e3t},Q4t={tokenize:t3t};function Y4t(e){let n=-1;const t=[];for(;++n=3&&(u===null||St(u))?(e.exit("thematicBreak"),n(u)):t(u)}function l(u){return u===s?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),gn(u)?hn(e,o,"whitespace")(u):o(u))}}const xi={continuation:{tokenize:d3t},exit:h3t,name:"list",tokenize:u3t},l3t={partial:!0,tokenize:_3t},c3t={partial:!0,tokenize:f3t};function u3t(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:w3(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(R1,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return t(m)}function l(m){return w3(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(um,r.interrupt?t:_,e.attempt(l3t,p,d))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return gn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function d3t(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(um,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,hn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!gn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(c3t,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,hn(e,e.attempt(xi,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function f3t(e,n,t){const r=this;return hn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function h3t(e){e.exit(this.containerState.type)}function _3t(e,n,t){const r=this;return hn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!gn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Vj={name:"setextUnderline",resolveTo:p3t,tokenize:m3t};function p3t(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function m3t(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,d;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){d=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),gn(u)?hn(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||St(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const g3t={tokenize:v3t};function v3t(e){const n=this,t=e.attempt(um,r,e.attempt(this.parser.constructs.flowInitial,s,hn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(S4t,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const b3t={resolveAll:t$()},y3t=e$("string"),x3t=e$("text");function e$(e){return{resolveAll:t$(e==="text"?w3t:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),l}function l(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),l)}function u(_){if(_===null)return!0;const d=s[_];let p=-1;if(d)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function L3t(e,n){let t=-1;const r=[];let s;for(;++t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Kj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,de(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Qj(t)),de(this,ru)+J3t(t,r)}}ru=new WeakMap;const H3t=new Set(["*","**","_","__"]);function Qj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;t0){const Zt=Ze.tokenStack[Ze.tokenStack.length-1];(Zt[1]||Qj).call(Ze,void 0,Zt[0])}for(Re.position={start:Bc(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:Bc(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt0&&(Fe(this,ru,de(this,ru)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Yj(t)),de(this,ru)+r5t(t,r)}}ru=new WeakMap;const W3t=new Set(["*","**","_","__"]);function Yj(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(Z3t(n)){Yj(n,t,r);continue}const i=V3t(n,e,t);if(i>t){t=i-1;continue}const a=K3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Yj(n,t,r)}return n}function q3t(e,n,t){const r=n[t];return r==="`"?U3t(e,n,t):r==="$"?G3t(e,n,t):r==="~"?W3t(e,n,t):t}function U3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&Sv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&Sv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function G3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function W3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(Sv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!Sv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function V3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` -`)return e.pendingHtml=null,s+1;return n.length}function K3t(e,n,t){const r=Q3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Y3t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Q3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Y3t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Jj(s)||!Jj(r)}function Yj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function X3t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Z3t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function J3t(e,n){n.pendingHtml!==null&&(e=e.slice(0,n5t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return xo(e5t(e,t));const r=t5t(n);if(r)return xo(ih(e,r));const s=i5t(n);return s?s.kind==="delim"?xo(j3(e,s.start,s.token.length)?s$(e,s.token):e.slice(0,s.start)):j3(e,s.start,s.token.length)?s.kind==="fence"?xo(e):s.kind==="code"?xo(ih(e,s.token)):s.token==="$$"?xo(ih(e,(e.endsWith(` +`){t5t(n),n.exclusive||(n.commitIndex=t+1);continue}const s=V3t(n,e,t);if(s>t){t=s-1;continue}if(n.exclusive)continue;if(n5t(n)){Xj(n,t,r);continue}const i=X3t(n,e,t);if(i>t){t=i-1;continue}const a=Z3t(n,e,t);if(a>t){t=a-1;continue}eo(e,t)||Xj(n,t,r)}return n}function V3t(e,n,t){const r=n[t];return r==="`"?K3t(e,n,t):r==="$"?Q3t(e,n,t):r==="~"?Y3t(e,n,t):t}function K3t(e,n,t){const r=KS(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&wv(n,t)&&!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!eo(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||eo(n,t)?t+r:r>=3&&wv(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function Q3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||eo(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function Y3t(e,n,t){const r=KS(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(wv(n,t)&&!eo(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!wv(n,t)||eo(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function X3t(e,n,t){if(n[t]!=="<"||eo(n,t))return t;const r=n[t+1];if(r!==void 0&&!a$(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` +`)return e.pendingHtml=null,s+1;return n.length}function Z3t(e,n,t){const r=J3t(n,t);if(!r)return t;if(eo(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(e5t(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function J3t(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function e5t(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!eT(s)||!eT(r)}function Xj(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function t5t(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function n5t(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function r5t(e,n){n.pendingHtml!==null&&(e=e.slice(0,a5t(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return xo(s5t(e,t));const r=i5t(n);if(r)return xo(ih(e,r));const s=c5t(n);return s?s.kind==="delim"?xo(j3(e,s.start,s.token.length)?s$(e,s.token):e.slice(0,s.start)):j3(e,s.start,s.token.length)?s.kind==="fence"?xo(e):s.kind==="code"?xo(ih(e,s.token)):s.token==="$$"?xo(ih(e,(e.endsWith(` `)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?xo(e):xo(ih(e,"$")):xo(s.kind==="fence"?e:e.slice(0,s.start)):xo(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function e5t(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return j3(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function t5t(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!H3t.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function n5t(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!r5t(e,s,r))break;t=s,r=s}return t}function r5t(e,n,t){if(e[t-1]!==">"||eo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!a$(r))return!1;for(let s=n+1;s"||i===` +`)+"$$")):/\s/.test(e[e.length-1]??"")?xo(e):xo(ih(e,"$")):xo(s.kind==="fence"?e:e.slice(0,s.start)):xo(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function s5t(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return j3(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function i5t(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!W3t.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function a5t(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!o5t(e,s,r))break;t=s,r=s}return t}function o5t(e,n,t){if(e[t-1]!==">"||eo(e,n))return!1;const r=e[n+1];if(r!==void 0&&!a$(r))return!1;for(let s=n+1;s"||i===` `)return!1}return!0}function xo(e){var v;const n=e.lastIndexOf(` `),t=n===-1?0:n+2,r=e.slice(0,t),s=e.slice(t),i=s.indexOf(` -`),a=i===-1?s:s.slice(0,i),o=(v=a.match(/^( *)\|/))==null?void 0:v[1];if(o===void 0)return e;if(Xj(a)<2&&!a5t(a,o))return r;const l=a.trimEnd().endsWith("|")?a:s$(a," |"),u=Xj(l),_=u<2?0:l.trimEnd().endsWith("|")?u-1:u;if(_===0)return e;const d=i===-1?"":s.slice(i+1),p=Zj(o,Array.from({length:_},()=>"-"));if(d.length===0)return r+l+` +`),a=i===-1?s:s.slice(0,i),o=(v=a.match(/^( *)\|/))==null?void 0:v[1];if(o===void 0)return e;if(Zj(a)<2&&!u5t(a,o))return r;const l=a.trimEnd().endsWith("|")?a:s$(a," |"),u=Zj(l),_=u<2?0:l.trimEnd().endsWith("|")?u-1:u;if(_===0)return e;const d=i===-1?"":s.slice(i+1),p=Jj(o,Array.from({length:_},()=>"-"));if(d.length===0)return r+l+` `+p;const m=d.indexOf(` -`),x=m===-1?d:d.slice(0,m),S=m===-1?"":d.slice(m);if(o5t(x,o,_))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const b=i$(x,o).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let E=0;E1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+l+` -`+Zj(o,b)+S}return r+l+` +`),x=m===-1?d:d.slice(0,m),S=m===-1?"":d.slice(m);if(d5t(x,o,_))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const b=i$(x,o).map(w=>{const y=w.trim();if(y.length===0)return"-";let C=0;for(let E=0;E1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+l+` +`+Jj(o,b)+S}return r+l+` `+p+` -`+d}function ih(e,n){return e+n.slice(s5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function s5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function i5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Xj(e){let n=0;for(let t=0;t0}function Zj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function o5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function Sv(e,n){return n===0||e[n-1]===` -`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Jj(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class l5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){de(this,Dh)!==null&&de(this,Fp)===n&&l$(de(this,Lh),r)&&!!de(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===wv)||(n=n(),n.use(wv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new F3t:null))}update(n){de(this,xd)&&(n=de(this,xd).update(n));let t=de(this,Oh);if(n===t)return de(this,Sd);const r=de(this,Hp),s=c5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(de(this,Dh)),l=de(this,qp),u=l.slice(i).some(N=>N.some(T3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),W2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=sw(_,d,a);W2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||T3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=sw(_,d,a);W2(N.length===d.length),l.splice(0,l.length,...N)}const p=sw(o.runSync(_),d,a),m=de(this,Up),x=de(this,Gp),S=de(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(de(this,wd)),Fe(this,wd,de(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||m5t.test(e.slice(0,n))?e:""}const aw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function w5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=S5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function S5t(e,n){switch(e.nodeType){case 1:return N5t(e,n);case 3:return C5t(e);case 8:return E5t(e);case 9:return rT(e,n);case 10:return k5t();case 11:return rT(e,n);default:return}}function rT(e,n){return{type:"root",children:d$(e,n)}}function k5t(){return{type:"doctype"}}function C5t(e){return{type:"text",value:e.nodeValue||""}}function E5t(e){return{type:"comment",value:e.nodeValue||""}}function N5t(e,n){const t=e.namespaceURI,r=t===aw.svg?jyt:dB,s=t===aw.html?e.tagName.toLowerCase():e.tagName,i=t===aw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` -`.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function h$(e,n,t){return e.type==="element"?I5t(e,n,t):e.type==="text"?t.whitespace==="normal"?_$(e,t):B5t(e):[]}function I5t(e,n,t){const r=p$(e,t),s=e.children||[];let i=-1,a=[];if(L5t(e))return a;let o,l;for(A3(e)||lT(e)&&sT(n,e,lT)?l=` -`:D5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(q5t,"-$1").toLowerCase(),G5t={"&":"&",">":">","<":"<",'"':""","'":"'"},W5t=/[&><"']/g,Ks=e=>String(e).replace(W5t,n=>G5t[n]),D1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?D1(e.body[0]):e:e.type==="font"?D1(e.body):e,V5t=new Set(["mathord","textord","atom"]),Wl=e=>V5t.has(D1(e).type),K5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},R3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Q5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Y5t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Q5t(n)}function X5t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Y5t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(R3)){var r=R3[t];r&&X5t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=K5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[Z5t[this.id]]}sub(){return jo[J5t[this.id]]}fracNum(){return jo[e6t[this.id]]}fracDen(){return jo[t6t[this.id]]}cramp(){return jo[n6t[this.id]]}text(){return jo[r6t[this.id]]}isTight(){return this.size>=2}}var XS=0,kv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(kv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],Z5t=[gp,ka,gp,ka,Qh,oi,Qh,oi],J5t=[ka,ka,ka,ka,oi,oi,oi,oi],e6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],t6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],n6t=[kv,kv,Pl,Pl,ka,ka,oi,oi],r6t=[XS,kv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},M3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function s6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var L1=[];M3.forEach(e=>e.blocks.forEach(n=>L1.push(...n)));function m$(e){for(var n=0;n=L1[n]&&e<=L1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,i6t=function(n,t){return"M95,"+(622+n+t)+` +`+d}function ih(e,n){return e+n.slice(l5t(e,n))}function s$(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return ih(e,n);const r=e.slice(0,-t.length);return ih(r,n)+t}function l5t(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function c5t(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Zj(e){let n=0;for(let t=0;t0}function Jj(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function i$(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function d5t(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=i$(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function KS(e,n){let t=n+1;for(;tn+t}function wv(e,n){return n===0||e[n-1]===` +`}function eo(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function eT(e){return!!e&&/[A-Za-z0-9]/.test(e)}function a$(e){return!!e&&/[A-Za-z]/.test(e)}const o$=FS().use(VS);var Fp,Dh,Lh,xd,Oh,Hp,qp,Up,wd,Gp,Sd;class f5t{constructor(){st(this,Fp,o$);st(this,Dh,null);st(this,Lh,{});st(this,xd,null);st(this,Oh,"");st(this,Hp,[]);st(this,qp,[]);st(this,Up,[]);st(this,wd,0);st(this,Gp,[]);st(this,Sd,[])}reconfigure(n,t,r){de(this,Dh)!==null&&de(this,Fp)===n&&l$(de(this,Lh),r)&&!!de(this,xd)===t||(Fe(this,Fp,n),n.attachers.some(s=>s[0]===xv)||(n=n(),n.use(xv),n.freeze()),Fe(this,Dh,n),Fe(this,Lh,r),Fe(this,Oh,""),Fe(this,Hp,[]),Fe(this,qp,[]),Fe(this,Up,[]),Fe(this,wd,0),Fe(this,Gp,[]),Fe(this,xd,t?new G3t:null))}update(n){de(this,xd)&&(n=de(this,xd).update(n));let t=de(this,Oh);if(n===t)return de(this,Sd);const r=de(this,Hp),s=h5t(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Xu(de(this,Dh)),l=de(this,qp),u=l.slice(i).some(N=>N.some(T3));let _=o.parse(n.slice(a)),d=_.children.map(N=>Xu(Xu(N.position).start.offset)+a);Fe(this,Oh,n),G2(r.length===l.length),r.splice(i,r.length-i,...d);{const N=rw(_,d,a);G2(N.length===d.length),l.splice(i,l.length-i,...N)}if(u||T3(_)){i=0,a=0,_=o.parse(n),d=_.children.map(T=>Xu(Xu(T.position).start.offset)+a),r.splice(0,r.length,...d);const N=rw(_,d,a);G2(N.length===d.length),l.splice(0,l.length,...N)}const p=rw(o.runSync(_),d,a),m=de(this,Up),x=de(this,Gp),S=de(this,Sd),v=x.length;let b=null,w=0;for(;wv&&(m.length=x.length=r.length);for(let N=r.length=C?M=v-(r.length-T):T=v){m[T]=String(de(this,wd)),Fe(this,wd,de(this,wd)+1),x[T]=null,b&&(b[T]=void 0);continue}m[T]=m[M]??String(r0(this,wd)._++),x[T]=x[M]??null,b&&(b[T]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||y5t.test(e.slice(0,n))?e:""}const iw={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function E5t(e,n){return u$(e,{})||{type:"root",children:[]}}function u$(e,n){const t=N5t(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function N5t(e,n){switch(e.nodeType){case 1:return A5t(e,n);case 3:return j5t(e);case 8:return T5t(e);case 9:return sT(e,n);case 10:return z5t();case 11:return sT(e,n);default:return}}function sT(e,n){return{type:"root",children:d$(e,n)}}function z5t(){return{type:"doctype"}}function j5t(e){return{type:"text",value:e.nodeValue||""}}function T5t(e){return{type:"comment",value:e.nodeValue||""}}function A5t(e,n){const t=e.namespaceURI,r=t===iw.svg?Myt:dB,s=t===iw.html?e.tagName.toLowerCase():e.tagName,i=t===iw.html&&s==="template"?e.content:e,a=e.getAttributeNames(),o={};let l=-1;for(;++lu&&(u=_):_&&(u!==void 0&&u>-1&&l.push(` +`.repeat(u)||" "),u=-1,l.push(_))}return l.join("")}function h$(e,n,t){return e.type==="element"?F5t(e,n,t):e.type==="text"?t.whitespace==="normal"?_$(e,t):H5t(e):[]}function F5t(e,n,t){const r=p$(e,t),s=e.children||[];let i=-1,a=[];if($5t(e))return a;let o,l;for(A3(e)||cT(e)&&iT(n,e,cT)?l=` +`:B5t(e)?(o=2,l=2):f$(e)&&(o=1,l=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(V5t,"-$1").toLowerCase(),Q5t={"&":"&",">":">","<":"<",'"':""","'":"'"},Y5t=/[&><"']/g,Ks=e=>String(e).replace(Y5t,n=>Q5t[n]),M1=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?M1(e.body[0]):e:e.type==="font"?M1(e.body):e,X5t=new Set(["mathord","textord","atom"]),Wl=e=>X5t.has(M1(e).type),Z5t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},R3={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function J5t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function e6t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return J5t(n)}function t6t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:e6t(r)}class YS{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(R3)){var r=R3[t];r&&t6t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ye("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=Z5t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class $c{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return jo[n6t[this.id]]}sub(){return jo[r6t[this.id]]}fracNum(){return jo[s6t[this.id]]}fracDen(){return jo[i6t[this.id]]}cramp(){return jo[a6t[this.id]]}text(){return jo[o6t[this.id]]}isTight(){return this.size>=2}}var XS=0,Sv=1,hh=2,Pl=3,gp=4,ka=5,Qh=6,oi=7,jo=[new $c(XS,0,!1),new $c(Sv,0,!0),new $c(hh,1,!1),new $c(Pl,1,!0),new $c(gp,2,!1),new $c(ka,2,!0),new $c(Qh,3,!1),new $c(oi,3,!0)],n6t=[gp,ka,gp,ka,Qh,oi,Qh,oi],r6t=[ka,ka,ka,ka,oi,oi,oi,oi],s6t=[hh,Pl,gp,ka,Qh,oi,Qh,oi],i6t=[Pl,Pl,ka,ka,oi,oi,oi,oi],a6t=[Sv,Sv,Pl,Pl,ka,ka,oi,oi],o6t=[XS,Sv,hh,Pl,hh,Pl,hh,Pl],Yt={DISPLAY:jo[XS],TEXT:jo[hh],SCRIPT:jo[gp],SCRIPTSCRIPT:jo[Qh]},M3=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function l6t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var D1=[];M3.forEach(e=>e.blocks.forEach(n=>D1.push(...n)));function m$(e){for(var n=0;n=D1[n]&&e<=D1[n+1])return!0;return!1}var _s=e=>e+" "+e,Wf=80,c6t=function(n,t){return"M95,"+(622+n+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -716,7 +716,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+n)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},a6t=function(n,t){return"M263,"+(601+n+t)+`c0.7,0,18,39.7,52,119 +M`+(834+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},u6t=function(n,t){return"M263,"+(601+n+t)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+n/2.084+" -"+n+` @@ -726,7 +726,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},o6t=function(n,t){return"M983 "+(10+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},d6t=function(n,t){return"M983 "+(10+n+t)+` l`+n/3.13+" -"+n+` c4,-6.7,10,-10,18,-10 H400000v`+(40+n)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -735,7 +735,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},l6t=function(n,t){return"M424,"+(2398+n+t)+` +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},f6t=function(n,t){return"M424,"+(2398+n+t)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -745,18 +745,18 @@ v`+(40+n)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+n)+" "+t+` -h400000v`+(40+n)+"h-400000z"},c6t=function(n,t){return"M473,"+(2713+n+t)+` +h400000v`+(40+n)+"h-400000z"},h6t=function(n,t){return"M473,"+(2713+n+t)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+n/5.298+" -"+n+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+n)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},u6t=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},d6t=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` +606zM`+(1001+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},_6t=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},p6t=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},f6t=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=i6t(t,Wf);break;case"sqrtSize1":s=a6t(t,Wf);break;case"sqrtSize2":s=o6t(t,Wf);break;case"sqrtSize3":s=l6t(t,Wf);break;case"sqrtSize4":s=c6t(t,Wf);break;case"sqrtTall":s=d6t(t,Wf,r)}return s},h6t=function(n,t){switch(n){case"⎜":return _s("M291 0 H417 V"+t+" H291z");case"∣":return _s("M145 0 H188 V"+t+" H145z");case"∥":return _s("M145 0 H188 V"+t+" H145z")+_s("M367 0 H410 V"+t+" H367z");case"⎟":return _s("M457 0 H583 V"+t+" H457z");case"⎢":return _s("M319 0 H403 V"+t+" H319z");case"⎥":return _s("M263 0 H347 V"+t+" H263z");case"⎪":return _s("M384 0 H504 V"+t+" H384z");case"⏐":return _s("M312 0 H355 V"+t+" H312z");case"‖":return _s("M257 0 H300 V"+t+" H257z")+_s("M478 0 H521 V"+t+" H478z");default:return""}},cT={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},m6t=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=c6t(t,Wf);break;case"sqrtSize1":s=u6t(t,Wf);break;case"sqrtSize2":s=d6t(t,Wf);break;case"sqrtSize3":s=f6t(t,Wf);break;case"sqrtSize4":s=h6t(t,Wf);break;case"sqrtTall":s=p6t(t,Wf,r)}return s},g6t=function(n,t){switch(n){case"⎜":return _s("M291 0 H417 V"+t+" H291z");case"∣":return _s("M145 0 H188 V"+t+" H145z");case"∥":return _s("M145 0 H188 V"+t+" H145z")+_s("M367 0 H410 V"+t+" H367z");case"⎟":return _s("M457 0 H583 V"+t+" H457z");case"⎢":return _s("M319 0 H403 V"+t+" H319z");case"⎥":return _s("M263 0 H347 V"+t+" H263z");case"⎪":return _s("M384 0 H504 V"+t+" H384z");case"⏐":return _s("M312 0 H355 V"+t+" H312z");case"‖":return _s("M257 0 H300 V"+t+" H257z")+_s("M478 0 H521 V"+t+" H478z");default:return""}},uT={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -927,7 +927,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},_6t=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},v6t=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -955,47 +955,47 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(p6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var D3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in D3||n in m6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in D3)r=D3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=U5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(g6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class Fb{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class v6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class L3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var w6t=e=>e instanceof m_||e instanceof Fb||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},uT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function S6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in uT&&(r=uT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var ow={};function k6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!ow[n]){var t=ow[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return ow[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",ee="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";P(V,ee,he,"≡","\\equiv",!0);P(V,ee,he,"≺","\\prec",!0);P(V,ee,he,"≻","\\succ",!0);P(V,ee,he,"∼","\\sim",!0);P(V,ee,he,"⊥","\\perp");P(V,ee,he,"⪯","\\preceq",!0);P(V,ee,he,"⪰","\\succeq",!0);P(V,ee,he,"≃","\\simeq",!0);P(V,ee,he,"∣","\\mid",!0);P(V,ee,he,"≪","\\ll",!0);P(V,ee,he,"≫","\\gg",!0);P(V,ee,he,"≍","\\asymp",!0);P(V,ee,he,"∥","\\parallel");P(V,ee,he,"⋈","\\bowtie",!0);P(V,ee,he,"⌣","\\smile",!0);P(V,ee,he,"⊑","\\sqsubseteq",!0);P(V,ee,he,"⊒","\\sqsupseteq",!0);P(V,ee,he,"≐","\\doteq",!0);P(V,ee,he,"⌢","\\frown",!0);P(V,ee,he,"∋","\\ni",!0);P(V,ee,he,"∝","\\propto",!0);P(V,ee,he,"⊢","\\vdash",!0);P(V,ee,he,"⊣","\\dashv",!0);P(V,ee,he,"∋","\\owns");P(V,ee,dm,".","\\ldotp");P(V,ee,dm,"⋅","\\cdotp");P(V,ee,dm,"⋅","·");P(He,ee,ve,"⋅","·");P(V,ee,ve,"#","\\#");P(He,ee,ve,"#","\\#");P(V,ee,ve,"&","\\&");P(He,ee,ve,"&","\\&");P(V,ee,ve,"ℵ","\\aleph",!0);P(V,ee,ve,"∀","\\forall",!0);P(V,ee,ve,"ℏ","\\hbar",!0);P(V,ee,ve,"∃","\\exists",!0);P(V,ee,ve,"∇","\\nabla",!0);P(V,ee,ve,"♭","\\flat",!0);P(V,ee,ve,"ℓ","\\ell",!0);P(V,ee,ve,"♮","\\natural",!0);P(V,ee,ve,"♣","\\clubsuit",!0);P(V,ee,ve,"℘","\\wp",!0);P(V,ee,ve,"♯","\\sharp",!0);P(V,ee,ve,"♢","\\diamondsuit",!0);P(V,ee,ve,"ℜ","\\Re",!0);P(V,ee,ve,"♡","\\heartsuit",!0);P(V,ee,ve,"ℑ","\\Im",!0);P(V,ee,ve,"♠","\\spadesuit",!0);P(V,ee,ve,"§","\\S",!0);P(He,ee,ve,"§","\\S");P(V,ee,ve,"¶","\\P",!0);P(He,ee,ve,"¶","\\P");P(V,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\textdagger");P(V,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\textdaggerdbl");P(V,ee,ui,"⎱","\\rmoustache",!0);P(V,ee,na,"⎰","\\lmoustache",!0);P(V,ee,ui,"⟯","\\rgroup",!0);P(V,ee,na,"⟮","\\lgroup",!0);P(V,ee,dt,"∓","\\mp",!0);P(V,ee,dt,"⊖","\\ominus",!0);P(V,ee,dt,"⊎","\\uplus",!0);P(V,ee,dt,"⊓","\\sqcap",!0);P(V,ee,dt,"∗","\\ast");P(V,ee,dt,"⊔","\\sqcup",!0);P(V,ee,dt,"◯","\\bigcirc",!0);P(V,ee,dt,"∙","\\bullet",!0);P(V,ee,dt,"‡","\\ddagger");P(V,ee,dt,"≀","\\wr",!0);P(V,ee,dt,"⨿","\\amalg");P(V,ee,dt,"&","\\And");P(V,ee,he,"⟵","\\longleftarrow",!0);P(V,ee,he,"⇐","\\Leftarrow",!0);P(V,ee,he,"⟸","\\Longleftarrow",!0);P(V,ee,he,"⟶","\\longrightarrow",!0);P(V,ee,he,"⇒","\\Rightarrow",!0);P(V,ee,he,"⟹","\\Longrightarrow",!0);P(V,ee,he,"↔","\\leftrightarrow",!0);P(V,ee,he,"⟷","\\longleftrightarrow",!0);P(V,ee,he,"⇔","\\Leftrightarrow",!0);P(V,ee,he,"⟺","\\Longleftrightarrow",!0);P(V,ee,he,"↦","\\mapsto",!0);P(V,ee,he,"⟼","\\longmapsto",!0);P(V,ee,he,"↗","\\nearrow",!0);P(V,ee,he,"↩","\\hookleftarrow",!0);P(V,ee,he,"↪","\\hookrightarrow",!0);P(V,ee,he,"↘","\\searrow",!0);P(V,ee,he,"↼","\\leftharpoonup",!0);P(V,ee,he,"⇀","\\rightharpoonup",!0);P(V,ee,he,"↙","\\swarrow",!0);P(V,ee,he,"↽","\\leftharpoondown",!0);P(V,ee,he,"⇁","\\rightharpoondown",!0);P(V,ee,he,"↖","\\nwarrow",!0);P(V,ee,he,"⇌","\\rightleftharpoons",!0);P(V,fe,he,"≮","\\nless",!0);P(V,fe,he,"","\\@nleqslant");P(V,fe,he,"","\\@nleqq");P(V,fe,he,"⪇","\\lneq",!0);P(V,fe,he,"≨","\\lneqq",!0);P(V,fe,he,"","\\@lvertneqq");P(V,fe,he,"⋦","\\lnsim",!0);P(V,fe,he,"⪉","\\lnapprox",!0);P(V,fe,he,"⊀","\\nprec",!0);P(V,fe,he,"⋠","\\npreceq",!0);P(V,fe,he,"⋨","\\precnsim",!0);P(V,fe,he,"⪹","\\precnapprox",!0);P(V,fe,he,"≁","\\nsim",!0);P(V,fe,he,"","\\@nshortmid");P(V,fe,he,"∤","\\nmid",!0);P(V,fe,he,"⊬","\\nvdash",!0);P(V,fe,he,"⊭","\\nvDash",!0);P(V,fe,he,"⋪","\\ntriangleleft");P(V,fe,he,"⋬","\\ntrianglelefteq",!0);P(V,fe,he,"⊊","\\subsetneq",!0);P(V,fe,he,"","\\@varsubsetneq");P(V,fe,he,"⫋","\\subsetneqq",!0);P(V,fe,he,"","\\@varsubsetneqq");P(V,fe,he,"≯","\\ngtr",!0);P(V,fe,he,"","\\@ngeqslant");P(V,fe,he,"","\\@ngeqq");P(V,fe,he,"⪈","\\gneq",!0);P(V,fe,he,"≩","\\gneqq",!0);P(V,fe,he,"","\\@gvertneqq");P(V,fe,he,"⋧","\\gnsim",!0);P(V,fe,he,"⪊","\\gnapprox",!0);P(V,fe,he,"⊁","\\nsucc",!0);P(V,fe,he,"⋡","\\nsucceq",!0);P(V,fe,he,"⋩","\\succnsim",!0);P(V,fe,he,"⪺","\\succnapprox",!0);P(V,fe,he,"≆","\\ncong",!0);P(V,fe,he,"","\\@nshortparallel");P(V,fe,he,"∦","\\nparallel",!0);P(V,fe,he,"⊯","\\nVDash",!0);P(V,fe,he,"⋫","\\ntriangleright");P(V,fe,he,"⋭","\\ntrianglerighteq",!0);P(V,fe,he,"","\\@nsupseteqq");P(V,fe,he,"⊋","\\supsetneq",!0);P(V,fe,he,"","\\@varsupsetneq");P(V,fe,he,"⫌","\\supsetneqq",!0);P(V,fe,he,"","\\@varsupsetneqq");P(V,fe,he,"⊮","\\nVdash",!0);P(V,fe,he,"⪵","\\precneqq",!0);P(V,fe,he,"⪶","\\succneqq",!0);P(V,fe,he,"","\\@nsubseteqq");P(V,fe,dt,"⊴","\\unlhd");P(V,fe,dt,"⊵","\\unrhd");P(V,fe,he,"↚","\\nleftarrow",!0);P(V,fe,he,"↛","\\nrightarrow",!0);P(V,fe,he,"⇍","\\nLeftarrow",!0);P(V,fe,he,"⇏","\\nRightarrow",!0);P(V,fe,he,"↮","\\nleftrightarrow",!0);P(V,fe,he,"⇎","\\nLeftrightarrow",!0);P(V,fe,he,"△","\\vartriangle");P(V,fe,ve,"ℏ","\\hslash");P(V,fe,ve,"▽","\\triangledown");P(V,fe,ve,"◊","\\lozenge");P(V,fe,ve,"Ⓢ","\\circledS");P(V,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(V,fe,ve,"∡","\\measuredangle",!0);P(V,fe,ve,"∄","\\nexists");P(V,fe,ve,"℧","\\mho");P(V,fe,ve,"Ⅎ","\\Finv",!0);P(V,fe,ve,"⅁","\\Game",!0);P(V,fe,ve,"‵","\\backprime");P(V,fe,ve,"▲","\\blacktriangle");P(V,fe,ve,"▼","\\blacktriangledown");P(V,fe,ve,"■","\\blacksquare");P(V,fe,ve,"⧫","\\blacklozenge");P(V,fe,ve,"★","\\bigstar");P(V,fe,ve,"∢","\\sphericalangle",!0);P(V,fe,ve,"∁","\\complement",!0);P(V,fe,ve,"ð","\\eth",!0);P(He,ee,ve,"ð","ð");P(V,fe,ve,"╱","\\diagup");P(V,fe,ve,"╲","\\diagdown");P(V,fe,ve,"□","\\square");P(V,fe,ve,"□","\\Box");P(V,fe,ve,"◊","\\Diamond");P(V,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(V,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(V,fe,ve,"ℶ","\\beth",!0);P(V,fe,ve,"ℸ","\\daleth",!0);P(V,fe,ve,"ℷ","\\gimel",!0);P(V,fe,ve,"ϝ","\\digamma",!0);P(V,fe,ve,"ϰ","\\varkappa");P(V,fe,na,"┌","\\@ulcorner",!0);P(V,fe,ui,"┐","\\@urcorner",!0);P(V,fe,na,"└","\\@llcorner",!0);P(V,fe,ui,"┘","\\@lrcorner",!0);P(V,fe,he,"≦","\\leqq",!0);P(V,fe,he,"⩽","\\leqslant",!0);P(V,fe,he,"⪕","\\eqslantless",!0);P(V,fe,he,"≲","\\lesssim",!0);P(V,fe,he,"⪅","\\lessapprox",!0);P(V,fe,he,"≊","\\approxeq",!0);P(V,fe,dt,"⋖","\\lessdot");P(V,fe,he,"⋘","\\lll",!0);P(V,fe,he,"≶","\\lessgtr",!0);P(V,fe,he,"⋚","\\lesseqgtr",!0);P(V,fe,he,"⪋","\\lesseqqgtr",!0);P(V,fe,he,"≑","\\doteqdot");P(V,fe,he,"≓","\\risingdotseq",!0);P(V,fe,he,"≒","\\fallingdotseq",!0);P(V,fe,he,"∽","\\backsim",!0);P(V,fe,he,"⋍","\\backsimeq",!0);P(V,fe,he,"⫅","\\subseteqq",!0);P(V,fe,he,"⋐","\\Subset",!0);P(V,fe,he,"⊏","\\sqsubset",!0);P(V,fe,he,"≼","\\preccurlyeq",!0);P(V,fe,he,"⋞","\\curlyeqprec",!0);P(V,fe,he,"≾","\\precsim",!0);P(V,fe,he,"⪷","\\precapprox",!0);P(V,fe,he,"⊲","\\vartriangleleft");P(V,fe,he,"⊴","\\trianglelefteq");P(V,fe,he,"⊨","\\vDash",!0);P(V,fe,he,"⊪","\\Vvdash",!0);P(V,fe,he,"⌣","\\smallsmile");P(V,fe,he,"⌢","\\smallfrown");P(V,fe,he,"≏","\\bumpeq",!0);P(V,fe,he,"≎","\\Bumpeq",!0);P(V,fe,he,"≧","\\geqq",!0);P(V,fe,he,"⩾","\\geqslant",!0);P(V,fe,he,"⪖","\\eqslantgtr",!0);P(V,fe,he,"≳","\\gtrsim",!0);P(V,fe,he,"⪆","\\gtrapprox",!0);P(V,fe,dt,"⋗","\\gtrdot");P(V,fe,he,"⋙","\\ggg",!0);P(V,fe,he,"≷","\\gtrless",!0);P(V,fe,he,"⋛","\\gtreqless",!0);P(V,fe,he,"⪌","\\gtreqqless",!0);P(V,fe,he,"≖","\\eqcirc",!0);P(V,fe,he,"≗","\\circeq",!0);P(V,fe,he,"≜","\\triangleq",!0);P(V,fe,he,"∼","\\thicksim");P(V,fe,he,"≈","\\thickapprox");P(V,fe,he,"⫆","\\supseteqq",!0);P(V,fe,he,"⋑","\\Supset",!0);P(V,fe,he,"⊐","\\sqsupset",!0);P(V,fe,he,"≽","\\succcurlyeq",!0);P(V,fe,he,"⋟","\\curlyeqsucc",!0);P(V,fe,he,"≿","\\succsim",!0);P(V,fe,he,"⪸","\\succapprox",!0);P(V,fe,he,"⊳","\\vartriangleright");P(V,fe,he,"⊵","\\trianglerighteq");P(V,fe,he,"⊩","\\Vdash",!0);P(V,fe,he,"∣","\\shortmid");P(V,fe,he,"∥","\\shortparallel");P(V,fe,he,"≬","\\between",!0);P(V,fe,he,"⋔","\\pitchfork",!0);P(V,fe,he,"∝","\\varpropto");P(V,fe,he,"◀","\\blacktriangleleft");P(V,fe,he,"∴","\\therefore",!0);P(V,fe,he,"∍","\\backepsilon");P(V,fe,he,"▶","\\blacktriangleright");P(V,fe,he,"∵","\\because",!0);P(V,fe,he,"⋘","\\llless");P(V,fe,he,"⋙","\\gggtr");P(V,fe,dt,"⊲","\\lhd");P(V,fe,dt,"⊳","\\rhd");P(V,fe,he,"≂","\\eqsim",!0);P(V,ee,he,"⋈","\\Join");P(V,fe,he,"≑","\\Doteq",!0);P(V,fe,dt,"∔","\\dotplus",!0);P(V,fe,dt,"∖","\\smallsetminus");P(V,fe,dt,"⋒","\\Cap",!0);P(V,fe,dt,"⋓","\\Cup",!0);P(V,fe,dt,"⩞","\\doublebarwedge",!0);P(V,fe,dt,"⊟","\\boxminus",!0);P(V,fe,dt,"⊞","\\boxplus",!0);P(V,fe,dt,"⋇","\\divideontimes",!0);P(V,fe,dt,"⋉","\\ltimes",!0);P(V,fe,dt,"⋊","\\rtimes",!0);P(V,fe,dt,"⋋","\\leftthreetimes",!0);P(V,fe,dt,"⋌","\\rightthreetimes",!0);P(V,fe,dt,"⋏","\\curlywedge",!0);P(V,fe,dt,"⋎","\\curlyvee",!0);P(V,fe,dt,"⊝","\\circleddash",!0);P(V,fe,dt,"⊛","\\circledast",!0);P(V,fe,dt,"⋅","\\centerdot");P(V,fe,dt,"⊺","\\intercal",!0);P(V,fe,dt,"⋒","\\doublecap");P(V,fe,dt,"⋓","\\doublecup");P(V,fe,dt,"⊠","\\boxtimes",!0);P(V,fe,he,"⇢","\\dashrightarrow",!0);P(V,fe,he,"⇠","\\dashleftarrow",!0);P(V,fe,he,"⇇","\\leftleftarrows",!0);P(V,fe,he,"⇆","\\leftrightarrows",!0);P(V,fe,he,"⇚","\\Lleftarrow",!0);P(V,fe,he,"↞","\\twoheadleftarrow",!0);P(V,fe,he,"↢","\\leftarrowtail",!0);P(V,fe,he,"↫","\\looparrowleft",!0);P(V,fe,he,"⇋","\\leftrightharpoons",!0);P(V,fe,he,"↶","\\curvearrowleft",!0);P(V,fe,he,"↺","\\circlearrowleft",!0);P(V,fe,he,"↰","\\Lsh",!0);P(V,fe,he,"⇈","\\upuparrows",!0);P(V,fe,he,"↿","\\upharpoonleft",!0);P(V,fe,he,"⇃","\\downharpoonleft",!0);P(V,ee,he,"⊶","\\origof",!0);P(V,ee,he,"⊷","\\imageof",!0);P(V,fe,he,"⊸","\\multimap",!0);P(V,fe,he,"↭","\\leftrightsquigarrow",!0);P(V,fe,he,"⇉","\\rightrightarrows",!0);P(V,fe,he,"⇄","\\rightleftarrows",!0);P(V,fe,he,"↠","\\twoheadrightarrow",!0);P(V,fe,he,"↣","\\rightarrowtail",!0);P(V,fe,he,"↬","\\looparrowright",!0);P(V,fe,he,"↷","\\curvearrowright",!0);P(V,fe,he,"↻","\\circlearrowright",!0);P(V,fe,he,"↱","\\Rsh",!0);P(V,fe,he,"⇊","\\downdownarrows",!0);P(V,fe,he,"↾","\\upharpoonright",!0);P(V,fe,he,"⇂","\\downharpoonright",!0);P(V,fe,he,"⇝","\\rightsquigarrow",!0);P(V,fe,he,"⇝","\\leadsto");P(V,fe,he,"⇛","\\Rrightarrow",!0);P(V,fe,he,"↾","\\restriction");P(V,ee,ve,"‘","`");P(V,ee,ve,"$","\\$");P(He,ee,ve,"$","\\$");P(He,ee,ve,"$","\\textdollar");P(V,ee,ve,"%","\\%");P(He,ee,ve,"%","\\%");P(V,ee,ve,"_","\\_");P(He,ee,ve,"_","\\_");P(He,ee,ve,"_","\\textunderscore");P(V,ee,ve,"∠","\\angle",!0);P(V,ee,ve,"∞","\\infty",!0);P(V,ee,ve,"′","\\prime");P(V,ee,ve,"△","\\triangle");P(V,ee,ve,"Γ","\\Gamma",!0);P(V,ee,ve,"Δ","\\Delta",!0);P(V,ee,ve,"Θ","\\Theta",!0);P(V,ee,ve,"Λ","\\Lambda",!0);P(V,ee,ve,"Ξ","\\Xi",!0);P(V,ee,ve,"Π","\\Pi",!0);P(V,ee,ve,"Σ","\\Sigma",!0);P(V,ee,ve,"Υ","\\Upsilon",!0);P(V,ee,ve,"Φ","\\Phi",!0);P(V,ee,ve,"Ψ","\\Psi",!0);P(V,ee,ve,"Ω","\\Omega",!0);P(V,ee,ve,"A","Α");P(V,ee,ve,"B","Β");P(V,ee,ve,"E","Ε");P(V,ee,ve,"Z","Ζ");P(V,ee,ve,"H","Η");P(V,ee,ve,"I","Ι");P(V,ee,ve,"K","Κ");P(V,ee,ve,"M","Μ");P(V,ee,ve,"N","Ν");P(V,ee,ve,"O","Ο");P(V,ee,ve,"P","Ρ");P(V,ee,ve,"T","Τ");P(V,ee,ve,"X","Χ");P(V,ee,ve,"¬","\\neg",!0);P(V,ee,ve,"¬","\\lnot");P(V,ee,ve,"⊤","\\top");P(V,ee,ve,"⊥","\\bot");P(V,ee,ve,"∅","\\emptyset");P(V,fe,ve,"∅","\\varnothing");P(V,ee,Bt,"α","\\alpha",!0);P(V,ee,Bt,"β","\\beta",!0);P(V,ee,Bt,"γ","\\gamma",!0);P(V,ee,Bt,"δ","\\delta",!0);P(V,ee,Bt,"ϵ","\\epsilon",!0);P(V,ee,Bt,"ζ","\\zeta",!0);P(V,ee,Bt,"η","\\eta",!0);P(V,ee,Bt,"θ","\\theta",!0);P(V,ee,Bt,"ι","\\iota",!0);P(V,ee,Bt,"κ","\\kappa",!0);P(V,ee,Bt,"λ","\\lambda",!0);P(V,ee,Bt,"μ","\\mu",!0);P(V,ee,Bt,"ν","\\nu",!0);P(V,ee,Bt,"ξ","\\xi",!0);P(V,ee,Bt,"ο","\\omicron",!0);P(V,ee,Bt,"π","\\pi",!0);P(V,ee,Bt,"ρ","\\rho",!0);P(V,ee,Bt,"σ","\\sigma",!0);P(V,ee,Bt,"τ","\\tau",!0);P(V,ee,Bt,"υ","\\upsilon",!0);P(V,ee,Bt,"ϕ","\\phi",!0);P(V,ee,Bt,"χ","\\chi",!0);P(V,ee,Bt,"ψ","\\psi",!0);P(V,ee,Bt,"ω","\\omega",!0);P(V,ee,Bt,"ε","\\varepsilon",!0);P(V,ee,Bt,"ϑ","\\vartheta",!0);P(V,ee,Bt,"ϖ","\\varpi",!0);P(V,ee,Bt,"ϱ","\\varrho",!0);P(V,ee,Bt,"ς","\\varsigma",!0);P(V,ee,Bt,"φ","\\varphi",!0);P(V,ee,dt,"∗","*",!0);P(V,ee,dt,"+","+");P(V,ee,dt,"−","-",!0);P(V,ee,dt,"⋅","\\cdot",!0);P(V,ee,dt,"∘","\\circ",!0);P(V,ee,dt,"÷","\\div",!0);P(V,ee,dt,"±","\\pm",!0);P(V,ee,dt,"×","\\times",!0);P(V,ee,dt,"∩","\\cap",!0);P(V,ee,dt,"∪","\\cup",!0);P(V,ee,dt,"∖","\\setminus",!0);P(V,ee,dt,"∧","\\land");P(V,ee,dt,"∨","\\lor");P(V,ee,dt,"∧","\\wedge",!0);P(V,ee,dt,"∨","\\vee",!0);P(V,ee,ve,"√","\\surd");P(V,ee,na,"⟨","\\langle",!0);P(V,ee,na,"∣","\\lvert");P(V,ee,na,"∥","\\lVert");P(V,ee,ui,"?","?");P(V,ee,ui,"!","!");P(V,ee,ui,"⟩","\\rangle",!0);P(V,ee,ui,"∣","\\rvert");P(V,ee,ui,"∥","\\rVert");P(V,ee,he,"=","=");P(V,ee,he,":",":");P(V,ee,he,"≈","\\approx",!0);P(V,ee,he,"≅","\\cong",!0);P(V,ee,he,"≥","\\ge");P(V,ee,he,"≥","\\geq",!0);P(V,ee,he,"←","\\gets");P(V,ee,he,">","\\gt",!0);P(V,ee,he,"∈","\\in",!0);P(V,ee,he,"","\\@not");P(V,ee,he,"⊂","\\subset",!0);P(V,ee,he,"⊃","\\supset",!0);P(V,ee,he,"⊆","\\subseteq",!0);P(V,ee,he,"⊇","\\supseteq",!0);P(V,fe,he,"⊈","\\nsubseteq",!0);P(V,fe,he,"⊉","\\nsupseteq",!0);P(V,ee,he,"⊨","\\models");P(V,ee,he,"←","\\leftarrow",!0);P(V,ee,he,"≤","\\le");P(V,ee,he,"≤","\\leq",!0);P(V,ee,he,"<","\\lt",!0);P(V,ee,he,"→","\\rightarrow",!0);P(V,ee,he,"→","\\to");P(V,fe,he,"≱","\\ngeq",!0);P(V,fe,he,"≰","\\nleq",!0);P(V,ee,Vl," ","\\ ");P(V,ee,Vl," ","\\space");P(V,ee,Vl," ","\\nobreakspace");P(He,ee,Vl," ","\\ ");P(He,ee,Vl," "," ");P(He,ee,Vl," ","\\space");P(He,ee,Vl," ","\\nobreakspace");P(V,ee,Vl,"","\\nobreak");P(V,ee,Vl,"","\\allowbreak");P(V,ee,dm,",",",");P(V,ee,dm,";",";");P(V,fe,dt,"⊼","\\barwedge",!0);P(V,fe,dt,"⊻","\\veebar",!0);P(V,ee,dt,"⊙","\\odot",!0);P(V,ee,dt,"⊕","\\oplus",!0);P(V,ee,dt,"⊗","\\otimes",!0);P(V,ee,ve,"∂","\\partial",!0);P(V,ee,dt,"⊘","\\oslash",!0);P(V,fe,dt,"⊚","\\circledcirc",!0);P(V,fe,dt,"⊡","\\boxdot",!0);P(V,ee,dt,"△","\\bigtriangleup");P(V,ee,dt,"▽","\\bigtriangledown");P(V,ee,dt,"†","\\dagger");P(V,ee,dt,"⋄","\\diamond");P(V,ee,dt,"⋆","\\star");P(V,ee,dt,"◃","\\triangleleft");P(V,ee,dt,"▹","\\triangleright");P(V,ee,na,"{","\\{");P(He,ee,ve,"{","\\{");P(He,ee,ve,"{","\\textbraceleft");P(V,ee,ui,"}","\\}");P(He,ee,ve,"}","\\}");P(He,ee,ve,"}","\\textbraceright");P(V,ee,na,"{","\\lbrace");P(V,ee,ui,"}","\\rbrace");P(V,ee,na,"[","\\lbrack",!0);P(He,ee,ve,"[","\\lbrack",!0);P(V,ee,ui,"]","\\rbrack",!0);P(He,ee,ve,"]","\\rbrack",!0);P(V,ee,na,"(","\\lparen",!0);P(V,ee,ui,")","\\rparen",!0);P(He,ee,ve,"<","\\textless",!0);P(He,ee,ve,">","\\textgreater",!0);P(V,ee,na,"⌊","\\lfloor",!0);P(V,ee,ui,"⌋","\\rfloor",!0);P(V,ee,na,"⌈","\\lceil",!0);P(V,ee,ui,"⌉","\\rceil",!0);P(V,ee,ve,"\\","\\backslash");P(V,ee,ve,"∣","|");P(V,ee,ve,"∣","\\vert");P(He,ee,ve,"|","\\textbar",!0);P(V,ee,ve,"∥","\\|");P(V,ee,ve,"∥","\\Vert");P(He,ee,ve,"∥","\\textbardbl");P(He,ee,ve,"~","\\textasciitilde");P(He,ee,ve,"\\","\\textbackslash");P(He,ee,ve,"^","\\textasciicircum");P(V,ee,he,"↑","\\uparrow",!0);P(V,ee,he,"⇑","\\Uparrow",!0);P(V,ee,he,"↓","\\downarrow",!0);P(V,ee,he,"⇓","\\Downarrow",!0);P(V,ee,he,"↕","\\updownarrow",!0);P(V,ee,he,"⇕","\\Updownarrow",!0);P(V,ee,is,"∐","\\coprod");P(V,ee,is,"⋁","\\bigvee");P(V,ee,is,"⋀","\\bigwedge");P(V,ee,is,"⨄","\\biguplus");P(V,ee,is,"⋂","\\bigcap");P(V,ee,is,"⋃","\\bigcup");P(V,ee,is,"∫","\\int");P(V,ee,is,"∫","\\intop");P(V,ee,is,"∬","\\iint");P(V,ee,is,"∭","\\iiint");P(V,ee,is,"∏","\\prod");P(V,ee,is,"∑","\\sum");P(V,ee,is,"⨂","\\bigotimes");P(V,ee,is,"⨁","\\bigoplus");P(V,ee,is,"⨀","\\bigodot");P(V,ee,is,"∮","\\oint");P(V,ee,is,"∯","\\oiint");P(V,ee,is,"∰","\\oiiint");P(V,ee,is,"⨆","\\bigsqcup");P(V,ee,is,"∫","\\smallint");P(He,ee,g_,"…","\\textellipsis");P(V,ee,g_,"…","\\mathellipsis");P(He,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"⋯","\\@cdots",!0);P(V,ee,g_,"⋱","\\ddots",!0);P(V,ee,ve,"⋮","\\varvdots");P(He,ee,ve,"⋮","\\varvdots");P(V,ee,Cr,"ˊ","\\acute");P(V,ee,Cr,"ˋ","\\grave");P(V,ee,Cr,"¨","\\ddot");P(V,ee,Cr,"~","\\tilde");P(V,ee,Cr,"ˉ","\\bar");P(V,ee,Cr,"˘","\\breve");P(V,ee,Cr,"ˇ","\\check");P(V,ee,Cr,"^","\\hat");P(V,ee,Cr,"⃗","\\vec");P(V,ee,Cr,"˙","\\dot");P(V,ee,Cr,"˚","\\mathring");P(V,ee,Bt,"","\\@imath");P(V,ee,Bt,"","\\@jmath");P(V,ee,ve,"ı","ı");P(V,ee,ve,"ȷ","ȷ");P(He,ee,ve,"ı","\\i",!0);P(He,ee,ve,"ȷ","\\j",!0);P(He,ee,ve,"ß","\\ss",!0);P(He,ee,ve,"æ","\\ae",!0);P(He,ee,ve,"œ","\\oe",!0);P(He,ee,ve,"ø","\\o",!0);P(He,ee,ve,"Æ","\\AE",!0);P(He,ee,ve,"Œ","\\OE",!0);P(He,ee,ve,"Ø","\\O",!0);P(He,ee,Cr,"ˊ","\\'");P(He,ee,Cr,"ˋ","\\`");P(He,ee,Cr,"ˆ","\\^");P(He,ee,Cr,"˜","\\~");P(He,ee,Cr,"ˉ","\\=");P(He,ee,Cr,"˘","\\u");P(He,ee,Cr,"˙","\\.");P(He,ee,Cr,"¸","\\c");P(He,ee,Cr,"˚","\\r");P(He,ee,Cr,"ˇ","\\v");P(He,ee,Cr,"¨",'\\"');P(He,ee,Cr,"˝","\\H");P(He,ee,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,ee,ve,"–","--",!0);P(He,ee,ve,"–","\\textendash");P(He,ee,ve,"—","---",!0);P(He,ee,ve,"—","\\textemdash");P(He,ee,ve,"‘","`",!0);P(He,ee,ve,"‘","\\textquoteleft");P(He,ee,ve,"’","'",!0);P(He,ee,ve,"’","\\textquoteright");P(He,ee,ve,"“","``",!0);P(He,ee,ve,"“","\\textquotedblleft");P(He,ee,ve,"”","''",!0);P(He,ee,ve,"”","\\textquotedblright");P(V,ee,ve,"°","\\degree",!0);P(He,ee,ve,"°","\\degree");P(He,ee,ve,"°","\\textdegree",!0);P(V,ee,ve,"£","\\pounds");P(V,ee,ve,"£","\\mathsterling",!0);P(He,ee,ve,"£","\\pounds");P(He,ee,ve,"£","\\textsterling",!0);P(V,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var dT='0123456789/@."';for(var lw=0;lw{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return xT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return E6t[i]}else{if(r===120485||r===120486)return xT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},T6t=function(n,t,r,s){var i=new Fb(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},A6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},F3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},R6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},M6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},Ev={},Nv={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&L6t.has(b)?S.classes[0]="mord":b==="mbin"&&D6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),H3(i,(x,S)=>{var v,b,w=U3(S),y=U3(x),C=w&&y?x.hasClass("mtight")?(v=M6t[w])==null?void 0:v[y]:(b=R6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},H3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof Fb||n instanceof m_&&n.hasClass("enclosing")?n:null},q3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return q3(s[s.length-1],"right");if(t==="left")return q3(s[0],"left")}}return n},U3=function(n,t){if(!n)return null;t&&(n=q3(n,t));var r=n.classes[0];return I6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(Ev[n.type]){var s=Ev[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function G3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var B6t=new Set(["\\imath","\\jmath"]),$6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},P6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=P6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(B6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=F3[t].fontName;return JS(i,o,r)?F3[t].variant:null};function fw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||fw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Nv[n.type])return Nv[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function wT(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&$6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var F6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ST=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],kT=function(n,t){return t.size<2?n:F6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=ST[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:kT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:ST[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=kT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=k6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},H6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return wT(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=G3(n,s);i=Ge(["katex"],[a])}else{var o=wT(n,t,s,r.displayMode,!1),l=G3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},q6t=function(n,t,r){var s=T$(r),i=G3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},U6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ub=function(n){var t=new Xe("mo",[new rs(U6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},G6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},W6t=new Set(["widehat","widecheck","widetilde","utilde"]),Gb=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(W6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=G6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},V6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new L3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new L3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},K6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y6t(e){return e in K6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Wb(e){var n=Vb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Vb(e){return e&&(e.type==="atom"||Q6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(w6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=x6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=Gb(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=qb({mode:r.mode,text:r.label},n,"textord"),m=y6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?Ub(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},X6t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=zv(n[0]),r=!X6t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=Gb(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=Ub(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=Gb(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=Ub(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Kb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Kb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Kb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Kb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Z6t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},CT=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ET=e=>e.type==="textord"&&e.text==="@",J6t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function eSt(e,n,t){var r=Z6t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function tSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=eSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=CT()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var W3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},nSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(W3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=W3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===W3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=nSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},rSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},sSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=sSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},hw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},_w=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",h6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},V3=.008,t1={type:"kern",size:-1*V3},iSt=new Set(["|","\\lvert","\\rvert","\\vert"]),aSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):iSt.has(n)?(u="∣",d="vert",p=333):aSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var H=M-S-y,q=Math.round(M*1e3),Y=_6t(d,Math.round(H*1e3)),G=new mu(d,Y),X=et(p/1e3),te=et(q/1e3),I=new ql([G],{width:X,height:te,viewBox:"0 0 "+p+" "+q}),L=gu([],[I],s);L.height=q/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(hw(_,m,i)),$.push(t1),l===null){var F=M-S-y+2*V3;$.push(_w(u,F,s))}else{var W=(M-S-y-C)/2+2*V3;$.push(_w(u,W,s)),$.push(t1),$.push(hw(l,m,i)),$.push(t1),$.push(_w(u,W,s))}$.push(t1),$.push(hw(o,m,i))}var U=s.havingBaseStyle(Yt.TEXT),Z=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[Z],U),Yt.TEXT,s,a)},pw=80,mw=.08,gw=function(n,t,r,s,i){var a=f6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},oSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+pw,n<1?i=1:n<1.4&&(i=.7),l=(1+a+mw)/i,u=(1+a)/i,o=gw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+pw)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+mw)/i,o=gw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+mw,u=n+a,_=Math.floor(1e3*n+a)+pw,o=gw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),lSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(lSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},cSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},K3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=cSt:q$.has(n)?o=W$:o=uSt;var l=V$(n,t,o,s);return l.type==="small"?rSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},vw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return K3(n,d,!0,s,i,a)},NT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},fSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function zT(e){return"isMiddle"in e}function Qb(e,n){var t=Vb(e);if(t&&fSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Qb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:NT[e.funcName].size,mclass:NT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function jT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Qb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Qb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{jT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{jT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Qb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Yb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=u6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=V6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Xb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Yb,mathmlBuilder:Xb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},hSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(TT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ue;le=(oe=(ue=U)==null?void 0:ue.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),q.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},_St={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Vb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Wb(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Vb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Wb(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){hSt.has(e.envName)&&Zb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Zb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Zb(e),tSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var AT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},RT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=zv(n[0]),i=r;return i in RT&&(i=RT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Kb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var pSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:pSt,mathmlBuilder:mSt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var MT=["display","text","script","scriptscript"],DT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=zv(n[0]),a=i.type==="atom"&&i.family==="open"?DT(i.text):null,o=zv(n[1]),l=o.type==="atom"&&o.family==="close"?DT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=MT[Number(x.text)]}}else m=sn(m,"textord"),p=MT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=Gb(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},gSt=(e,n)=>{var t=Ub(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:gSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return T6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var bw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new v6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var LT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=LT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=LT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},vSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=vSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var bSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=bSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:ySt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:OT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:OT.indexOf(r)+1,body:i}},htmlBuilder:xSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var Q3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function wSt(e){return e in Q3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!wSt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=Q3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=Q3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var SSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=SSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=U3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return qb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return qb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var yw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},xw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(xw.hasOwnProperty(e.text)){var t=xw[e.text].className||"";if(e.mode==="text"){var r=qb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(yw.hasOwnProperty(e.text))return Ge(["mspace",yw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(xw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(yw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var IT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[IT(),new Xe("mtd",[vu(e.body,n)]),IT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var BT={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},$T={"\\textbf":"textbf","\\textmd":"textmd"},kSt={"\\textit":"textit","\\textup":"textup"},PT=(e,n)=>{var t=e.font;if(t){if(BT[t])return n.withTextFontFamily(BT[t]);if($T[t])return n.withTextFontWeight($T[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(kSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=PT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=PT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=FT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r - ]`,CSt="\\\\[a-zA-Z@]+",ESt="\\\\[^\uD800-\uDFFF]",NSt="("+CSt+")"+aP+"*",zSt=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function b6t(e){return"toText"in e}class p_{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(b6t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var D3={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},y6t={ex:!0,em:!0,mu:!0},g$=function(n){return typeof n!="string"&&(n=n.unit),n in D3||n in y6t||n==="ex"},Ar=function(n,t){var r;if(n.unit in D3)r=D3[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ye("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},et=function(n){return+n.toFixed(4)+"em"},pu=function(n){return n.filter(t=>t).join(" ")},ZS=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=K5t(r)+":"+s+";")}return t},v$=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},b$=function(n){var t=document.createElement(n);t.className=pu(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,y$=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ks(pu(this.classes))+'"');var r=ZS(this.style);r&&(t+=' style="'+Ks(r)+'"');for(var s of Object.keys(this.attributes)){if(x6t.test(s))throw new Ye("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ks(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class m_{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,v$.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"span")}toMarkup(){return y$.call(this,"span")}}class Pb{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,v$.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return b$.call(this,"a")}toMarkup(){return y$.call(this,"a")}}class w6t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ks(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=et(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=pu(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+et(this.italic)+";"),r+=ZS(this.style),r&&(n=!0,t+=' style="'+Ks(r)+'"');var s=Ks(this.text);return n?(t+=">",t+=s,t+="",t):s}}class ql{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class L3{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var E6t=e=>e instanceof m_||e instanceof Pb||e instanceof p_,Ao={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qg={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},dT={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function N6t(e,n){Ao[e]=n}function JS(e,n,t){if(!Ao[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Ao[n][r];if(!s&&e[0]in dT&&(r=dT[e[0]].charCodeAt(0),s=Ao[n][r]),!s&&t==="text"&&m$(r)&&(s=Ao[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var aw={};function z6t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!aw[n]){var t=aw[n]={cssEmPerMu:Qg.quad[n]/18};for(var r in Qg)Qg.hasOwnProperty(r)&&(t[r]=Qg[r][n])}return aw[n]}var Sr={math:{},text:{}};function P(e,n,t,r,s,i){Sr[e][s]={font:n,group:t,replace:r},i&&r&&(Sr[e][r]=Sr[e][s])}var V="math",He="text",ee="main",fe="ams",Cr="accent-token",dt="bin",ui="close",g_="inner",Bt="mathord",is="op-token",na="open",dm="punct",he="rel",Vl="spacing",ve="textord";P(V,ee,he,"≡","\\equiv",!0);P(V,ee,he,"≺","\\prec",!0);P(V,ee,he,"≻","\\succ",!0);P(V,ee,he,"∼","\\sim",!0);P(V,ee,he,"⊥","\\perp");P(V,ee,he,"⪯","\\preceq",!0);P(V,ee,he,"⪰","\\succeq",!0);P(V,ee,he,"≃","\\simeq",!0);P(V,ee,he,"∣","\\mid",!0);P(V,ee,he,"≪","\\ll",!0);P(V,ee,he,"≫","\\gg",!0);P(V,ee,he,"≍","\\asymp",!0);P(V,ee,he,"∥","\\parallel");P(V,ee,he,"⋈","\\bowtie",!0);P(V,ee,he,"⌣","\\smile",!0);P(V,ee,he,"⊑","\\sqsubseteq",!0);P(V,ee,he,"⊒","\\sqsupseteq",!0);P(V,ee,he,"≐","\\doteq",!0);P(V,ee,he,"⌢","\\frown",!0);P(V,ee,he,"∋","\\ni",!0);P(V,ee,he,"∝","\\propto",!0);P(V,ee,he,"⊢","\\vdash",!0);P(V,ee,he,"⊣","\\dashv",!0);P(V,ee,he,"∋","\\owns");P(V,ee,dm,".","\\ldotp");P(V,ee,dm,"⋅","\\cdotp");P(V,ee,dm,"⋅","·");P(He,ee,ve,"⋅","·");P(V,ee,ve,"#","\\#");P(He,ee,ve,"#","\\#");P(V,ee,ve,"&","\\&");P(He,ee,ve,"&","\\&");P(V,ee,ve,"ℵ","\\aleph",!0);P(V,ee,ve,"∀","\\forall",!0);P(V,ee,ve,"ℏ","\\hbar",!0);P(V,ee,ve,"∃","\\exists",!0);P(V,ee,ve,"∇","\\nabla",!0);P(V,ee,ve,"♭","\\flat",!0);P(V,ee,ve,"ℓ","\\ell",!0);P(V,ee,ve,"♮","\\natural",!0);P(V,ee,ve,"♣","\\clubsuit",!0);P(V,ee,ve,"℘","\\wp",!0);P(V,ee,ve,"♯","\\sharp",!0);P(V,ee,ve,"♢","\\diamondsuit",!0);P(V,ee,ve,"ℜ","\\Re",!0);P(V,ee,ve,"♡","\\heartsuit",!0);P(V,ee,ve,"ℑ","\\Im",!0);P(V,ee,ve,"♠","\\spadesuit",!0);P(V,ee,ve,"§","\\S",!0);P(He,ee,ve,"§","\\S");P(V,ee,ve,"¶","\\P",!0);P(He,ee,ve,"¶","\\P");P(V,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\dag");P(He,ee,ve,"†","\\textdagger");P(V,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\ddag");P(He,ee,ve,"‡","\\textdaggerdbl");P(V,ee,ui,"⎱","\\rmoustache",!0);P(V,ee,na,"⎰","\\lmoustache",!0);P(V,ee,ui,"⟯","\\rgroup",!0);P(V,ee,na,"⟮","\\lgroup",!0);P(V,ee,dt,"∓","\\mp",!0);P(V,ee,dt,"⊖","\\ominus",!0);P(V,ee,dt,"⊎","\\uplus",!0);P(V,ee,dt,"⊓","\\sqcap",!0);P(V,ee,dt,"∗","\\ast");P(V,ee,dt,"⊔","\\sqcup",!0);P(V,ee,dt,"◯","\\bigcirc",!0);P(V,ee,dt,"∙","\\bullet",!0);P(V,ee,dt,"‡","\\ddagger");P(V,ee,dt,"≀","\\wr",!0);P(V,ee,dt,"⨿","\\amalg");P(V,ee,dt,"&","\\And");P(V,ee,he,"⟵","\\longleftarrow",!0);P(V,ee,he,"⇐","\\Leftarrow",!0);P(V,ee,he,"⟸","\\Longleftarrow",!0);P(V,ee,he,"⟶","\\longrightarrow",!0);P(V,ee,he,"⇒","\\Rightarrow",!0);P(V,ee,he,"⟹","\\Longrightarrow",!0);P(V,ee,he,"↔","\\leftrightarrow",!0);P(V,ee,he,"⟷","\\longleftrightarrow",!0);P(V,ee,he,"⇔","\\Leftrightarrow",!0);P(V,ee,he,"⟺","\\Longleftrightarrow",!0);P(V,ee,he,"↦","\\mapsto",!0);P(V,ee,he,"⟼","\\longmapsto",!0);P(V,ee,he,"↗","\\nearrow",!0);P(V,ee,he,"↩","\\hookleftarrow",!0);P(V,ee,he,"↪","\\hookrightarrow",!0);P(V,ee,he,"↘","\\searrow",!0);P(V,ee,he,"↼","\\leftharpoonup",!0);P(V,ee,he,"⇀","\\rightharpoonup",!0);P(V,ee,he,"↙","\\swarrow",!0);P(V,ee,he,"↽","\\leftharpoondown",!0);P(V,ee,he,"⇁","\\rightharpoondown",!0);P(V,ee,he,"↖","\\nwarrow",!0);P(V,ee,he,"⇌","\\rightleftharpoons",!0);P(V,fe,he,"≮","\\nless",!0);P(V,fe,he,"","\\@nleqslant");P(V,fe,he,"","\\@nleqq");P(V,fe,he,"⪇","\\lneq",!0);P(V,fe,he,"≨","\\lneqq",!0);P(V,fe,he,"","\\@lvertneqq");P(V,fe,he,"⋦","\\lnsim",!0);P(V,fe,he,"⪉","\\lnapprox",!0);P(V,fe,he,"⊀","\\nprec",!0);P(V,fe,he,"⋠","\\npreceq",!0);P(V,fe,he,"⋨","\\precnsim",!0);P(V,fe,he,"⪹","\\precnapprox",!0);P(V,fe,he,"≁","\\nsim",!0);P(V,fe,he,"","\\@nshortmid");P(V,fe,he,"∤","\\nmid",!0);P(V,fe,he,"⊬","\\nvdash",!0);P(V,fe,he,"⊭","\\nvDash",!0);P(V,fe,he,"⋪","\\ntriangleleft");P(V,fe,he,"⋬","\\ntrianglelefteq",!0);P(V,fe,he,"⊊","\\subsetneq",!0);P(V,fe,he,"","\\@varsubsetneq");P(V,fe,he,"⫋","\\subsetneqq",!0);P(V,fe,he,"","\\@varsubsetneqq");P(V,fe,he,"≯","\\ngtr",!0);P(V,fe,he,"","\\@ngeqslant");P(V,fe,he,"","\\@ngeqq");P(V,fe,he,"⪈","\\gneq",!0);P(V,fe,he,"≩","\\gneqq",!0);P(V,fe,he,"","\\@gvertneqq");P(V,fe,he,"⋧","\\gnsim",!0);P(V,fe,he,"⪊","\\gnapprox",!0);P(V,fe,he,"⊁","\\nsucc",!0);P(V,fe,he,"⋡","\\nsucceq",!0);P(V,fe,he,"⋩","\\succnsim",!0);P(V,fe,he,"⪺","\\succnapprox",!0);P(V,fe,he,"≆","\\ncong",!0);P(V,fe,he,"","\\@nshortparallel");P(V,fe,he,"∦","\\nparallel",!0);P(V,fe,he,"⊯","\\nVDash",!0);P(V,fe,he,"⋫","\\ntriangleright");P(V,fe,he,"⋭","\\ntrianglerighteq",!0);P(V,fe,he,"","\\@nsupseteqq");P(V,fe,he,"⊋","\\supsetneq",!0);P(V,fe,he,"","\\@varsupsetneq");P(V,fe,he,"⫌","\\supsetneqq",!0);P(V,fe,he,"","\\@varsupsetneqq");P(V,fe,he,"⊮","\\nVdash",!0);P(V,fe,he,"⪵","\\precneqq",!0);P(V,fe,he,"⪶","\\succneqq",!0);P(V,fe,he,"","\\@nsubseteqq");P(V,fe,dt,"⊴","\\unlhd");P(V,fe,dt,"⊵","\\unrhd");P(V,fe,he,"↚","\\nleftarrow",!0);P(V,fe,he,"↛","\\nrightarrow",!0);P(V,fe,he,"⇍","\\nLeftarrow",!0);P(V,fe,he,"⇏","\\nRightarrow",!0);P(V,fe,he,"↮","\\nleftrightarrow",!0);P(V,fe,he,"⇎","\\nLeftrightarrow",!0);P(V,fe,he,"△","\\vartriangle");P(V,fe,ve,"ℏ","\\hslash");P(V,fe,ve,"▽","\\triangledown");P(V,fe,ve,"◊","\\lozenge");P(V,fe,ve,"Ⓢ","\\circledS");P(V,fe,ve,"®","\\circledR");P(He,fe,ve,"®","\\circledR");P(V,fe,ve,"∡","\\measuredangle",!0);P(V,fe,ve,"∄","\\nexists");P(V,fe,ve,"℧","\\mho");P(V,fe,ve,"Ⅎ","\\Finv",!0);P(V,fe,ve,"⅁","\\Game",!0);P(V,fe,ve,"‵","\\backprime");P(V,fe,ve,"▲","\\blacktriangle");P(V,fe,ve,"▼","\\blacktriangledown");P(V,fe,ve,"■","\\blacksquare");P(V,fe,ve,"⧫","\\blacklozenge");P(V,fe,ve,"★","\\bigstar");P(V,fe,ve,"∢","\\sphericalangle",!0);P(V,fe,ve,"∁","\\complement",!0);P(V,fe,ve,"ð","\\eth",!0);P(He,ee,ve,"ð","ð");P(V,fe,ve,"╱","\\diagup");P(V,fe,ve,"╲","\\diagdown");P(V,fe,ve,"□","\\square");P(V,fe,ve,"□","\\Box");P(V,fe,ve,"◊","\\Diamond");P(V,fe,ve,"¥","\\yen",!0);P(He,fe,ve,"¥","\\yen",!0);P(V,fe,ve,"✓","\\checkmark",!0);P(He,fe,ve,"✓","\\checkmark");P(V,fe,ve,"ℶ","\\beth",!0);P(V,fe,ve,"ℸ","\\daleth",!0);P(V,fe,ve,"ℷ","\\gimel",!0);P(V,fe,ve,"ϝ","\\digamma",!0);P(V,fe,ve,"ϰ","\\varkappa");P(V,fe,na,"┌","\\@ulcorner",!0);P(V,fe,ui,"┐","\\@urcorner",!0);P(V,fe,na,"└","\\@llcorner",!0);P(V,fe,ui,"┘","\\@lrcorner",!0);P(V,fe,he,"≦","\\leqq",!0);P(V,fe,he,"⩽","\\leqslant",!0);P(V,fe,he,"⪕","\\eqslantless",!0);P(V,fe,he,"≲","\\lesssim",!0);P(V,fe,he,"⪅","\\lessapprox",!0);P(V,fe,he,"≊","\\approxeq",!0);P(V,fe,dt,"⋖","\\lessdot");P(V,fe,he,"⋘","\\lll",!0);P(V,fe,he,"≶","\\lessgtr",!0);P(V,fe,he,"⋚","\\lesseqgtr",!0);P(V,fe,he,"⪋","\\lesseqqgtr",!0);P(V,fe,he,"≑","\\doteqdot");P(V,fe,he,"≓","\\risingdotseq",!0);P(V,fe,he,"≒","\\fallingdotseq",!0);P(V,fe,he,"∽","\\backsim",!0);P(V,fe,he,"⋍","\\backsimeq",!0);P(V,fe,he,"⫅","\\subseteqq",!0);P(V,fe,he,"⋐","\\Subset",!0);P(V,fe,he,"⊏","\\sqsubset",!0);P(V,fe,he,"≼","\\preccurlyeq",!0);P(V,fe,he,"⋞","\\curlyeqprec",!0);P(V,fe,he,"≾","\\precsim",!0);P(V,fe,he,"⪷","\\precapprox",!0);P(V,fe,he,"⊲","\\vartriangleleft");P(V,fe,he,"⊴","\\trianglelefteq");P(V,fe,he,"⊨","\\vDash",!0);P(V,fe,he,"⊪","\\Vvdash",!0);P(V,fe,he,"⌣","\\smallsmile");P(V,fe,he,"⌢","\\smallfrown");P(V,fe,he,"≏","\\bumpeq",!0);P(V,fe,he,"≎","\\Bumpeq",!0);P(V,fe,he,"≧","\\geqq",!0);P(V,fe,he,"⩾","\\geqslant",!0);P(V,fe,he,"⪖","\\eqslantgtr",!0);P(V,fe,he,"≳","\\gtrsim",!0);P(V,fe,he,"⪆","\\gtrapprox",!0);P(V,fe,dt,"⋗","\\gtrdot");P(V,fe,he,"⋙","\\ggg",!0);P(V,fe,he,"≷","\\gtrless",!0);P(V,fe,he,"⋛","\\gtreqless",!0);P(V,fe,he,"⪌","\\gtreqqless",!0);P(V,fe,he,"≖","\\eqcirc",!0);P(V,fe,he,"≗","\\circeq",!0);P(V,fe,he,"≜","\\triangleq",!0);P(V,fe,he,"∼","\\thicksim");P(V,fe,he,"≈","\\thickapprox");P(V,fe,he,"⫆","\\supseteqq",!0);P(V,fe,he,"⋑","\\Supset",!0);P(V,fe,he,"⊐","\\sqsupset",!0);P(V,fe,he,"≽","\\succcurlyeq",!0);P(V,fe,he,"⋟","\\curlyeqsucc",!0);P(V,fe,he,"≿","\\succsim",!0);P(V,fe,he,"⪸","\\succapprox",!0);P(V,fe,he,"⊳","\\vartriangleright");P(V,fe,he,"⊵","\\trianglerighteq");P(V,fe,he,"⊩","\\Vdash",!0);P(V,fe,he,"∣","\\shortmid");P(V,fe,he,"∥","\\shortparallel");P(V,fe,he,"≬","\\between",!0);P(V,fe,he,"⋔","\\pitchfork",!0);P(V,fe,he,"∝","\\varpropto");P(V,fe,he,"◀","\\blacktriangleleft");P(V,fe,he,"∴","\\therefore",!0);P(V,fe,he,"∍","\\backepsilon");P(V,fe,he,"▶","\\blacktriangleright");P(V,fe,he,"∵","\\because",!0);P(V,fe,he,"⋘","\\llless");P(V,fe,he,"⋙","\\gggtr");P(V,fe,dt,"⊲","\\lhd");P(V,fe,dt,"⊳","\\rhd");P(V,fe,he,"≂","\\eqsim",!0);P(V,ee,he,"⋈","\\Join");P(V,fe,he,"≑","\\Doteq",!0);P(V,fe,dt,"∔","\\dotplus",!0);P(V,fe,dt,"∖","\\smallsetminus");P(V,fe,dt,"⋒","\\Cap",!0);P(V,fe,dt,"⋓","\\Cup",!0);P(V,fe,dt,"⩞","\\doublebarwedge",!0);P(V,fe,dt,"⊟","\\boxminus",!0);P(V,fe,dt,"⊞","\\boxplus",!0);P(V,fe,dt,"⋇","\\divideontimes",!0);P(V,fe,dt,"⋉","\\ltimes",!0);P(V,fe,dt,"⋊","\\rtimes",!0);P(V,fe,dt,"⋋","\\leftthreetimes",!0);P(V,fe,dt,"⋌","\\rightthreetimes",!0);P(V,fe,dt,"⋏","\\curlywedge",!0);P(V,fe,dt,"⋎","\\curlyvee",!0);P(V,fe,dt,"⊝","\\circleddash",!0);P(V,fe,dt,"⊛","\\circledast",!0);P(V,fe,dt,"⋅","\\centerdot");P(V,fe,dt,"⊺","\\intercal",!0);P(V,fe,dt,"⋒","\\doublecap");P(V,fe,dt,"⋓","\\doublecup");P(V,fe,dt,"⊠","\\boxtimes",!0);P(V,fe,he,"⇢","\\dashrightarrow",!0);P(V,fe,he,"⇠","\\dashleftarrow",!0);P(V,fe,he,"⇇","\\leftleftarrows",!0);P(V,fe,he,"⇆","\\leftrightarrows",!0);P(V,fe,he,"⇚","\\Lleftarrow",!0);P(V,fe,he,"↞","\\twoheadleftarrow",!0);P(V,fe,he,"↢","\\leftarrowtail",!0);P(V,fe,he,"↫","\\looparrowleft",!0);P(V,fe,he,"⇋","\\leftrightharpoons",!0);P(V,fe,he,"↶","\\curvearrowleft",!0);P(V,fe,he,"↺","\\circlearrowleft",!0);P(V,fe,he,"↰","\\Lsh",!0);P(V,fe,he,"⇈","\\upuparrows",!0);P(V,fe,he,"↿","\\upharpoonleft",!0);P(V,fe,he,"⇃","\\downharpoonleft",!0);P(V,ee,he,"⊶","\\origof",!0);P(V,ee,he,"⊷","\\imageof",!0);P(V,fe,he,"⊸","\\multimap",!0);P(V,fe,he,"↭","\\leftrightsquigarrow",!0);P(V,fe,he,"⇉","\\rightrightarrows",!0);P(V,fe,he,"⇄","\\rightleftarrows",!0);P(V,fe,he,"↠","\\twoheadrightarrow",!0);P(V,fe,he,"↣","\\rightarrowtail",!0);P(V,fe,he,"↬","\\looparrowright",!0);P(V,fe,he,"↷","\\curvearrowright",!0);P(V,fe,he,"↻","\\circlearrowright",!0);P(V,fe,he,"↱","\\Rsh",!0);P(V,fe,he,"⇊","\\downdownarrows",!0);P(V,fe,he,"↾","\\upharpoonright",!0);P(V,fe,he,"⇂","\\downharpoonright",!0);P(V,fe,he,"⇝","\\rightsquigarrow",!0);P(V,fe,he,"⇝","\\leadsto");P(V,fe,he,"⇛","\\Rrightarrow",!0);P(V,fe,he,"↾","\\restriction");P(V,ee,ve,"‘","`");P(V,ee,ve,"$","\\$");P(He,ee,ve,"$","\\$");P(He,ee,ve,"$","\\textdollar");P(V,ee,ve,"%","\\%");P(He,ee,ve,"%","\\%");P(V,ee,ve,"_","\\_");P(He,ee,ve,"_","\\_");P(He,ee,ve,"_","\\textunderscore");P(V,ee,ve,"∠","\\angle",!0);P(V,ee,ve,"∞","\\infty",!0);P(V,ee,ve,"′","\\prime");P(V,ee,ve,"△","\\triangle");P(V,ee,ve,"Γ","\\Gamma",!0);P(V,ee,ve,"Δ","\\Delta",!0);P(V,ee,ve,"Θ","\\Theta",!0);P(V,ee,ve,"Λ","\\Lambda",!0);P(V,ee,ve,"Ξ","\\Xi",!0);P(V,ee,ve,"Π","\\Pi",!0);P(V,ee,ve,"Σ","\\Sigma",!0);P(V,ee,ve,"Υ","\\Upsilon",!0);P(V,ee,ve,"Φ","\\Phi",!0);P(V,ee,ve,"Ψ","\\Psi",!0);P(V,ee,ve,"Ω","\\Omega",!0);P(V,ee,ve,"A","Α");P(V,ee,ve,"B","Β");P(V,ee,ve,"E","Ε");P(V,ee,ve,"Z","Ζ");P(V,ee,ve,"H","Η");P(V,ee,ve,"I","Ι");P(V,ee,ve,"K","Κ");P(V,ee,ve,"M","Μ");P(V,ee,ve,"N","Ν");P(V,ee,ve,"O","Ο");P(V,ee,ve,"P","Ρ");P(V,ee,ve,"T","Τ");P(V,ee,ve,"X","Χ");P(V,ee,ve,"¬","\\neg",!0);P(V,ee,ve,"¬","\\lnot");P(V,ee,ve,"⊤","\\top");P(V,ee,ve,"⊥","\\bot");P(V,ee,ve,"∅","\\emptyset");P(V,fe,ve,"∅","\\varnothing");P(V,ee,Bt,"α","\\alpha",!0);P(V,ee,Bt,"β","\\beta",!0);P(V,ee,Bt,"γ","\\gamma",!0);P(V,ee,Bt,"δ","\\delta",!0);P(V,ee,Bt,"ϵ","\\epsilon",!0);P(V,ee,Bt,"ζ","\\zeta",!0);P(V,ee,Bt,"η","\\eta",!0);P(V,ee,Bt,"θ","\\theta",!0);P(V,ee,Bt,"ι","\\iota",!0);P(V,ee,Bt,"κ","\\kappa",!0);P(V,ee,Bt,"λ","\\lambda",!0);P(V,ee,Bt,"μ","\\mu",!0);P(V,ee,Bt,"ν","\\nu",!0);P(V,ee,Bt,"ξ","\\xi",!0);P(V,ee,Bt,"ο","\\omicron",!0);P(V,ee,Bt,"π","\\pi",!0);P(V,ee,Bt,"ρ","\\rho",!0);P(V,ee,Bt,"σ","\\sigma",!0);P(V,ee,Bt,"τ","\\tau",!0);P(V,ee,Bt,"υ","\\upsilon",!0);P(V,ee,Bt,"ϕ","\\phi",!0);P(V,ee,Bt,"χ","\\chi",!0);P(V,ee,Bt,"ψ","\\psi",!0);P(V,ee,Bt,"ω","\\omega",!0);P(V,ee,Bt,"ε","\\varepsilon",!0);P(V,ee,Bt,"ϑ","\\vartheta",!0);P(V,ee,Bt,"ϖ","\\varpi",!0);P(V,ee,Bt,"ϱ","\\varrho",!0);P(V,ee,Bt,"ς","\\varsigma",!0);P(V,ee,Bt,"φ","\\varphi",!0);P(V,ee,dt,"∗","*",!0);P(V,ee,dt,"+","+");P(V,ee,dt,"−","-",!0);P(V,ee,dt,"⋅","\\cdot",!0);P(V,ee,dt,"∘","\\circ",!0);P(V,ee,dt,"÷","\\div",!0);P(V,ee,dt,"±","\\pm",!0);P(V,ee,dt,"×","\\times",!0);P(V,ee,dt,"∩","\\cap",!0);P(V,ee,dt,"∪","\\cup",!0);P(V,ee,dt,"∖","\\setminus",!0);P(V,ee,dt,"∧","\\land");P(V,ee,dt,"∨","\\lor");P(V,ee,dt,"∧","\\wedge",!0);P(V,ee,dt,"∨","\\vee",!0);P(V,ee,ve,"√","\\surd");P(V,ee,na,"⟨","\\langle",!0);P(V,ee,na,"∣","\\lvert");P(V,ee,na,"∥","\\lVert");P(V,ee,ui,"?","?");P(V,ee,ui,"!","!");P(V,ee,ui,"⟩","\\rangle",!0);P(V,ee,ui,"∣","\\rvert");P(V,ee,ui,"∥","\\rVert");P(V,ee,he,"=","=");P(V,ee,he,":",":");P(V,ee,he,"≈","\\approx",!0);P(V,ee,he,"≅","\\cong",!0);P(V,ee,he,"≥","\\ge");P(V,ee,he,"≥","\\geq",!0);P(V,ee,he,"←","\\gets");P(V,ee,he,">","\\gt",!0);P(V,ee,he,"∈","\\in",!0);P(V,ee,he,"","\\@not");P(V,ee,he,"⊂","\\subset",!0);P(V,ee,he,"⊃","\\supset",!0);P(V,ee,he,"⊆","\\subseteq",!0);P(V,ee,he,"⊇","\\supseteq",!0);P(V,fe,he,"⊈","\\nsubseteq",!0);P(V,fe,he,"⊉","\\nsupseteq",!0);P(V,ee,he,"⊨","\\models");P(V,ee,he,"←","\\leftarrow",!0);P(V,ee,he,"≤","\\le");P(V,ee,he,"≤","\\leq",!0);P(V,ee,he,"<","\\lt",!0);P(V,ee,he,"→","\\rightarrow",!0);P(V,ee,he,"→","\\to");P(V,fe,he,"≱","\\ngeq",!0);P(V,fe,he,"≰","\\nleq",!0);P(V,ee,Vl," ","\\ ");P(V,ee,Vl," ","\\space");P(V,ee,Vl," ","\\nobreakspace");P(He,ee,Vl," ","\\ ");P(He,ee,Vl," "," ");P(He,ee,Vl," ","\\space");P(He,ee,Vl," ","\\nobreakspace");P(V,ee,Vl,"","\\nobreak");P(V,ee,Vl,"","\\allowbreak");P(V,ee,dm,",",",");P(V,ee,dm,";",";");P(V,fe,dt,"⊼","\\barwedge",!0);P(V,fe,dt,"⊻","\\veebar",!0);P(V,ee,dt,"⊙","\\odot",!0);P(V,ee,dt,"⊕","\\oplus",!0);P(V,ee,dt,"⊗","\\otimes",!0);P(V,ee,ve,"∂","\\partial",!0);P(V,ee,dt,"⊘","\\oslash",!0);P(V,fe,dt,"⊚","\\circledcirc",!0);P(V,fe,dt,"⊡","\\boxdot",!0);P(V,ee,dt,"△","\\bigtriangleup");P(V,ee,dt,"▽","\\bigtriangledown");P(V,ee,dt,"†","\\dagger");P(V,ee,dt,"⋄","\\diamond");P(V,ee,dt,"⋆","\\star");P(V,ee,dt,"◃","\\triangleleft");P(V,ee,dt,"▹","\\triangleright");P(V,ee,na,"{","\\{");P(He,ee,ve,"{","\\{");P(He,ee,ve,"{","\\textbraceleft");P(V,ee,ui,"}","\\}");P(He,ee,ve,"}","\\}");P(He,ee,ve,"}","\\textbraceright");P(V,ee,na,"{","\\lbrace");P(V,ee,ui,"}","\\rbrace");P(V,ee,na,"[","\\lbrack",!0);P(He,ee,ve,"[","\\lbrack",!0);P(V,ee,ui,"]","\\rbrack",!0);P(He,ee,ve,"]","\\rbrack",!0);P(V,ee,na,"(","\\lparen",!0);P(V,ee,ui,")","\\rparen",!0);P(He,ee,ve,"<","\\textless",!0);P(He,ee,ve,">","\\textgreater",!0);P(V,ee,na,"⌊","\\lfloor",!0);P(V,ee,ui,"⌋","\\rfloor",!0);P(V,ee,na,"⌈","\\lceil",!0);P(V,ee,ui,"⌉","\\rceil",!0);P(V,ee,ve,"\\","\\backslash");P(V,ee,ve,"∣","|");P(V,ee,ve,"∣","\\vert");P(He,ee,ve,"|","\\textbar",!0);P(V,ee,ve,"∥","\\|");P(V,ee,ve,"∥","\\Vert");P(He,ee,ve,"∥","\\textbardbl");P(He,ee,ve,"~","\\textasciitilde");P(He,ee,ve,"\\","\\textbackslash");P(He,ee,ve,"^","\\textasciicircum");P(V,ee,he,"↑","\\uparrow",!0);P(V,ee,he,"⇑","\\Uparrow",!0);P(V,ee,he,"↓","\\downarrow",!0);P(V,ee,he,"⇓","\\Downarrow",!0);P(V,ee,he,"↕","\\updownarrow",!0);P(V,ee,he,"⇕","\\Updownarrow",!0);P(V,ee,is,"∐","\\coprod");P(V,ee,is,"⋁","\\bigvee");P(V,ee,is,"⋀","\\bigwedge");P(V,ee,is,"⨄","\\biguplus");P(V,ee,is,"⋂","\\bigcap");P(V,ee,is,"⋃","\\bigcup");P(V,ee,is,"∫","\\int");P(V,ee,is,"∫","\\intop");P(V,ee,is,"∬","\\iint");P(V,ee,is,"∭","\\iiint");P(V,ee,is,"∏","\\prod");P(V,ee,is,"∑","\\sum");P(V,ee,is,"⨂","\\bigotimes");P(V,ee,is,"⨁","\\bigoplus");P(V,ee,is,"⨀","\\bigodot");P(V,ee,is,"∮","\\oint");P(V,ee,is,"∯","\\oiint");P(V,ee,is,"∰","\\oiiint");P(V,ee,is,"⨆","\\bigsqcup");P(V,ee,is,"∫","\\smallint");P(He,ee,g_,"…","\\textellipsis");P(V,ee,g_,"…","\\mathellipsis");P(He,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"…","\\ldots",!0);P(V,ee,g_,"⋯","\\@cdots",!0);P(V,ee,g_,"⋱","\\ddots",!0);P(V,ee,ve,"⋮","\\varvdots");P(He,ee,ve,"⋮","\\varvdots");P(V,ee,Cr,"ˊ","\\acute");P(V,ee,Cr,"ˋ","\\grave");P(V,ee,Cr,"¨","\\ddot");P(V,ee,Cr,"~","\\tilde");P(V,ee,Cr,"ˉ","\\bar");P(V,ee,Cr,"˘","\\breve");P(V,ee,Cr,"ˇ","\\check");P(V,ee,Cr,"^","\\hat");P(V,ee,Cr,"⃗","\\vec");P(V,ee,Cr,"˙","\\dot");P(V,ee,Cr,"˚","\\mathring");P(V,ee,Bt,"","\\@imath");P(V,ee,Bt,"","\\@jmath");P(V,ee,ve,"ı","ı");P(V,ee,ve,"ȷ","ȷ");P(He,ee,ve,"ı","\\i",!0);P(He,ee,ve,"ȷ","\\j",!0);P(He,ee,ve,"ß","\\ss",!0);P(He,ee,ve,"æ","\\ae",!0);P(He,ee,ve,"œ","\\oe",!0);P(He,ee,ve,"ø","\\o",!0);P(He,ee,ve,"Æ","\\AE",!0);P(He,ee,ve,"Œ","\\OE",!0);P(He,ee,ve,"Ø","\\O",!0);P(He,ee,Cr,"ˊ","\\'");P(He,ee,Cr,"ˋ","\\`");P(He,ee,Cr,"ˆ","\\^");P(He,ee,Cr,"˜","\\~");P(He,ee,Cr,"ˉ","\\=");P(He,ee,Cr,"˘","\\u");P(He,ee,Cr,"˙","\\.");P(He,ee,Cr,"¸","\\c");P(He,ee,Cr,"˚","\\r");P(He,ee,Cr,"ˇ","\\v");P(He,ee,Cr,"¨",'\\"');P(He,ee,Cr,"˝","\\H");P(He,ee,Cr,"◯","\\textcircled");var x$={"--":!0,"---":!0,"``":!0,"''":!0};P(He,ee,ve,"–","--",!0);P(He,ee,ve,"–","\\textendash");P(He,ee,ve,"—","---",!0);P(He,ee,ve,"—","\\textemdash");P(He,ee,ve,"‘","`",!0);P(He,ee,ve,"‘","\\textquoteleft");P(He,ee,ve,"’","'",!0);P(He,ee,ve,"’","\\textquoteright");P(He,ee,ve,"“","``",!0);P(He,ee,ve,"“","\\textquotedblleft");P(He,ee,ve,"”","''",!0);P(He,ee,ve,"”","\\textquotedblright");P(V,ee,ve,"°","\\degree",!0);P(He,ee,ve,"°","\\degree");P(He,ee,ve,"°","\\textdegree",!0);P(V,ee,ve,"£","\\pounds");P(V,ee,ve,"£","\\mathsterling",!0);P(He,ee,ve,"£","\\pounds");P(He,ee,ve,"£","\\textsterling",!0);P(V,fe,ve,"✠","\\maltese");P(He,fe,ve,"✠","\\maltese");var fT='0123456789/@."';for(var ow=0;ow{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return wT[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return T6t[i]}else{if(r===120485||r===120486)return wT[0];if(120486{if(pu(e.classes)!==pu(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},w$=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ge=function(n,t,r,s){var i=new m_(n,t,r,s);return tk(i),i},gu=(e,n,t,r)=>new m_(e,n,t,r),Yh=function(n,t,r){var s=Ge([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=et(s.height),s.maxFontSize=1,s},D6t=function(n,t,r,s){var i=new Pb(n,t,r,s);return tk(i),i},Kl=function(n){var t=new p_(n);return tk(t),t},Xh=function(n,t){return n instanceof p_?Ge([],[n],t):n},L6t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=Ge(["mspace"],[],n),r=Ar(e,n);return t.style.marginRight=et(r),t},Zg=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},F3={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},k$={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},C$=function(n,t){var[r,s,i]=k$[n],a=new mu(r),o=new ql([a],{width:et(s),height:et(i),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=gu(["overlay"],[o],t);return l.height=i,l.style.height=et(i),l.style.width=et(s),l},jr={number:3,unit:"mu"},Ju={number:4,unit:"mu"},wl={number:5,unit:"mu"},O6t={mord:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mop:{mord:jr,mop:jr,mrel:wl,minner:jr},mbin:{mord:Ju,mop:Ju,mopen:Ju,minner:Ju},mrel:{mord:wl,mop:wl,mopen:wl,minner:wl},mopen:{},mclose:{mop:jr,mbin:Ju,mrel:wl,minner:jr},mpunct:{mord:jr,mop:jr,mrel:wl,mopen:jr,mclose:jr,mpunct:jr,minner:jr},minner:{mord:jr,mop:jr,mbin:Ju,mrel:wl,mopen:jr,mpunct:jr,minner:jr}},I6t={mord:{mop:jr},mop:{mord:jr,mop:jr},mbin:{},mrel:{},mopen:{},mclose:{mop:jr},mpunct:{},minner:{mop:jr}},E$={},Cv={},Ev={};function ot(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},l=0;l{var v=S.classes[0],b=x.classes[0];v==="mbin"&&$6t.has(b)?S.classes[0]="mord":b==="mbin"&&B6t.has(v)&&(x.classes[0]="mord")},{node:d},p,m),H3(i,(x,S)=>{var v,b,w=U3(S),y=U3(x),C=w&&y?x.hasClass("mtight")?(v=I6t[w])==null?void 0:v[y]:(b=O6t[w])==null?void 0:b[y]:null;if(C)return S$(C,u)},{node:d},p,m),i},H3=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(d+1,0,p),a++})(a)}s&&n.pop()},N$=function(n){return n instanceof p_||n instanceof Pb||n instanceof m_&&n.hasClass("enclosing")?n:null},q3=function(n,t){var r=N$(n);if(r){var s=r.children;if(s.length){if(t==="right")return q3(s[s.length-1],"right");if(t==="left")return q3(s[0],"left")}}return n},U3=function(n,t){if(!n)return null;t&&(n=q3(n,t));var r=n.classes[0];return F6t[r]||null},vp=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ge(t.concat(r))},Gn=function(n,t,r){if(!n)return Ge();if(Cv[n.type]){var s=Cv[n.type](n,t);if(r&&t.size!==r.size){s=Ge(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ye("Got group of unknown type: '"+n.type+"'")};function Jg(e,n){var t=Ge(["base"],e,n),r=Ge(["strut"]);return r.style.height=et(t.height+t.depth),t.depth&&(r.style.verticalAlign=et(-t.depth)),t.children.unshift(r),t}function G3(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=ps(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Jg(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push(Jg(a,n));var u;t?(u=Jg(ps(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=Ge(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=et(_.height+_.depth),_.depth&&(d.style.verticalAlign=et(-_.depth))}return _}function z$(e){return new p_(e)}class Xe{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=pu(this.classes));for(var r=0;r0&&(n+=' class ="'+Ks(pu(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class rs{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ks(this.toText())}toText(){return this.text}}class j${constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",et(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var H6t=new Set(["\\imath","\\jmath"]),q6t=new Set(["mrow","mtable"]),ja=function(n,t,r){return Sr[t][n]&&Sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(x$.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=Sr[t][n].replace),new rs(n)},nk=function(n){return n.length===1?n[0]:new Xe("mrow",n)},U6t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},rk=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=U6t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(H6t.has(i))return null;if(Sr[r][i]){var a=Sr[r][i].replace;a&&(i=a)}var o=F3[t].fontName;return JS(i,o,r)?F3[t].variant:null};function dw(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof rs&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof rs&&t.text===","}else return!1}var ra=function(n,t,r){if(n.length===1){var s=cr(n[0],t);return r&&s instanceof Xe&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||dw(a))){var u=l.children[0];u instanceof Xe&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof rs&&_.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof rs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(l),a=l}return i},vu=function(n,t,r){return nk(ra(n,t,r))},cr=function(n,t){if(!n)return new Xe("mrow");if(Ev[n.type])return Ev[n.type](n,t);throw new Ye("Got group of unknown type: '"+n.type+"'")};function ST(e,n,t,r,s){var i=ra(e,t),a;i.length===1&&i[0]instanceof Xe&&q6t.has(i[0].type)?a=i[0]:a=new Xe("mrow",i);var o=new Xe("annotation",[new rs(n)]);o.setAttribute("encoding","application/x-tex");var l=new Xe("semantics",[a,o]),u=new Xe("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ge([_],[u])}var G6t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],kT=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],CT=function(n,t){return t.size<2?n:G6t[n-1][t.size-1]};class Nl{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Nl.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=kT[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Nl(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:CT(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:kT[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=CT(Nl.BASESIZE,n);return this.size===t&&this.textSize===Nl.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nl.BASESIZE?["sizing","reset-size"+this.size,"size"+Nl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=z6t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nl.BASESIZE=6;var T$=function(n){return new Nl({style:n.displayMode?Yt.DISPLAY:Yt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},A$=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ge(r,[n])}return n},W6t=function(n,t,r){var s=T$(r),i;if(r.output==="mathml")return ST(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=G3(n,s);i=Ge(["katex"],[a])}else{var o=ST(n,t,s,r.displayMode,!1),l=G3(n,s);i=Ge(["katex"],[o,l])}return A$(i,r)},V6t=function(n,t,r){var s=T$(r),i=G3(n,s),a=Ge(["katex"],[i]);return A$(a,r)},K6t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},qb=function(n){var t=new Xe("mo",[new rs(K6t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Q6t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Y6t=new Set(["widehat","widecheck","widetilde","utilde"]),Ub=function(n,t){function r(){var o=4e5,l=n.label.slice(1);if(Y6t.has(l)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,d,p;if(u>5)l==="widehat"||l==="widecheck"?(_=420,o=2364,p=.42,d=l+"4"):(_=312,o=2340,p=.34,d="tilde4");else{var m=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],d=l+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],d="tilde"+m)}var x=new mu(d),S=new ql([x],{width:"100%",height:et(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:gu([],[S],t),minWidth:0,height:p}}else{var v=[],b=Q6t[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[w,y,C]=b,E=C/1e3,N=w.length,T,j;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],j=[b[3]]}else if(N===2)T=["halfarrow-left","halfarrow-right"],j=["xMinYMin","xMaxYMin"];else if(N===3)T=["brace-left","brace-center","brace-right"],j=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+N+" children.");for(var M=0;M0&&(s.style.minWidth=et(i)),s},X6t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=Ge(["stretchy",t],[],i),t==="fbox"){var l=i.color&&i.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new L3({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new L3({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new ql(u,{width:"100%",height:et(o)});a=gu([],[_],i)}return a.height=o,a.style.height=et(o),a},Z6t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},J6t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function eSt(e){return e in Z6t}function sn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function Gb(e){var n=Wb(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function Wb(e){return e&&(e.type==="atom"||J6t.hasOwnProperty(e.type))?e:null}var R$=e=>{if(e instanceof Ji)return e;if(E6t(e)&&e.children.length===1)return R$(e.children[0])},sk=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=sn(e.base,"accent"),t=r.base,e.base=t,s=C6t(Gn(e,n)),e.base=r):(r=sn(e,"accent"),t=r.base);var i=Gn(t,n.havingCrampedStyle()),a=r.isShifty&&Wl(t),o=0;if(a){var l,u;o=(l=(u=R$(i))==null?void 0:u.skew)!=null?l:0}var _=r.label==="\\c",d=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=Ub(r,n),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+et(2*o)+")",marginLeft:et(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=C$("vec",n),x=k$.vec[1]):(m=Hb({mode:r.mode,text:r.label},n,"textord"),m=k6t(m),m.italic=0,x=m.width,_&&(d+=m.depth)),p=Ge(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),d=i.height);var v=o;S||(v-=x/2),p.style.left=et(v),r.label==="\\textcircled"&&(p.style.top=".2em"),p=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-d},{type:"elem",elem:p}]})}var b=Ge(["mord","accent"],[p],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},M$=(e,n)=>{var t=e.isStretchy?qb(e.label):new Xe("mo",[ja(e.label,e.mode)]),r=new Xe("mover",[cr(e.base,n),t]);return r.setAttribute("accent","true"),r},tSt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=Nv(n[0]),r=!tSt.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:sk,mathmlBuilder:M$});ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=Gn(e.base,n),r=Ub(e,n),s=e.label==="\\utilde"?.12:0,i=qn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ge(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=qb(e.label),r=new Xe("munder",[cr(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var e1=e=>{var n=new Xe("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=Xh(Gn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=Xh(Gn(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=Ub(e,n),l=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var d=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else _=qn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ge(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=qb(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=e1(cr(e.body,n));if(e.below){var i=e1(cr(e.below,n));r=new Xe("munderover",[t,i,s])}else r=new Xe("mover",[t,s])}else if(e.below){var a=e1(cr(e.below,n));r=new Xe("munder",[t,a])}else r=e1(),r=new Xe("mover",[t,r]);return r}});function D$(e,n){var t=ps(e.body,n,!0);return Ge([e.mclass],t,n)}function L$(e,n){var t,r=ra(e.body,n);return e.mclass==="minner"?t=new Xe("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Xe("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Xe("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}ot({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:ns(s),isCharacterBox:Wl(s)}},htmlBuilder:D$,mathmlBuilder:L$});var Vb=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};ot({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Vb(n[0]),body:ns(n[1]),isCharacterBox:Wl(n[1])}}});ot({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=Vb(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:ns(s)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[l],isCharacterBox:Wl(l)}},htmlBuilder:D$,mathmlBuilder:L$});ot({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Vb(n[0]),body:ns(n[0])}},htmlBuilder(e,n){var t=ps(e.body,n,!0),r=Ge([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ra(e.body,n),r=new Xe("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var nSt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},ET=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),NT=e=>e.type==="textord"&&e.text==="@",rSt=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function sSt(e,n,t){var r=nSt[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),l={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function iSt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ye("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var d=0;d<2;d++){for(var p=!0,m=l+1;mAV=|." after @',a[l]);var x=sSt(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=ET()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=Xh(Gn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=et(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Xe("mrow",[cr(e.label,n)]);return t=new Xe("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Xe("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=Xh(Gn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Xe("mrow",[cr(e.fragment,n)])}});ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=sn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new Ye("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var O$=(e,n)=>{var t=ps(e.body,n.withColor(e.color),!1);return Kl(t)},I$=(e,n)=>{var t=ra(e.body,n.withColor(e.color)),r=new Xe("mstyle",t);return r.setAttribute("mathcolor",e.color),r};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=sn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:ns(s)}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=sn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:O$,mathmlBuilder:I$});ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&sn(s,"size").value}},htmlBuilder(e,n){var t=Ge(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=et(Ar(e.size,n)))),t},mathmlBuilder(e,n){var t=new Xe("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",et(Ar(e.size,n)))),t}});var W3={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},B$=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ye("Expected a control sequence",e);return n},aSt=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},$$=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(W3[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=W3[r.text]),sn(n.parseFunction(),"internal");throw new Ye("Invalid token after macro prefix",r)}});ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ye("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ye('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ye('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ye("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=n.gullet.consumeArg();return a&&l.unshift(a),(t==="\\edef"||t==="\\xdef")&&(l=n.gullet.expandTokens(l),l.reverse()),n.gullet.macros.set(s,{tokens:l,numArgs:i,delimiters:o},t===W3[t]),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken());n.gullet.consumeSpaces();var s=aSt(n);return $$(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=B$(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return $$(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var N0=function(n,t,r){var s=Sr.math[n]&&Sr.math[n].replace,i=JS(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},ik=function(n,t,r,s){var i=r.havingBaseStyle(t),a=Ge(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},P$=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=et(i),n.height-=i,n.depth+=i},oSt=function(n,t,r,s,i,a){var o=ii(n,"Main-Regular",i,s),l=ik(o,t,s,a);return P$(l,s,t),l},lSt=function(n,t,r,s){return ii(n,"Size"+t+"-Regular",r,s)},F$=function(n,t,r,s,i,a){var o=lSt(n,t,i,s),l=ik(Ge(["delimsizing","size"+t],[o],s),Yt.TEXT,s,a);return r&&P$(l,s,Yt.TEXT),l},fw=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ge(["delimsizinginner",s],[Ge([],[ii(n,t,r)])]);return{type:"elem",elem:i}},hw=function(n,t,r){var s=Ao["Size4-Regular"][n.charCodeAt(0)]?Ao["Size4-Regular"][n.charCodeAt(0)][4]:Ao["Size1-Regular"][n.charCodeAt(0)][4],i=new mu("inner",g6t(n,Math.round(1e3*t))),a=new ql([i],{width:et(s),height:et(t),style:"width:"+et(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=gu([],[a],r);return o.height=t,o.style.height=et(t),o.style.width=et(s),{type:"elem",elem:o}},V3=.008,t1={type:"kern",size:-1*V3},cSt=new Set(["|","\\lvert","\\rvert","\\vert"]),uSt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),H$=function(n,t,r,s,i,a){var o,l,u,_,d="",p=0;o=u=_=n,l=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):cSt.has(n)?(u="∣",d="vert",p=333):uSt.has(n)?(u="∥",d="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",d="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",d="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",d="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",d="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",d="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",d="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",d="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",d="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",l="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",l="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=N0(o,m,i),S=x.height+x.depth,v=N0(u,m,i),b=v.height+v.depth,w=N0(_,m,i),y=w.height+w.depth,C=0,E=1;if(l!==null){var N=N0(l,m,i);C=N.height+N.depth,E=2}var T=S+y+C,j=Math.max(0,Math.ceil((t-T)/(E*b))),M=T+j*E*b,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var B=M/2-O,$=[];if(d.length>0){var H=M-S-y,q=Math.round(M*1e3),Y=v6t(d,Math.round(H*1e3)),G=new mu(d,Y),X=et(p/1e3),te=et(q/1e3),I=new ql([G],{width:X,height:te,viewBox:"0 0 "+p+" "+q}),L=gu([],[I],s);L.height=q/1e3,L.style.width=X,L.style.height=te,$.push({type:"elem",elem:L})}else{if($.push(fw(_,m,i)),$.push(t1),l===null){var F=M-S-y+2*V3;$.push(hw(u,F,s))}else{var W=(M-S-y-C)/2+2*V3;$.push(hw(u,W,s)),$.push(t1),$.push(fw(l,m,i)),$.push(t1),$.push(hw(u,W,s))}$.push(t1),$.push(fw(o,m,i))}var U=s.havingBaseStyle(Yt.TEXT),Z=qn({positionType:"bottom",positionData:B,children:$});return ik(Ge(["delimsizing","mult"],[Z],U),Yt.TEXT,s,a)},_w=80,pw=.08,mw=function(n,t,r,s,i){var a=m6t(n,s,r),o=new mu(n,a),l=new ql([o],{width:"400em",height:et(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return gu(["hide-tail"],[l],i)},dSt=function(n,t){var r=t.havingBaseSizing(),s=V$("\\surd",n*r.sizeMultiplier,W$,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,l,u,_,d;return s.type==="small"?(_=1e3+1e3*a+_w,n<1?i=1:n<1.4&&(i=.7),l=(1+a+pw)/i,u=(1+a)/i,o=mw("sqrtMain",l,_,a,t),o.style.minWidth="0.853em",d=.833/i):s.type==="large"?(_=(1e3+_w)*U0[s.size],u=(U0[s.size]+a)/i,l=(U0[s.size]+a+pw)/i,o=mw("sqrtSize"+s.size,l,_,a,t),o.style.minWidth="1.02em",d=1/i):(l=n+a+pw,u=n+a,_=Math.floor(1e3*n+a)+_w,o=mw("sqrtTall",l,_,a,t),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=et(l),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},q$=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),fSt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),U$=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),U0=[0,1.2,1.8,2.4,3],G$=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),q$.has(n)||U$.has(n))return F$(n,t,!1,r,s,i);if(fSt.has(n))return H$(n,U0[t],!1,r,s,i);throw new Ye("Illegal delimiter: '"+n+"'")},hSt=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],_St=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"stack"}],W$=[{type:"small",style:Yt.SCRIPTSCRIPT},{type:"small",style:Yt.SCRIPT},{type:"small",style:Yt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],pSt=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},V$=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},K3=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;U$.has(n)?o=hSt:q$.has(n)?o=W$:o=_St;var l=V$(n,t,o,s);return l.type==="small"?oSt(n,l.style,r,s,i,a):l.type==="large"?F$(n,l.size,r,s,i,a):H$(n,t,r,s,i,a)},gw=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,l=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),d=Math.max(_/500*l,2*_-u);return K3(n,d,!0,s,i,a)},zT={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},mSt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function jT(e){return"isMiddle"in e}function Kb(e,n){var t=Wb(e);if(t&&mSt.has(t.text))return t;throw t?new Ye("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ye("Invalid delimiter type '"+e.type+"'",e)}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=Kb(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:zT[e.funcName].size,mclass:zT[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ge([e.mclass]):G$(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ja(e.delim,e.mode));var t=new Xe("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=et(U0[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function TT(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ye("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Kb(n[0],e).text,color:t}}});ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Kb(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=sn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{TT(e);for(var t=ps(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{TT(e);var t=ra(e.body,n);if(e.left!=="."){var r=new Xe("mo",[ja(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Xe("mo",[ja(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return nk(t)}});ot({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=Kb(n[0],e);if(!e.parser.leftrightDepth)throw new Ye("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=vp(n,[]):(t=G$(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ja("|","text"):ja(e.delim,e.mode),r=new Xe("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Qb=(e,n)=>{var t=Xh(Gn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=Wl(e.body);if(r==="sout")i=Ge(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var l=Ar({number:.6,unit:"pt"},n),u=Ar({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=et(d/2+l);var p=Math.floor(1e3*d*s),m=_6t(p),x=new ql([new mu("phase",m)],{width:"400em",height:et(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=gu(["hide-tail"],[x],n),i.style.height=et(d),a=t.depth+l+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=S):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*b,v=Math.max(0,.25-t.depth)):(S=o?.2:0,v=S),i=X6t(t,r,S,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=et(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=et(b),i.style.borderRightWidth=et(b)),a=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var w;if(e.backgroundColor)w=qn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];w=qn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:y}]})}return/cancel/.test(r)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(r)&&!o?Ge(["mord","cancel-lap"],[w],n):Ge(["mord"],[w],n)},Yb=(e,n)=>{var t,r=new Xe(e.label.includes("colorbox")?"mpadded":"menclose",[cr(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+et(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=sn(n[0],"color-token").color,a=sn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Qb,mathmlBuilder:Yb});ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var K$={};function Wo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},l=0;l{var n=e.parser.settings;if(!n.displayMode)throw new Ye("{"+e.envName+"} can be used only in display mode.")},gSt=new Set(["gather","gather*"]);function ak(e){if(!e.includes("ed"))return!e.includes("*")}function Eu(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:_,maxNumCols:d,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new Ye("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],v=[],b=[],w=l!=null?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){w&&(e.gullet.macros.get("\\df@tag")?(w.push(e.subparse([new Yi("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(AT(e));;){var E=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:E};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),x.push(N);var T=e.fetch().text;if(T==="&"){if(d&&x.length===d){if(u||o)throw new Ye("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(T==="\\end"){C(),x.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),b.length0&&(y+=.25),u.push({pos:y,isDashed:Ze[_t]})}for(C(a[0]),r=0;r0&&(B+=w,TZe))for(r=0;r=o)){var le=void 0;if(s>0||n.hskipBeforeAndAfter){var oe,ue;le=(oe=(ue=U)==null?void 0:ue.pregap)!=null?oe:p,le!==0&&(Y=Ge(["arraycolsep"],[]),Y.style.width=et(le),q.push(Y))}var pe=[];for(r=0;r0){for(var Ft=Yh("hline",t,_),mt=Yh("hdashline",t,_),rt=[{type:"elem",elem:Ut,shift:0}];u.length>0;){var ut=u.pop(),Ct=ut.pos-$;ut.isDashed?rt.push({type:"elem",elem:mt,shift:Ct}):rt.push({type:"elem",elem:Ft,shift:Ct})}Ut=qn({positionType:"individualShift",children:rt})}if(X.length===0)return Ge(["mord"],[Ut],t);var we=qn({positionType:"individualShift",children:X}),Re=Ge(["tag"],[we],t);return Kl([Ut,Re])},vSt={c:"center ",l:"left ",r:"right "},Ko=function(n,t){for(var r=[],s=new Xe("mtd",[],["mtr-glue"]),i=new Xe("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",v=!1,b=0,w=x.length;x[0].type==="separator"&&(p+="top ",b=1),x[x.length-1].type==="separator"&&(p+="bottom ",w-=1);for(var y=b;y0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(v=1),r[x]={type:"align",align:S,pregap:v,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};Wo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=Wb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(a){var o=Gb(a),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ye("Unknown column alignment: "+l,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Eu(e.parser,i,ok(e.envName))},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ye("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=Eu(e.parser,r,ok(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=Eu(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=Wb(n[0]),r=t?[n[0]]:sn(n[0],"ordgroup").body,s=r.map(function(o){var l=Gb(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ye("Unknown column alignment: "+u,o)});if(s.length>1)throw new Ye("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=Eu(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new Ye("{subarray} can contain only one column");return a},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Eu(e.parser,n,ok(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){gSt.has(e.envName)&&Xb(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ak(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y$,htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Xb(e);var n={autoTag:ak(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Eu(e.parser,n,"display")},htmlBuilder:Vo,mathmlBuilder:Ko});Wo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Xb(e),iSt(e.parser)},htmlBuilder:Vo,mathmlBuilder:Ko});ae("\\nonumber","\\gdef\\@eqnsw{0}");ae("\\notag","\\nonumber");ot({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ye(e.funcName+" valid only within array environment")}});var RT=K$;ot({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ye("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return Gn(e.body,r)},Z$=(e,n)=>{var t=e.font,r=n.withFont(t);return cr(e.body,r)},MT={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ot({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=Nv(n[0]),i=r;return i in MT&&(i=MT[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:X$,mathmlBuilder:Z$});ot({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Vb(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Wl(r)}}});ot({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:X$,mathmlBuilder:Z$});var bSt=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=Gn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,l=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(d>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var v;if(_){var w=n.fontMetrics().axisHeight;m-a.depth-(w+.5*d){var t=new Xe("mfrac",[cr(e.numer,n),cr(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=Ar(e.barSize,n);t.setAttribute("linethickness",et(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Xe("mo",[new rs(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Xe("mo",[new rs(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return nk(s)}return t},J$=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};ot({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),J$({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},_)},htmlBuilder:bSt,mathmlBuilder:ySt});ot({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var DT=["display","text","script","scriptscript"],LT=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=Nv(n[0]),a=i.type==="atom"&&i.family==="open"?LT(i.text):null,o=Nv(n[1]),l=o.type==="atom"&&o.family==="close"?LT(o.text):null,u=sn(n[2],"size"),_,d=null;u.isBlank?_=!0:(d=u.value,_=d.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=sn(m.body[0],"textord");p=DT[Number(x.text)]}}else m=sn(m,"textord"),p=DT[Number(m.text)];return J$({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:d,leftDelim:a,rightDelim:l},p)}});ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:sn(n[0],"size").value,token:s}}});ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=sn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var eP=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?Gn(e.sup,n.havingStyle(t.sup()),n):Gn(e.sub,n.havingStyle(t.sub()),n),s=sn(e.base,"horizBrace")):s=sn(e,"horizBrace");var i=Gn(s.base,n.havingBaseStyle(Yt.DISPLAY)),a=Ub(s,n),o;if(s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=qn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=Ge(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=qn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=qn({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ge(["minner",s.isOver?"mover":"munder"],[o],n)},xSt=(e,n)=>{var t=qb(e.label);return new Xe(e.isOver?"mover":"munder",[cr(e.base,n),t])};ot({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:eP,mathmlBuilder:xSt});ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=sn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:ns(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=ps(e.body,n,!1);return D6t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=vu(e.body,n);return t instanceof Xe||(t=new Xe("mrow",[t])),t.setAttribute("href",e.href),t}});ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=sn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=sn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=ps(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ge(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>vu(e.body,n)});ot({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:ns(n[0]),mathml:ns(n[1])}},htmlBuilder:(e,n)=>{var t=ps(e.html,n,!1);return Kl(t)},mathmlBuilder:(e,n)=>vu(e.mathml,n)});var vw=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ye("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!g$(r))throw new Ye("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ot({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var l=sn(t[0],"raw").string,u=l.split(","),_=0;_{var t=Ar(e.height,n),r=0;e.totalheight.number>0&&(r=Ar(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=Ar(e.width,n));var i={height:et(t+r)};s>0&&(i.width=et(s)),r>0&&(i.verticalAlign=et(-r));var a=new w6t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Xe("mglyph",[]);t.setAttribute("alt",e.alt);var r=Ar(e.height,n),s=0;if(e.totalheight.number>0&&(s=Ar(e.totalheight,n)-r,t.setAttribute("valign",et(-s))),t.setAttribute("height",et(r+s)),e.width.number>0){var i=Ar(e.width,n);t.setAttribute("width",et(i))}return t.setAttribute("src",e.src),t}});ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=sn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return S$(e.dimension,n)},mathmlBuilder(e,n){var t=Ar(e.dimension,n);return new j$(t)}});ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ge([],[Gn(e.body,n)]),t=Ge(["inner"],[t],n)):t=Ge(["inner"],[Gn(e.body,n)]);var r=Ge(["fix"],[]),s=Ge([e.alignment],[t,r],n),i=Ge(["strut"]);return i.style.height=et(s.height+s.depth),s.depth&&(i.style.verticalAlign=et(-s.depth)),s.children.unshift(i),s=Ge(["thinbox"],[s],n),Ge(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Xe("mpadded",[cr(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ye("Mismatched "+e.funcName)}});var OT=(e,n)=>{switch(n.style.size){case Yt.DISPLAY.size:return e.display;case Yt.TEXT.size:return e.text;case Yt.SCRIPT.size:return e.script;case Yt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:ns(n[0]),text:ns(n[1]),script:ns(n[2]),scriptscript:ns(n[3])}},htmlBuilder:(e,n)=>{var t=OT(e,n),r=ps(t,n,!1);return Kl(r)},mathmlBuilder:(e,n)=>{var t=OT(e,n);return vu(t,n)}});var tP=(e,n,t,r,s,i,a)=>{e=Ge([],[e]);var o=t&&Wl(t),l,u;if(n){var _=Gn(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var d=Gn(t,r.havingStyle(s.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var p;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;p=qn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var x=e.height-a;p=qn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:et(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=qn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:et(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[p];if(l&&i!==0&&!o){var b=Ge(["mspace"],[],r);b.style.marginRight=et(i),v.unshift(b)}return Ge(["mop","op-limits"],v,r)},nP=new Set(["\\smallint"]),v_=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"op"),s=!0):i=sn(e,"op");var a=n.style,o=!1;a.size===Yt.DISPLAY.size&&i.symbol&&!nP.has(i.name)&&(o=!0);var l,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=ii(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var p=C$(d+"Size"+(o?"2":"1"),n);l=qn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var m=ps(i.body,n,!0);m.length===1&&m[0]instanceof Ji?(l=m[0],l.classes[0]="mop"):l=Ge(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Xe("mo",[ja(e.name,e.mode)]),nP.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Xe("mo",ra(e.body,n));else{t=new Xe("mi",[new rs(e.name.slice(1))]);var r=new Xe("mo",[ja("⁡","text")]);e.parentIsSupSub?t=new Xe("mrow",[t,r]):t=z$([t,r])}return t},wSt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ot({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=wSt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ns(r)}},htmlBuilder:v_,mathmlBuilder:fm});var SSt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ot({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:v_,mathmlBuilder:fm});ot({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=SSt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:v_,mathmlBuilder:fm});var rP=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=sn(e.base,"operatorname"),s=!0):i=sn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(d=>{var p="text"in d?d.text:void 0;return typeof p=="string"?{type:"textord",mode:d.mode,text:p}:d}),l=ps(o,n.withFont("mathrm"),!0),u=0;u{for(var t=ra(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new rs(o)]}var l=new Xe("mi",t);l.setAttribute("mathvariant","normal");var u=new Xe("mo",[ja("⁡","text")]);return e.parentIsSupSub?new Xe("mrow",[l,u]):z$([l,u])};ot({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:ns(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:rP,mathmlBuilder:kSt});ae("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");rf({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Kl(ps(e.body,n,!1)):Ge(["mord"],ps(e.body,n,!0),n)},mathmlBuilder(e,n){return vu(e.body,n,!0)}});ot({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle()),r=Yh("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ge(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("mover",[cr(e.body,n),t]);return r.setAttribute("accent","true"),r}});ot({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:ns(r)}},htmlBuilder:(e,n)=>{var t=ps(e.body,n.withPhantom(),!1);return Kl(t)},mathmlBuilder:(e,n)=>{var t=ra(e.body,n);return new Xe("mphantom",t)}});ae("\\hphantom","\\smash{\\phantom{#1}}");ot({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ge(["inner"],[Gn(e.body,n.withPhantom())]),r=Ge(["fix"],[]);return Ge(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ra(ns(e.body),n),r=new Xe("mphantom",t),s=new Xe("mpadded",[r]);return s.setAttribute("width","0px"),s}});ot({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=sn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Ar(e.dy,n);return qn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});ot({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});ot({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=sn(n[0],"size"),a=sn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&sn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=Ge(["mord","rule"],[],n),r=Ar(e.width,n),s=Ar(e.height,n),i=e.shift?Ar(e.shift,n):0;return t.style.borderRightWidth=et(r),t.style.borderTopWidth=et(s),t.style.bottom=et(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=Ar(e.width,n),r=Ar(e.height,n),s=e.shift?Ar(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Xe("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",et(t)),a.setAttribute("height",et(r));var o=new Xe("mpadded",[a]);return s>=0?o.setAttribute("height",et(s)):(o.setAttribute("height",et(s)),o.setAttribute("depth",et(-s))),o.setAttribute("voffset",et(s)),o}});function sP(e,n,t){for(var r=ps(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return sP(e.body,t,n)};ot({type:"sizing",names:IT,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:IT.indexOf(r)+1,body:i}},htmlBuilder:CSt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ra(e.body,t),s=new Xe("mstyle",r);return s.setAttribute("mathsize",et(t.sizeMultiplier)),s}});ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&sn(t[0],"ordgroup");if(a)for(var o,l=0;l{var t=Ge([],[Gn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ge(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Xe("mpadded",[cr(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});ot({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=Gn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=Xh(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+d-t.height-t.depth)/2);var p=l.height-t.height-a-u;t.style.paddingLeft=et(_);var m=qn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Yt.SCRIPTSCRIPT),S=Gn(e.index,x,n),v=.6*(m.height-m.depth),b=qn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:S}]}),w=Ge(["root"],[b]);return Ge(["mord","sqrt"],[w,m],n)}else return Ge(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Xe("mroot",[cr(t,n),cr(r,n)]):new Xe("msqrt",[cr(t,n)])}});var Q3={display:Yt.DISPLAY,text:Yt.TEXT,script:Yt.SCRIPT,scriptscript:Yt.SCRIPTSCRIPT};function ESt(e){return e in Q3}ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!ESt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=Q3[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),sP(e.body,r,n)},mathmlBuilder(e,n){var t=Q3[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ra(e.body,r),i=new Xe("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var NSt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Yt.DISPLAY.size||r.alwaysHandleSupSub);return s?v_:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Yt.DISPLAY.size||r.limits);return i?rP:null}else{if(r.type==="accent")return Wl(r.base)?sk:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?eP:null}else return null}else return null};rf({type:"supsub",htmlBuilder(e,n){var t=NSt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=Gn(r,n),o,l,u=n.fontMetrics(),_=0,d=0,p=r&&Wl(r);if(s){var m=n.havingStyle(n.style.sup());o=Gn(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());l=Gn(i,x,n),p||(d=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Yt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var v=n.sizeMultiplier,b=et(.5/u.ptPerEm/v),w=null;if(l){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ji||y){var C;w=et(-((C=a.italic)!=null?C:0))}}var E;if(o&&l){_=Math.max(_,S,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var N=u.defaultRuleThickness,T=4*N;if(_-o.depth-(l.height-d)0&&(_+=j,d-=j)}var M=[{type:"elem",elem:l,shift:d,marginRight:b,marginLeft:w},{type:"elem",elem:o,shift:-_,marginRight:b}];E=qn({positionType:"individualShift",children:M})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var O=[{type:"elem",elem:l,marginLeft:w,marginRight:b}];E=qn({positionType:"shift",positionData:d,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),E=qn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var B=U3(a,"right")||"mord";return Ge([B],[a,Ge(["msupsub"],[E])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[cr(e.base,n)];e.sub&&i.push(cr(e.sub,n)),e.sup&&i.push(cr(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Yt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Yt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(n.style===Yt.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||n.style===Yt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Yt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Yt.DISPLAY)?a="mover":a="msup"}return new Xe(a,i)}});rf({type:"atom",htmlBuilder(e,n){return ek(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Xe("mo",[ja(e.text,e.mode)]);if(e.family==="bin"){var r=rk(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var iP={mi:"italic",mn:"normal",mtext:"normal"};rf({type:"mathord",htmlBuilder(e,n){return Hb(e,n,"mathord")},mathmlBuilder(e,n){var t=new Xe("mi",[ja(e.text,e.mode,n)]),r=rk(e,n)||"italic";return r!==iP[t.type]&&t.setAttribute("mathvariant",r),t}});rf({type:"textord",htmlBuilder(e,n){return Hb(e,n,"textord")},mathmlBuilder(e,n){var t=ja(e.text,e.mode,n),r=rk(e,n)||"normal",s;return e.mode==="text"?s=new Xe("mtext",[t]):/[0-9]/.test(e.text)?s=new Xe("mn",[t]):e.text==="\\prime"?s=new Xe("mo",[t]):s=new Xe("mi",[t]),r!==iP[s.type]&&s.setAttribute("mathvariant",r),s}});var bw={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yw={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};rf({type:"spacing",htmlBuilder(e,n){if(yw.hasOwnProperty(e.text)){var t=yw[e.text].className||"";if(e.mode==="text"){var r=Hb(e,n,"textord");return r.classes.push(t),r}else return Ge(["mspace",t],[ek(e.text,e.mode,n)],n)}else{if(bw.hasOwnProperty(e.text))return Ge(["mspace",bw[e.text]],[],n);throw new Ye('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(yw.hasOwnProperty(e.text))t=new Xe("mtext",[new rs(" ")]);else{if(bw.hasOwnProperty(e.text))return new Xe("mspace");throw new Ye('Unknown type of space "'+e.text+'"')}return t}});var BT=()=>{var e=new Xe("mtd",[]);return e.setAttribute("width","50%"),e};rf({type:"tag",mathmlBuilder(e,n){var t=new Xe("mtable",[new Xe("mtr",[BT(),new Xe("mtd",[vu(e.body,n)]),BT(),new Xe("mtd",[vu(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var $T={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},PT={"\\textbf":"textbf","\\textmd":"textmd"},zSt={"\\textit":"textit","\\textup":"textup"},FT=(e,n)=>{var t=e.font;if(t){if($T[t])return n.withTextFontFamily($T[t]);if(PT[t])return n.withTextFontWeight(PT[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(zSt[t])};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:ns(s),font:r}},htmlBuilder(e,n){var t=FT(e,n),r=ps(e.body,t,!0);return Ge(["mord","text"],r,t)},mathmlBuilder(e,n){var t=FT(e,n);return vu(e.body,t)}});ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=Yh("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=qn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ge(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Xe("mo",[new rs("‾")]);t.setAttribute("stretchy","true");var r=new Xe("munder",[cr(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=Gn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return qn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Xe("mpadded",[cr(e.body,n)],["vcenter"]);return new Xe("mrow",[t])}});ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ye("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=HT(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),au=E$,aP=`[ \r + ]`,jSt="\\\\[a-zA-Z@]+",TSt="\\\\[^\uD800-\uDFFF]",ASt="("+jSt+")"+aP+"*",RSt=`\\\\( |[ \r ]+ -?)[ \r ]*`,Y3="[̀-ͯ]",jSt=new RegExp(Y3+"+$"),TSt="("+aP+"+)|"+(zSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Y3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Y3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+NSt)+("|"+ESt+")");class HT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(TSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Yi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Yi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class ASt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var RSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var qT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=qT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=qT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},MSt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in UT?n=UT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&MSt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new ASt(RSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new HT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new HT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var GT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ww={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},WT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Jb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new DSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Jb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=KT(e,"(");let i=KT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Ib(t))&&(!n||t!==47)}_P.peek=hkt;function ikt(){this.buffer()}function akt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function okt(){this.buffer()}function lkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ckt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ukt(e){this.exit(e)}function dkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function fkt(e){this.exit(e)}function hkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function _kt(){return{enter:{gfmFootnoteCallString:ikt,gfmFootnoteCall:akt,gfmFootnoteDefinitionLabelString:okt,gfmFootnoteDefinition:lkt},exit:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt}}}function pkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?pP:mkt))),u(),l}}function mkt(e,n,t){return n===0?e:pP(e,n,t)}function pP(e,n,t){return(t?"":" ")+e}const gkt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mP.peek=wkt;function vkt(){return{canContainEols:["delete"],enter:{strikethrough:ykt},exit:{strikethrough:xkt}}}function bkt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gkt}],handlers:{delete:mP}}}function ykt(e){this.enter({type:"delete",children:[]},e)}function xkt(e){this.exit(e)}function mP(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function wkt(){return"~"}function Skt(e){return e.length}function kkt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||Skt,i=[],a=[],o=[],l=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++bl[b])&&(l[b]=y)}S.push(w)}a[_]=S,o[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dl[d]&&(l[d]=w),m[d]=w),p[d]=y}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),Nkt);return s(),a}function Nkt(e,n,t){return">"+(t?"":" ")+e}function zkt(e,n){return YT(e,n.inConstruct,!0)&&!YT(e,n.notInConstruct,!1)}function YT(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function jkt(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Tkt(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Akt(e,n,t,r){const s=Tkt(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(jkt(e,t)){const d=t.enter("codeIndented"),p=t.indentLines(i,Rkt);return d(),p}const o=t.createTracker(r),l=s.repeat(Math.max(gP(i,s)+1,3)),u=t.enter("codeFenced");let _=o.move(l);if(e.lang){const d=t.enter(`codeFencedLang${a}`);_+=o.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=t.enter(`codeFencedMeta${a}`);_+=o.move(" "),_+=o.move(t.safe(e.meta,{before:_,after:` +?)[ \r ]*`,Y3="[̀-ͯ]",MSt=new RegExp(Y3+"+$"),DSt="("+aP+"+)|"+(RSt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Y3+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Y3+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+ASt)+("|"+TSt+")");class qT{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(DSt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new Yi("EOF",new Si(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ye("Unexpected character: '"+n[t]+"'",new Yi(n[t],new Si(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Yi(s,new Si(this,t,this.tokenRegex.lastIndex))}}class LSt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ye("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var OSt=Q$;ae("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});ae("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});ae("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});ae("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});ae("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});ae("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ae("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var UT={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ae("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ye("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=UT[n.text],r==null||r>=t)throw new Ye("Invalid base-"+t+" digit "+n.text);for(var s;(s=UT[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ye("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new Ye("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new Ye("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ye("Invalid number of arguments: "+l);o=parseInt(l),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};ae("\\newcommand",e=>lk(e,!1,!0,!1));ae("\\renewcommand",e=>lk(e,!0,!1,!1));ae("\\providecommand",e=>lk(e,!0,!0,!0));ae("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});ae("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});ae("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),au[t],Sr.math[t],Sr.text[t]),""});ae("\\bgroup","{");ae("\\egroup","}");ae("~","\\nobreakspace");ae("\\lq","`");ae("\\rq","'");ae("\\aa","\\r a");ae("\\AA","\\r A");ae("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ae("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ae("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ae("ℬ","\\mathscr{B}");ae("ℰ","\\mathscr{E}");ae("ℱ","\\mathscr{F}");ae("ℋ","\\mathscr{H}");ae("ℐ","\\mathscr{I}");ae("ℒ","\\mathscr{L}");ae("ℳ","\\mathscr{M}");ae("ℛ","\\mathscr{R}");ae("ℭ","\\mathfrak{C}");ae("ℌ","\\mathfrak{H}");ae("ℨ","\\mathfrak{Z}");ae("\\Bbbk","\\Bbb{k}");ae("\\llap","\\mathllap{\\textrm{#1}}");ae("\\rlap","\\mathrlap{\\textrm{#1}}");ae("\\clap","\\mathclap{\\textrm{#1}}");ae("\\mathstrut","\\vphantom{(}");ae("\\underbar","\\underline{\\text{#1}}");ae("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ae("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ae("\\ne","\\neq");ae("≠","\\neq");ae("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ae("∉","\\notin");ae("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ae("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ae("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ae("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ae("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ae("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ae("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ae("⟂","\\perp");ae("‼","\\mathclose{!\\mkern-0.8mu!}");ae("∌","\\notni");ae("⌜","\\ulcorner");ae("⌝","\\urcorner");ae("⌞","\\llcorner");ae("⌟","\\lrcorner");ae("©","\\copyright");ae("®","\\textregistered");ae("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ae("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ae("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ae("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ae("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ae("⋮","\\vdots");ae("\\varGamma","\\mathit{\\Gamma}");ae("\\varDelta","\\mathit{\\Delta}");ae("\\varTheta","\\mathit{\\Theta}");ae("\\varLambda","\\mathit{\\Lambda}");ae("\\varXi","\\mathit{\\Xi}");ae("\\varPi","\\mathit{\\Pi}");ae("\\varSigma","\\mathit{\\Sigma}");ae("\\varUpsilon","\\mathit{\\Upsilon}");ae("\\varPhi","\\mathit{\\Phi}");ae("\\varPsi","\\mathit{\\Psi}");ae("\\varOmega","\\mathit{\\Omega}");ae("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ae("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ae("\\boxed","\\fbox{$\\displaystyle{#1}$}");ae("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ae("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ae("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ae("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ae("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var GT={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},ISt=new Set(["bin","rel"]);ae("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in GT?n=GT[t]:(t.slice(0,4)==="\\not"||t in Sr.math&&ISt.has(Sr.math[t].group))&&(n="\\dotsb"),n});var ck={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ae("\\dotso",function(e){var n=e.future().text;return n in ck?"\\ldots\\,":"\\ldots"});ae("\\dotsc",function(e){var n=e.future().text;return n in ck&&n!==","?"\\ldots\\,":"\\ldots"});ae("\\cdots",function(e){var n=e.future().text;return n in ck?"\\@cdots\\,":"\\@cdots"});ae("\\dotsb","\\cdots");ae("\\dotsm","\\cdots");ae("\\dotsi","\\!\\cdots");ae("\\dotsx","\\ldots\\,");ae("\\DOTSI","\\relax");ae("\\DOTSB","\\relax");ae("\\DOTSX","\\relax");ae("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ae("\\,","\\tmspace+{3mu}{.1667em}");ae("\\thinspace","\\,");ae("\\>","\\mskip{4mu}");ae("\\:","\\tmspace+{4mu}{.2222em}");ae("\\medspace","\\:");ae("\\;","\\tmspace+{5mu}{.2777em}");ae("\\thickspace","\\;");ae("\\!","\\tmspace-{3mu}{.1667em}");ae("\\negthinspace","\\!");ae("\\negmedspace","\\tmspace-{4mu}{.2222em}");ae("\\negthickspace","\\tmspace-{5mu}{.277em}");ae("\\enspace","\\kern.5em ");ae("\\enskip","\\hskip.5em\\relax");ae("\\quad","\\hskip1em\\relax");ae("\\qquad","\\hskip2em\\relax");ae("\\tag","\\@ifstar\\tag@literal\\tag@paren");ae("\\tag@paren","\\tag@literal{({#1})}");ae("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ye("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ae("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ae("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ae("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ae("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ae("\\newline","\\\\\\relax");ae("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var oP=et(Ao["Main-Regular"][84][1]-.7*Ao["Main-Regular"][65][1]);ae("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ae("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+oP+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ae("\\hspace","\\@ifstar\\@hspacer\\@hspace");ae("\\@hspace","\\hskip #1\\relax");ae("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ae("\\ordinarycolon",":");ae("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ae("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ae("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ae("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ae("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ae("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ae("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ae("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ae("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ae("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ae("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ae("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ae("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ae("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ae("∷","\\dblcolon");ae("∹","\\eqcolon");ae("≔","\\coloneqq");ae("≕","\\eqqcolon");ae("⩴","\\Coloneqq");ae("\\ratio","\\vcentcolon");ae("\\coloncolon","\\dblcolon");ae("\\colonequals","\\coloneqq");ae("\\coloncolonequals","\\Coloneqq");ae("\\equalscolon","\\eqqcolon");ae("\\equalscoloncolon","\\Eqqcolon");ae("\\colonminus","\\coloneq");ae("\\coloncolonminus","\\Coloneq");ae("\\minuscolon","\\eqcolon");ae("\\minuscoloncolon","\\Eqcolon");ae("\\coloncolonapprox","\\Colonapprox");ae("\\coloncolonsim","\\Colonsim");ae("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ae("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ae("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ae("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ae("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ae("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ae("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ae("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ae("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ae("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ae("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ae("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ae("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ae("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ae("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ae("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ae("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ae("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ae("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ae("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ae("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ae("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ae("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ae("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ae("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ae("\\imath","\\html@mathml{\\@imath}{ı}");ae("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ae("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ae("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ae("⟦","\\llbracket");ae("⟧","\\rrbracket");ae("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ae("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ae("⦃","\\lBrace");ae("⦄","\\rBrace");ae("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ae("⦵","\\minuso");ae("\\darr","\\downarrow");ae("\\dArr","\\Downarrow");ae("\\Darr","\\Downarrow");ae("\\lang","\\langle");ae("\\rang","\\rangle");ae("\\uarr","\\uparrow");ae("\\uArr","\\Uparrow");ae("\\Uarr","\\Uparrow");ae("\\N","\\mathbb{N}");ae("\\R","\\mathbb{R}");ae("\\Z","\\mathbb{Z}");ae("\\alef","\\aleph");ae("\\alefsym","\\aleph");ae("\\Alpha","\\mathrm{A}");ae("\\Beta","\\mathrm{B}");ae("\\bull","\\bullet");ae("\\Chi","\\mathrm{X}");ae("\\clubs","\\clubsuit");ae("\\cnums","\\mathbb{C}");ae("\\Complex","\\mathbb{C}");ae("\\Dagger","\\ddagger");ae("\\diamonds","\\diamondsuit");ae("\\empty","\\emptyset");ae("\\Epsilon","\\mathrm{E}");ae("\\Eta","\\mathrm{H}");ae("\\exist","\\exists");ae("\\harr","\\leftrightarrow");ae("\\hArr","\\Leftrightarrow");ae("\\Harr","\\Leftrightarrow");ae("\\hearts","\\heartsuit");ae("\\image","\\Im");ae("\\infin","\\infty");ae("\\Iota","\\mathrm{I}");ae("\\isin","\\in");ae("\\Kappa","\\mathrm{K}");ae("\\larr","\\leftarrow");ae("\\lArr","\\Leftarrow");ae("\\Larr","\\Leftarrow");ae("\\lrarr","\\leftrightarrow");ae("\\lrArr","\\Leftrightarrow");ae("\\Lrarr","\\Leftrightarrow");ae("\\Mu","\\mathrm{M}");ae("\\natnums","\\mathbb{N}");ae("\\Nu","\\mathrm{N}");ae("\\Omicron","\\mathrm{O}");ae("\\plusmn","\\pm");ae("\\rarr","\\rightarrow");ae("\\rArr","\\Rightarrow");ae("\\Rarr","\\Rightarrow");ae("\\real","\\Re");ae("\\reals","\\mathbb{R}");ae("\\Reals","\\mathbb{R}");ae("\\Rho","\\mathrm{P}");ae("\\sdot","\\cdot");ae("\\sect","\\S");ae("\\spades","\\spadesuit");ae("\\sub","\\subset");ae("\\sube","\\subseteq");ae("\\supe","\\supseteq");ae("\\Tau","\\mathrm{T}");ae("\\thetasym","\\vartheta");ae("\\weierp","\\wp");ae("\\Zeta","\\mathrm{Z}");ae("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ae("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ae("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ae("\\bra","\\mathinner{\\langle{#1}|}");ae("\\ket","\\mathinner{|{#1}\\rangle}");ae("\\braket","\\mathinner{\\langle{#1}\\rangle}");ae("\\Bra","\\left\\langle#1\\right|");ae("\\Ket","\\left|#1\\right\\rangle");var lP=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=d;if(!d&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",l(!1)),s.length&&n.macros.set("\\|",l(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};ae("\\bra@ket",lP(!1));ae("\\bra@set",lP(!0));ae("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ae("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ae("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ae("\\angln","{\\angl n}");ae("\\blue","\\textcolor{##6495ed}{#1}");ae("\\orange","\\textcolor{##ffa500}{#1}");ae("\\pink","\\textcolor{##ff00af}{#1}");ae("\\red","\\textcolor{##df0030}{#1}");ae("\\green","\\textcolor{##28ae7b}{#1}");ae("\\gray","\\textcolor{gray}{#1}");ae("\\purple","\\textcolor{##9d38bd}{#1}");ae("\\blueA","\\textcolor{##ccfaff}{#1}");ae("\\blueB","\\textcolor{##80f6ff}{#1}");ae("\\blueC","\\textcolor{##63d9ea}{#1}");ae("\\blueD","\\textcolor{##11accd}{#1}");ae("\\blueE","\\textcolor{##0c7f99}{#1}");ae("\\tealA","\\textcolor{##94fff5}{#1}");ae("\\tealB","\\textcolor{##26edd5}{#1}");ae("\\tealC","\\textcolor{##01d1c1}{#1}");ae("\\tealD","\\textcolor{##01a995}{#1}");ae("\\tealE","\\textcolor{##208170}{#1}");ae("\\greenA","\\textcolor{##b6ffb0}{#1}");ae("\\greenB","\\textcolor{##8af281}{#1}");ae("\\greenC","\\textcolor{##74cf70}{#1}");ae("\\greenD","\\textcolor{##1fab54}{#1}");ae("\\greenE","\\textcolor{##0d923f}{#1}");ae("\\goldA","\\textcolor{##ffd0a9}{#1}");ae("\\goldB","\\textcolor{##ffbb71}{#1}");ae("\\goldC","\\textcolor{##ff9c39}{#1}");ae("\\goldD","\\textcolor{##e07d10}{#1}");ae("\\goldE","\\textcolor{##a75a05}{#1}");ae("\\redA","\\textcolor{##fca9a9}{#1}");ae("\\redB","\\textcolor{##ff8482}{#1}");ae("\\redC","\\textcolor{##f9685d}{#1}");ae("\\redD","\\textcolor{##e84d39}{#1}");ae("\\redE","\\textcolor{##bc2612}{#1}");ae("\\maroonA","\\textcolor{##ffbde0}{#1}");ae("\\maroonB","\\textcolor{##ff92c6}{#1}");ae("\\maroonC","\\textcolor{##ed5fa6}{#1}");ae("\\maroonD","\\textcolor{##ca337c}{#1}");ae("\\maroonE","\\textcolor{##9e034e}{#1}");ae("\\purpleA","\\textcolor{##ddd7ff}{#1}");ae("\\purpleB","\\textcolor{##c6b9fc}{#1}");ae("\\purpleC","\\textcolor{##aa87ff}{#1}");ae("\\purpleD","\\textcolor{##7854ab}{#1}");ae("\\purpleE","\\textcolor{##543b78}{#1}");ae("\\mintA","\\textcolor{##f5f9e8}{#1}");ae("\\mintB","\\textcolor{##edf2df}{#1}");ae("\\mintC","\\textcolor{##e0e5cc}{#1}");ae("\\grayA","\\textcolor{##f6f7f7}{#1}");ae("\\grayB","\\textcolor{##f0f1f2}{#1}");ae("\\grayC","\\textcolor{##e3e5e6}{#1}");ae("\\grayD","\\textcolor{##d6d8da}{#1}");ae("\\grayE","\\textcolor{##babec2}{#1}");ae("\\grayF","\\textcolor{##888d93}{#1}");ae("\\grayG","\\textcolor{##626569}{#1}");ae("\\grayH","\\textcolor{##3b3e40}{#1}");ae("\\grayI","\\textcolor{##21242c}{#1}");ae("\\kaBlue","\\textcolor{##314453}{#1}");ae("\\kaGreen","\\textcolor{##71B307}{#1}");var cP={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class BSt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new LSt(OSt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new qT(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new Yi("EOF",r.loc)),this.pushTokens(s),new Yi("",Si.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new Ye("Extra }",i)}else if(i.text==="EOF")throw new Ye("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ye("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ye("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ye("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Ye("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...a[+l.text-1]);else throw new Ye("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new Yi(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new qT(s,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var _={tokens:l,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||au.hasOwnProperty(n)||Sr.math.hasOwnProperty(n)||Sr.text.hasOwnProperty(n)||cP.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:au.hasOwnProperty(n)&&!au[n].primitive}}var WT=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,n1=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),xw={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},VT={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Zb{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new BSt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ye("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yi("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Zb.endOfExpression.has(s.text)||t&&s.text===t||n&&au[s.text]&&au[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(m$(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:Si.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=C+1:(x!==C&&w.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(N)?w.push(...N):N&&w.push(N),x=C+y[0].length,b=!0),!p.global)break;y=p.exec(u.value)}return b?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=QT(e,"(");let i=QT(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function hP(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Id(t)||Ob(t))&&(!n||t!==47)}_P.peek=gkt;function ckt(){this.buffer()}function ukt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function dkt(){this.buffer()}function fkt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function _kt(e){this.exit(e)}function pkt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Ja(this.sliceSerialize(e)).toLowerCase(),t.label=n}function mkt(e){this.exit(e)}function gkt(){return"["}function _P(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function vkt(){return{enter:{gfmFootnoteCallString:ckt,gfmFootnoteCall:ukt,gfmFootnoteDefinitionLabelString:dkt,gfmFootnoteDefinition:fkt},exit:{gfmFootnoteCallString:hkt,gfmFootnoteCall:_kt,gfmFootnoteDefinitionLabelString:pkt,gfmFootnoteDefinition:mkt}}}function bkt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:_P},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),_(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((n?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?pP:ykt))),u(),l}}function ykt(e,n,t){return n===0?e:pP(e,n,t)}function pP(e,n,t){return(t?"":" ")+e}const xkt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];mP.peek=Ekt;function wkt(){return{canContainEols:["delete"],enter:{strikethrough:kkt},exit:{strikethrough:Ckt}}}function Skt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xkt}],handlers:{delete:mP}}}function kkt(e){this.enter({type:"delete",children:[]},e)}function Ckt(e){this.exit(e)}function mP(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function Ekt(){return"~"}function Nkt(e){return e.length}function zkt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||Nkt,i=[],a=[],o=[],l=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++bl[b])&&(l[b]=y)}S.push(w)}a[_]=S,o[_]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dl[d]&&(l[d]=w),m[d]=w),p[d]=y}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),Akt);return s(),a}function Akt(e,n,t){return">"+(t?"":" ")+e}function Rkt(e,n){return XT(e,n.inConstruct,!0)&&!XT(e,n.notInConstruct,!1)}function XT(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function Mkt(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Dkt(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Lkt(e,n,t,r){const s=Dkt(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(Mkt(e,t)){const d=t.enter("codeIndented"),p=t.indentLines(i,Okt);return d(),p}const o=t.createTracker(r),l=s.repeat(Math.max(gP(i,s)+1,3)),u=t.enter("codeFenced");let _=o.move(l);if(e.lang){const d=t.enter(`codeFencedLang${a}`);_+=o.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=t.enter(`codeFencedMeta${a}`);_+=o.move(" "),_+=o.move(t.safe(e.meta,{before:_,after:` `,encode:["`"],...o.current()})),d()}return _+=o.move(` `),i&&(_+=o.move(i+` -`)),_+=o.move(l),u(),_}function Rkt(e,n,t){return(t?"":" ")+e}function fk(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Mkt(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("definition");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("[");return u+=l.move(t.safe(t.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":` -`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function Dkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function bp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function jv(e,n,t){const r=Kh(e),s=Kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vP.peek=Lkt;function vP(e,n,t,r){const s=Dkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=jv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=jv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Lkt(e,n,t){return t.options.emphasis||"*"}function Okt(e,n){let t=!1;return $S(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,S3}),!!((!e.depth||e.depth<3)&&GS(e)&&(n.options.setext||t))}function Ikt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Okt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` +`)),_+=o.move(l),u(),_}function Okt(e,n,t){return(t?"":" ")+e}function fk(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Ikt(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("definition");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("[");return u+=l.move(t.safe(t.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":` +`,...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function Bkt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function bp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zv(e,n,t){const r=Kh(e),s=Kh(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vP.peek=$kt;function vP(e,n,t,r){const s=Bkt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=zv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function $kt(e,n,t){return t.options.emphasis||"*"}function Pkt(e,n){let t=!1;return $S(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,S3}),!!((!e.depth||e.depth<3)&&GS(e)&&(n.options.setext||t))}function Fkt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Pkt(e,t)){const _=t.enter("headingSetext"),d=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` `,after:` `});return d(),_(),p+` `+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` `))+1))}const a="#".repeat(s),o=t.enter("headingAtx"),l=t.enter("phrasing");i.move(a+" ");let u=t.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=bp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}bP.peek=Bkt;function bP(e){return e.value||""}function Bkt(){return"<"}yP.peek=$kt;function yP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function $kt(){return"!"}xP.peek=Pkt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pkt(){return"!"}wP.peek=Fkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Hkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Hkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=qkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function qkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ukt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Gkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Wkt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Gkt(t):hk(t);const o=e.ordered?a==="."?")":".":Ukt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Qkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Ykt=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xkt(e,n,t,r){return(e.children.some(function(a){return Ykt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zkt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=Jkt;function NP(e,n,t,r){const s=Zkt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=jv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=jv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function Jkt(e,n,t){return t.options.strong||"*"}function e7t(e,n,t,r){return t.safe(e.value,r)}function t7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function n7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(t7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Ekt,break:XT,code:Akt,definition:Mkt,emphasis:vP,hardBreak:XT,heading:Ikt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Wkt,listItem:Kkt,paragraph:Qkt,root:Xkt,strong:NP,text:e7t,thematicBreak:n7t};function r7t(){return{enter:{table:s7t,tableData:ZT,tableHeader:ZT,tableRow:a7t},exit:{codeText:o7t,table:i7t,tableData:Ew,tableHeader:Ew,tableRow:Ew}}}function s7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function i7t(e){this.exit(e),this.data.inTable=void 0}function a7t(e){this.enter({type:"tableRow",children:[]},e)}function Ew(e){this.exit(e)}function ZT(e){this.enter({type:"tableCell",children:[]},e)}function o7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,l7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function l7t(e,n){return n==="|"?n:e}function c7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=bp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),l(),o(),u}bP.peek=Hkt;function bP(e){return e.value||""}function Hkt(){return"<"}yP.peek=qkt;function yP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const l=t.createTracker(r);let u=l.move("![");return u+=l.move(t.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(t.safe(e.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function qkt(){return"!"}xP.peek=Ukt;function xP(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("![");const u=t.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Ukt(){return"!"}wP.peek=Gkt;function wP(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}kP.peek=Wkt;function kP(e,n,t,r){const s=fk(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,l;if(SP(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let d=a.move("<");return d+=a.move(t.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),o(),t.stack=_,d}o=t.enter("link"),l=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function Wkt(e,n,t){return SP(e,t)?"<":"["}CP.peek=Vkt;function CP(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let l=o.move("[");const u=t.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const d=t.safe(t.associationId(e),{before:l,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==d?l+=o.move(d+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Vkt(){return"["}function hk(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Kkt(e){const n=hk(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Qkt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function EP(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Ykt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?Qkt(t):hk(t);const o=e.ordered?a==="."?")":".":Kkt(t);let l=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(l=!0),EP(t)===a&&_){let d=-1;for(;++d-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return l(),u;function _(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function Jkt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const e7t=lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function t7t(e,n,t,r){return(e.children.some(function(a){return e7t(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function n7t(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}NP.peek=r7t;function NP(e,n,t,r){const s=n7t(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let l=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),_=zv(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(l=bp(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zv(r.after.charCodeAt(0),d,s);p.inside&&(l=l.slice(0,-1)+bp(d));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+l+m}function r7t(e,n,t){return t.options.strong||"*"}function s7t(e,n,t,r){return t.safe(e.value,r)}function i7t(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function a7t(e,n,t){const r=(EP(t)+(t.options.ruleSpaces?" ":"")).repeat(i7t(t));return t.options.ruleSpaces?r.slice(0,-1):r}const zP={blockquote:Tkt,break:ZT,code:Lkt,definition:Ikt,emphasis:vP,hardBreak:ZT,heading:Fkt,html:bP,image:yP,imageReference:xP,inlineCode:wP,link:kP,linkReference:CP,list:Ykt,listItem:Zkt,paragraph:Jkt,root:t7t,strong:NP,text:s7t,thematicBreak:a7t};function o7t(){return{enter:{table:l7t,tableData:JT,tableHeader:JT,tableRow:u7t},exit:{codeText:d7t,table:c7t,tableData:Cw,tableHeader:Cw,tableRow:Cw}}}function l7t(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function c7t(e){this.exit(e),this.data.inTable=void 0}function u7t(e){this.enter({type:"tableRow",children:[]},e)}function Cw(e){this.exit(e)}function JT(e){this.enter({type:"tableCell",children:[]},e)}function d7t(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,f7t));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function f7t(e,n){return n==="|"?n:e}function h7t(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:o}};function a(m,x,S,v){return u(_(m,S,v),m.align)}function o(m,x,S,v){const b=d(m,S,v),w=u([b]);return w.slice(0,w.indexOf(` -`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return kkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const N7t={tokenize:L7t,partial:!0};function z7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R7t,continuation:{tokenize:M7t},exit:D7t}},text:{91:{name:"gfmFootnoteCall",tokenize:A7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j7t,resolveTo:T7t}}}}function j7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function T7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function A7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function R7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function M7t(e,n,t){return e.check(um,n,e.attempt(N7t,n,t))}function D7t(e){e.exit("gfmFootnoteDefinition")}function L7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function O7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class I7t{constructor(){this.map=[]}add(n,t,r){B7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function B7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,H=$==="tableHead"||$==="tableRow"?N:l;return H===N&&r.parser.lazy[r.now().line]?t(O):H(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function H7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new I7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function eA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const q7t={name:"tasklistCheck",tokenize:G7t};function U7t(){return{text:{91:q7t}}}function G7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:W7t},n,t)(l):t(l)}}function W7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function V7t(e){return GB([v7t(),z7t(),O7t(e),P7t(),U7t()])}const K7t={};function IP(e){const n=this,t=e||K7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(V7t(t)),i.push(_7t()),a.push(p7t(t))}function Q7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Y7t(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`))}function l(m,x,S,v){const b=S.enter("tableCell"),w=S.enter("phrasing"),y=S.containerPhrasing(m,{...v,before:i,after:i});return w(),b(),y}function u(m,x){return zkt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const v=m.children;let b=-1;const w=[],y=x.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const A7t={tokenize:$7t,partial:!0};function R7t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:O7t,continuation:{tokenize:I7t},exit:B7t}},text:{91:{name:"gfmFootnoteCall",tokenize:L7t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:M7t,resolveTo:D7t}}}}function M7t(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return t(l);const u=Ja(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),n(l))}}function D7t(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function L7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?t(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(i>999||d===93&&!a||d===null||d===91||lr(d))return t(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(Ja(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(d)}return lr(d)||(a=!0),i++,e.consume(d),d===92?_:u}function _(d){return d===91||d===92||d===93?(e.consume(d),i++,u):u(d)}}function O7t(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||lr(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=Ja(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return lr(x)||(o=!0),a++,e.consume(x),x===92?d:_}function d(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),hn(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function I7t(e,n,t){return e.check(um,n,e.attempt(A7t,n,t))}function B7t(e){e.exit("gfmFootnoteDefinition")}function $7t(e,n,t){const r=this;return hn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function P7t(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l1?l(x):(a.consume(x),d++,m);if(d<2&&!t)return l(x);const v=a.exit("strikethroughSequenceTemporary"),b=Kh(x);return v._open=!b||b===2&&!!S,v._close=!S||S===2&&!!b,o(x)}}}class F7t{constructor(){this.map=[]}add(n,t,r){H7t(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function H7t(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,H=$==="tableHead"||$==="tableRow"?N:l;return H===N&&r.parser.lazy[r.now().line]?t(O):H(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):St(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):gn(O)?hn(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||lr(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:d)}function p(O){return O===92||O===124?(e.consume(O),d):d(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,gn(O)?hn(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?v(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):E(O)}function S(O){return gn(O)?hn(e,v,"whitespace")(O):v(O)}function v(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):O===45?(i+=1,b(O)):O===null||St(O)?C(O):E(O)}function b(O){return O===45?(e.enter("tableDelimiterFiller"),w(O)):E(O)}function w(O){return O===45?(e.consume(O),w):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(O))}function y(O){return gn(O)?hn(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||St(O)?!a||s!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):E(O)}function E(O){return t(O)}function N(O){return e.enter("tableRow"),T(O)}function T(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),T):O===null||St(O)?(e.exit("tableRow"),n(O)):gn(O)?hn(e,T,"whitespace")(O):(e.enter("data"),j(O))}function j(O){return O===null||O===124||lr(O)?(e.exit("data"),T(O)):(e.consume(O),O===92?M:j)}function M(O){return O===92||O===124?(e.consume(O),j):j(O)}}function W7t(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,_,d;const p=new F7t;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",d,n]])}return s!==void 0&&(i.end=Object.assign({},nh(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function tA(e,n,t,r,s){const i=[],a=nh(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function nh(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const V7t={name:"tasklistCheck",tokenize:Q7t};function K7t(){return{text:{91:V7t}}}function Q7t(e,n,t){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return lr(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):t(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(l)}function o(l){return St(l)?n(l):gn(l)?e.check({tokenize:Y7t},n,t)(l):t(l)}}function Y7t(e,n,t){return hn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function X7t(e){return GB([w7t(),R7t(),P7t(e),U7t(),K7t()])}const Z7t={};function IP(e){const n=this,t=e||Z7t,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(X7t(t)),i.push(v7t()),a.push(b7t(t))}function J7t(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function n(){this.buffer()}function t(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u;const d=_.data.hChildren[0];d.type,d.tagName,d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function a(l){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(l),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function eCt(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,l){const u=i.value||"",_=o.createTracker(l),d="$".repeat(Math.max(gP(u,"$")+1,2)),p=o.enter("mathFlow");let m=_.move(d);if(i.meta){const x=o.enter("mathFlowMeta");m+=_.move(o.safe(i.meta,{after:` `,before:m,encode:["$"],..._.current()})),x()}return m+=_.move(` `),u&&(m+=_.move(u+` -`)),m+=_.move(d),p(),m}function r(i,a,o){let l=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const _="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++dt)return null;try{return Tt.highlight(e,n).children}catch{return null}}function PP(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(PP)},n)}function iCt(e,n,t=3e5){var r;return((r=$P(e,n,t))==null?void 0:r.map(PP))??e}function FP(e,n,t=3e5){const r=$P(e,n,t);if(!r)return e.split(` +`)),m+=_.move(d),p(),m}function r(i,a,o){let l=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const _="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++dt)return null;try{return Tt.highlight(e,n).children}catch{return null}}function PP(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(PP)},n)}function cCt(e,n,t=3e5){var r;return((r=$P(e,n,t))==null?void 0:r.map(PP))??e}function FP(e,n,t=3e5){const r=$P(e,n,t);if(!r)return e.split(` `);const s=[];let i=[];const a=[];let o=0;const l=_=>{let d=_;for(let p=a.length-1;p>=0;p--)d=f.jsx("span",{className:a[p],children:d},o++);i.push(d)},u=_=>{var d;if(_.type==="text"){(_.value??"").split(` -`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&l(p)});return}_.type==="element"&&(a.push((((d=_.properties)==null?void 0:d.className)??[]).join(" ")),(_.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function HP(e){return Array.isArray(e)?e.length===0:e===""}const nA=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Zh(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function yp(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function Z3(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const l=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!l)break;r+=l[0].length,t+=l[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function aCt(e,n){const t=e[n];if(t!=="`"&&t!=="~"||yp(e,n)||Zh(e,n,t)<3)return!1;const r=e.lastIndexOf(` +`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&l(p)});return}_.type==="element"&&(a.push((((d=_.properties)==null?void 0:d.className)??[]).join(" ")),(_.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function HP(e){return Array.isArray(e)?e.length===0:e===""}const rA=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function Zh(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function yp(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function Z3(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const l=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!l)break;r+=l[0].length,t+=l[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function uCt(e,n){const t=e[n];if(t!=="`"&&t!=="~"||yp(e,n)||Zh(e,n,t)<3)return!1;const r=e.lastIndexOf(` `,n-1)+1,s=e.indexOf(` -`,n),i=e.slice(r,s===-1?e.length:s),a=Z3(i);return a.indentation<=3&&r+a.offset===n}function oCt(e,n){const t=e[n],r=Zh(e,n,t),s=e.lastIndexOf(` +`,n),i=e.slice(r,s===-1?e.length:s),a=Z3(i);return a.indentation<=3&&r+a.offset===n}function dCt(e,n){const t=e[n],r=Zh(e,n,t),s=e.lastIndexOf(` `,n-1)+1,i=e.indexOf(` `,n),a=Z3(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` `,n+r);if(o===-1)return e.length;for(o+=1;o=a.listIndent&&d.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return l===-1?e.length:l+1;if(l===-1)return e.length;o=l+1}return e.length}function lCt(e,n,t){const r=Zh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function uCt(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function fCt(e,{predictMath:n=!1}={}){const t=uCt(e),r=new Set,s=new Set;for(let u=0;u=a.listIndent&&d.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return l===-1?e.length:l+1;if(l===-1)return e.length;o=l+1}return e.length}function fCt(e,n,t){const r=Zh(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function _Ct(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function mCt(e,{predictMath:n=!1}={}){const t=_Ct(e),r=new Set,s=new Set;for(let u=0;u`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),fCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function pCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Vr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=pCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const mCt=1e5;function gCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:i6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(fb,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:iCt(e,n,mCt)})})]})}function vCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function sA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=vCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Nw(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Nw(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function yCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function aA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Vr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function xCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Vr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},wCt=FS().use(VS).use(IP).use(BP,GP).use(bCt).use(wv).use(yCt).use(fP);function SCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const l=i?v3(i[1]):null;return f.jsx(gCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(aA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(xCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&SCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(aA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(d5t,{content:qP(n,{predictMath:a}),processor:wCt,components:o,predict:a})})}),oA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function kCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Vr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:oA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function lA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const Tv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` -`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${Tv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Tv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=oht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Udt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(wst())||m.current()};lb(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Pr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Tst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Dst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":vst(),onClick:b,disabled:_,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Est()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),CCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),ey="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),J3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function zw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?o6():wXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:vWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:D4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:OZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:WKe()}}function ECt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:l6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():a6()}):f.jsx(f.Fragment,{children:"—"})}function NCt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),ib(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:JGe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${zw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:zw(o).variant,children:zw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:gqe()}),f.jsx("span",{className:"v",children:f.jsx(ECt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?pJe():f6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:jQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:uqe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):d6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",yGe()]})]})}function zCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:AUe()}):f.jsx(Pt,{variant:"error",children:mKe()}):f.jsx(Pt,{variant:"error",children:yUe()}):f.jsx(Pt,{variant:"error",children:FWe()})}function jCt({onEditState:e}){var T;const n=mn({mutationFn:Ddt}),t=HN(),r=ct(t),s=r.data??null,i=j=>{Pr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:OD()}):f.jsx(zCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${ey} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[LUe(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[HVe(),f.jsx(Wr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:iGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})})}function TCt(){var y;const e=mn({mutationFn:C=>Odt(...C)}),n=qN(),t=ct(n),r=t.data??null,s=C=>{Pr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?_6():nb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Wr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Wr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",ACt=5e3;function tF(e){const n=za(),t=e.map(a=>UN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:ACt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Pr(UN(a).queryKey,{running:!0})}]}function RCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function MCt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:fKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(RCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():c6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(I0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function DCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:EVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:RKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()})}function LCt({remote:e=!1}){var I;const n=mn({mutationFn:Jdt}),t=tht(),r=ct(t),s=r.data??null,i=L=>{Pr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:ey,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[vVe(),f.jsx(Ld,{choices:[{id:"",label:sQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:dJe(),children:E?T?Gi():Ad():y?CL():c6()}),f.jsx("span",{role:"status",children:f.jsx(DCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[ZQe(),f.jsx(Wr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[f6(),f.jsx(Wr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[EZe(),f.jsx(Wr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:mUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function OCt(){var C;const e=mn({mutationFn:tft}),n=nht(),t=ct(n),r=t.data??null,s=E=>{Pr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await nft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:ey,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[IWe(),f.jsx(Wr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[zGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:nZe()}),f.jsx(ICt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[_Ye(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",ZWe()]})})}function ICt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:aZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:vYe()}):f.jsx(Pt,{variant:"error",children:h6()})}function BCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function $Ct({remote:e}){var p;const n=ct(sht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:CCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:D4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:D4()}):f.jsx(Pt,{variant:"warning",children:nb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:jXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:dQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:eQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:OKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(O0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),uZe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:wJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[kKe()," ",f.jsx("code",{children:"ssh-add"}),CQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?ket():EL()]})]})]})}const PCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ty={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},cA=["hf","modal","slurm","ray","openresearch"],jw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},e5=["tinker","hf","modal","ray","k8s"],FCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},uA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function HCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:sft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=cA.includes(a),y=jw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=FCt[a],j=p?Dtt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=cA.includes($);if(!(p||jw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),jw.includes(H.id)||M(H.id,q)}function B($){if($===uA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:fGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ty[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:VUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:uA,label:XUe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:vZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function qCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?c6():bet();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":e5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ty[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:PCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():vtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||e5.includes(e.id)?_6():Gtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(z1,{size:16})})]})]})}function UCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ty[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(MCt,{remote:r}),e.id==="slurm"&&f.jsx(LCt,{remote:r}),e.id==="openresearch"&&f.jsx($Ct,{remote:r})]})]})}function GCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ty[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:i,disabled:r.saving,children:f.jsx(Gr,{size:14})})]}),e.id==="tinker"&&f.jsx(VCt,{target:e}),e.id==="hf"&&f.jsx(QCt,{}),e.id==="modal"&&f.jsx(TCt,{}),e.id==="ray"&&f.jsx(OCt,{}),e.id==="k8s"&&f.jsx(jCt,{onEditState:s})]})}function WCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Pr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=rht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(qCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?BCt(S):v??mGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!e5.includes(j.id)?f.jsx(UCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:NUe()}),f.jsx(f8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(HCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:_6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:TVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(GCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",Zqe()]})]})}function VCt({target:e}){var w;const n=mn({mutationFn:Ndt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=FN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Pr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?_tt():_.validationStatus==="billingRequired"?att():nb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:ntt()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:utt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?QJe():a6(),f.jsx(Wr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function KCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:nb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:MWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:yKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function QCt(){var v;const e=mn({mutationFn:Cdt}),n=PN(),t=ct(n),r=t.data??null,s=b=>{Pr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...PN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:f6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(KCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:ey,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:oWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?JJe():fHe(),f.jsx(Wr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??rWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[wZe()," ",f.jsx("code",{children:"HF_TOKEN"}),oXe()]})})})}const dA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function t5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function YCt({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Bdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){t5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){t5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:KQe()})]}):f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:E4({name:Ne(e)}),"aria-label":E4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function XCt({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){t5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":eKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":sKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Kqe(),onClick:n,disabled:o,children:f.jsx(Gr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function ZCt(){var u;const e=iht(),n=ct(e),t=n.data??null,r=_=>{Pr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!dA.includes(_)),l=[...dA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:YZe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",aqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(YCt,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(XCt,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:Zet,icon:zmt},{value:"light",label:Ket,icon:Ymt},{value:"dark",label:Fet,icon:Tmt}],JCt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function e8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":IN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:JCt,value:e,variant:"field",dropDown:!0,onSelect:s=>{dD(s)&&rO(s)}})})]})]})]})}const t8t={installer:uct,"app-bundle":Zlt,portable:vct,cargo:nct,homebrew:act,nix:_ct,unknown:wct},Tw={cargo:Ect,homebrew:Tct,nix:Dct};function n8t(){var d;const e=mn({mutationFn:p=>Adt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:MN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:GWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:t8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:QYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):oet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[YVe(),n.envDisabled&&Ttt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ett({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>jdt().then(r)),children:s==="apply"?r6():n.updateAvailable?wtt():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IQe()}),f.jsx("p",{children:((d=Tw[n.channel])==null?void 0:d.call(Tw))??EJe()})]})}),n.channel==="app-bundle"&&f.jsx(s8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function r8t(){var d;const e=mn({mutationFn:Sft}),n=hht(),t=ct(n),r=t.data??null,s=p=>{Pr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:qZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${qUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:lKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function s8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Rdt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?r6():a?GJe():s?TJe():jPe()})]})}function i8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=ov(),t=ct(n),r=t.data??null,s=x=>{Pr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,void 0,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:FGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:GGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:rJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?fet():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[wWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function a8t(){var m,x,S;const e=mn({mutationFn:ddt}),n=mn({mutationFn:fdt}),t=e1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Pr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:QGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:oJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():BJe()})}):f.jsx(lA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:UQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:dXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?LN():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:pXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?DN():DJe()})}):f.jsx(lA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:T4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function o8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...fht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Pr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),yft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(ov()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(ce=>{Pr(ov().queryKey,ce),m(!1)}).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Wut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:HYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:ret({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:_Ve()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:nYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:IXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??u6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Iqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:BYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):d6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void bft(e.id).then(a).catch(Z=>_(String(Z))),children:dWe()})})]}),f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:ZXe()})]}):f.jsx(Pt,{children:uVe()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Btt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:kGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:S1()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":S1(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Wr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:GD(),disabled:N===null||j,"aria-label":S1()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),xft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(a8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:pQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:wVe()}),f.jsx("p",{children:_Ze()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:YKe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const l8t={env:tat,config:iat,xdg:cat,default:Xit},Aw={preparing:qit,copying:bit,verifying:hat,finalizing:Sit},c8t=e=>{var n;return((n=Aw[e])==null?void 0:n.call(Aw))??e};function u8t(){var y;const e=aht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Pdt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Ait({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Fdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:UXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Det()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:tGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:$Ue()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:l8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[WVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[zYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Nit({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Vit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:c8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[BVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[DVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?$it():Lit()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const n5=e=>e==="running"||e==="starting";function d8t(e){return n5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Mqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:MXe()}),f.jsx("th",{children:rXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ab,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:d8t(t)})]},t.id)})})]})})}function f8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>n5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!n5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[JYe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function h8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:jWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],_8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:p6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function p8t(e){return oF.includes(e)}function m8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||p8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:p6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(e8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(i8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(NCt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(u8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(r8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(n8t,{})})]})]}),e==="compute"&&f.jsx(WCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(h8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(ZCt,{})]}),e==="git"&&f.jsx(o8t,{project:n,onProjectUpdate:t})]})}function Av(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function r5(e){return`${e.plugin?`${Av(e.plugin)}: `:""}${Av(e.name)}`}const fA={name:"plan",get description(){return XTe()},source:"command"};function Rw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function hA(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function b8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==fA.name);return n&&t.push(fA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||r5(r).localeCompare(r5(s),void 0,{sensitivity:"base"}))}function y8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function _A(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function x8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:r5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:rnt()})]},i.name))})}const w8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let S8t=null;function s5(e,n){const t=S8t??(S8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(Av(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),Av(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return g8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function k8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...pht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Qtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:Jtt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function C8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function E8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of w8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` -`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(k8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function N8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const i5=6.5,pA=2*Math.PI*i5;function z8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(j8t,{usage:e})}function j8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":N8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${pA*Math.max(a,2)/100} ${pA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Rv="!";function mA(e){return e.startsWith(Rv)?e.slice(Rv.length).trim():null}function T8t(e){return e.startsWith(Rv)?e.slice(Rv.length):e}function A8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function R8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function M8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` +`,u+3),p=d===-1?e.length:d;/^[ \t]*$/.test(e.slice(_,u))&&/^[ \t\r]*$/.test(e.slice(u+3,p))&&a.push(u)}for(let u=0;u+1`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),mCt(t,n)}function qP(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function bCt(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Vr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=bCt(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const yCt=1e5;function xCt({code:e,lang:n}){const[t,r]=R.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(Qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:i6(),"aria-label":q5e(),onClick:s,children:t?f.jsx(Na,{size:13}):f.jsx(db,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:cCt(e,n,yCt)})})]})}function wCt(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function iA(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),l=wCt(a[2]??"");if(!l[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Ew(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:l},position:Ew(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sUP(e)}function kCt(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=c$(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function oA({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?NQ({path:Ne(e)}):e,...Vr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(VO,{size:12}),f.jsx("span",{className:"file-chip-label",children:a}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function CCt({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?HQ({id:Ne(e)}):mY({id:Ne(e)}),...Vr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(O6,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||AL()}),f.jsx(JO,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const GP={singleDollarTextMath:!0},ECt=FS().use(VS).use(IP).use(BP,GP).use(SCt).use(xv).use(kCt).use(fP);function NCt(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const WP={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` +`)))return f.jsx("code",{className:s,...r,children:t});const l=i?v3(i[1]):null;return f.jsx(xCt,{code:a,lang:l})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},Fo=R.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Yd();const o=R.useMemo(()=>({"file-mention":l=>f.jsx(oA,{path:l.path,lines:l.lines,exp:l.exp,onOpenFile:t}),"run-mention":l=>f.jsx(CCt,{id:l.id,label:l.label,onOpenRun:r}),a:({node:l,href:u,children:_,...d})=>{if(u&&NCt(u)&&t){let p;try{p=decodeURI(u)}catch{return f.jsx("span",{children:_})}const m=s?s(p):p;return m?f.jsx(oA,{path:m,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...d,children:_})},th:({node:l,...u})=>f.jsx("th",{dir:"auto",...u}),td:({node:l,...u})=>f.jsx("td",{dir:"auto",...u}),img:({node:l,src:u,alt:_,className:d,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?f.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${d??""}`}):null},...WP}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(p5t,{content:qP(n,{predictMath:a}),processor:ECt,components:o,predict:a})})}),lA="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function zCt({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,l]=R.useState(!1),u=R.useRef(null),[_,d]=R.useState(!1),[p,m]=R.useState(""),x=R.useRef(null);R.useEffect(()=>{if(!o)return;const v=b=>{u.current&&!u.current.contains(b.target)&&l(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),R.useEffect(()=>{var v;_&&((v=x.current)==null||v.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),d(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(O6,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?gAe({agent:Ne(n)}):hAe({agent:Ne(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Vr(t),children:jAe()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:GAe(),rows:2,value:p,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),m(""),d(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),S())}}),f.jsxs("div",{className:lA,children:[f.jsx(Le,{size:"small",onClick:()=>{m(""),d(!1)},children:xAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(Le,{size:"small",variant:"primary",onClick:S,children:[IAe(),f.jsx(GO,{size:13})]})]})]}):f.jsxs("div",{className:lA,children:[f.jsx(Le,{size:"small",onClick:i,children:MAe()}),f.jsx(Le,{size:"small",onClick:()=>d(!0),children:FAe()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[f.jsx(Le,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:tAe()}),f.jsx(Le,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":CAe(),onClick:()=>l(v=>!v),children:f.jsx(Uo,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(or,{onClick:()=>{l(!1),r("bypassPermissions")},children:iAe()})})]}):f.jsx(Le,{size:"small",variant:"primary",onClick:()=>r(),children:cAe()})]})]})}function cA({save:e,onSaved:n,placeholder:t,createHref:r,createLabel:s}){const[i,a]=R.useState(""),[o,l]=R.useState(!1),[u,_]=R.useState(null);async function d(p){if(p.preventDefault(),!(o||!i.trim())){l(!0),_(null);try{n(await e(i.trim())),a("")}catch(m){_(m instanceof Error?m.message:String(m))}finally{l(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:d,children:[f.jsx("input",{type:"password",value:i,onChange:p=>a(p.target.value),placeholder:t,autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:o||!i.trim(),children:o?Ei():no()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:s??Qwe()}),u&&f.jsx("div",{className:"error",children:u})]})}function VP({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}const jv="code-source-text",KP="code-source-wrap",QP="file-view-gutter text-right text-muted select-none";function YP(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function XP({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:l,scrollPosition:u,onScrollPositionChange:_}){const d=R.useMemo(()=>FP(e,AS(i)),[e,i]),{ruleCh:p,codeCh:m}=YP(d.length),x=R.useRef(null),S=R.useRef(null),v=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},b=R.useRef(u);R.useLayoutEffect(()=>{const C=x.current;!C||!b.current||(C.scrollTop=b.current.top,C.scrollLeft=b.current.left,v())},[i]),R.useLayoutEffect(v,[e]),R.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const E=e.split(` +`),N=Math.min(Math.max(Math.trunc(a),1),E.length);let T=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const E=C.currentTarget,{selectionStart:N,selectionEnd:T}=E,j=e.slice(0,N)+" "+e.slice(T);n(j),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=N+1})}}},y=`absolute inset-0 m-0 py-3.5 pe-4 ${jv} ${KP} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${jv}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:S,className:`file-view-code ${y} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((C,E)=>f.jsxs("div",{"data-line":E+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[f.jsx("span",{className:`${QP} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:E+1}),HP(C)?f.jsx("br",{}):C]},E))}),f.jsx("textarea",{ref:x,className:`file-view-editarea ${y} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{v(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:w,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function ZP({onClose:e,onSaved:n}){const t=dht(),r=ct(t),[s,i]=R.useState(()=>r.data??null),[a,o]=R.useState(()=>{var y;return((y=r.data)==null?void 0:y.content)??""}),l=!s&&r.error?r.error.message:null,u=mn({mutationFn:({content:y,previous:C})=>Kdt(y,C)}),[_,d]=R.useState(!1),p=R.useRef(null),m=R.useRef(e),x=s!==null&&a!==s.content,S=R.useRef(x),v=R.useRef(_);S.current=x,v.current=_,m.current=e,R.useEffect(()=>{!r.data||S.current||v.current||(i(r.data),o(r.data.content))},[r.data]);const b=()=>{v.current||S.current&&!window.confirm(Est())||m.current()};ob(p,b,"textarea");async function w(){if(!(!s||!x||_)){d(!0);try{if(await u.mutateAsync({content:a,previous:s.content}),!Fn(t.queryKey))return;Pr(t.queryKey,{...s,content:a}),i({...s,content:a}),n==null||n(),Qn(Dst(),"success")}catch(y){Qn(y instanceof Error?y.message:String(y),"error")}finally{d(!1)}}}return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:y=>{y.target===y.currentTarget&&b()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Bst()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":wst(),onClick:b,disabled:_,children:f.jsx(Gr,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):s===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(It,{})," ",Tst()]}):f.jsx(XP,{value:a,onChange:o,onSave:()=>void w(),path:s.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(Le,{onClick:b,disabled:_,children:Ad()}),f.jsx(Le,{variant:"primary",onClick:()=>void w(),disabled:!x||_,children:_?Ei():no()})]})]})}),document.body)}const Ho=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),Bd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),jCt=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Jb="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Ca=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),mk=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Ro=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),J3=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),G0=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Vf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function Nw(e){return e.agentReady?{cls:"ok",variant:"success",label:e.authMethod==="local"?o6():EXe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:wWe()}:e.authMethod==="local"?{cls:"warn",variant:"warning",label:KD()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:D4()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:PZe()}:{cls:"warn",variant:"warning",label:vL()}:{cls:"warn",variant:"warning",label:YKe()}}function TCt({h:e}){return e.authMethod?e.authMethod==="local"?f.jsx(f.Fragment,{children:l6()}):f.jsx(f.Fragment,{children:e.authMethod==="oauth"?FHe():a6()}):f.jsx(f.Fragment,{children:"—"})}function ACt(){const e=hu(),{data:n=null}=ct(e),[t,r]=R.useState("claude-code"),[s,i]=R.useState(!1),a=(l,u=!1)=>{i(!0),sb(l,u).catch(()=>{}).finally(()=>i(!1))},o=n==null?void 0:n.find(l=>l.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:rWe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(n??[]).map(l=>f.jsxs("button",{className:l.id===t?"active":"",onClick:()=>r(l.id),children:[l.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${Nw(l).cls}`})]},l.id))}),n?o?f.jsxs("div",{className:Ho,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Pt,{variant:Nw(o).variant,children:Nw(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(Le,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[f.jsx(Aa,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:Gqe()}),f.jsx("span",{className:"v",children:o.binPath??EHe()}),f.jsx("span",{className:"k",children:kL()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:xqe()}),f.jsx("span",{className:"v",children:f.jsx(TCt,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?bJe():f6()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:MQe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:uYe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:_qe()}),f.jsx("span",{className:"v",children:o.models.length>0?lL({count:Wt(o.models.length),models:new Intl.ListFormat(z()).format(o.models.slice(0,4).map(l=>Ne(I0(l))))}):d6()})]}),o.agentNote&&f.jsx("p",{className:Ca,children:nm(o.agentNote)}),o.id==="opencode"&&f.jsx(dI,{installed:o.installed})]}):null:f.jsxs(ss,{children:[f.jsx(It,{})," ",kGe()]})]})}function RCt({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Pt,{variant:"success",children:LUe()}):f.jsx(Pt,{variant:"error",children:yKe()}):f.jsx(Pt,{variant:"error",children:kUe()}):f.jsx(Pt,{variant:"error",children:GWe()})}function MCt({onEditState:e}){var T;const n=mn({mutationFn:Bdt}),t=qN(),r=ct(t),s=r.data??null,i=j=>{Pr(t.queryKey,M=>(typeof j=="function"?j(M??null):j)??void 0)},a=s?null:((T=r.error)==null?void 0:T.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(!1),[m,x]=R.useState(!1),[S,v]=R.useState(null),b=j=>{i(j),l(j.context??""),_(j.namespace)},w=R.useRef(null);R.useEffect(()=>{const j=w.current;w.current=s,s&&(!j||o===(j.context??"")&&u.trim()===j.namespace)&&(l(s.context??""),_(s.namespace??""))},[s,o,u]);const y=s!==null&&o===(s.context??"")&&u.trim()===s.namespace,C=s!==null&&!y;R.useEffect(()=>{e==null||e({dirty:C,saving:d})},[C,d,e]);async function E(){if(!(m||d||!y)){x(!0);try{await nt.fetchQuery({...qN(),staleTime:0})}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}finally{x(!1)}}}async function N(j){if(j.preventDefault(),!(d||m)){p(!0),v(null);try{b(await n.mutateAsync({context:o,namespace:u.trim()}))}catch(M){v(M instanceof Error?M.message:String(M))}finally{p(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:a}):s?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:m||d?f.jsx(Pt,{children:Xi()}):C?f.jsx(Pt,{children:ID()}):f.jsx(RCt,{s})})]}),y&&!m&&!d&&s.preflight.error&&f.jsx("p",{className:`${Jb} break-words`,children:s.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:N,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[$Ue(),f.jsx(Ld,{choices:[{id:"",label:s.currentContext?oFe({context:Ne(s.currentContext)}):rFe()},...o&&!s.contexts.includes(o)?[{id:o,label:THe({context:Ne(o)})}]:[],...s.contexts.map(j=>({id:j,label:j}))],value:o,variant:"field",dropDown:!0,disabled:d||m,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[WVe(),f.jsx(Wr,{type:"text",value:u,disabled:d||m,onChange:j=>_(j.target.value),placeholder:cGe(),autoComplete:"off",spellCheck:!1})]}),S&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:S}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",onClick:()=>void E(),disabled:d||m||!y,children:[f.jsx(Aa,{size:13})," ",m?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:d||m||y,children:d?Ei():no()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aUe()]})})}function DCt(){var y;const e=mn({mutationFn:C=>Pdt(...C)}),n=UN(),t=ct(n),r=t.data??null,s=C=>{Pr(n.queryKey,E=>(typeof C=="function"?C(E??null):C)??void 0)},[i,a]=R.useState(null),o=i??((y=t.error)==null?void 0:y.message)??null,[l,u]=R.useState(""),[_,d]=R.useState(""),[p,m]=R.useState(!1),x=t.isPending||p,[S,v]=R.useState(!1);async function b(){if(!(x||S)){m(!0),a(null);try{await nt.fetchQuery({...UN(),staleTime:0})}catch(C){a(C instanceof Error?C.message:String(C))}finally{m(!1)}}}async function w(C){if(C.preventDefault(),!(!l.trim()||!_.trim()||x||S||r!=null&&r.processEnv)){v(!0),a(null);try{s(await e.mutateAsync([l.trim(),_.trim()])),u(""),d("")}catch(E){a(E instanceof Error?E.message:String(E))}finally{v(!1)}}}return f.jsxs(f.Fragment,{children:[!r&&x?f.jsxs(ss,{children:[f.jsx(It,{})," ",uUe()]}):r&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:r.tokenConfigured?"success":"warning",children:r.tokenConfigured?_6():tb()})})]}),(r==null?void 0:r.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:SFe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?NFe():$Fe(),f.jsx(Wr,{type:"password",value:l,onChange:C=>u(C.target.value),placeholder:(r==null?void 0:r.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.tokenConfigured?AFe():qFe(),f.jsx(Wr,{type:"password",value:_,onChange:C=>d(C.target.value),placeholder:(r==null?void 0:r.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:r==null?void 0:r.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:LFe()}),o&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:o}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:x||S,onClick:()=>void b(),children:[f.jsx(Aa,{size:13})," ",Xp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!l.trim()||!_.trim()||x||S||(r==null?void 0:r.processEnv),children:S?Ei():no()})]})]})]})}const JP="rounded-sm border-border-strong bg-surface text-subtext",eF="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",LCt=5e3;function tF(e){const n=za(),t=e.map(a=>GN(a)),r=$G({queries:t.map(a=>({...a,refetchInterval:LCt}))});return[Object.fromEntries(e.flatMap((a,o)=>r[o].data?[[a,r[o].data.running]]:[])),a=>{Fn(n)&&Pr(GN(a).queryKey,{running:!0})}]}function OCt({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Pt,{className:eF,children:aL()})});if(e===void 0)return f.jsx(Pt,{className:JP,children:gL()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:r.length===1?YFe({tool:Ne(r[0])}):eHe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:$o(e.testedAt)})]})}function ICt({remote:e=!1}){const n=YL(),t=ct(n),r=t.data??(t.isError?[]:null),[s,i]=R.useState(!1),[a,o]=R.useState({}),[l,u]=R.useState({}),[_,d]=R.useState(null),[p,m]=R.useState(!1),[x,S]=R.useState(0),v=e?[]:(r==null?void 0:r.filter(N=>{const T=a[N.host]??N.lastTest;return(T==null?void 0:T.reachable)&&T.toolsFound}).map(N=>N.host))??[],[b,w]=tF(v);function y(N){m(!1),S(T=>T+1),d(N),u(T=>({...T,[N]:!0}))}function C(){m(!1),d(null)}function E(N,T){u(j=>({...j,[N]:!T}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(Le,{variant:"ghost",onClick:()=>i(!0),children:[f.jsx(tI,{size:14})," ",TL()]})}),r===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",yL()]}):r.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:mKe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:r.map(N=>{const T=a[N.host]??N.lastTest,j=_===N.host,M=l[N.host]??!1,O=!e&&(j||(T==null?void 0:T.reachable)===!1),B=`${N.user?`${N.user}@`:""}${N.hostname??N.host}${N.port?`:${N.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[O?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":M,"aria-label":M?RK({name:Ne(N.host)}):eQ({name:Ne(N.host)}),onClick:$=>{$.stopPropagation(),E(N.host,M)},children:f.jsx(Uo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${M?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:N.host,children:N.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:B,children:B})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(OCt,{test:T,connecting:j&&!p,masterRunning:b[N.host]})}),f.jsx(Le,{size:"small",type:"button",className:"justify-self-end",onClick:$=>{$.stopPropagation(),j&&!p?C():y(N.host)},disabled:!j&&_!==null&&!p,children:j?p?Gi():Ad():(T==null?void 0:T.reachable)===!1?Gi():T?CL():c6()})]})]}),O&&(M||j)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${M?"":" hidden"}`,children:[!j&&(T==null?void 0:T.error)&&f.jsx(F0t,{host:N.host,transcript:T.error}),j&&f.jsx(C6,{host:N.host,backend:"ssh",active:M,onComplete:$=>{$.backend==="ssh"&&(o(H=>({...H,[N.host]:$.result})),w(N.host),m(!1),d(null))},onError:$=>{m(!0),o(H=>({...H,[N.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:$,testedAt:Date.now()}}))}},x)]})]},N.host)})}),s&&f.jsx(ZP,{onClose:()=>i(!1)})]})}function BCt({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Pt,{className:eF,children:aL()}):e===null?f.jsx(Pt,{className:JP,children:gL()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Pt,{className:"rounded-sm",variant:"warning",children:oL()}):f.jsx(Pt,{className:"rounded-sm",variant:"success",children:Yp()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:TVe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:OKe()}):f.jsx(Pt,{className:"rounded-sm",variant:"error",children:h6()})}function $Ct({remote:e=!1}){var I;const n=mn({mutationFn:rft}),t=iht(),r=ct(t),s=r.data??null,i=L=>{Pr(t.queryKey,F=>(typeof L=="function"?L(F??null):L)??void 0)},a=s?null:((I=r.error)==null?void 0:I.message)??null,[o,l]=R.useState(""),[u,_]=R.useState(""),[d,p]=R.useState(""),[m,x]=R.useState(""),[S,v]=R.useState(!1),[b,w]=R.useState(null),[y,C]=R.useState(null),[E,N]=R.useState(!1),[T,j]=R.useState(!1),[M,O]=R.useState(0),B=!e&&o&&(y!=null&&y.reachable)&&y.slurmFound&&y.toolsFound?[o]:[],[$,H]=tF(B);function q(){j(!1),O(L=>L+1),N(!0)}const Y=L=>{i(L),l(L.host??""),_(L.partition??""),p(L.account??""),x(L.timeLimit??"")},G=R.useRef(null);R.useEffect(()=>{const L=G.current;G.current=s,s&&(!L||o===(L.host??"")&&u.trim()===(L.partition??"")&&d.trim()===(L.account??"")&&m.trim()===(L.timeLimit??""))&&(l(s.host??""),_(s.partition??""),p(s.account??""),x(s.timeLimit??""))},[s,o,u,d,m]);const X=s!==null&&o===(s.host??"")&&u.trim()===(s.partition??"")&&d.trim()===(s.account??"")&&m.trim()===(s.timeLimit??"");async function te(L){if(L.preventDefault(),!S){v(!0),w(null);try{Y(await n.mutateAsync({host:o,partition:u.trim(),account:d.trim(),timeLimit:m.trim()}))}catch(F){w(F instanceof Error?F.message:String(F))}finally{v(!1)}}}return f.jsx(f.Fragment,{children:a?f.jsx("div",{className:"error",children:a}):s?f.jsxs(f.Fragment,{children:[!E&&(y==null?void 0:y.error)&&f.jsx("p",{className:Jb,children:y.error}),f.jsxs("form",{className:mk,onSubmit:te,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[wVe(),f.jsx(Ld,{choices:[{id:"",label:lQe()},...o&&!s.hosts.some(L=>L.host===o)?[{id:o,label:`${o} (not in ~/.ssh/config)`}]:[],...s.hosts.map(L=>({id:L.host,label:L.host}))],value:o,variant:"field",dropDown:!0,disabled:S||E,onSelect:L=>{l(L),C(null),N(!1),j(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(Le,{type:"button",onClick:()=>{E&&!T?(j(!1),N(!1)):q()},disabled:!o,title:o?void 0:pJe(),children:E?T?Gi():Ad():y?CL():c6()}),f.jsx("span",{role:"status",children:f.jsx(BCt,{test:y,connecting:E&&!T,masterRunning:$[o]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[nYe(),f.jsx(Wr,{type:"text",list:"slurm-partitions",value:u,onChange:L=>_(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:y==null?void 0:y.partitions.map(L=>f.jsx("option",{value:L},L))})]}),f.jsxs("label",{children:[f6(),f.jsx(Wr,{type:"text",value:d,onChange:L=>p(L.target.value),placeholder:zN(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[TZe(),f.jsx(Wr,{type:"text",value:m,onChange:L=>x(L.target.value),placeholder:yUe(),autoComplete:"off",spellCheck:!1})]})]}),b&&f.jsx("div",{className:"error",children:b}),f.jsx("div",{className:"actions",children:f.jsx(Le,{variant:"primary",type:"submit",disabled:S||X||E,children:S?Ei():no()})})]}),!e&&E&&f.jsx(C6,{host:o,backend:"slurm",onComplete:L=>{L.backend==="slurm"&&(C(L.result),H(o),j(!1),N(!1))},onError:L=>{j(!0),C({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:L})}},M)]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",aVe()]})})}function PCt(){var C;const e=mn({mutationFn:ift}),n=aht(),t=ct(n),r=t.data??null,s=E=>{Pr(n.queryKey,N=>(typeof E=="function"?E(N??null):E)??void 0)},i=r?null:((C=t.error)==null?void 0:C.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(null),[p,m]=R.useState(null),x=p!==null&&p!=="testing"?p:null,S=E=>{s(E),o(E.address??"")},v=R.useRef(null);R.useEffect(()=>{const E=v.current;v.current=r,r&&(!E||a===(E.address??""))&&o(r.address??"")},[r,a]);const b=r!==null&&a===(r.address??"");async function w(E){if(E.preventDefault(),!l){u(!0),d(null);try{S(await e.mutateAsync({address:a}))}catch(N){d(N instanceof Error?N.message:String(N))}finally{u(!1)}}}async function y(){m("testing");try{m(await aft(a.trim()||void 0))}catch(E){m({reachable:!1,address:a.trim()||"(unknown)",rayVersion:null,error:E instanceof Error?E.message:String(E)})}}return f.jsx(f.Fragment,{children:i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[(x==null?void 0:x.error)&&f.jsx("p",{className:Jb,children:x.error}),f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[FWe(),f.jsx(Wr,{type:"text",value:a,onChange:E=>{o(E.target.value),m(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[RGe(),": ",Ne(r.resolvedAddress)," · ",xL(),": ",r.source]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{variant:"primary",type:"submit",disabled:l||b,children:l?Ei():no()}),f.jsx(Le,{type:"button",onClick:()=>void y(),disabled:p==="testing",children:aZe()}),f.jsx(FCt,{test:p})]}),(x==null?void 0:x.reachable)&&x.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[vYe(),": ",x.rayVersion]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nVe()]})})}function FCt({test:e}){return e===null?null:e==="testing"?f.jsx(Pt,{children:uZe()}):e.reachable?f.jsx(Pt,{variant:"success",children:wYe()}):f.jsx(Pt,{variant:"error",children:h6()})}function HCt(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Dl(e.memBytes),r=e.gpus.length===0?null:hPe({count:e.gpus.length});return[n,e.cpuCount>0?C$e({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function qCt({remote:e}){var p;const n=ct(lht()),t=n.data,r=(p=n.error)==null?void 0:p.message,s=n.isFetching,[i,a]=R.useState(0),[o,l]=R.useState(!0),[u,_]=R.useState(!1),d=()=>n.refetch();return f.jsxs(f.Fragment,{children:[r&&!t?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:jCt,children:[f.jsx("span",{className:"k",children:l_()}),f.jsx("span",{className:"v",children:!t&&s||u?f.jsxs(Pt,{className:"gap-1.5",role:"status",children:[f.jsx(It,{}),u?QHe():Xi()]}):r?f.jsx(Pt,{variant:"warning",children:D4()}):t?t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:Yp()}):t.sshKeyStatus==="unknown"?f.jsx(Pt,{variant:"warning",children:D4()}):f.jsx(Pt,{variant:"warning",children:tb()}):f.jsx(Pt,{variant:"warning",children:vL()}):null}),f.jsx("span",{className:"k",children:IQe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn&&t.orgs.length>0?t.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:MXe()}),f.jsx("span",{className:"v",children:t!=null&&t.loggedIn?t.sshKeyStatus==="matched"?f.jsx(Pt,{variant:"success",children:pQe()}):t.sshKeyStatus==="no_local_match"?f.jsx(Pt,{variant:"warning",children:sQe()}):t.sshKeyStatus==="none_registered"?f.jsx(Pt,{variant:"error",children:PKe()}):f.jsx(Pt,{children:wL()}):"—"})]}),e&&t&&!t.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:pFe({command:Ne("orx login")})}),!e&&i>0&&f.jsx(P0t,{login:o,onComplete:()=>{_(!1),a(0),d()},onError:m=>{_(!1),Qn(m,"error")}},i),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="none_registered"&&(t.sshKeyPath?f.jsxs("p",{dir:"auto",className:Ca,children:[nqe()," ",f.jsxs("code",{children:["orx ssh-key add ",t.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Ca,children:[RKe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),_Ze()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(t==null?void 0:t.loggedIn)&&t.sshKeyStatus==="no_local_match"&&(t.sshKeyPath?f.jsx("p",{dir:"auto",className:Ca,children:EJe({register:Ne(`orx ssh-key add ${t.sshKeyPath}`),load:Ne("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Ca,children:[zKe()," ",f.jsx("code",{children:"ssh-add"}),jQe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!s&&(r||(t==null?void 0:t.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(t==null?void 0:t.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(Le,{onClick:()=>void d(),disabled:s||u,children:[f.jsx(Aa,{size:13})," ",s?Xi():Qp()]}),!e&&t&&(!t.loggedIn||t.sshKeyStatus!=="matched")&&f.jsxs(Le,{variant:"primary",disabled:s||u,onClick:()=>{l(!t.loggedIn),_(!0),a(m=>m+1)},children:[u?f.jsx(It,{}):f.jsx(c_,{size:13})," ",t.loggedIn?zet():EL()]})]})]})}const UCt={local:Qpe,ssh:pme,tinker:bme,hf:Fpe,modal:Jpe,k8s:Gpe,slurm:dme,ray:ome,openresearch:rme},ey={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},uA=["hf","modal","slurm","ray","openresearch"],zw=["hf","modal","openresearch"],nF={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},e5=["tinker","hf","modal","ray","k8s"],GCt={tinker:mge,hf:sge,modal:lge,openresearch:fge},dA="__custom__";function g0(e,n){return!!(n&&!(nF[e]??[]).includes(n))}function WCt({settings:e,projectId:n,onSaved:t}){const r=mn({mutationFn:lft}),s=e.configuredDefaultBackend??e.defaultBackend??"local",i=e.defaultFlavor??"",[a,o]=R.useState(s),[l,u]=R.useState(i),[_,d]=R.useState(g0(s,i)),[p,m]=R.useState(!1),[x,S]=R.useState(null),v=e.targets.find($=>$.id===a),b=e.targets.filter($=>$.configured||$.id===s),w=uA.includes(a),y=zw.includes(a),C=nF[a]??[],E=a===s&&(!w||l.trim()===i),N=Od[a](),T=GCt[a],j=p?Btt():y&&!l.trim()?e$e({destination:N}):a==="ssh"?lHe():sHe({destination:N});R.useEffect(()=>{o(s),u(i),d(g0(s,i))},[s,i]);async function M($,H){const q=uA.includes($);if(!(p||zw.includes($)&&!H.trim())){m(!0),S(null);try{t(await r.mutateAsync({backend:$,flavor:q&&H.trim()||null,projectId:n}))}catch(Y){S(Y instanceof Error?Y.message:String(Y)),o(s),u(i),d(g0(s,i))}finally{m(!1)}}}function O($){const H=e.targets.find(Y=>Y.id===$);if(!H)return;o(H.id);const q=H.id===s?i:"";u(q),d(g0(H.id,q)),zw.includes(H.id)||M(H.id,q)}function B($){if($===dA){d(!0);return}d(!1),u($),(!y||$)&&M(a,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:mGe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),E||M(a,l)},children:[f.jsx(Ld,{choices:b.map($=>({id:$.id,label:Od[$.id]()})),value:a,variant:"field",dropDown:!0,disabled:p,renderIcon:$=>{const H=e.targets.find(q=>q.id===$.id);return H?f.jsx(u_,{kind:ey[H.id],size:16}):null},onSelect:O}),w&&f.jsx("div",{children:_?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:l,onChange:$=>u($.target.value),onBlur:()=>{if(y&&!l.trim()){a===s&&(u(i),d(g0(s,i)));return}E||M(a,l)},placeholder:XUe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:p}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":NN(),title:NN(),onMouseDown:$=>$.preventDefault(),onClick:()=>d(!1),children:f.jsx(Uo,{size:12})})]}):f.jsx(Ld,{choices:[{id:"",label:y?YBe():mHe()},...l&&!C.includes(l)?[{id:l,label:I$e({value:Ne(l)})}]:[],...C.map($=>({id:$,label:$})),{id:dA,label:tGe()}],value:l,variant:"field",dropDown:!0,disabled:p,onSelect:B})})]}),x&&f.jsx("div",{className:"error mt-2.5",children:x}),v&&!v.configured&&f.jsx("p",{className:Ca,children:wZe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:j}),T&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:T()})]})}function VCt({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?HBe():e.id==="openresearch"?EL():e.id==="ray"?c6():ket();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":Od[e.id](),"aria-describedby":i,"aria-haspopup":e5.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(u_,{kind:ey[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:Od[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:UCt[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?JPe():wtt()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:V$e()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?_L():e.configured?!r||e5.includes(e.id)?_6():Qtt():a}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(N1,{size:16})})]})]})}function KCt({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(op,{size:16})," ",fL()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(u_,{kind:ey[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:Od[e.id]()})]}),n&&f.jsx(Pt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:_L()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(ICt,{remote:r}),e.id==="slurm"&&f.jsx($Ct,{remote:r}),e.id==="openresearch"&&f.jsx(qCt,{remote:r})]})]})}function QCt({target:e,onClose:n}){const t=R.useRef(null),[r,s]=R.useState({dirty:!1,saving:!1});R.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(QPe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(u_,{kind:ey[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:Od[e.id]()})]}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:i,disabled:r.saving,children:f.jsx(Gr,{size:14})})]}),e.id==="tinker"&&f.jsx(XCt,{target:e}),e.id==="hf"&&f.jsx(JCt,{}),e.id==="modal"&&f.jsx(DCt,{}),e.id==="ray"&&f.jsx(PCt,{}),e.id==="k8s"&&f.jsx(MCt,{onEditState:s})]})}function YCt({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){var M,O;const s=QL(e==null?void 0:e.id),i=ct(s),a=i.data??null,o=B=>{Pr(s.queryKey,$=>(typeof B=="function"?B($??null):B)??void 0)},l=a?null:((M=i.error)==null?void 0:M.message)??null,[u,_]=R.useState(null),[d,p]=R.useState(null),m=oht(),x=ct(m),S=x.data??null,v=((O=x.error)==null?void 0:O.message)??null;R.useEffect(()=>{_(null),p(null)},[e==null?void 0:e.id]);const b=B=>{o(B),p(null)},w=a?a.targets:null,y=(a==null?void 0:a.configuredDefaultBackend)??(a==null?void 0:a.defaultBackend),C=w?[...w].sort((B,$)=>+($.id===y)-+(B.id===y)):null,E=(C==null?void 0:C.filter(B=>B.configured))??[],N=(C==null?void 0:C.filter(B=>!B.configured))??[],T=B=>f.jsx(VCt,{target:B,isDefault:y===B.id,summary:B.id==="local"?S?HCt(S):v??yGe():void 0,onOpen:B.id==="local"?void 0:()=>_(B.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${B.id}`),j=u?a==null?void 0:a.targets.find(B=>B.id===u):null;return j&&!e5.includes(j.id)?f.jsx(KCt,{target:j,isDefault:y===j.id,onBack:()=>_(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:hL()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:AUe()}),f.jsx(m8t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):a?f.jsxs(f.Fragment,{children:[d&&f.jsx("div",{className:"error",children:d}),f.jsx(WCt,{settings:a,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:_6()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(T)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:DVe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(T)})]}),j&&f.jsx(QCt,{target:j,onClose:()=>_(null)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",nUe()]})]})}function XCt({target:e}){var w;const n=mn({mutationFn:Adt}),[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(null),l=HN(),u=ct(l),_=u.data??null,d=a??((w=u.error)==null?void 0:w.message)??null,p=y=>{Pr(l.queryKey,C=>(typeof y=="function"?y(C??null):y)??void 0)},[m,x]=R.useState(!1),S=u.isPending||m;async function v(){if(!(S||s)){x(!0),o(null);try{await nt.fetchQuery({...HN(),staleTime:0})}catch(y){o(y instanceof Error?y.message:String(y))}finally{x(!1)}}}async function b(y){if(y.preventDefault(),!(!t.trim()||s||S)){i(!0),o(null);try{p(await n.mutateAsync(t.trim())),r("")}catch(C){o(C instanceof Error?C.message:String(C))}finally{i(!1)}}}return f.jsxs(f.Fragment,{children:[!_&&S?f.jsxs(ss,{children:[f.jsx(It,{})," ",Xi()]}):_&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0",children:f.jsx(Pt,{variant:_.validationStatus==="valid"?"success":_.validationStatus==="invalid"?"error":"warning",children:_.validationStatus==="valid"?Yp():_.validationStatus==="invalid"?vtt():_.validationStatus==="billingRequired"?utt():tb()})})]}),(_==null?void 0:_.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:att()})}),(_==null?void 0:_.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:_tt()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:b,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||_!==null&&_.validationStatus!=="missing"?JJe():a6(),f.jsx(Wr,{type:"password",value:t,placeholder:(_==null?void 0:_.maskedKey)??"",onChange:y=>r(y.target.value),autoComplete:"new-password"})]}),d&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:d}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:s||S,onClick:()=>void v(),children:[f.jsx(Aa,{size:13})," ",S?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!t.trim()||s||S,children:s?zL():no()})]})]})]})}function ZCt({settings:e}){return e.validationStatus==="missing"?f.jsx(Pt,{variant:"warning",children:tb()}):e.validationStatus==="invalid"?f.jsx(Pt,{variant:"error",children:IWe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Pt,{variant:"success",children:Yp()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Pt,{variant:"warning",children:kKe()}),f.jsx(S6,{content:CPe(),className:"text-subtext",children:f.jsx(M6,{size:15})})]}):null}function JCt(){var v;const e=mn({mutationFn:jdt}),n=FN(),t=ct(n),r=t.data??null,s=b=>{Pr(n.queryKey,w=>(typeof b=="function"?b(w??null):b)??void 0)},i=r?null:((v=t.error)==null?void 0:v.message)??null,[a,o]=R.useState(""),[l,u]=R.useState(!1),[_,d]=R.useState(!1),[p,m]=R.useState(null);async function x(){if(!(l||_||!r&&!i)){d(!0),m(null);try{await nt.fetchQuery({...FN(),staleTime:0})}catch(b){m(b instanceof Error?b.message:String(b))}finally{d(!1)}}}async function S(b){if(b.preventDefault(),!(!a.trim()||l||_||!r&&!i)){u(!0),m(null);try{const w=await e.mutateAsync(a.trim());s(w),m(null),o("")}catch(w){m(w instanceof Error?w.message:String(w))}finally{u(!1)}}}return f.jsxs(f.Fragment,{children:[i?f.jsx("div",{className:"error",children:i}):r?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[r.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:f6()}),f.jsx("dd",{className:"m-0 text-text",children:r.username})]}),(r.validationStatus==="missing"||r.validationStatus==="invalid"||r.validationStatus==="valid"&&r.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:l_()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(ZCt,{settings:r})})]})]}),r.validationStatus==="unreachable"&&r.validationError&&f.jsx("p",{className:Jb,children:r.validationError}),r.source==="env"&&f.jsx("p",{className:Ca,children:dWe()}),r.validationStatus==="valid"&&r.jobsWrite===null&&f.jsx("p",{className:Ca,children:xPe({login:Ne("hf auth login"),url:Ne("huggingface.co/settings/tokens")})})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",uVe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[r!=null&&r.configured?ret():fHe(),f.jsx(Wr,{type:"password",value:a,onChange:b=>o(b.target.value),placeholder:(r==null?void 0:r.maskedToken)??oWe(),autoComplete:"off"})]}),p&&f.jsx("div",{className:"error",children:p}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(Le,{type:"button",disabled:l||_||!r&&!i,onClick:()=>void x(),children:[f.jsx(Aa,{size:13})," ",_?Xi():Qp()]}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!a.trim()||l||_||!r&&!i,children:l?zL():no()})]})]})]})}const rF=/^hf_[A-Za-z0-9]{10,}$/;function sF(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Ca,children:[EZe()," ",f.jsx("code",{children:"HF_TOKEN"}),dXe()]})})})}const fA=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function t5(e,n){const t=n instanceof Error?n.message:String(n);Qn(t.includes(e)?t:`${e}: ${t}`,"error")}function e8t({name:e,entry:n,onVars:t}){const r=mn({mutationFn:d=>PL(...d)}),s=mn({mutationFn:Hdt}),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!i.trim()||o)){l(!0);try{t(await r.mutateAsync([e,i.trim()])),a("")}catch(d){t5(e,d)}finally{l(!1)}}}async function _(){if(!o){l(!0);try{t(await s.mutateAsync(e))}catch(d){t5(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Pt,{children:ZQe()})]}):f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&a("")},placeholder:SL(),"aria-label":RY({name:Ne(e)}),autoComplete:"new-password",disabled:o})}),f.jsx("td",{children:n?f.jsx(Qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:C4({name:Ne(e)}),"aria-label":C4({name:Ne(e)}),onClick:()=>void _(),disabled:o,children:f.jsx(Zd,{size:13})}):i.trim()&&f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o,children:o?Ei():no()})})]}),!n&&e!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function t8t({onVars:e,onDone:n}){const t=mn({mutationFn:d=>PL(...d)}),[r,s]=R.useState(""),[i,a]=R.useState(""),[o,l]=R.useState(!1);async function u(){if(!(!r.trim()||!i.trim()||o)){l(!0);try{e(await t.mutateAsync([r.trim(),i.trim()])),n()}catch(d){t5(r.trim(),d)}finally{l(!1)}}}const _=d=>{d.key==="Enter"&&(d.preventDefault(),u()),d.key==="Escape"&&!o&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:r,onChange:d=>s(d.target.value),onKeyDown:_,placeholder:"MY_API_KEY","aria-label":sKe(),autoComplete:"off",spellCheck:!1,disabled:o})}),f.jsx("td",{children:f.jsx(Wr,{variant:"inline",className:"text-base",type:"password",value:i,onChange:d=>a(d.target.value),onKeyDown:_,placeholder:SL(),"aria-label":lKe(),autoComplete:"new-password",disabled:o})}),f.jsxs("td",{children:[f.jsx(Le,{size:"small",onClick:()=>void u(),disabled:o||!r.trim()||!i.trim(),children:o?Ei():no()}),f.jsx(Qt,{title:Ad(),"aria-label":Zqe(),onClick:n,disabled:o,children:f.jsx(Gr,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&rF.test(i.trim())&&f.jsx(sF,{})]})}function n8t(){var u;const e=cht(),n=ct(e),t=n.data??null,r=_=>{Pr(e.queryKey,d=>(typeof _=="function"?_(d??null):_)??void 0)},s=t?null:((u=n.error)==null?void 0:u.message)??null,[i,a]=R.useState(!1),o=t===null?[]:t.map(_=>_.key).filter(_=>!fA.includes(_)),l=[...fA,...o];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:eJe()}),f.jsxs(Le,{size:"small",className:"shrink-0",onClick:()=>a(!0),disabled:i||t===null,children:[f.jsx(tm,{size:12})," ",uqe()]})]}),f.jsx("div",{className:Ho,children:s?f.jsx("div",{className:"error",children:s}):t===null?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[l.map(_=>f.jsx(e8t,{name:_,entry:t.find(d=>d.key===_),onVars:r},_)),i&&f.jsx(t8t,{onVars:r,onDone:()=>a(!1)})]})})})]})}const v0=[{value:"system",label:ntt,icon:Rmt},{value:"light",label:Zet,icon:egt},{value:"dark",label:Get,icon:Dmt}],r8t=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function s8t(){const e=Yd(),[n,t]=aO(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(d=>d===document.activeElement),u=((o===-1?v0.findIndex(d=>d.value===n):o)+i+v0.length)%v0.length;t(v0[u].value),(_=a[u])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:SBe()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Ro} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:BN()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":BN(),onKeyDown:r,children:v0.map(({value:s,label:i,icon:a})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(a,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Ro,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:dFe()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(Ld,{choices:r8t,value:e,variant:"field",dropDown:!0,onSelect:s=>{fD(s)&&rO(s)}})})]})]})]})}const i8t={installer:_ct,"app-bundle":nct,portable:wct,cargo:act,homebrew:uct,nix:vct,unknown:Ect},jw={cargo:Tct,homebrew:Dct,nix:Bct};function a8t(){var d;const e=mn({mutationFn:p=>Ldt(...p)}),{status:n,error:t,apply:r}=F6(),[s,i]=R.useState(null),[a,o]=R.useState(null),l=hI(n),u=s!==null||l.restarting;if(!n)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:DN()}),t?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:t})}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]});const _=async(p,m)=>{i(p),o(null);try{await m()}catch(x){o(x instanceof Error?x.message:String(x))}finally{i(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:DN()}),f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:`${Bd} pb-3.5`,children:[f.jsx("div",{className:"k",children:kL()}),f.jsx("div",{className:"v",children:n.current}),f.jsx("div",{className:"k",children:QWe()}),f.jsx("div",{className:"v",children:n.latest??"—"}),f.jsx("div",{className:"k",children:mL()}),f.jsx("div",{className:"v",children:i8t[n.channel]()})]}),n.restartRequired&&f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:JYe()}),f.jsx("p",{children:l.error?ML({error:l.error}):fet({installed:Ne(n.installedVersion??"—"),current:Ne(n.current??n.installedVersion??"—")})})]}),n.canRestart&&f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:l.restart,children:l.restarting?DL():RL()})]}),n.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:TN()}),f.jsxs("p",{children:[eKe(),n.envDisabled&&Dtt()]})]}),f.jsx(sp,{type:"button",checked:n.autoUpdate,"aria-label":TN(),disabled:u,onClick:()=>void _("auto",()=>e.mutateAsync([!n.autoUpdate]).then(r))})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:n.updateAvailable?Ttt({version:Ne(n.latest??"—")}):DBe()}),f.jsx("p",{children:n.updateAvailable?GPe():WBe()})]}),f.jsx(Le,{size:"small",type:"button",disabled:u,onClick:()=>void _("apply",()=>Mdt().then(r)),children:s==="apply"?r6():n.updateAvailable?Ett():BBe()})]})]}):f.jsx("div",{className:Ro,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:FQe()}),f.jsx("p",{children:((d=jw[n.channel])==null?void 0:d.call(jw))??TJe()})]})}),n.channel==="app-bundle"&&f.jsx(l8t,{busy:s,disabled:u,run:_}),a&&f.jsx("div",{className:"error",children:a})]})]})}function o8t(){var d;const e=mn({mutationFn:Nft}),n=ght(),t=ct(n),r=t.data??null,s=p=>{Pr(n.queryKey,m=>(typeof p=="function"?p(m??null):p)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((d=t.error)==null?void 0:d.message)??null,_=()=>{!r||i||(a(!0),l(null),e.mutateAsync(!r.preferenceEnabled).then(s).catch(p=>l(p instanceof Error?p.message:String(p))).finally(()=>a(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:VZe()}),r?f.jsxs("div",{className:`${Ho} mt-3`,children:[f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[CN(),r.locked&&r.reason&&f.jsx(S6,{content:`${VUe()} ${r.reason}.`,className:"text-subtext",children:f.jsx(M6,{size:15})})]}),f.jsx("p",{children:fKe()})]}),f.jsx(sp,{type:"button",checked:r.enabled,"aria-label":CN(),disabled:i||r.locked,onClick:_})]}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function l8t({busy:e,disabled:n,run:t}){const r=mn({mutationFn:Odt}),[s,i]=R.useState(null),[a,o]=R.useState(!1),l=u=>void t("cli",()=>r.mutateAsync(u).then(_=>{i(_),o(!1)}).catch(_=>{throw o(!u&&String((_==null?void 0:_.message)??_).includes("--force")),_}));return f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:IPe({command:Ne("orx")})}),s?f.jsxs("p",{children:[s.alreadyCurrent?l$e({link:Ne(s.link)}):f$e({link:Ne(s.link)}),!s.onPath&&bBe({directory:Ne(s.dir)})]}):f.jsx("p",{children:MPe({command:Ne("orx")})})]}),f.jsx(Le,{size:"small",type:"button",disabled:n,onClick:()=>l(a),children:e==="cli"?r6():a?QJe():s?DJe():jPe()})]})}function c8t(){var m;const e=mn({mutationFn:x=>GL(...x)}),n=av(),t=ct(n),r=t.data??null,s=x=>{Pr(n.queryKey,S=>(typeof x=="function"?x(S??null):x)??void 0)},[i,a]=R.useState(!1),[o,l]=R.useState(null),u=o??((m=t.error)==null?void 0:m.message)??null,_=async()=>{await t.refetch({cancelRefetch:!1})},d=()=>{if(!r||i)return;const x=!r.githubForNewProjects;a(!0),l(null),e.mutateAsync([x,void 0,!0]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))},p=()=>{if(!r||i)return;const x=!r.githubAutoTopicsForNewProjects;a(!0),l(null),e.mutateAsync([r.githubForNewProjects,x]).then(s).catch(S=>l(S instanceof Error?S.message:String(S))).finally(()=>a(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:GGe()}),r?f.jsxs("div",{className:`${Ho} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:QGe()}),f.jsx(Pt,{variant:r.githubAuthenticated?"success":r.ghInstalled?"warning":"error",children:r.githubAuthenticated?iL():cL()})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:jN()}),f.jsx("p",{children:oJe()})]}),f.jsx(sp,{type:"button",checked:r.githubForNewProjects,"aria-label":jN(),disabled:i||!r.githubAuthenticated&&!r.githubForNewProjects,onClick:d})]}),f.jsxs("div",{className:Ro,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:EN()}),f.jsx("p",{children:dL()})]}),f.jsx(sp,{type:"button",checked:r.githubAutoTopicsForNewProjects,"aria-label":EN(),disabled:i,onClick:p})]}),!r.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:r.ghInstalled,onCheck:_})}),u&&f.jsx("div",{className:"error",children:u})]}):u?f.jsx("div",{className:"error",children:u}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}function iF({ghInstalled:e,onCheck:n}){const[t,r]=R.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:nm(e?met():FPe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(qh,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[EWe()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Xi():Qp()})]})]})}function u8t(){var m,x,S;const e=mn({mutationFn:pdt}),n=mn({mutationFn:mdt}),t=s1t(),r=ct(t),s=((m=r.data)==null?void 0:m.hasToken)??null,i=((x=r.data)==null?void 0:x.hasSession)??null,a=v=>Pr(t.queryKey,{hasToken:s??!1,hasSession:i??!1,...v}),o=v=>a({hasToken:v}),[l,u]=R.useState(!1),[_,d]=R.useState(null),p=_??((S=r.error)==null?void 0:S.message);return f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:bL()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:JGe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:s?"success":"default",children:s===null?p?Ya():Xi():s?ON():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:dJe()}),s?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),e.mutateAsync().then(v=>o(v.hasToken)).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?LN():HJe()})}):f.jsx(cA,{save:BL,onSaved:v=>o(v.hasToken),placeholder:KQe(),createHref:"https://www.overleaf.com/user/settings"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:pXe()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i?"success":"default",children:i===null?p?Ya():Xi():i?ON():M4()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:bXe()}),i?f.jsx("div",{className:G0,children:f.jsx(Le,{disabled:l,onClick:()=>{u(!0),d(null),n.mutateAsync().then(v=>a({hasSession:v.hasSession})).catch(v=>d(v instanceof Error?v.message:String(v))).finally(()=>u(!1))},children:l?LN():BJe()})}):f.jsx(cA,{save:v=>$L(v),onSaved:v=>a({hasSession:v.hasSession}),placeholder:T4(),createHref:"https://www.overleaf.com/project",createLabel:sje()}),p&&f.jsx("div",{className:"error",children:p})]})}function d8t({project:e,onProjectUpdate:n}){var U;const t=mn({mutationFn:Z=>GL(...Z)}),r={...mht((e==null?void 0:e.id)??""),enabled:!!e},s=ct(r),i=s.data??null,a=Z=>{Pr(r.queryKey,ce=>(typeof Z=="function"?Z(ce??null):Z)??void 0)},[o,l]=R.useState(!1),[u,_]=R.useState(null),d=u??((U=s.error)==null?void 0:U.message)??null,[p,m]=R.useState(!1),[x,S]=R.useState(!1),[v,b]=R.useState(null),[w,y]=R.useState(null),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(null),$=!!(i!=null&&i.github.owner&&i.github.repo),H=R.useRef(null);R.useEffect(()=>{!e||H.current===e.id||(H.current=e.id,E(e.githubAutoTopicsEnabled),T(e.githubTopics.join(", ")),B(null))},[e]);const q=async()=>{await s.refetch({cancelRefetch:!1})},Y=Z=>{const ce=Z instanceof Error?Z.message:String(Z);return ce.toLowerCase().includes("archived")?tPe():ce.includes("(fetch first)")||ce.includes("non-fast-forward")?iPe():ce.includes("403")||ce.toLowerCase().includes("permission denied")?cPe():ce},G=()=>{e&&(l(!0),_(null),kft(e.id).then(Z=>{a(Z.git),n(Z.project),nt.fetchQuery(av()).then(ce=>{!ce.githubForNewProjects&&!ce.githubDefaultPromptSeen&&(y(ce.githubAutoTopicsForNewProjects),m(!0))}).catch(()=>{})}).catch(Z=>_(Y(Z))).finally(()=>l(!1)))},X=Z=>{S(!0),b(null),t.mutateAsync([Z,w??Z,!0]).then(ce=>{Pr(av().queryKey,ce),m(!1)}).catch(ce=>b(ce instanceof Error?ce.message:String(ce))).finally(()=>S(!1))},I=N===null?null:(Z=>Z.split(",").map(ce=>ce.trim()).filter(ce=>ce.length>0))(N),L=(e==null?void 0:e.githubTopics)??null,F=!!(e&&C!==null&&I!==null&&L!==null&&(C!==e.githubAutoTopicsEnabled||I.length!==L.length||I.some((Z,ce)=>Z!==L[ce]))),W=()=>{!e||C===null||I===null||(M(!0),B(null),Yut(e.id,{githubAutoTopicsEnabled:C,githubTopics:I}).then(Z=>{E(Z.githubAutoTopicsEnabled),T(Z.githubTopics.join(", ")),n(Z)}).catch(Z=>B(Z instanceof Error?Z.message:String(Z))).finally(()=>M(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:WYe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:oet({project:(e==null?void 0:e.name)??M$e()})}),e?d&&!i?f.jsx("div",{className:"error",children:d}):i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:vVe()}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:aYe()}),f.jsx("span",{className:"v",children:i.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:i.gitVersion??WD()}),f.jsx("span",{className:"k",children:FXe()}),f.jsx("span",{className:"v",children:i.initialized?X$e({branch:Ne(i.currentBranch??u6()),state:i.clean?s$e():gPe()}):DHe()}),f.jsx("span",{className:"k",children:Fqe()}),f.jsx("span",{className:"v",children:i.baselineBranch}),f.jsx("span",{className:"k",children:HYe()}),f.jsx("span",{className:"v",children:i.remotes.length?i.remotes.map(Z=>`${Z.name}: ${Z.url}`).join(" · "):d6()})]}),!i.initialized&&f.jsx("div",{className:G0,children:f.jsx(Le,{variant:"primary",onClick:()=>void Sft(e.id).then(a).catch(Z=>_(String(Z))),children:pWe()})})]}),f.jsxs("div",{className:J3,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:uL()}),f.jsx("span",{className:"v",children:f.jsx(Pt,{variant:i.github.authenticated?"success":i.github.ghInstalled?"warning":"error",children:i.github.authenticated?iL():cL()})}),f.jsx("span",{className:"k",children:_Ye()}),f.jsx("span",{className:"v",children:$?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[i.github.owner,"/",i.github.repo]}),!i.github.enabled&&f.jsx(Pt,{children:nZe()})]}):f.jsx(Pt,{children:_Ve()})}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:ZXe()}),f.jsx("span",{className:"v",children:i.github.syncStatus})]})]}),!i.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(iF,{ghInstalled:i.github.ghInstalled,onCheck:()=>q()})}),i.github.authenticated&&!i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$?Htt():j$e()}),f.jsxs("div",{className:G0,children:[$&&i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{variant:"primary",disabled:o,onClick:G,children:o?wIe():vIe()})]})]}),i.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:zGe()}),f.jsxs("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:[f.jsxs("div",{className:"flex flex-row items-center justify-between gap-2.5",children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-text",children:MN()}),f.jsx("p",{className:"m-0 text-sm leading-relaxed text-subtext",children:dL()})]}),f.jsx(sp,{type:"button",checked:C??!1,"aria-label":aqe(),disabled:C===null||j,onClick:()=>E(Z=>!(Z??!1))})]}),f.jsxs("div",{className:"mt-2.5 flex flex-row items-center gap-2.5",children:[f.jsx(Wr,{value:N??"",onChange:Z=>T(Z.target.value),placeholder:z4(),disabled:N===null||j,"aria-label":MN()}),f.jsx(Le,{variant:"primary",disabled:!F||j,onClick:W,children:j?Ei():no()})]}),O&&f.jsx("div",{className:"error mt-2",children:O})]}),f.jsxs("div",{className:G0,children:[i.github.url&&f.jsxs(qh,{href:i.github.url,target:"_blank",rel:"noreferrer",children:[RN()," ",f.jsx(Md,{size:12})]}),f.jsx(Le,{disabled:o,onClick:()=>{l(!0),Cft(e.id).then(Z=>{a(Z.git),n(Z.project)}).catch(Z=>_(Z instanceof Error?Z.message:String(Z))).finally(()=>l(!1))},children:o?EIe():_Ie()})]})]})]}),f.jsx(u8t,{}),d&&f.jsx("div",{className:"error",children:Y(d)})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx("div",{className:Ho,children:f.jsx("p",{className:Ca,children:bQe()})}),p&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>X(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:Z=>Z.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:EVe()}),f.jsx("p",{children:vZe()}),v&&f.jsx("div",{className:"error",children:v}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(Le,{disabled:x,onClick:()=>X(!1),children:eQe()}),f.jsx(Le,{variant:"primary",disabled:x,onClick:()=>X(!0),children:x?Ei():bFe()})]})]})})]})}const f8t={env:iat,config:cat,xdg:hat,default:tat},Tw={preparing:Vit,copying:Sit,verifying:gat,finalizing:Nit},h8t=e=>{var n;return((n=Tw[e])==null?void 0:n.call(Tw))??e};function _8t(){var y;const e=uht(),n=ct(e),t=n.data??null,r=t?null:((y=n.error)==null?void 0:y.message)??null,[s,i]=R.useState(""),[a,o]=R.useState(!1),[l,u]=R.useState(null),[_,d]=R.useState({kind:"idle"}),[p,m]=R.useState(null);R.useEffect(()=>{t&&i(C=>C||t.current)},[t]),R.useEffect(()=>tO(C=>{C.type==="progress"?d(E=>{const N=E.kind==="moving"?E.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(d({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i("")):C.type==="error"&&d({kind:"error",message:C.error})}),[]);const x=(t==null?void 0:t.source)==="env",S=s.trim(),v=t!==null&&S===t.current;async function b(){if(!(a||!S)){o(!0),m(null),u(null);try{u(await Udt(S))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!S||v)&&(m(null),!!window.confirm(Lit({path:Ne(S)})))){d({kind:"moving",phase:"preparing",copied:0,total:(l==null?void 0:l.treeBytes)??0});try{await Gdt(S)}catch(E){d({kind:"idle"}),m(E instanceof Error?E.message:String(E))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:KXe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:Bet()}),r?f.jsx("div",{className:Ho,children:f.jsx("div",{className:"error",children:r})}):t?f.jsxs("div",{className:Ho,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:iGe()})}),f.jsxs("div",{className:Bd,children:[f.jsx("span",{className:"k",children:qUe()}),f.jsx("span",{className:"v",children:t.current}),f.jsx("span",{className:"k",children:xL()}),f.jsx("span",{className:"v",children:f8t[t.source]()})]}),!x&&f.jsxs("form",{className:mk,onSubmit:w,children:[f.jsxs("label",{children:[YVe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),l&&!l.error&&l.ok&&f.jsxs("p",{className:Ca,children:[RYe()," ",Dl(l.treeBytes??0),l.freeBytes!=null&&` — ${Ait({size:Ne(Dl(l.freeBytes))})}`,l.sameFilesystem?Xit():"","."]}),l&&l.ok===!1&&l.error&&f.jsx("div",{className:"error",children:l.error}),p&&f.jsx("div",{className:"error",children:p}),_.kind==="moving"&&f.jsx(VP,{value:_.copied,max:_.total,label:h8t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[Dl(_.copied)," / ",Dl(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Ca,children:[HVe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",GHe({path:Ne(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[BVe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(Le,{type:"button",onClick:b,disabled:a||!S||v||_.kind==="moving",children:a?Xi():NBe()}),f.jsx(Le,{variant:"primary",type:"submit",disabled:!S||v||_.kind==="moving",children:_.kind==="moving"?qit():$it()})]})]})]}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const n5=e=>e==="running"||e==="starting";function p8t(e){return n5(e.status)?np(Date.now()-e.createdAt):e.endedAt?np(e.endedAt-e.createdAt):"—"}function aF({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:Iqe()}),f.jsx("th",{children:l_()}),f.jsx("th",{children:IXe()}),f.jsx("th",{children:oXe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(P6,{backend:t.backend}),r&&f.jsx(ib,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:AN(),"aria-label":AN(),onClick:i=>i.stopPropagation(),children:f.jsx(Md,{size:12})})]})}),f.jsx("td",{children:f.jsx($l,{status:Wi(t)})}),f.jsx("td",{children:$o(t.createdAt)}),f.jsx("td",{children:p8t(t)})]},t.id)})})]})})}function m8t({projectId:e,onViewHistory:n}){var d;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(d=t.error)==null?void 0:d.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const p=setInterval(()=>a(m=>m+1),3e4);return()=>clearInterval(p)},[]);const o=()=>{e&&t.refetch()},l=(p,m)=>m.createdAt-p.createdAt,u=r==null?void 0:r.filter(p=>n5(p.status)).sort(l),_=r==null?void 0:r.filter(p=>!n5(p.status)).sort(l);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[rXe(),u&&u.length>0&&f.jsx("span",{className:"count-badge",children:u.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]}),f.jsx(Le,{size:"small",onClick:n,children:_!=null&&_.length?b3e({count:Wt(_.length)}):p3e()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!u||!_?f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]}):f.jsx(aF,{instances:u,emptyLabel:e?r3e():d3e()})]})}function g8t({projectId:e,onBack:n}){var l;const t=ct({...iu(e??""),enabled:!!e,subscribed:!!e}),r=e?t.data??(t.error?[]:null):[],s=(l=t.error)==null?void 0:l.message,i=t.isFetching,[,a]=R.useState(0);R.useEffect(()=>{const u=setInterval(()=>a(_=>_+1),3e4);return()=>clearInterval(u)},[]);const o=()=>{e&&t.refetch()};return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(op,{size:14})," ",fL()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:MWe()}),f.jsxs(Le,{size:"small",onClick:o,disabled:i,children:[f.jsx(Aa,{size:12,className:i?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),s&&f.jsx("div",{className:"error",children:s}),r?f.jsx(aF,{instances:[...r].sort((u,_)=>_.createdAt-u.createdAt),emptyLabel:e?J4e():o3e()}):f.jsxs(ss,{children:[f.jsx(It,{})," ",xu()]})]})}const oF=["projects","harnesses","storage"],v8t=[{id:"compute",label:hL,icon:f.jsx(WO,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:pL,icon:f.jsx(c_,{size:15}),activeTabs:["environment"]},{id:"settings",label:p6,icon:f.jsx(tI,{size:15}),activeTabs:["settings",...oF]}];function b8t(e){return oF.includes(e)}function y8t({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||b8t(e),a=R.useRef(null);return R.useLayoutEffect(()=>{const o=a.current,l=o==null?void 0:o.parentElement;if(!o||!l)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(l),u();const d=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,d,{passive:!0});return()=>{d();for(const m of p)window.removeEventListener(m,d)}},[e,n==null?void 0:n.id]),f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:p6()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Vf,children:f.jsx(s8t,{})}),f.jsx("section",{ref:e==="projects"?a:void 0,className:Vf,children:f.jsx(c8t,{})}),f.jsx("section",{ref:e==="harnesses"?a:void 0,className:Vf,children:f.jsx(ACt,{})}),!s&&f.jsx("section",{ref:e==="storage"?a:void 0,className:Vf,children:f.jsx(_8t,{})}),f.jsx("section",{className:Vf,children:f.jsx(o8t,{})}),!s&&f.jsx("section",{className:Vf,children:f.jsx(a8t,{})})]})]}),e==="compute"&&f.jsx(YCt,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&f.jsx(g8t,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:pL()}),f.jsx(n8t,{})]}),e==="git"&&f.jsx(d8t,{project:n,onProjectUpdate:t})]})}function Tv(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll("-"," ")}function r5(e){return`${e.plugin?`${Tv(e.plugin)}: `:""}${Tv(e.name)}`}const hA={name:"plan",get description(){return XTe()},source:"command"};function Aw(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function _A(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function S8t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==hA.name);return n&&t.push(hA),t.sort((r,s)=>+(s.source==="command")-+(r.source==="command")||r5(r).localeCompare(r5(s),void 0,{sensitivity:"base"}))}function k8t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function pA(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}function C8t({skills:e,activeIndex:n,onPick:t,onHover:r}){const s=R.useRef(null);return R.useLayoutEffect(()=>{var i;(i=s.current)==null||i.scrollIntoView({block:"nearest"})},[n,e]),f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 w-full max-h-[min(18rem,40vh)] overflow-y-auto overscroll-contain p-1.5 bg-background border border-border-variant rounded-2xl shadow-control-subtle z-50",children:e.map((i,a)=>f.jsxs("button",{ref:a===n?s:void 0,type:"button",className:`skill-item flex items-center gap-2 w-full text-start py-1 px-2 rounded-full text-sm font-normal text-text/80 [&.active]:bg-hover-muted [&.active]:text-text ${a===n?"active":""}`,onMouseDown:o=>{o.preventDefault(),t(i)},onMouseEnter:()=>r(a),children:[i.source==="command"&&i.name==="plan"?f.jsx(YO,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}):f.jsx(rI,{size:16,strokeWidth:1.5,className:"shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"skill-name shrink-0",children:r5(i)}),f.jsx("span",{className:"skill-desc min-w-0 truncate text-muted",children:i.description}),i.source==="user"&&f.jsx("span",{className:"ms-auto shrink-0 ps-2 text-muted",children:ont()})]},i.name))})}const E8t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"];let N8t=null;function s5(e,n){const t=N8t??(N8t=document.createElement("canvas").getContext("2d"));if(!t||!n)return 6;const r=getComputedStyle(n);t.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const s=20+t.measureText(Tv(e)).width-t.measureText(`/${e}`).width;return Math.max(2,Math.ceil((s+6)/t.measureText(" ").width))}function lF({name:e}){const n=e==="plan"?YO:rI;return f.jsxs(f.Fragment,{children:[f.jsx(n,{size:16,strokeWidth:1.5,className:"me-1 inline-block align-middle","aria-hidden":"true"}),Tv(e)]})}function cF(e,n,t,r,s,i=!1){let a=0;return x8t(e,n).map((o,l,u)=>{var m,x;const _=a+o.text.length;a=_;const d=o.text.slice(1).toLowerCase();if(o.command&&s)return s(o.text,d,_,l);let p=o.text;return i||((m=u[l-1])!=null&&m.command&&(p=p.replace(/^[ \t]+/," ")),(x=u[l+1])!=null&&x.command&&(p=p.replace(/[ \t]+$/," "))),o.command?f.jsx("span",{className:t,onMouseDown:void 0,children:f.jsx(lF,{name:d})},l):i?f.jsx("span",{"aria-hidden":"true",children:o.text},l):f.jsx(R.Fragment,{children:p},l)})}function z8t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=R.useRef(null),o=R.useRef(null),l=R.useRef(null),u=R.useId(),[_,d]=R.useState(!1),p=ct({...bht(n,s,r.harness),enabled:_,subscribed:_}),m=p.data??null,x=p.isFetching,[S,v]=R.useState({}),b=()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null},w=()=>{const E=a.current;if(!E)return;const N=E.getBoundingClientRect(),T=Math.min(420,window.innerWidth-32),j=Math.max(16,Math.min(N.left-4,window.innerWidth-T-16));v(N.top>300?{bottom:window.innerHeight-N.top+12,left:j,width:T}:{left:j,top:N.bottom+12,width:T})},y=()=>{b(),w(),d(!0)},C=()=>{b(),l.current=window.setTimeout(()=>d(!1),120)};return R.useEffect(()=>()=>b(),[]),R.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),f.jsxs(R.Fragment,{children:[f.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":YQ({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 inline-grid align-baseline cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:y,onMouseLeave:C,onFocus:y,onBlur:C,onKeyDown:E=>{var N,T;if(E.key==="Escape"){d(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),y();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(T=o.current)==null||T.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var N,T;E.preventDefault(),(N=i.current)==null||N.focus(),(T=i.current)==null||T.setSelectionRange(t,t),b()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsx("span",{className:"invisible col-start-1 row-start-1","aria-hidden":"true",children:e}),f.jsx("span",{className:"relative z-1 col-start-1 row-start-1 w-0 whitespace-nowrap",children:f.jsx("span",{className:"bg-background text-skill-blue",children:f.jsx(lF,{name:n})})})]}),_&&ro.createPortal(f.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":zY({name:n}),style:{...S,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:b,onMouseLeave:C,onFocus:b,onBlur:C,onMouseDown:E=>E.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Pt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:Jtt()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:x&&m===null?f.jsx("span",{className:"text-muted",children:rnt()}):f.jsx(Fo,{text:m??r.description})})]}),document.body)]})}function j8t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:cF(e,n,"skill-chip me-0.5 whitespace-nowrap font-normal text-skill-blue")})}function T8t({text:e,editingTokenEnd:n,isCommand:t,skills:r,projectId:s,textareaRef:i}){const a=R.useRef(null);return R.useLayoutEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const u=()=>{const d=getComputedStyle(o);for(const p of E8t)l.style.setProperty(p,d.getPropertyValue(p));l.style.width=`${o.clientWidth+parseFloat(d.borderLeftWidth)+parseFloat(d.borderRightWidth)}px`};u();const _=new ResizeObserver(u);return _.observe(o),()=>_.disconnect()},[e,i]),R.useLayoutEffect(()=>{const o=i.current;if(!o)return;const l=()=>{a.current&&(a.current.scrollTop=o.scrollTop)};return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)},[i,e]),f.jsxs("div",{ref:a,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[cF(e,t,"",void 0,(o,l,u,_)=>{var x;const d=e.slice(u),p=((x=/^[ \t]+/.exec(d))==null?void 0:x[0].length)??0;if(u===n||d&&!d.startsWith(` +`)&&pS.name===l);return m&&m.source!=="command"?f.jsx(z8t,{label:o,name:l,end:u,skill:m,projectId:s,textareaRef:i},`${_}:${u}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.slice(1)]},`${_}:${u}`)},!0),"​"]})}function A8t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const i5=6.5,mA=2*Math.PI*i5;function R8t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(M8t,{usage:e})}function M8t({usage:e}){const{open:n,setOpen:t,ref:r}=so(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":A8t(a),l=a===null?"":new Intl.NumberFormat(z(),{style:"percent"}).format(a/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:kge(),onClick:()=>t(u=>!u),children:a===null?Tg(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:i5,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${mA*Math.max(a,2)/100} ${mA}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:yge()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?zge({value:Ne(Tg(s))}):Rge({used:Ne(Tg(s)),total:Ne(Tg(i)),percent:Ne(l)})})]}),a!==null&&f.jsx(VP,{value:s,max:i,fillColor:o})]})]})}const Av="!";function gA(e){return e.startsWith(Av)?e.slice(Av.length).trim():null}function D8t(e){return e.startsWith(Av)?e.slice(Av.length):e}function L8t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function O8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function I8t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` ${t} ${e.replace(/^\n|\n$/g,"")} @@ -1007,22 +1007,22 @@ ${t} ${e} \\] -`:`\\(${e}\\)`}function D8t(e,n){const t=n.trim().split(` +`:`\\(${e}\\)`}function B8t(e,n){const t=n.trim().split(` `),r=" ".repeat(e.length+1);return[`${e} ${t[0]??""}`,...t.slice(1).map(s=>s?`${r}${s}`:"")].join(` -`)}function L8t(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,l)=>a[l]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` -`)}function O8t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function I8t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function B8t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const uF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",gk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,dF=1024,fF=2e4,Mw=8,s1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function gA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Dw(e,n){return gA(e).compareBoundaryPoints(Range.START_TO_START,gA(n))<0}function vA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const $8t=new Set(["A","B","CODE","EM","I","STRONG"]);function P8t(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if($8t.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function F8t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function H8t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Dw(s,u)&&t.append(vA(s,u)),t.append(o.cloneNode(!0)),s=_,!Dw(s,r))break}return i.length===0?t.append(e.cloneContents()):Dw(s,r)&&t.append(vA(s,r)),P8t(e,t),F8t(t),t}function q8t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>xp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` +`)}function $8t(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,l)=>a[l]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` +`)}function P8t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function F8t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function H8t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const uF="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",gk="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",bu=256,dF=1024,fF=2e4,Rw=8,s1="chat-annotations";function ld(e){return e instanceof Element?e:e.parentElement}function vA(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function Mw(e,n){return vA(e).compareBoundaryPoints(Range.START_TO_START,vA(n))<0}function bA(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const q8t=new Set(["A","B","CODE","EM","I","STRONG"]);function U8t(e,n){var s,i;const t=ld(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=ld(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if(q8t.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=ld(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function G8t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function W8t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,l=document.createRange();l.selectNode(o);const u={container:l.startContainer,offset:l.startOffset},_={container:l.endContainer,offset:l.endOffset};if(Mw(s,u)&&t.append(bA(s,u)),t.append(o.cloneNode(!0)),s=_,!Mw(s,r))break}return i.length===0?t.append(e.cloneContents()):Mw(s,r)&&t.append(bA(s,r)),U8t(e,t),G8t(t),t}function V8t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>xp(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` -${L8t(n,!!e.querySelector("tr:first-child th"))} +${$8t(n,!!e.querySelector("tr:first-child th"))} `:""}function hF(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const i=[];for(const a of Array.from(e.children).filter(o=>o instanceof HTMLElement&&o.tagName==="LI")){const o=a.getAttribute("value"),l=o===null?s:Number(o),u=Number.isFinite(l)?l:s;s=u+1;const _=Array.from(a.childNodes).map(d=>d instanceof HTMLElement&&d.matches("UL, OL")?` ${hF(d).trim()} -`:xp(d)).join("").trim();i.push(D8t(n?`${u}.`:"-",_))}return` +`:xp(d)).join("").trim();i.push(B8t(n?`${u}.`:"-",_))}return` ${i.join(` `)} -`}function xp(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return A8t(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(xp).join("");if(e.matches(".katex-display")){const l=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return l?a5(l,!0):""}if(e.matches(".katex")){const l=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return l?a5(l,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return q8t(e);if(e.matches("UL, OL"))return hF(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return R8t(e.textContent??"");if(e.tagName==="PRE")return M8t(e.textContent??"");const n=Array.from(e.childNodes).map(xp).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const l=e.getAttribute("href");return l?`[${n}](${l})`:n}if(e.tagName==="LI")return`${n.trim()} +`}function xp(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return L8t(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(xp).join("");if(e.matches(".katex-display")){const l=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return l?a5(l,!0):""}if(e.matches(".katex")){const l=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return l?a5(l,!1):""}if(e.tagName==="BR")return` +`;if(e.tagName==="TABLE")return V8t(e);if(e.matches("UL, OL"))return hF(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return O8t(e.textContent??"");if(e.tagName==="PRE")return I8t(e.textContent??"");const n=Array.from(e.childNodes).map(xp).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const l=e.getAttribute("href");return l?`[${n}](${l})`:n}if(e.tagName==="LI")return`${n.trim()} `;if(e.matches("TH, TD"))return`${n.trim()} | `;if(e.tagName==="TR")return`${n.replace(/ \| $/,"")} `;if(e.tagName==="BLOCKQUOTE")return` @@ -1030,7 +1030,7 @@ ${n.trim().split(` `).map(l=>`> ${l}`).join(` `)} -`;const t=O8t(e.tagName,n);return t?` +`;const t=P8t(e.tagName,n);return t?` ${t} @@ -1038,35 +1038,35 @@ ${t} ${n.trim()} -`:n}function U8t(e,n){return xp(e).replace(/\r\n?/g,` +`:n}function K8t(e,n){return xp(e).replace(/\r\n?/g,` `).replace(/[ \t]+\n/g,` `).replace(/\n{3,}/g,` -`).trim()||n}function bA(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function G8t(e,n){var s,i,a,o;if(!I8t(e))return;const t=bA(e);if(t.length<8)return;let r;for(const l of n.querySelectorAll(".msg-assistant > .md .katex")){const _=[(s=l.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=l.querySelector(".katex-html"))==null?void 0:i.textContent,l.textContent].filter(x=>!!x).map(bA).find(x=>B8t(x,t));if(!_)continue;const d=(o=(a=l.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!d)continue;const p=!!l.closest(".katex-display"),m={markdown:a5(d,p).trim(),delta:Math.abs(_.length-t.length)};(!r||m.delta .md .katex")){const _=[(s=l.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=l.querySelector(".katex-html"))==null?void 0:i.textContent,l.textContent].filter(x=>!!x).map(yA).find(x=>H8t(x,t));if(!_)continue;const d=(o=(a=l.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!d)continue;const p=!!l.closest(".katex-display"),m={markdown:a5(d,p).trim(),delta:Math.abs(_.length-t.length)};(!r||m.deltaj.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(j=>j.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),E=34,N=74,T=y>=E+Mw?y-E-Mw:C+Mw;return{text:U8t(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function V8t(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?W8t(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function K8t(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(s1);return}const t=new Highlight(...n);return CSS.highlights.set(s1,t),()=>{CSS.highlights.get(s1)===t&&CSS.highlights.delete(s1)}},[e])}function Q8t({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?G8t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Fo,{text:t??e.text})})}function Y8t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Ide()}),f.jsx(Q8t,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ude(),"aria-label":eY({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Gr,{size:13})})]},t.id))}function vk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=so(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(XO,{size:l?13:14,className:"text-muted"}),e.length===1?Yae():nie({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:bE(),"aria-label":bE(),onClick:t,children:f.jsx(Gr,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Mde(),children:f.jsx(Y8t,{annotations:e,onRemove:r?m:void 0})})]})}function X8t(e){return f.jsx(vk,{...e,variant:"composer"})}const Z8t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),yA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),J8t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),e9t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),o5="prompt-actions flex flex-wrap gap-2",xA=[],t9t=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Lw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function n9t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Ow(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Iw(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function r9t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function _h(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=dF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function ny(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).trim();if(!d)return null;const p=W8t(t,e),m=Array.from(t.getClientRects()).filter(j=>j.width>0&&j.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(j=>j.topx.top),v=S.length>0?S:[x],b=Math.min(...v.map(j=>j.left)),w=Math.max(...v.map(j=>j.right)),y=Math.min(...v.map(j=>j.top)),C=Math.max(...v.map(j=>j.bottom)),E=34,N=74,T=y>=E+Rw?y-E-Rw:C+Rw;return{text:K8t(p,d),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(w-b)/2)),top:T}}function X8t(e,n){const[t,r]=R.useState(null),s=R.useRef(!1),i=R.useCallback(()=>{const l=e.current;r(l?Y8t(l):null)},[e]);R.useEffect(()=>{let l=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},d=p=>{!p.isPrimary||!s.current||(s.current=!1,l=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",d,!0),window.addEventListener("pointercancel",d,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",d,!0),window.removeEventListener("pointercancel",d,!0),l!==null&&window.cancelAnimationFrame(l),s.current=!1}},[i]),R.useEffect(()=>{if(!t)return;const l=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",l,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",l,!0),window.removeEventListener("resize",i)}},[t,i]);const a=R.useCallback(()=>{var l;t&&(n({text:t.text,range:t.range}),r(null),(l=window.getSelection())==null||l.removeAllRanges())},[t,n]),o=R.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function Z8t(e){R.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(s1);return}const t=new Highlight(...n);return CSS.highlights.set(s1,t),()=>{CSS.highlights.get(s1)===t&&CSS.highlights.delete(s1)}},[e])}function J8t({annotation:e}){const n=R.useRef(null),[t,r]=R.useState();return R.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?Q8t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx(Fo,{text:t??e.text})})}function e9t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:Ide()}),f.jsx(J8t,{annotation:t})]}),n&&f.jsx(Qt,{type:"button",size:"small","data-annotation-remove":!0,title:ude(),"aria-label":eY({number:Wt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Gr,{size:13})})]},t.id))}function vk({annotations:e,variant:n,onClear:t,onRemove:r}){const s=R.useRef(null),i=R.useRef(null),a=R.useId(),o=so(s),l=n==="sent",u=R.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},d=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=l||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return R.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),f.jsxs("div",{className:l?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:l?_:void 0,onMouseLeave:l?d:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${l?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${l?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[f.jsx(XO,{size:l?13:14,className:"text-muted"}),e.length===1?Yae():nie({count:Wt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:bE(),"aria-label":bE(),onClick:t,children:f.jsx(Gr,{size:13})})]}),o.open&&f.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${l?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Mde(),children:f.jsx(e9t,{annotations:e,onRemove:r?m:void 0})})]})}function t9t(e){return f.jsx(vk,{...e,variant:"composer"})}const n9t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),xA=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),r9t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),s9t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),o5="prompt-actions flex flex-wrap gap-2",wA=[],i9t=[],b0={};function rd(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function Dw(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function a9t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function Gs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function Lw(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function Ow(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=bu));s++);return r}function o9t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function _h(...e){const n=new Set,t=new RegExp(`^${Nd}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=bu||r++>=dF)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function ty(e){return e.replace(/^Exit code \d+\s*/i,"").split(` `).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` -`).trim()}function s9t(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function i9t(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Mxt(r),_F(r)}function _F(e){return o9t(e).replace(/[\t\r ]+/g," ").trim()}function a9t(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&mF(s)?{ref:r,path:s}:null}function u9t(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function wA(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function d9t(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const l=wA(s,o);if(!l)return null;s=l}return s?wA(s,e):e}const ko="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",f9t=new RegExp(`\\bchat_(${ko})\\b`,"gi"),Nd=`(?:${ko}|[0-9a-f]{8})`;function ph(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,d=null,p=!1;for(let m=u;m{let _=!1;for(let d=u;dOxt(t.raw,n))}function ya(e,n){return ry(e,n).length>0}function h9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(f9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function l5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function _9t(e,n,t=[],r=[]){const s=ry(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:l5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:l5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ry(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:l5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const SA=new WeakMap;function $d(e){const n=z(),t=SA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=p9t(e);return SA.set(e,{locale:n,activity:r}),r}function p9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=r9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Iw(i,"targetIds")),_=_h(Iw(i,"runTargetIds")),d=_h(Iw(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Ow(i,"search_query","q"),N=Ow(i,"image_query","q"),T=Ow(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=i9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=Lxt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Ixt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:h9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),H=ry(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),q=H?Iee():kZ(),Y=H?KY():lJ();if(ya(E,"logs")){const re=_9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(c9t).find(re=>re!=null);if(X){const re=Lw(X.path);return{kind:re?"skill":"read",label:re?y2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const te=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=te>=0?O[te]:null,L=I?l9t(I):null,F=L?d9t(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const re=Lw(F);return{kind:re?"skill":"read",label:re?y2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=u9t(N[W].raw);return{kind:"search",label:re?w2({pattern:Ne(re)}):x2(),searchPattern:re??void 0}}const U=O.find(re=>(re==null?void 0:re.name)==="git"),Z=U==null?void 0:U.args[0];if(Z==="grep"){const re=U==null?void 0:U.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?w2({pattern:Ne(re)}):x2(),searchPattern:re}}if(Z==="status")return{kind:"command",label:mle()};if(Z==="diff")return{kind:"command",label:Ede()};if(Z==="log")return{kind:"command",label:Kue()};const ce=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return ce("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||ce("typecheck")?{kind:"command",label:Ole()}:ce("lint")?{kind:"command",label:ile()}:ce("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?n9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Lw(p):null;return N?{kind:"skill",label:y2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=s9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?w2({pattern:Ne(E)}):x2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:m9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function m9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Mv({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(dmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Bw({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Vr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?TD():dpe({count:Wt(e.length)})})]})}function c5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:qxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(gpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Vr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Bw,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Vr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Bw,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Vr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Bw,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:mD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function g9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const v9t=250;function b9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=v9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const y9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),y9t);return()=>window.clearTimeout(r)},[e]),e&&n}function x9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:kD()}}function w9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function S9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=w9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=zxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?amt:I6,m=ny(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function kA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ny((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:x3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Mv,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(c5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function k9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=S9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(g9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=b9t(w,y),E=wF(C!=null),N=C??x9t(x),T=C?C.label:kD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Mv,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(c5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(kA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Mv,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(c5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:H,activity:q})=>f.jsx(kA,{part:$,repeatCount:H,activity:q,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function C9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Gr,iconClass:"text-accent-red"}:{label:Cue(),icon:hb,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:J8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?CD():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${yA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:Z8t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:yA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Vr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:o5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:e9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:o5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function E9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function N9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Hft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function z9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(MD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":i6(),disabled:!e,onClick:p,children:f.jsx(fb,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const j9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=A9t(n);if($)return f.jsx(R9t,{part:$});if(n.role==="user"){const te=n.parts.filter(Z=>Z.type==="text").map(Z=>Z.text??"").join(` -`),I=Z=>!!(v!=null&&v.some(ce=>ce.name===Z)),L=n.parts.filter(Z=>Z.type==="image"&&Z.text).map(N9t),F=L.filter(Z=>!Z.isPdf),W=L.filter(Z=>Z.isPdf),U=n.parts.filter(Z=>Z.type==="annotation"&&Z.text).map(Z=>({id:Z.id,text:Z.text??""}));if(O!==null){const Z=()=>{const ce=O.trim();!ce||N||(B(null),j(n.id,ce))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:ce=>B(ce.target.value),onKeyDown:ce=>{ce.key==="Escape"?(ce.preventDefault(),B(null)):ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),Z())}}),f.jsxs("div",{className:`${o5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:Z,disabled:N||!O.trim(),children:z4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[U.length>0&&f.jsx(vk,{annotations:U,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(C8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((Z,ce)=>f.jsx("a",{href:Z.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:Z.src,alt:vie()})},ce))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((Z,ce)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:Z.src,target:"_blank",rel:"noreferrer",children:[f.jsx(hb,{size:15}),f.jsx("span",{children:Z.name})]},ce))})]}),w!==void 0&&f.jsx(z9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const H=n.parts.find(te=>te.type==="tool"&&x3(te)),q=n.parts.find(om)??H,Y=n.parts.filter(te=>te!==q&&!(H&&x3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(T9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),q&&f.jsx(SF,{part:q,usageLimited:!!H,busy:m,recovering:x===((X=(G=q.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function T9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Nxt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:O1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:O1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:O1(i,t)})]})}function A9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function R9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?mD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[xD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function O1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(k9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(D9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(O9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(C9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function M9t(e){return $d(e).label}function D9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Dv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Dv(t.children,n);if(r)return r}return null}function L9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ny(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=O1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?r6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function O9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ny(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Mv,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Vr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function I9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function B9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=I9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const $9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>E9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(U=>U.role==="user"&&!U.id.startsWith(Cd));return kxt(a,n,W,U=>U.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),H=R.useCallback(W=>j[W].id,[j]),q=R.useCallback(W=>{if(B)return j.map((Z,ce)=>ce);const U=new Set(yB(W));return j.forEach((Z,ce)=>{O.current.has(Z.id)&&U.add(ce)}),[...U].sort((Z,ce)=>Z-ce)},[j,B]),Y=xxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:H,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:q});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var ce;const U=window.getSelection();if(!U||U.isCollapsed||!U.rangeCount)return;const Z=U.getRangeAt(0);for(const re of((ce=t.current)==null?void 0:ce.querySelectorAll("[data-message-id]"))??[])Z.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=B9t(n),te=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ue,pe;const U=j[W.index],Z=U.parts.find(om),ce=(Q=(ne=Z==null?void 0:Z.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=Z?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":U.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(U.id),onFocusCapture:()=>O.current.add(U.id),children:f.jsx(j9t,{message:U,forkCount:(le=M.get(U.id))==null?void 0:le.count,forkIndex:(oe=M.get(U.id))==null?void 0:oe.index,forkPrevId:(ue=M.get(U.id))==null?void 0:ue.prevId,forkNextId:(pe=M.get(U.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===U.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:ce===C?C:null,onRecover:E,skills:N,predictTextTail:_&&U===G&&U.role==="assistant"})},U.id)})})]})}),P9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ED},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:yD}];function F9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const H9t=14,q9t=500,U9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*H9t,q9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function G9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:SD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:wD()})})]})]})}const CA=[PO,eI,c_,_b],$w=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],EA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function W9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Kdt(...w)}),r=ct(YL()),s=ct(cht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);lb(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:qht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Gr,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Wr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function V9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Bft(...ie)}),T=mn({mutationFn:ie=>Ift(...ie)}),j=mn({mutationFn:ie=>Mft(...ie)}),M=mn({mutationFn:ie=>Lft(...ie)}),O=mn({mutationFn:ie=>Oft(...ie)}),B=mn({mutationFn:Dft}),$=R.useMemo(()=>Ea(e),[e]),{data:H=t9t}=ct($),q=R.useCallback(ie=>{Pr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[W,U]=R.useState(new Set),[Z,ce]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ue=R.useRef({projectId:e,activeId:I,mainView:i});(ue.current.projectId!==e||ue.current.activeId!==I||ue.current.mainView!==i)&&(ue.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Sht(e,i==="chat"?I:null),{data:_t=Q9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=V8t(Cn,En);K8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=s5(ie.name,on.current),Ae=v8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Rw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==s5(Oe.query,ie))return!1;const Ue=hA(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=H.find(ie=>ie.id===I),Ys=wt??Bgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=K9t}=ct(_ht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>b8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=mA(re),ks=os!==null,gs=Rw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:iv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=sb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Fr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Fr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(k2())}catch{Te(IE())}}function yr(ie,be){const Ae=hA(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=F.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(F.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{F.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();U(e===j2?new Set([m6,g6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>lv(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},U9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>lv(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??xA:xA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>wxt(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&U(be=>Ext(be,ie.ids,we.busySessions,H,i==="chat"?I:null))},[e,we.busySessions,H,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&Cxt(Es),Hr=I?we.queuedBySession[I]??[]:[],oa=Hr.some(ie=>ie.dispatchState==="retrying"),Jl=Hr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Hr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Hr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Hr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...$ht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===j2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:y8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Fr,zn=_A(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ue.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(k2())}catch{Te(IE()),ho()}return}const J=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>$N(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!J){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(J,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&Z==="archived"&&ce("active");const Tn=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>$N(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ue.current,Oe=F.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return F.current===Oe&&(q(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Oe&&ue.current===Ae&&(L.current(Ue.id,{replace:!0}),ue.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=T8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ue.current;let Oe=I;const Ue=()=>{const Ln=ue.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(k2());return}try{const Ln=_A(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&Z==="archived"&&ce("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await qft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Vft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Txt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Uft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Gft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Wft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Pft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Fft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){tb(ie),ue.current.projectId===e&&ue.current.activeId===ie&&ue.current.mainView==="chat"&&L.current(null,{replace:!0}),U(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Kft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=H.filter(ie=>P9t(Z,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{ce("active"),w(null)},[w]),Ru=R.useCallback(ie=>{ce("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),_8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===Z))==null?void 0:ua.railLabel())??ED()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(F9t,{value:Z,onChange:ce})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(G9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===j2){npt(ie.id);const be=zut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:Z==="archived"?Hae():H.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(hv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:l6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(W9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),te(!0)}}),X&&f.jsx(ZP,{onClose:()=>{te(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Tpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx($9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:EA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:CA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${$w[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${$w[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:EA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=CA[be],Oe=$w[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(hpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(kCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Hr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Hr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} +`).trim()}function l9t(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function c9t(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Ixt(r),_F(r)}function _F(e){return d9t(e).replace(/[\t\r ]+/g," ").trim()}function u9t(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&mF(s)?{ref:r,path:s}:null}function _9t(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function SA(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function p9t(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const l=SA(s,o);if(!l)return null;s=l}return s?SA(s,e):e}const ko="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",m9t=new RegExp(`\\bchat_(${ko})\\b`,"gi"),Nd=`(?:${ko}|[0-9a-f]{8})`;function ph(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,d=null,p=!1;for(let m=u;m{let _=!1;for(let d=u;dPxt(t.raw,n))}function ya(e,n){return ny(e,n).length>0}function g9t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,fF).matchAll(m9t))if(n.add(t[0].toLowerCase()),n.size>=bu)break;return[...n]}function l5(e,n){if(!e)return[];const t=new Set,r=e.slice(0,fF),s=n==="runs"?[new RegExp(`/runs/(${ko})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${ko})`,"gi"),new RegExp(`^\\s*RUN\\s+(${ko})\\b`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${ko})`,"gi"),new RegExp(`^\\s*id:\\s*(${ko})`,"gim"),new RegExp(`={3,}\\s*(${ko})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=bu)return[...t];const i=new RegExp(`^\\s*(${ko})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=bu)break;return[...t]}function vF(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function bF(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function yF(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const l=o+a[0].length;l<=t&&/\bdone\b/.test(e.slice(l,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function v9t(e,n,t=[],r=[]){const s=ny(e,"logs"),i=new Set;if(s.length===0){if(!ya(e,"logs"))return[];const o=t.length>0?[]:l5(n,"runs");for(const l of t.length>0?t:o.length>0?o:r)if(i.add(l),i.size>=bu)break;return _h([...i])}let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let d=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){d=b;break}}}if(!d){a=!0;continue}if(new RegExp(`^${Nd}$`,"i").test(d)){i.add(d);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(d);if(!p){a=!0;continue}const m=p[1],x=bF(e,m,l,Nd);for(const v of x)i.add(v);const S=yF(e,m,l,Nd);for(const v of S)i.add(v);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:l5(n,"runs"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}function Kf(e,n,t=[],r=[]){const s=ny(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:l}of vF(e,s)){const u=Vh(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let d=!1;_&&new RegExp(`^${Nd}$`,"i").test(_)&&(i.add(_),d=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=bF(e,m,l,Nd);if(x.length>0){for(const v of x)i.add(v);d=!0}const S=yF(e,m,l,Nd);for(const v of S)i.add(v);S.length>0&&(d=!0)}d||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:l5(n,"experiments"),l=t.length>0?t:o.length>0?o:r;for(const u of l)if(i.add(u),i.size>=bu)break}return _h([...i])}const kA=new WeakMap;function $d(e){const n=z(),t=kA.get(e);if((t==null?void 0:t.locale)===n)return t.activity;const r=b9t(e);return kA.set(e,{locale:n,activity:r}),r}function b9t(e){var b,w,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=Gs(i,"command","cmd"),o=o9t(i,"commandArgv"),l=((w=e.state)==null?void 0:w.output)||((y=e.state)==null?void 0:y.error),u=_h(Ow(i,"targetIds")),_=_h(Ow(i,"runTargetIds")),d=_h(Ow(i,"experimentTargetIds")),p=Gs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=Gs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const E=Lw(i,"search_query","q"),N=Lw(i,"image_query","q"),T=Lw(i,"find","pattern");return E?{kind:"web",label:rE({query:E})}:N?{kind:"web",label:GJ({query:N})}:T?{kind:"web",label:cee({pattern:T})}:Array.isArray(i.open)?{kind:"web",label:cue()}:Array.isArray(i.weather)?{kind:"web",label:Rle()}:Array.isArray(i.finance)?{kind:"web",label:kle()}:Array.isArray(i.sports)?{kind:"web",label:zle()}:Array.isArray(i.time)?{kind:"web",label:yle()}:{kind:"web",label:gE()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:Oue()};const E=c9t(a??(o==null?void 0:o.join(" "))??""),N=ph(E);let T=N.map(re=>re.raw);if(o!=null&&o.length){const re=$xt(o);T=re===null?[o]:ph(_F(re)).map(ne=>ne.raw)}let j=null;for(const re of T)if(j=Fxt(re),j)break;const M=T.some(re=>{const ne=Vh(re);return ne!==null&&ne[0]!=="discover"&&ne[0]!=="paper"});if(j&&!M){const re=j.kind==="discover"?{keyword:NJ(),embedding:AJ(),openalex:nee(),biorxiv:LJ()}[j.strategy]:null,ne=j.kind==="discover"?j.query?BX({activity:re??nE(),query:j.query}):re??nE():j.id?l0({target:Ne(j.id)}):zZ();return{kind:j.kind==="paper"?"read":"search",label:ne,litCall:j}}if(ya(E,"agent\\s+spawn"))return{kind:"agent",label:Yle(),spawnedSessionIds:g9t(l),litCall:j??void 0};const O=N.map(re=>gF(re.raw)),B=ya(E,"exp\\s+status"),$=ya(E,"exp\\s+desc"),H=ny(E,"exp\\s+desc").some(re=>(Vh(re.raw)??[]).some(Q=>Q==="--set"||Q.startsWith("--set=")||Q==="--stdin")),q=H?Iee():kZ(),Y=H?KY():lJ();if(ya(E,"logs")){const re=v9t(E,l,_,u);return{kind:"project",label:re.length===1?eJ():sJ(),runIds:re,litCall:j??void 0}}if(ya(E,"exp\\s+run"))return{kind:"project",label:efe(),litCall:j??void 0};if(ya(E,"exp\\s+wait"))return{kind:"project",label:Tfe(),litCall:j??void 0};if(ya(E,"exp\\s+cancel"))return{kind:"project",label:tle(),litCall:j??void 0};const G=ya(E,"project\\s+view");if(G&&B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&$)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G&&B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(G)return{kind:"project",label:Zue(),litCall:j??void 0};if(B&&$)return{kind:"project",label:Y,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(B)return{kind:"project",label:vE(),experimentIds:Kf(E,l,d,u),litCall:j??void 0};if($)return{kind:"project",label:q,experimentIds:Kf(E,l,d,u),litCall:j??void 0};if(ya(E,"runs?"))return{kind:"project",label:Pce(),litCall:j??void 0};if(ya(E,"projects"))return{kind:"project",label:Uce(),litCall:j??void 0};if(ya(E,"compute"))return{kind:"project",label:cle(),litCall:j??void 0};const X=O.map(h9t).find(re=>re!=null);if(X){const re=Dw(X.path);return{kind:re?"skill":"read",label:re?b2({name:Ne(re)}):l0({target:Ne(rd(X.path))}),filePath:X.path,fileRef:X.ref,labelTarget:re?`${re} skill`:rd(X.path)}}const te=O.findIndex(re=>re!=null&&["sed","cat","head","tail"].includes(re.name)),I=te>=0?O[te]:null,L=I?f9t(I):null,F=L?p9t(L,N,te,Gs(i,"cwd","workdir")):null;if(L&&F){const re=Dw(F);return{kind:re?"skill":"read",label:re?b2({name:Ne(re)}):l0({target:Ne(rd(L))}),filePath:F,labelTarget:re?`${re} skill`:rd(L)}}if(O.some(re=>(re==null?void 0:re.name)==="find"||(re==null?void 0:re.name)==="ls"||(re==null?void 0:re.name)==="rg"&&re.args.includes("--files")))return{kind:"search",label:CE()};const W=O.findIndex(re=>(re==null?void 0:re.name)==="rg"||(re==null?void 0:re.name)==="grep");if(W>=0){const re=_9t(N[W].raw);return{kind:"search",label:re?x2({pattern:Ne(re)}):y2(),searchPattern:re??void 0}}const U=O.find(re=>(re==null?void 0:re.name)==="git"),Z=U==null?void 0:U.args[0];if(Z==="grep"){const re=U==null?void 0:U.args.slice(1).find(ne=>!ne.startsWith("-"));return{kind:"search",label:re?x2({pattern:Ne(re)}):y2(),searchPattern:re}}if(Z==="status")return{kind:"command",label:mle()};if(Z==="diff")return{kind:"command",label:Ede()};if(Z==="log")return{kind:"command",label:Kue()};const ce=re=>O.some(ne=>!ne||!["cargo","pnpm","npm","yarn"].includes(ne.name)?!1:ne.args[0]===re||ne.args[0]==="run"&&ne.args[1]===re);return ce("test")?{kind:"command",label:Pue()}:O.some(re=>(re==null?void 0:re.name)==="tsc")||ce("typecheck")?{kind:"command",label:Ole()}:ce("lint")?{kind:"command",label:ile()}:ce("build")?{kind:"command",label:Voe()}:{kind:"command",label:fZ({command:Ne(E)})}}case"skill":{const E=Gs(i,"skill","name"),N=E?a9t(n,E):null;return{kind:"skill",label:E?eZ({name:Ne(E)}):YX(),filePath:N??void 0,labelTarget:N&&E?`${E} skill`:void 0}}case"read":{const E=p?rd(p):null,N=p?Dw(p):null;return N?{kind:"skill",label:b2({name:Ne(N)}),filePath:p??void 0,labelTarget:`${N} skill`}:E?{kind:"read",label:l0({target:Ne(E)}),filePath:p??void 0,labelTarget:E}:{kind:"read",label:Uue()}}case"edit":case"write":case"notebookedit":{const E=l9t(i),N=p??(E==null?void 0:E.path)??null,T=N?rd(N):null,j=T?(E==null?void 0:E.type)==="add"?uX({target:Ne(T)}):(E==null?void 0:E.type)==="delete"?wX({target:Ne(T)}):TX({target:Ne(T)}):null;return T?{kind:"edit",label:j??xE(),filePath:N??void 0,labelTarget:T}:{kind:"edit",label:xE()}}case"grep":{const E=Gs(i,"pattern");return{kind:"search",label:E?x2({pattern:Ne(E)}):y2(),searchPattern:E??void 0}}case"glob":{const E=Gs(i,"pattern");return{kind:"search",label:E?HX({pattern:Ne(E)}):CE()}}case"websearch":{const E=Gs(i,"query"),N=Gs(i,"url"),T=Gs(i,"pattern");return E?{kind:"web",label:rE({query:E})}:T&&N?{kind:"web",label:ZJ({pattern:T})}:N?{kind:"web",label:lZ({target:Ne(N)})}:{kind:"web",label:m??gE()}}case"webfetch":{const E=Gs(i,"url");return{kind:"web",label:E?l0({target:Ne(E)}):m??BZ()}}case"task":return{kind:"agent",label:m??mZ()};case"subagent":return{kind:"agent",label:y9t(i)};case"error":return{kind:"command",label:bfe()};case"contextcompaction":return{kind:"command",label:nX(),progressLabel:aX()};default:{const E=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:E?`${n}: ${E}`:n}}}}function y9t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return xee();case"sendInput":return gee();case"resumeAgent":return WZ();case"wait":return Fee();case"closeAgent":return ZY()}switch(typeof e.kind=="string"?e.kind:""){case"started":return Mee();case"interacted":return OY();case"interrupted":return jee()}return Cee()}function Rv({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(c_,{...t});if(e.litCall)r=f.jsx(NB,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx($O,{...t});break;case"read":case"project":r=f.jsx(PO,{...t});break;case"search":r=f.jsx(eI,{...t});break;case"edit":r=f.jsx(L6,{...t});break;case"web":r=f.jsx(pmt,{...t});break;case"agent":r=f.jsx(B6,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function Iw({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=R.useState(!1),a=R.useRef(null),o=R.useRef(!1);return R.useEffect(()=>{var l,u;!s||!o.current||(o.current=!1,(u=(l=a.current)==null?void 0:l.querySelector("button"))==null||u.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((l,u)=>f.jsxs("span",{children:[u>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?Vr(_=>n(l.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(l.id)}},children:l.label}):f.jsx("span",{children:l.label})]},l.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?sQ({target:r}):kY({count:Wt(e.length),target:r}),onClick:l=>{l.preventDefault(),l.stopPropagation(),o.current=!s&&l.detail===0,i(u=>!u)},children:s?AD():dpe({count:Wt(e.length)})})]})}function c5({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,l,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:Vxt(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(xpt,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const d=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Vr(p=>n(d,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((l=e.spawnedSessionIds)!=null&&l.length&&r){const d=e.spawnedSessionIds,p=d.slice(0,3),m=d.slice(p.length).map((x,S)=>({id:x,label:dE({number:Wt(p.length+S+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",f.jsx("button",{className:"tool-target",title:iue(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(x)},children:dE({number:Wt(S+1)})})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onSelect:r,targetType:Qse()})]})]})}if((u=e.runIds)!=null&&u.length){const d=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",t?f.jsx("button",{className:"tool-target",title:LQ({run:Ne(x)}),...Vr(v=>t(x,v),{stopPropagation:!0}),children:(s==null?void 0:s(x))||El()}):f.jsx("span",{children:(s==null?void 0:s(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onOpen:t,targetType:Fhe()})]})]})}if((_=e.experimentIds)!=null&&_.length){const d=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(d.length===0)return e.label;const p=d.slice(0,3),m=d.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||El()}));return f.jsxs(f.Fragment,{children:[e.label," — ",p.map((x,S)=>f.jsxs("span",{children:[S>0&&", ",i?f.jsx("button",{className:"tool-target",title:SQ({name:(a==null?void 0:a(x))||Ne(x)}),...Vr(v=>i(x,v),{stopPropagation:!0}),children:(a==null?void 0:a(x))||El()}):f.jsx("span",{children:(a==null?void 0:a(x))||El()})]},x)),m.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(Iw,{items:m,onOpen:i,targetType:dae()})]})]})}return e.label}function bk(e){const n=e.progressLabel??{skill:sZ(),read:HZ(),search:hee(),edit:DX(),project:fJ(),web:UY(),agent:vX(),command:gD()}[e.kind];return{...e,label:n}}function xF(e,n){const t=$d({id:"permission-preview",type:"tool",tool:e,state:{status:"running",input:n}});return{skill:WX(),read:yZ(),search:SJ(),edit:EX(),project:YZ(),web:PY(),agent:_X(),command:mJ()}[t.kind]}function x9t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const w9t=250;function S9t(e,n){const[t,r]=R.useState(e),s=R.useRef(Date.now()),i=R.useRef(e);return R.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=w9t-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const k9t=160;function wF(e){const[n,t]=R.useState(!1);return R.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),k9t);return()=>window.clearTimeout(r)},[e]),e&&n}function C9t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:CD()}}function E9t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function N9t(e){const n=[];let t=null;for(const r of e){const s=$d(r),i=E9t(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function SF({part:e,busy:n,recovering:t,onRecover:r,usageLimited:s=!1}){var x,S;const i=(x=e.state)==null?void 0:x.input,a=(i==null?void 0:i.nextRetryAt)??null,[o,l]=R.useState(Date.now());if(R.useEffect(()=>{if(typeof a!="number"||(l(Date.now()),a<=Date.now()))return;const v=window.setInterval(()=>{const b=Date.now();l(b),b>=a&&window.clearInterval(v)},1e3);return()=>window.clearInterval(v)},[a]),e.id==="turn-retry"){const v=Rxt(i??{},o);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(It,{}),f.jsx("span",{children:v})]})}const u=CB(i==null?void 0:i.recoveryAction),_=i==null?void 0:i.turnId,d=kB(e)?Nae():s?Xhe():BE(),p=s?umt:I6,m=ty(((S=e.state)==null?void 0:S.error)||BE());return f.jsxs("details",{className:"turn-usage-limit group/limit text-base text-subtext",children:[f.jsxs("summary",{className:"flex w-fit max-w-full items-center gap-2 cursor-pointer list-none rounded-sm focus-visible:outline-2 focus-visible:outline-text [&::-webkit-details-marker]:hidden",children:[f.jsx(p,{size:18,className:"shrink-0 text-accent-red","aria-hidden":"true"}),f.jsx("span",{children:d}),f.jsx(Ta,{size:16,className:"shrink-0 text-text transition-transform duration-120 ease-standard group-open/limit:rotate-90 motion-reduce:transition-none","aria-hidden":"true"})]}),f.jsx("pre",{className:"mt-2 rounded-md bg-surface p-2 text-sm font-mono whitespace-pre-wrap wrap-anywhere",children:m}),!s&&r&&_&&(u==="retry"||u==="continue")&&f.jsx(Le,{type:"button",size:"small",className:"mt-2",disabled:n||t,onClick:()=>r(_,u),children:t?h_e():u==="retry"?Gi():Gie()})]})}function CA({part:e,activity:n,repeatCount:t=1,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}){const u=e.state,_=(u==null?void 0:u.status)==="error",d=ty((u==null?void 0:u.error)||(u==null?void 0:u.output)||""),p=_&&!!d,[m,x]=R.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`;if(e.tool==="error")return f.jsx(SF,{part:e,busy:!1,recovering:!1,usageLimited:x3(e)});const v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Rv,{activity:n,className:"text-muted"}),f.jsxs("span",{className:`${uF} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(c5,{activity:n,onOpenFile:r,onOpenRun:s,onOpenSpawnedSession:i,runExperimentName:a,onOpenExperiment:o,experimentName:l}),t>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:fQ({count:Wt(t)}),children:["×",t]})]})]});return p?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?lQ({activity:n.label}):yY({activity:n.label}),onClick:()=>x(b=>!b),children:f.jsx(Ta,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:f.jsx("div",{className:gk,children:d.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function z9t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var j,M,O,B;const[l,u]=R.useState(!1),[_,d]=R.useState(!1),p=()=>{d(!0),u($=>!$)},m=N9t(e),x=m.map(({activity:$})=>$),S=n?m.at(-1):void 0,v=S==null?void 0:S.part,b=S==null?void 0:S.activity,w=((j=v==null?void 0:v.state)==null?void 0:j.status)!=="error"?(b&&bk(b))??null:null,y=!!v&&((M=v.state)==null?void 0:M.status)==="running"&&!(w!=null&&w.progressLabel)&&(x9t((O=v.state)==null?void 0:O.input)||(w==null?void 0:w.kind)==="command"&&!Gs(((B=v.state)==null?void 0:B.input)??{},"command","cmd")),C=S9t(w,y),E=wF(C!=null),N=C??C9t(x),T=C?C.label:CD();return e.length===1?C?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Rv,{activity:C,className:E?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${E?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:T,children:f.jsx(c5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(CA,{part:e[0],activity:m[0].activity,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Rv,{activity:N,className:E?"tool-running-shimmer-icon":"text-muted"}),C?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${E?"tool-running-shimmer":""}`,title:T,children:f.jsx(c5,{activity:C,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:p,"aria-expanded":l,children:T}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:p,"aria-expanded":l,"aria-label":l?Fie():oae(),children:f.jsx(Ta,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${l?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${l?"open":""}`,"aria-hidden":!l,inert:!l,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_&&m.map(({part:$,count:H,activity:q})=>f.jsx(CA,{part:$,repeatCount:H,activity:q,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},$.id))})})})]})}function j9t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=R.useState([]),o=!n,l=d=>n==null?void 0:n({promptId:e.id,...d});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:gue(),icon:Na,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:jue(),icon:L6,iconClass:"text-accent-amber"}:s.approved===!1?{label:xue(),icon:Gr,iconClass:"text-accent-red"}:{label:Cue(),icon:fb,iconClass:"text-muted"},x=m.icon;return f.jsxs("details",{className:r9t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?ED():LE()}),f.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),f.jsx(Ta,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${xA} ms-6`,children:[f.jsx(Fo,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const d=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&f.jsx(vk,{annotations:p,variant:"sent"}),f.jsxs("details",{className:n9t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||ahe()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${d?"chosen":""}`,children:d||Mhe()})]}),f.jsxs("div",{className:xA,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return f.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==d&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const d=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Jfe():LE()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${d?"clamped":""}`,children:f.jsx(Fo,{text:s.plan??"",onOpenFile:t})}),d&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Vr(p=>r(s.plan??"",e.id,p)),children:Efe()}),!o&&!d&&f.jsxs("div",{className:o5,children:[f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0,resumeMode:"auto"}),children:ooe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!0,resumeMode:"bypassPermissions"}),children:doe()}),f.jsx(Le,{size:"small",onClick:()=>l({approve:!1}),children:nde()})]})]})}if(s.kind==="permission"){const d=s.toolInput??{},p=Gs(d,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=Gs(d,"description")||"",S=m||x||xF(s.tool,d),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(I6,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:Noe()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(Le,{size:"small",variant:"ghost",onClick:()=>l({approve:!1}),children:rce()}),f.jsx(Le,{size:"small",variant:"primary",onClick:()=>l({approve:!0}),children:Soe()})]})]})]})}const u=d=>a(p=>s.multiSelect?p.includes(d)?p.filter(m=>m!==d):[...p,d]:[d]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:s9t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(d=>{const p=i.includes(d.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(d.label):l({answers:[d.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:d.label}),d.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:d.description})]},d.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:o5,children:f.jsx(Le,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>l({answers:i}),children:pfe()})})]})}function T9t(e,n){return e.role==="user"?!0:e.parts.some(t=>Wh(t,n))}function A9t(e){const n=e.text??"",t=n.startsWith("data:")?n:Wft(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function R9t({text:e,createdAt:n,count:t,index:r,prevId:s,nextId:i,onSelect:a,pagerDisabled:o,onEdit:l,editDisabled:u}){const _=t>1,d=new Date(n),p=async()=>{try{if(!navigator.clipboard)throw new Error(DD());await navigator.clipboard.writeText(e),Qn(tp(),"success")}catch(m){Qn(m instanceof Error?m.message:String(m),"error")}};return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${_?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[_&&f.jsxs(f.Fragment,{children:[f.jsx(Qt,{size:"small",title:NE(),"aria-label":NE(),disabled:o||!s,onClick:()=>s&&a(s),children:f.jsx(FO,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[r+1,"/",t]}),f.jsx(Qt,{size:"small",title:EE(),"aria-label":EE(),disabled:o||!i,onClick:()=>i&&a(i),children:f.jsx(Ta,{size:14})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100 transition-opacity duration-80 ease-standard",children:[f.jsx("time",{dateTime:d.toISOString(),className:"text-xs text-subtext tabular-nums me-2",children:d.toLocaleTimeString(z(),{hour:"numeric",minute:"2-digit"})}),f.jsx(Qt,{size:"small","aria-label":i6(),disabled:!e,onClick:p,children:f.jsx(db,{size:13})})]}),f.jsx(Qt,{size:"small",title:yE(),"aria-label":yE(),disabled:u,onClick:l,children:f.jsx(L6,{size:13})})]})}const M9t=R.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:v,predictTextTail:b=!1,forkCount:w,forkIndex:y=0,forkPrevId:C,forkNextId:E,forkDisabled:N,branchDisabled:T,onFork:j,onSelectFork:M}){var G,X;Yd();const[O,B]=R.useState(null),$=L9t(n);if($)return f.jsx(O9t,{part:$});if(n.role==="user"){const te=n.parts.filter(Z=>Z.type==="text").map(Z=>Z.text??"").join(` +`),I=Z=>!!(v!=null&&v.some(ce=>ce.name===Z)),L=n.parts.filter(Z=>Z.type==="image"&&Z.text).map(A9t),F=L.filter(Z=>!Z.isPdf),W=L.filter(Z=>Z.isPdf),U=n.parts.filter(Z=>Z.type==="annotation"&&Z.text).map(Z=>({id:Z.id,text:Z.text??""}));if(O!==null){const Z=()=>{const ce=O.trim();!ce||N||(B(null),j(n.id,ce))};return f.jsx("div",{className:"msg-user-group ms-auto self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":uce(),value:O,autoFocus:!0,onChange:ce=>B(ce.target.value),onKeyDown:ce=>{ce.key==="Escape"?(ce.preventDefault(),B(null)):ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),Z())}}),f.jsxs("div",{className:`${o5} justify-end`,children:[f.jsx(Le,{size:"small",onClick:()=>B(null),children:Xoe()}),f.jsx(Le,{size:"small",variant:"primary",onClick:Z,disabled:N||!O.trim(),children:N4()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn ms-auto self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[U.length>0&&f.jsx(vk,{annotations:U,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:align-baseline",children:[f.jsx(j8t,{text:te,isCommand:I}),F.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:F.map((Z,ce)=>f.jsx("a",{href:Z.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:Z.src,alt:vie()})},ce))}),W.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:W.map((Z,ce)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:Z.src,target:"_blank",rel:"noreferrer",children:[f.jsx(fb,{size:15}),f.jsx("span",{children:Z.name})]},ce))})]}),w!==void 0&&f.jsx(R9t,{text:te,createdAt:n.createdAt,count:w,index:y,prevId:C,nextId:E,onSelect:M,pagerDisabled:T,onEdit:()=>B(te),editDisabled:N})]})}const H=n.parts.find(te=>te.type==="tool"&&x3(te)),q=n.parts.find(om)??H,Y=n.parts.filter(te=>te!==q&&!(H&&x3(te)));return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[f.jsx(D9t,{message:n,parts:Y,options:{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:b}}),q&&f.jsx(SF,{part:q,usageLimited:!!H,busy:m,recovering:x===((X=(G=q.state)==null?void 0:G.input)==null?void 0:X.turnId),onRecover:S})]})});function D9t({message:e,parts:n,options:t}){const r=t.predictTextTail??!1,{work:s,answer:i}=Axt(n,r),[a,o]=R.useState(!1),[,l]=R.useState(0);if(R.useEffect(()=>{if(!r||e.completedAt!=null||s.length===0)return;const p=window.setInterval(()=>l(m=>m+1),1e3);return()=>window.clearInterval(p)},[r,e.completedAt,s.length]),s.length===0)return f.jsx(f.Fragment,{children:L1(i,t)});const u=e.completedAt??(r?Date.now():null),_=u===null?null:u-e.createdAt,d=_===null?null:_<6e4||_>=36e5?np(_):l0e({minutes:Wt(Math.floor(_/6e4)),seconds:Wt(Math.floor(_/1e3)%60)});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"turn-work mb-4",children:[f.jsxs("button",{type:"button",className:"flex w-full items-center gap-1.5 border-b border-border/50 pb-2 text-start text-base text-subtext cursor-pointer hover:text-text focus-visible:outline-2 focus-visible:outline-primary","aria-expanded":a,"data-work-toggle":!0,onClick:()=>o(p=>!p),children:[f.jsx("span",{children:d===null?s0e():f0e({duration:d})}),f.jsx(Ta,{size:16,className:`shrink-0 text-muted transition-transform duration-200 ease-standard motion-reduce:transition-none ${a?"rotate-90":""}`})]}),f.jsx("div",{className:`tool-group-disclosure ${a?"open":""}`,"aria-hidden":!a,inert:!a,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"turn-work-content pt-4",children:L1(s,{...t,predictTextTail:!1,pendingTailToolId:null})})})})]}),f.jsx("div",{className:"turn-answer",children:L1(i,t)})]})}function L9t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XL?n:null}function O9t({part:e}){var l;const n=e.state,t=Gs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((l=n==null?void 0:n.input)==null?void 0:l.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?gD():s&&i!==null?Die({code:Wt(i)}):null;return f.jsx("div",{className:"msg-shell ms-auto self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[wD()," "]}),f.jsx(c_,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),a&&f.jsx("div",{className:`${gk} mt-2`,children:a.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function L1(e,n){var w,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u,onRespond:_,onOpenPlan:d,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&Wh(C,t)).at(-1),S=[];let v=[];const b=()=>{v.length!==0&&(S.push(f.jsx(z9t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:l,experimentName:u},`tg-${v[0].id}`)),v=[])};for(const C of e)if(Wh(C,t)){if(C.type==="tool"&&(B9t(C.tool)||(((w=C.children)==null?void 0:w.length)??0)>0)){b(),S.push(f.jsx(P9t,{part:C,pendingTail:m&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?S.push(f.jsx(Fo,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(f.jsx("div",{dir:"auto",role:"note","aria-label":Hfe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(f.jsx(j9t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:d},C.id))}return b(),S}function I9t(e){return $d(e).label}function B9t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function kF(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Mv(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Mv(t.children,n);if(r)return r}return null}function $9t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,v,b;const o=e.children??[],l=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?ty(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",d=L1(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:l,pendingTailToolId:l?wB(o):null}),m=o.some(w=>w.type==="text"&&!!w.text)?"":kF(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),_&&f.jsx("div",{className:gk,children:_.slice(0,2e4)}),d.length===0&&!m&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:l?r6():Bae()}):f.jsxs(f.Fragment,{children:[d,m&&f.jsx(Fo,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function P9t({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,d,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=ty(((_=e.state)==null?void 0:_.error)||((d=e.state)==null?void 0:d.output)||""),i=n&&!r?bk($d(e)):$d(e),a=wF(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!kF(e),l=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[n6()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(UO,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Rv,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${uF} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:l}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:eoe(),...Vr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[l,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(Ta,{size:12})})]})}function F9t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const l of s){const u=`${i}/${l.id}`;l.type==="tool"&&((a=l.state)!=null&&a.status)&&n.set(u,{status:l.state.status,part:l}),(o=l.children)!=null&&o.length&&r(l.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function yk(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=Gs(o,"reason","description")||xF(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function H9t(e){const[n,t]=R.useState({text:"",sequence:0}),r=R.useRef(null);return R.useEffect(()=>{var x,S,v,b,w;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=F9t(e),o=yk(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?sE({label:Oo(o.label)}):"",sequence:y.sequence+1}));return}const l=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([y,C])=>{var E;return((E=l.get(y))==null?void 0:E.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(y=>({text:sE({label:Oo(o.label)}),sequence:y.sequence+1}));return}const d=(S=_.find(([,y])=>om(y.part)))==null?void 0:S[1].part;if((d==null?void 0:d.id)==="turn-recovery"){const y=CB((b=(v=d.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${wte()}${y?` ${y==="retry"?nte():Zee()}`:""}`,sequence:C.sequence+1}));return}if((d==null?void 0:d.id)==="turn-retry"){t(y=>({text:Kee(),sequence:y.sequence+1}));return}const p=_.filter(([,y])=>y.status==="error");if(p.length>0){const y=p.slice(0,2).map(([,C])=>$d(C.part).label).join(", ");t(C=>({text:p.length===1?_te({labels:y}):vte({count:Wt(p.length),labels:y}),sequence:C.sequence+1}));return}const m=_.filter(([,y])=>y.status==="running");if(m.length>0){const y=(w=m.at(-1))==null?void 0:w[1].part;t(C=>({text:y?bk($d(y)).label:ate(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:ute(),sequence:y.sequence+1}))},[e]),n}const q9t=R.memo(function({messages:n,scrollRef:t,scrollToEndRef:r,stickToBottom:s,onPinToBottom:i,allMessages:a,canFork:o,onFork:l,onSelectFork:u,busy:_,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,recoveringTurnId:C,onRecover:E,skills:N}){var I,L,F;Yd();const T=((I=yk(n))==null?void 0:I.id)??null,j=R.useMemo(()=>n.filter(W=>T9t(W,T)),[n,T]),M=R.useMemo(()=>{const W=j.filter(U=>U.role==="user"&&!U.id.startsWith(Cd));return zxt(a,n,W,U=>U.startsWith(Cd))},[n,j,a]),O=R.useRef(new Set),[B,$]=R.useState(!1),H=R.useCallback(W=>j[W].id,[j]),q=R.useCallback(W=>{if(B)return j.map((Z,ce)=>ce);const U=new Set(yB(W));return j.forEach((Z,ce)=>{O.current.has(Z.id)&&U.add(ce)}),[...U].sort((Z,ce)=>Z-ce)},[j,B]),Y=Cxt({count:j.length,useFlushSync:!1,getScrollElement:()=>t.current,getItemKey:H,estimateSize:()=>400,overscan:1,initialRect:{width:((L=t.current)==null?void 0:L.clientWidth)??0,height:((F=t.current)==null?void 0:F.clientHeight)??0},initialOffset:()=>{var W;return Math.max(0,j.length*400-(((W=t.current)==null?void 0:W.clientHeight)??0))},anchorTo:s.current?"end":"start",followOnAppend:!0,scrollEndThreshold:60,rangeExtractor:q});R.useLayoutEffect(()=>{const W=()=>Y.scrollToEnd();return r.current=W,i(),()=>{r.current=null}},[Y,r,i]),R.useEffect(()=>{const W=()=>{var ce;const U=window.getSelection();if(!U||U.isCollapsed||!U.rangeCount)return;const Z=U.getRangeAt(0);for(const re of((ce=t.current)==null?void 0:ce.querySelectorAll("[data-message-id]"))??[])Z.intersectsNode(re)&&re.dataset.messageId&&O.current.add(re.dataset.messageId)};return document.addEventListener("selectionchange",W),()=>document.removeEventListener("selectionchange",W)},[t]);const G=j.at(-1),X=H9t(n),te=_?SB(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:X.text},X.sequence)}),f.jsx("button",{type:"button",className:"sr-only focus:not-sr-only","aria-pressed":B,onClick:()=>$(W=>!W),children:i_e()}),f.jsx("div",{className:"relative",style:{height:Y.getTotalSize()},children:Y.getVirtualItems().map(W=>{var ne,Q,le,oe,ue,pe;const U=j[W.index],Z=U.parts.find(om),ce=(Q=(ne=Z==null?void 0:Z.state)==null?void 0:ne.input)==null?void 0:Q.turnId,re=Z?_||C!==null:!1;return f.jsx("div",{"data-index":W.index,"data-message-id":U.id,ref:Y.measureElement,className:"absolute left-0 w-full pb-4",style:{top:W.start},onClickCapture:Se=>{!(Se.target instanceof Element)||!Se.target.closest("[data-work-toggle]")||(s.current=!1,Y.setOptions({...Y.options,anchorTo:"start"}))},onPointerDownCapture:()=>O.current.add(U.id),onFocusCapture:()=>O.current.add(U.id),children:f.jsx(M9t,{message:U,forkCount:(le=M.get(U.id))==null?void 0:le.count,forkIndex:(oe=M.get(U.id))==null?void 0:oe.index,forkPrevId:(ue=M.get(U.id))==null?void 0:ue.prevId,forkNextId:(pe=M.get(U.id))==null?void 0:pe.nextId,forkDisabled:!o,branchDisabled:_,onFork:l,onSelectFork:u,activePermissionId:T,pendingTailToolId:(te==null?void 0:te.messageId)===U.id?te.toolId:null,onOpenFile:d,onOpenRun:p,onOpenSpawnedSession:m,runExperimentName:x,onOpenExperiment:S,experimentName:v,onRespond:b,onOpenPlan:w,onOpenSubagent:y,busy:re,recoveringTurnId:ce===C?C:null,onRecover:E,skills:N,predictTextTail:_&&U===G&&U.role==="assistant"})},U.id)})})]})}),U9t=(e,n)=>e==="all"?!0:e==="archived"?n:!n,CF=[{id:"active",label:poe,railLabel:ND},{id:"archived",label:pE,railLabel:pE},{id:"all",label:boe,railLabel:xD}];function G9t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=so();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(Qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:kE(),"aria-label":kE(),onClick:()=>r(i=>!i),children:f.jsx(nI,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:CF.map(i=>f.jsxs(or,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(Na,{size:13})]},i.id))})]})}const W9t=14,V9t=500,K9t=1200;function EF({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*W9t,V9t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function Q9t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:l,onDelete:u}){var E;const{open:_,setOpen:d,ref:p}=so(),m=((E=e.title)==null?void 0:E.trim())||"Untitled",[x,S]=R.useState(!1),[v,b]=R.useState(""),w=R.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),S(!0)}function C(){var T;const N=v.trim();S(!1),N&&N!==(((T=e.title)==null?void 0:T.trim())||"")&&o(N)}return R.useEffect(()=>{var N,T;x&&((N=w.current)==null||N.focus(),(T=w.current)==null||T.select())},[x]),f.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot:empty]:hidden [&_.session-dot]:w-4 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:[mask-image:linear-gradient(to_right,black_calc(100%_-_16px),transparent)] [&_.session-title]:whitespace-nowrap [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-visible_.session-menu-btn]:inline-flex [&_.session-menu-btn:focus-visible]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-dot]:hidden [&:focus-visible_.session-dot]:hidden [&:has(.session-menu-btn:focus-visible)_.session-dot]:hidden [&.menu-open_.session-dot]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-dot]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${E0[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?c_e():""}`,onClick:()=>{x||(_?d(!1):a())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?d(!1):a())},children:[e.parentSessionId&&!x&&f.jsx(B6,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?f.jsx("input",{ref:w,className:"session-title-input","aria-label":Vde(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),S(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(EF,{title:m,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),f.jsx("button",{className:"session-menu-btn",title:RE(),"aria-label":RE(),onClick:N=>{N.stopPropagation(),d(T=>!T)},children:f.jsx(R6,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),y()},children:f.jsx("span",{children:kD()})}),f.jsx(or,{onClick:N=>{N.stopPropagation(),d(!1),l(!e.archived)},children:f.jsx("span",{children:e.archived?V_e():aie()})}),f.jsx(or,{danger:!0,onClick:N=>{N.stopPropagation(),d(!1),u()},children:f.jsx("span",{children:SD()})})]})]})}const EA=[PO,eI,c_,hb],Bw=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],NA="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function Y9t({onClose:e,onConfigureSsh:n}){var v,b;const t=mn({mutationFn:w=>Zdt(...w)}),r=ct(YL()),s=ct(hht()),i=r.data??null,a=s.data??[],[o,l]=R.useState(""),u=i?null:((v=r.error)==null?void 0:v.message)??((b=s.error)==null?void 0:b.message)??null,[_,d]=R.useState(null),p=R.useRef(null);ob(p,e);async function m(w){const y=window.open("/remote-launch","_blank");if(!y){Qn(bLe(),"error");return}d(w);try{const C=await t.mutateAsync([w,{theme:Vht(),locale:z()}]);y.location.replace(C.gatewayUrl),e()}catch(C){y.close(),Qn(C instanceof Error?C.message:String(C),"error")}finally{d(null)}}const x=i==null?void 0:i.filter(w=>w.host.toLocaleLowerCase().includes(o.trim().toLocaleLowerCase())),S=new Map(a.map(w=>[w.host,w]));return ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:w=>{w.target===w.currentTarget&&e()},children:f.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":eDe(),onClick:e,children:f.jsx(Gr,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:tL()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:sDe()}),f.jsx(Wr,{"data-initial-focus":!0,className:"mt-4",value:o,onChange:w=>l(w.target.value),placeholder:SN(),"aria-label":SN()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:u?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:u}):i===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(It,{})," ",yL()]}):(x==null?void 0:x.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:rLe()}):x==null?void 0:x.map(w=>{const y=S.get(w.host);return f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===w.host,onClick:()=>void m(w.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:w.host}),_===w.host?f.jsx(It,{}):y?f.jsx("span",{className:"text-sm text-subtext",children:dLe()}):null]},w.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(Le,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(nI,{size:15}),TL()]})})]})}),document.body)}function X9t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,onOpenFile:o,onOpenRun:l,runExperimentName:u,onOpenExperiment:_,experimentName:d,onOpenPlan:p,onOpenSubagent:m,runtime:x,onOpenDemoWelcome:S,composerPrefill:v=null,activeSessionId:b,onActiveSessionChange:w,preferredAgent:y,onPreferredAgentChange:C,children:E}){var Qr,ua,Ia,hc,nl;const N=mn({mutationFn:ie=>Hft(...ie)}),T=mn({mutationFn:ie=>Fft(...ie)}),j=mn({mutationFn:ie=>Ift(...ie)}),M=mn({mutationFn:ie=>$ft(...ie)}),O=mn({mutationFn:ie=>Pft(...ie)}),B=mn({mutationFn:Bft}),$=R.useMemo(()=>Ea(e),[e]),{data:H=i9t}=ct($),q=R.useCallback(ie=>{Pr($.queryKey,be=>{if(!be)return;const Ae=typeof ie=="function"?ie(be):ie,Oe=new Map(be.map(Ue=>[Ue.id,Ue]));for(const Ue of Ae)Oe.get(Ue.id)!==Ue&&Ga(nt,$.queryKey,Ue.id),Oe.delete(Ue.id);for(const Ue of Oe.keys())Ga(nt,$.queryKey,Ue);return Ae})},[$]),[Y,G]=R.useState(!1),[X,te]=R.useState(!1),I=b,L=R.useRef(w);L.current=w;const F=R.useRef({projectId:e});F.current.projectId!==e&&(F.current={projectId:e});const[W,U]=R.useState(new Set),[Z,ce]=R.useState("active"),[re,ne]=R.useState(""),[Q,le]=R.useState([]),oe=R.useRef(0),ue=R.useRef({projectId:e,activeId:I,mainView:i});(ue.current.projectId!==e||ue.current.activeId!==I||ue.current.mainView!==i)&&(ue.current={projectId:e,activeId:I,mainView:i});const[pe,Se]=R.useState([]),[ye,qe]=R.useState(null),[Ie,Te]=R.useState(null),vt=R.useRef(Promise.resolve()),Dt=R.useRef(0),Ut=R.useRef(0),[Ft,mt]=R.useState(null),rt=R.useRef(null),ut=R.useRef(!1),Ct=R.useRef(null),[we,Re,Ze]=Nht(e,i==="chat"?I:null),{data:_t=J9t}=ct(hu()),[wt,Zt]=R.useState(y);R.useEffect(()=>Zt(y),[y]);const[We,Gt]=R.useState({}),[an,yn]=R.useState(b0),[Vt,Yn]=R.useState(null),ln=R.useRef(!1),cn=R.useRef(null),[br,Xn]=R.useState(null),Zn=R.useRef(!1),Rn=R.useRef(null),[Rr,Nr]=R.useState(new Map),bt=R.useRef(new Map),fn=R.useRef(null),Cn=R.useRef(null),tn=R.useRef(null),nr=R.useRef(!0),[un,Mn]=R.useState(!0),on=R.useRef(null),rr=so(),En=R.useCallback(ie=>{var be;oe.current+=1,le(Ae=>[...Ae,{id:`annotation-${oe.current}`,...ie}]),(be=on.current)==null||be.focus()},[]),Ve=X8t(Cn,En);Z8t(Q),R.useEffect(()=>{le([]),Ve.dismiss()},[I,e,Ve.dismiss]);const[xt,lt]=R.useState(0),[ft,jt]=R.useState(!1),[xn,On]=R.useState(0),di=R.useRef(!1);function Xl(ie){if(!gs)return;if(ie.source==="command"&&ie.name==="plan"){yr(re,gs);return}const be=s5(ie.name,on.current),Ae=w8t(re,gs,ie.name,be);ne(Ae.text),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}function ao(ie){if(oo)return!1;const be=ie.selectionStart;if(di.current||be!==ie.selectionEnd)return!1;const Ae=re.slice(0,be).replace(/[ \t]+$/,"").length,Oe=Aw(re,Ae);if(!Oe||Oe.end!==Ae||!la(Oe.query)||be>Ae&&be-Ae!==s5(Oe.query,ie))return!1;const Ue=_A(re,{...Oe,end:be});return ne(Ue.text),On(Ue.cursor),window.requestAnimationFrame(()=>ie.setSelectionRange(Ue.cursor,Ue.cursor)),!0}function zi(ie){qe(null);let Oe=pe.reduce((Ue,zn)=>Ue+zn.size,0);for(const Ue of ie){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){qe(wie({name:Ne(Ue.name)}));continue}if(Oe+Ue.size>41943040){qe(Eie());continue}Oe+=Ue.size;const zn=new FileReader;zn.onload=()=>{const jn=zn.result;Se(fr=>[...fr,{dataUrl:jn,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},zn.readAsDataURL(Ue)}}function Ra(ie){const be=Array.from(ie.clipboardData.items).filter(Ae=>Ae.kind==="file"&&(Ae.type.startsWith("image/")||Ae.type==="application/pdf")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);be.length>0&&(ie.preventDefault(),zi(be))}const Jt=H.find(ie=>ie.id===I),Ys=wt??Hgt(_t),ur=Jt?{harness:Jt.harness,model:We.model??Jt.model,serviceTier:We.serviceTier!==void 0?We.serviceTier:Jt.serviceTier,permissionMode:We.permissionMode??Jt.permissionMode,reasoningLevel:We.reasoningLevel??Jt.reasoningLevel}:Ys?{...Ys,...We}:null,{data:Mr=Z9t}=ct(vht(ur==null?void 0:ur.harness)),Ke=ur?_t.find(ie=>ie.id===ur.harness):void 0,Ht=Ke==null?void 0:Ke.options,ji=R.useMemo(()=>S8t(Mr,Ht==null?void 0:Ht.planActivation),[Mr,Ht==null?void 0:Ht.planActivation]),os=gA(re),ks=os!==null,gs=Aw(re,xn),sa=(gs==null?void 0:gs.query)??null,Ma=sa===null?[]:ji.filter(ie=>ie.name.startsWith(sa)||ie.plugin&&`${ie.plugin}:${ie.name}`.toLowerCase().startsWith(sa)),oo=!ks&&sa!==null&&(gs==null?void 0:gs.end)===xn&&Ma.length>0,Cs=oo&&!ft?Ma:[],Da=Cs.length>0,Kr=Math.min(xt,Math.max(0,Cs.length-1));R.useEffect(()=>lt(0),[sa]);const Dr=ur&&Ke&&Ke.models.length>0&&!Ke.models.some(ie=>ie.id===ur.model)?Ke.models[0].id:(ur==null?void 0:ur.model)??null,en=ur&&{...ur,model:Dr,serviceTier:sv(Ke,Dr,ur.serviceTier),reasoningLevel:VL(Ke,Dr,ur.reasoningLevel)},vs=rb(Ke,en==null?void 0:en.model),Xs=ie=>{if(!en)return;const be={...en,...ie},Ae={};ie.model!==void 0&&ie.model!==en.model&&(Ae.model=ie.model),ie.serviceTier!==void 0&&ie.serviceTier!==en.serviceTier&&(Ae.serviceTier=ie.serviceTier),ie.permissionMode!==void 0&&ie.permissionMode!==en.permissionMode&&(Ae.permissionMode=ie.permissionMode),ie.reasoningLevel!==void 0&&ie.reasoningLevel!==en.reasoningLevel&&(Ae.reasoningLevel=ie.reasoningLevel),yn(Oe=>({...Oe,...Ae})),Zt(be),C(be).catch(()=>{}),Jt?Gt(Oe=>({...Oe,...ie})):ie.harness&&ie.harness!==en.harness&&Gt({})},dr=R.useCallback(ie=>{const be=vt.current.catch(()=>{}).then(()=>{if(!Fn($.queryKey))throw new DOMException("Workspace changed","AbortError");return ie()});return vt.current=be.then(()=>{},()=>{}),be},[$]),ls=ie=>{if(ie==="plan"&&(Ke==null?void 0:Ke.id)==="claude-code"?(yn(Oe=>({...Oe,permissionMode:ie})),Gt(Oe=>({...Oe,permissionMode:ie}))):(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Xs({permissionMode:ie})),!Jt)return;const be=Jt.id,Ae=++Dt.current;Te(null),dr(()=>N.mutateAsync([be,ie])).then(Oe=>{q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Dt.current===Ae&&Gt(Ue=>{const zn={...Ue};return delete zn.permissionMode,zn})}).catch(()=>{Dt.current===Ae&&(Gt(Oe=>{const Ue={...Oe};return delete Ue.permissionMode,Ue}),Te(e0e()))})},Ls=ie=>Xs({reasoningLevel:ie}),Fr=(en==null?void 0:en.harness)==="claude-code"?en.permissionMode==="plan":(Ht==null?void 0:Ht.planActivation)==="command"?Ft??(Jt==null?void 0:Jt.planMode)??!1:!1;R.useEffect(()=>{Ft===null||(Jt==null?void 0:Jt.planMode)!==Ft||(rt.current=null,mt(null))},[Jt==null?void 0:Jt.planMode,Ft]);async function Lr(ie){if(yn(Oe=>({...Oe,planMode:ie})),rt.current=ie,mt(ie),!Jt)return;const be=Jt.id,Ae=++Ut.current;Te(null);try{const Oe=await dr(()=>T.mutateAsync([be,ie]));q(Ue=>Ue.map(zn=>zn.id===Oe.id?Oe:zn)),Ut.current===Ae&&(rt.current=null,mt(null),Te(null))}catch(Oe){throw Ut.current===Ae&&(rt.current=null,mt(null)),Oe}}async function cs(){if((en==null?void 0:en.harness)==="claude-code"){ls("auto");return}if(Jt)try{await Lr(!1)}catch{Te(rae())}}async function bs(){const ie=!Fr;try{if((en==null?void 0:en.harness)==="claude-code")ls(ie?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(ie);else throw new Error(S2())}catch{Te(IE())}}function yr(ie,be){const Ae=_A(ie,be);ne(Ae.text),jt(!0),bs(),window.requestAnimationFrame(()=>{var Oe,Ue;(Oe=on.current)==null||Oe.focus(),(Ue=on.current)==null||Ue.setSelectionRange(Ae.cursor,Ae.cursor),On(Ae.cursor)})}const ys=R.useCallback(async(ie=!1)=>{const be=F.current;if(be.projectId!==e||!Fn($.queryKey))return null;const Ae=(nt.getQueryData($.queryKey)??[]).map(Oe=>Oe.id);try{const Oe=await nt.fetchQuery({...$,...ie?{staleTime:0}:{}});if(F.current!==be||!Fn($.queryKey))return null;const Ue=Oe.filter(jn=>!du.has(jn.id)),zn=new Set(Ue.map(jn=>jn.id));for(const jn of Ae)zn.has(jn)||cc(jn);return bt.current=new Map(Ue.map(jn=>[jn.id,jn.title])),Ue}catch{return null}},[e]),ia=R.useCallback(async ie=>{F.current.projectId!==e||!Fn($.queryKey)||await Promise.all([nt.fetchQuery({...Bl(ie),staleTime:0}),ys(!0)]).catch(()=>{})},[e,ys]);R.useEffect(()=>{const ie=OO();U(e===z2?new Set([m6,g6].filter(Ae=>!ie.has(Ae))):new Set),ne(""),Se([]),Nr(new Map),bt.current=new Map,ys();const be=F.current;return()=>{F.current===be&&(F.current={projectId:e})}},[e,ys]),R.useEffect(()=>{yn(b0),Rn.current=null},[I]),R.useEffect(()=>ov(ie=>{switch(ie.type){case"session":{if(ie.session.projectId!==e||du.has(ie.session.id))return;const be=bt.current.has(ie.session.id),Ae=bt.current.get(ie.session.id)!==ie.session.title;bt.current.set(ie.session.id,ie.session.title),be&&Ae&&ie.session.titleSource==="generated"&&(Nr(Oe=>{const Ue=new Map(Oe);return Ue.set(ie.session.id,(Oe.get(ie.session.id)??0)+1),Ue}),window.setTimeout(()=>{Nr(Oe=>{if(!Oe.has(ie.session.id))return Oe;const Ue=new Map(Oe);return Ue.delete(ie.session.id),Ue})},K9t));break}case"sessionDeleted":cc(ie.sessionId);break}}),[e]),R.useEffect(()=>ov(ie=>{ie.type==="reconnected"&&ys(!0)}),[ys]);const aa=I?we.messagesBySession[I]??wA:wA,Xo=I?we.activeLeafBySession[I]??null:null;cn.current=Xo;const Es=R.useMemo(()=>Ext(aa,Xo),[aa,Xo]),Nu=R.useRef({projectId:e,ids:we.busySessions});R.useEffect(()=>{const ie=Nu.current;Nu.current={projectId:e,ids:we.busySessions},ie.projectId===e&&U(be=>Txt(be,ie.ids,we.busySessions,H,i==="chat"?I:null))},[e,we.busySessions,H,I,i]);const $n=I?we.busySessions.has(I):!1,y_=!$n&&!!(Ke!=null&&Ke.agentReady),Zl=$n&&SB(Es)!=null,Zo=$n&&jxt(Es),Hr=I?we.queuedBySession[I]??[]:[],oa=Hr.some(ie=>ie.dispatchState==="retrying"),Jl=Hr.findIndex(ie=>ie.dispatchState==="blocked"),Ti=Hr.reduce((ie,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?ie:ie===null?be.nextRetryAt:Math.min(ie,be.nextRetryAt),null),[La,ec]=R.useState(()=>Date.now());R.useEffect(()=>{if(!oa||Ti===null||(ec(Date.now()),Ti<=Date.now()))return;const ie=window.setInterval(()=>{const be=Date.now();ec(be),be>=Ti&&window.clearInterval(ie)},1e3);return()=>window.clearInterval(ie)},[oa,Ti]),R.useEffect(()=>{const ie=Hr.reduce((be,Ae)=>Ae.planMode??be,void 0);ie!==void 0?(ut.current=!0,rt.current=ie,mt(ie)):ut.current&&(ut.current=!1,rt.current=null,mt(null))},[Hr]);const tc=!!I&&!(I in we.messagesBySession)&&Ze.isPending,nc=R.useMemo(()=>{const ie=new Set;for(const be of we.busySessions)(we.messagesBySession[be]??[]).some(Ae=>Ae.parts.some(Oe=>Oe.type==="prompt"&&Oe.prompt&&!Oe.prompt.resolved&&Oe.prompt.nativeId))&&ie.add(be);return ie},[we.busySessions,we.messagesBySession]),Ai=I?nc.has(I):!1,Nn=Jt,rc=Nn?Rr.get(Nn.id):void 0,Mt=R.useMemo(()=>{var ie;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(Ae.type==="prompt"&&((ie=Ae.prompt)==null?void 0:ie.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Es]),hr=R.useMemo(()=>{const ie=Nn==null?void 0:Nn.harness;if(!I||ie!=="claude-code"&&ie!=="codex")return null;for(let be=Es.length-1;be>=0;be--)for(const Ae of Es[be].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!we.busySessions.has(I)?null:Ae.id;return null},[Es,Nn==null?void 0:Nn.harness,I,we.busySessions]),xs=ks&&!hr,la=ie=>!hr&&!ks&&ji.some(be=>be.name===ie),[Ri,lo]=R.useState(null),co=Ri&&Ri.sessionId===I?Ri:null;R.useEffect(()=>{if(!Ri)return;const ie=we.busySessions.has(Ri.sessionId),be=Ri.sessionId===I&&Mt&&Mt.promptId!==Ri.promptId;(!ie||be)&&lo(null)},[Ri,Mt,we.busySessions,I]);const sc=R.useMemo(()=>yk(Es),[Es]),us=$n&&!!(Ke!=null&&Ke.supportsSteering)&&!!(Ke!=null&&Ke.agentReady)&&!Mt&&!hr&&!sc&&pe.length===0&&Q.length===0,Os=R.useMemo(()=>p&&I?(ie,be,Ae)=>p(ie,I,be,Ae):void 0,[p,I]),ic=R.useMemo(()=>m&&I?(ie,be,Ae)=>m(I,ie,be,Ae):void 0,[m,I]),Jo=R.useMemo(()=>o&&((ie,be,Ae,Oe,Ue)=>o(ie,I??void 0,be,Ae,Oe,Ue)),[o,I]);R.useEffect(()=>{Dt.current+=1,Ut.current+=1;const ie=(I?we.queuedBySession[I]??[]:[]).reduce((be,Ae)=>Ae.planMode??be,void 0);ut.current=ie!==void 0,rt.current=ie??null,mt(ie??null),Gt({}),Te(null)},[I]);const Is=i==="chat"&&(Es.length>0||$n),Oa=(en==null?void 0:en.harness)??null,zu=(en==null?void 0:en.model)??null,Zs=Ze.data?null:Ze.error,el=i==="chat"&&!Is&&!tc&&!Zs,tl=ct({...qht(e,Oa??"claude-code",zu,z()),enabled:el&&Oa!==null,subscribed:el&&Oa!==null}),ac=((Qr=tl.data)==null?void 0:Qr.prompts)??null,sf=Oa!==null&&tl.isPending,ju=e===z2?"demo":"project",Tu=ie=>{ne(ie),jt(!1),window.requestAnimationFrame(()=>{const be=on.current;be&&(be.focus(),be.setSelectionRange(ie.length,ie.length),On(ie.length))})};R.useEffect(()=>{v&&(ne(v),jt(!1),On(v.length))},[v]);const uo=R.useCallback(ie=>{const be=ie.scrollHeight-ie.scrollTop-ie.clientHeight<60;nr.current=be,Mn(be)},[]),fi=R.useCallback(()=>{var ie;nr.current=!0,Mn(!0),(ie=tn.current)==null||ie.call(tn)},[]);R.useEffect(()=>{const ie=fn.current,be=Cn.current;if(!ie||!be)return;const Ae=new ResizeObserver(()=>{var Oe;nr.current?(Oe=tn.current)==null||Oe.call(tn):Mn(ie.scrollHeight-ie.scrollTop-ie.clientHeight<60)});return Ae.observe(ie),Ae.observe(be),()=>Ae.disconnect()},[Is]);const oc=R.useCallback(ie=>{ie.currentTarget.blur(),fi()},[fi]);async function af({queue:ie=!1}={}){var Lt,Wn,Ns,zs,Ps,_i;if(Vc({name:"first_action",surface:ju,action:"typed_prompt"}),Zn.current)return;const be=re.trim(),Ae=hr?null:k8t(be,Ht==null?void 0:Ht.planActivation),Oe=!!Ae,Ue=!Fr,zn=pA(Ht==null?void 0:Ht.planActivation,Oe?Ue:void 0,rt.current),jn=Oe&&(Ke==null?void 0:Ke.id)==="claude-code"?Ue?"plan":"auto":void 0,fr=Ae?Ae.prompt:be,Ln=pe,_r=Q,da=_r.map(Tn=>({text:Tn.text})),_f=e,Mu=i;let rl=I;const $s=()=>{const Tn=ue.current;return Fn($.queryKey)&&Tn.projectId===_f&&Tn.activeId===rl&&Tn.mainView===Mu},ho=()=>{$s()&&(ne(Tn=>Tn||be),Se(Tn=>Tn.length?Tn:Ln),le(Tn=>Tn.length?Tn:_r))};if(Oe&&!fr&&Ln.length===0&&_r.length===0){ne(""),jt(!1);try{if((Ke==null?void 0:Ke.id)==="claude-code")ls(Ue?"plan":"auto");else if((Ht==null?void 0:Ht.planActivation)==="command")await Lr(Ue);else throw new Error(S2())}catch{Te(IE()),ho()}return}const J=en?{...en,...jn?{permissionMode:jn}:{}}:null;jn&&ls(jn);let ge=null;const je=rt.current;Oe&&(Ht==null?void 0:Ht.planActivation)==="command"&&(ge=++Ut.current,rt.current=Ue,mt(Ue));const $e=()=>{!$s()||ge===null||Ut.current!==ge||(rt.current=je,mt(je))};if(!fr&&Ln.length===0&&_r.length===0)return;if((fr||_r.length>0)&&hr&&Ln.length===0){ne(""),le([]),fo({promptId:hr,answers:[],note:fr||void 0,annotations:da}).then(Tn=>{Tn||ho()});return}const Me=JSON.stringify({text:fr,images:Ln.map(Tn=>({mediaType:Tn.mediaType,name:Tn.name,dataUrl:Tn.dataUrl})),annotations:da,settings:J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:null}),at=((Lt=Rn.current)==null?void 0:Lt.signature)===Me?Rn.current.id:`ct_${crypto.randomUUID()}`;if(Rn.current={signature:Me,id:at},$n){if(!I||!(Ke!=null&&Ke.agentReady)){$e();return}const Tn=I;ne(""),Se([]),le([]),qe(null);const Yr=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:(Ht==null?void 0:Ht.planActivation)==="command"?zn??(Jt==null?void 0:Jt.planMode):zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Js=Ln.map(sr=>({mediaType:sr.mediaType,dataBase64:sr.dataUrl.slice(sr.dataUrl.indexOf(",")+1),name:sr.name}));try{(Wn=(await dr(()=>PN(Tn,fr,Yr,Js.length?Js:void 0,da,at,us&&!ie&&!Oe?"steer":void 0))).turn)!=null&&Wn.existing&&await ia(Tn),$s()&&yn(b0),((Ns=Rn.current)==null?void 0:Ns.id)===at&&(Rn.current=null)}catch{$e(),ho()}return}if(!(Ke!=null&&Ke.agentReady)){$e();return}if(!J){$e();return}let tt=I;try{Zn.current=!0;try{if(!tt){const _o=await Au(J,zn);tt=_o.id,rl=_o.id}if(!Fn($.queryKey))return;const pr=Bl(tt);await nt.fetchQuery({...pr,...((zs=nt.getQueryState(pr.queryKey))==null?void 0:zs.fetchStatus)==="fetching"?{staleTime:0}:{}})}finally{Zn.current=!1}if(!Fn($.queryKey))return;$s()&&(ne(pr=>pr===re?"":pr),Se(pr=>pr===Ln?[]:pr),le(pr=>pr===_r?[]:pr),qe(null)),Re({type:"optimisticUser",sessionId:tt,text:fr||_ie(),attachments:Ln.map(pr=>({url:pr.dataUrl,mediaType:pr.mediaType,name:pr.name})),annotations:_r}),Re({type:"busy",sessionId:tt,busy:!0}),$s()&&fi(),$s()&&Z==="archived"&&ce("active");const Tn=J?{model:J.model,serviceTier:J.serviceTier,permissionMode:J.permissionMode,planMode:zn,reasoningLevel:J.reasoningLevel}:{};$s()&&Gt({});const Yr=Ln.map(pr=>({mediaType:pr.mediaType,dataBase64:pr.dataUrl.slice(pr.dataUrl.indexOf(",")+1),name:pr.name})),Js=tt;if(!Js)throw new Error(t_e());(Ps=(await dr(()=>PN(Js,fr,Tn,Yr.length?Yr:void 0,da,at))).turn)!=null&&Ps.existing&&await ia(Js),$s()&&yn(b0),((_i=Rn.current)==null?void 0:_i.id)===at&&(Rn.current=null)}catch(Tn){if(!Fn($.queryKey)||(ho(),$e(),!tt))return;const Yr=Tn instanceof Error?Tn.message:String(Tn);if(!/session is busy/i.test(Yr)&&await nt.fetchQuery({...Ea(e),staleTime:0}).then(sr=>{var _c;return!!((_c=sr.find(pr=>pr.id===tt))!=null&&_c.busy)}).catch(()=>!1)){$s()&&(ne(sr=>sr===fr?"":sr),Se(sr=>sr===Ln?[]:sr),le(sr=>sr===_r?[]:sr));return}Re({type:"busy",sessionId:tt,busy:!1}),Re({type:"localError",sessionId:tt,text:Sae({error:Ne(Yr)})})}}async function Au(ie,be){const Ae=ue.current,Oe=F.current,Ue=await j.mutateAsync([e,ie.harness,{model:ie.model,serviceTier:ie.serviceTier,permissionMode:ie.permissionMode,planMode:be,reasoningLevel:ie.reasoningLevel}]);return F.current===Oe&&(q(zn=>[Ue,...zn.filter(jn=>jn.id!==Ue.id)]),nt.getQueryData($.queryKey)||ys(!0)),F.current===Oe&&ue.current===Ae&&(L.current(Ue.id,{replace:!0}),ue.current={...Ae,activeId:Ue.id}),Ue}function hi(){const ie=D8t(re);ne(ie),window.requestAnimationFrame(()=>{var be,Ae;(be=on.current)==null||be.focus(),(Ae=on.current)==null||Ae.setSelectionRange(ie.length,ie.length),On(ie.length)})}async function of(){const ie=os;if(!ie)return;if(Te(null),$n){Te(Tie());return}const be=re,Ae=ue.current;let Oe=I;const Ue=()=>{const Ln=ue.current;return Ln.projectId===Ae.projectId&&Ln.activeId===Oe&&Ln.mainView===Ae.mainView},zn=()=>{Ue()&&ne(Ln=>Ln||be)};ne(""),jt(!1);let jn=I;if(!jn){if(!(Ke!=null&&Ke.agentReady)||!en){zn(),Te(S2());return}try{const Ln=pA(Ht==null?void 0:Ht.planActivation,void 0,rt.current);jn=(await Au(en,Ln)).id,Oe=jn,Ue()&&Gt({})}catch(Ln){zn();const _r=Ln instanceof Error?Ln.message:String(Ln);Ue()&&Te(fE({error:Ne(_r)}));return}}Ue()&&Z==="archived"&&ce("active");const fr=`${Cd}shell-${Date.now()}`;Re({type:"localShell",sessionId:jn,id:fr,command:ie}),Ue()&&fi();try{const{message:Ln}=await Vft(jn,ie);Re({type:"upsertMessage",sessionId:jn,message:Ln})}catch(Ln){const _r=Ln instanceof Error?Ln.message:String(Ln);Re({type:"localShell",sessionId:jn,id:fr,command:ie,error:fE({error:Ne(_r)})})}}function lf(){I&&Xft(I).catch(()=>{Te(x_e())})}const x_=R.useCallback(async(ie,be)=>{if(!(!I||ln.current)){ln.current=!0,Te(null),Yn(ie);try{const Ae=Dxt({model:an.model,serviceTier:an.serviceTier,permissionMode:an.permissionMode,planMode:an.planMode,reasoningLevel:an.reasoningLevel}),Oe=I;(await Kft(Oe,ie,be,Ae)).turn.existing&&await ia(Oe),yn(b0)}catch{Te(xhe())}finally{ln.current=!1,Yn(null)}}},[I,an,ia]),w_=R.useCallback((ie,be)=>{if(!I||$n||!(Ke!=null&&Ke.agentReady))return;const Ae=I;Re({type:"busy",sessionId:Ae,busy:!0}),fi(),dr(()=>Qft(Ae,ie,be)).catch(Oe=>{Re({type:"busy",sessionId:Ae,busy:!1});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:Ae,text:jhe({error:Ne(Ue)})})})},[I,$n,Ke==null?void 0:Ke.agentReady,fi,dr]),lc=R.useCallback(ie=>{if(!I||$n)return;const be=I,Ae=cn.current;Re({type:"activeLeaf",sessionId:be,leafId:ie}),dr(()=>Yft(be,ie)).catch(Oe=>{Re({type:"activeLeaf",sessionId:be,leafId:Ae});const Ue=Oe instanceof Error?Oe.message:String(Oe);Re({type:"localError",sessionId:be,text:C_e({error:Ne(Ue)})})})},[I,$n,dr]);function cf(ie){if(!I)return;const be=I;Uft(be,ie).then(({removed:Ae})=>{if(Ae)return ia(be)}).catch(()=>Te(Che()))}async function uf(ie){if(!I||br)return;const be=I;Te(null),Xn(ie);try{await Gft(be,ie),await ia(be)}catch{Te(Ihe())}finally{Xn(null)}}R.useEffect(()=>{if(!$n||i!=="chat")return;function ie(be){var Ae;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),lf(),(Ae=on.current)==null||Ae.focus())}return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[$n,I,i]);function cc(ie){eb(ie),ue.current.projectId===e&&ue.current.activeId===ie&&ue.current.mainView==="chat"&&L.current(null,{replace:!0}),U(be=>{if(!be.has(ie))return be;const Ae=new Set(be);return Ae.delete(ie),Ae}),bt.current.delete(ie)}function uc(ie,be){const Ae=ie.archived;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:be}:Ue)),M.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,archived:Ae}:Ue))})}function df(ie,be){const Ae=ie.title;q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:be}:Ue)),O.mutateAsync([ie.id,be]).catch(()=>{q(Oe=>Oe.map(Ue=>Ue.id===ie.id?{...Ue,title:Ae}:Ue))})}async function S_(ie){var Ae;const be=((Ae=ie.title)==null?void 0:Ae.trim())||Ng();if(window.confirm(Qie({title:Oo(be)}))){try{await B.mutateAsync(ie.id)}catch(Oe){Qn(Jie({title:Oo(be),error:Ne(Oe instanceof Error?Oe.message:String(Oe))}),"error");return}cc(ie.id)}}const fo=R.useCallback(ie=>{if(!I)return Promise.resolve(!1);const be=I;return Re({type:"busy",sessionId:be,busy:!0}),dr(()=>Zft(be,ie)).then(()=>!0).catch(()=>!1).finally(()=>{Fn($.queryKey)&&(nt.fetchQuery({...Bl(be),staleTime:0}).catch(()=>{}),nt.fetchQuery({...Ea(e),staleTime:0}).catch(()=>{}))})},[I,e,dr,$]),dc=H.filter(ie=>U9t(Z,ie.archived)),ff=/Mac|iPhone|iPad/.test(navigator.platform),k_=ff?"⌘ ⇧ ↵":"Ctrl + Shift + ↵",Bs=ff?"⌘ Enter":"Ctrl + Enter",Dn=R.useCallback(()=>{ce("active"),w(null)},[w]),Ru=R.useCallback(ie=>{ce("all"),w(ie)},[w]);R.useEffect(()=>{const ie=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),Dn())};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[Dn]);const fc=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:pt-0 [&_.rail-body]:pb-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:"rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start hover:bg-surface [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":k_,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Dn,children:[f.jsx(tm,{size:15}),Zce()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[f.jsx($O,{size:15}),qle()]}),v8t.map(ie=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&ie.activeTabs.includes(i)?"active":""}`,"data-onboarding":ie.id==="compute"?"nav-compute":void 0,onClick:()=>a(ie.id),children:[ie.icon,ie.label()]},ie.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-0 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((ua=CF.find(ie=>ie.id===Z))==null?void 0:ua.railLabel())??ND()}),f.jsx("div",{className:"rail-section-actions flex items-center gap-0.5",children:f.jsx(G9t,{value:Z,onChange:ce})})]}),f.jsxs("div",{className:"rail-body",children:[dc.map(ie=>f.jsx(Q9t,{session:ie,active:ie.id===I&&i==="chat",unread:W.has(ie.id),busy:we.busySessions.has(ie.id),waiting:nc.has(ie.id),revealTitle:Rr.get(ie.id),onOpen:()=>{if(w(ie.id),e===z2){apt(ie.id);const be=Rut[ie.id];be&&(Vc({name:"demo_experiment_started",kind:"curated",experiment:be}),Vc({name:"first_action",surface:"demo",action:"open_experiment"}))}},onRename:be=>df(ie,be),onSetArchived:be=>uc(ie,be),onDelete:()=>void S_(ie)},ie.id)),dc.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:Z==="archived"?Hae():H.length>0?Dae():Wae()})]}),x.kind==="ssh"?f.jsx(fv,{runtime:x}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(Qt,{size:"small","aria-label":tL(),"aria-haspopup":"dialog",onClick:()=>G(!0),children:f.jsx(r3,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:l6()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ne(x.version)]})]})]})}),Y&&f.jsx(Y9t,{onClose:()=>G(!1),onConfigureSsh:()=>{G(!1),te(!0)}}),X&&f.jsx(ZP,{onClose:()=>{te(!1),G(!0)}})]}),ca="chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none",hf=!r&&f.jsx(Qt,{title:ME(),"aria-label":ME(),onClick:s,children:f.jsx(ZO,{size:20})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:"flex h-12 shrink-0 items-center",children:hf}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:E})]})]}):f.jsxs(f.Fragment,{children:[r&&fc,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0 mt-5",children:[f.jsxs("div",{className:r?"contents":"grid shrink-0 grid-cols-[2rem_minmax(0,1fr)_2rem] items-center",children:[hf,f.jsxs("div",{className:ca,children:[f.jsx(lp,{variant:"header",title:Nn?((Ia=Nn.title)==null?void 0:Ia.trim())||Ng():hE(),children:Nn?f.jsx(EF,{title:((hc=Nn.title)==null?void 0:hc.trim())||Ng(),animate:rc!==void 0},rc??"static"):hE()}),S&&f.jsx(Qt,{"data-tip":_E(),"aria-label":_E(),onClick:S,children:f.jsx(Dpt,{size:15})})]})]}),Zs?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-5 text-subtext",role:"alert",children:[f.jsx("p",{children:Zs.message}),f.jsx(Le,{onClick:()=>void Ze.refetch(),children:Gi()})]}):tc?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(It,{}),f.jsx("span",{children:Kce()})]}):Is?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:fn,tabIndex:0,role:"region","aria-label":((nl=Nn==null?void 0:Nn.title)==null?void 0:nl.trim())||Ng(),onScroll:ie=>{uo(ie.currentTarget),Ve.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Cn,children:[f.jsx(q9t,{scrollRef:fn,scrollToEndRef:tn,stickToBottom:nr,onPinToBottom:fi,messages:Es,allMessages:aa,canFork:y_,onFork:w_,onSelectFork:lc,busy:$n,onOpenFile:Jo,onOpenRun:l,onOpenSpawnedSession:Ru,runExperimentName:u,onOpenExperiment:_,experimentName:d,onRespond:fo,onOpenPlan:Os,onOpenSubagent:ic,recoveringTurnId:Vt,onRecover:x_,skills:ji},I),$n&&Ai&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Dfe()}),$n&&!Ai&&!Zl&&!Zo&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:M_e()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx($6,{})}),f.jsx("h2",{children:Bfe()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(Dd,{size:19}),f.jsx("span",{children:n})]}),sf&&f.jsx("div",{className:NA,role:"status","aria-live":"polite","aria-label":sfe(),"aria-busy":"true",children:EA.map((ie,be)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${Bw[be].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${Bw[be].icon}`,children:[f.jsx(ie,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),ac&&ac.length>0&&f.jsx("div",{className:NA,role:"group","aria-label":lfe(),children:ac.map((ie,be)=>{const Ae=EA[be],Oe=Bw[be];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Oe.box}`,onClick:()=>{Vc({name:"project_starter_clicked",slot:be+1}),Vc({name:"first_action",surface:ju,action:"starter_click"}),Tu(ie.prompt)},children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ae,{size:17,className:Oe.icon}),ie.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:ie.prompt})]},be)})})]}),Ve.action&&f.jsxs(Le,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Ve.action.x,top:Ve.action.top,transform:"translateX(-50%)"},onMouseDown:ie=>ie.preventDefault(),onClick:Ve.add,children:[f.jsx(XO,{size:14}),Doe()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[Is&&f.jsx(Qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${un?"opacity-0":"opacity-100"}`,title:OE(),"aria-label":OE(),inert:un,onClick:oc,children:$n&&!Ai?f.jsx(R6,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(gpt,{size:16})}),Mt&&!(co&&Mt.promptId===co.promptId)&&f.jsx(zCt,{synthesized:Mt.synthesized,agentLabel:Nn?E0[Nn.harness]:j_e(),showResumeModes:(Nn==null?void 0:Nn.harness)==="claude-code",onView:ie=>Os==null?void 0:Os(Mt.plan,Mt.promptId,ie),onApprove:ie=>fo({promptId:Mt.promptId,approve:!0,...ie?{resumeMode:ie}:{}}),onReject:()=>fo({promptId:Mt.promptId,approve:!1}),onRevise:ie=>{I&&lo({sessionId:I,promptId:Mt.promptId}),fo({promptId:Mt.promptId,approve:!1,note:ie})}}),Hr.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Hr.map((ie,be)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:ie.error?`${ie.text} -${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Opt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?jxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Gr,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(x8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(X8t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(hb,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Gr,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Gr,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&mA(be)===null?Rw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(E8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:S2(),"aria-label":S2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(Jmt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:S2()}),f.jsx(Gxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Imt,{size:16})}),Fr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(vmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Gr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Gr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:xD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx($gt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(z8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Gr,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():z4(),"aria-label":xs?AE():z4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const K9t=[],Q9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const NA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Y9t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:NA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:gat()})})});let m=null;for(const S of u)if(m=Dv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:NA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx(L9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})})})}function X9t({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:ND()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(ab,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(mb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Hmt,{size:13})})]})}const Z9t=/\.(md|mdx|markdown)$/i,J9t=/\.tex$/i,eEt=/\.html?$/i,tEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,nEt=/\.(csv|tsv|xlsx?|ods)$/i,rEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,sEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,iEt=/\.pdf$/i,aEt=/\.(docx?|log|rtf|txt)$/i;function oEt(e){return tEt.test(e)}function xk(e){return Z9t.test(e)}function zF(e){return J9t.test(e)}function lEt(e){return eEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":oEt(e)?"image":nEt.test(e)?"spreadsheet":rEt.test(e)?"code":sEt.test(e)?"archive":iEt.test(e)?"pdf":aEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(MD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(SD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(wD(),i,!0)]}),document.body)}const u5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),zA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function jA(){return{dirs:new Map,files:[]}}function MF(e){const n=jA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:zA}):f.jsx(Ta,{size:13,className:zA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(cEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:u5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Vr(S=>i(m,S));return f.jsxs("button",{type:"button",className:u5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function uEt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({...pv(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?rb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:pD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(X9t,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?zD({error:Ne(p)}):jD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function dEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({...pv(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(pv(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!oD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const U=new Set(r);U.has(W)?U.delete(W):U.add(W),i(U)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?out({branch:Ne(O.baselineBranch)}):u6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,H=O?Jct({branch:Ne(`${B}${$>0?"*":""}`)}):rut({branch:Ne(n.baselineBranch)}),q=O?O.branch:n.baselineBranch,Y=(W,U)=>O?a(W,e,void 0,U):a(W,void 0,n.baselineBranch,U),G=(S==null?void 0:S.root)==="worktree",X=async(W,U)=>{try{await adt(l,W,U,{sessionId:e}),N()}catch(Z){Qn(Z instanceof Error?Z.message:String(Z),"error")}},te=W=>{const U=(S==null?void 0:S.path)??n.repoPath;jF(U,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&q?rb(n.githubOwner,n.githubRepo,q):void 0,githubTitle:q?pD({branch:Ne(q)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Nut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?zD({error:Ne(v)}):jD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:but()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:dut()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Sut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,U)=>{y(AF(W,U))},onRename:(W,U)=>{E(null),X(W,{action:"rename",newName:U})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:put()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` +${ie.error}`:ie.text,children:[ie.dispatchState==="blocked"?f.jsx(I6,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(Ppt,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:ie.text}),ie.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:ie.dispatchState==="retrying"?Mxt(ie.nextRetryAt,La):uhe()}),ie.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void uf(ie.id),"aria-label":fY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:br===ie.id?sL():Gi()}),f.jsx("button",{onClick:()=>cf(ie.id),"aria-label":lY({text:ie.text}),disabled:br!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:ade()}),be===Jl&&becf(ie.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Gr,{size:11})})]},ie.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${xs?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ke&&!Ke.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ke.name," ",jce()]})," ",Ke.agentNote?nm(Ke.agentNote):ghe()]}),Da&&f.jsx(C8t,{skills:Cs,activeIndex:Kr,onPick:Xl,onHover:lt}),Q.length>0&&f.jsx(t9t,{annotations:Q,onClear:()=>{le([]),window.requestAnimationFrame(()=>{var ie;return(ie=on.current)==null?void 0:ie.focus()})},onRemove:ie=>{const be=Q.filter(Ae=>Ae.id!==ie);le(be),be.length===0&&window.requestAnimationFrame(()=>{var Ae;return(Ae=on.current)==null?void 0:Ae.focus()})}}),pe.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((ie,be)=>{const Ae=()=>Se(Oe=>Oe.filter((Ue,zn)=>zn!==be));return ie.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:ie.name,children:[f.jsx(fb,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:ie.name??"document.pdf"}),f.jsx("button",{title:zE(),"aria-label":zE(),onClick:Ae,children:f.jsx(Gr,{size:11})})]},be):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:ie.dataUrl,alt:Wfe()}),f.jsx("button",{title:jE(),"aria-label":jE(),onClick:Ae,children:f.jsx(Gr,{size:11})})]},be)})}),ye&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ye}),Ie&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${xs?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:on,className:"relative z-1 bg-transparent",value:re,placeholder:hr?q_e():us&&Ke?g_e({harness:Ne(E0[Ke.id]),shortcut:Ne(Bs)}):en?Ke!=null&&Ke.agentReady?bae({harness:Ne(E0[en.harness])}):pae({harness:Ne(E0[en.harness])}):uie(),rows:2,onPaste:Ra,onDragOver:ie=>{ie.dataTransfer.types.includes("Files")&&ie.preventDefault()},onDrop:ie=>{ie.dataTransfer.files.length!==0&&(ie.preventDefault(),zi(Array.from(ie.dataTransfer.files)))},onChange:ie=>{const be=ie.target.value,Ae=ie.target.selectionStart;On(Ae);const Oe=Ae>0&&/\s/.test(be[Ae-1])&&!hr&&!di.current&&gA(be)===null?Aw(be,Ae-1):null;if((Oe==null?void 0:Oe.query)==="plan"&&(Ht!=null&&Ht.planActivation)){yr(be,Oe);return}ne(be),jt(!1)},onSelect:ie=>On(ie.currentTarget.selectionStart),onCompositionStart:()=>{di.current=!0},onCompositionEnd:()=>{di.current=!1},onKeyDown:ie=>{if(Da){if(ie.key==="ArrowDown"||ie.key==="ArrowUp"){ie.preventDefault();const be=ie.key==="ArrowDown"?1:-1;lt((Kr+be+Cs.length)%Cs.length);return}if(ie.key==="Tab"||ie.key==="Enter"){ie.preventDefault(),Xl(Cs[Kr]);return}if(ie.key==="Escape"){ie.preventDefault(),jt(!0);return}}if(ie.key==="Backspace"&&ao(ie.currentTarget)){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing){if(ie.preventDefault(),xs){of();return}af({queue:ie.metaKey||ie.ctrlKey})}}}),f.jsx(T8t,{text:re,editingTokenEnd:gs==null?void 0:gs.end,isCommand:la,skills:ji,projectId:e,textareaRef:on})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:rr.ref,children:[f.jsx(Qt,{type:"button",className:"composer-bare",title:w2(),"aria-label":w2(),"aria-haspopup":"dialog","aria-expanded":rr.open,onClick:()=>rr.setOpen(ie=>!ie),children:f.jsx(rgt,{size:16})}),rr.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:w2()}),f.jsx(Qxt,{})]})]}),f.jsx("input",{ref:Ct,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:ie=>{zi(Array.from(ie.target.files??[])),ie.target.value=""}}),f.jsx(Qt,{type:"button",className:"composer-attach",title:mE(),"aria-label":mE(),onClick:()=>{var ie;return(ie=Ct.current)==null?void 0:ie.click()},children:f.jsx(Fmt,{size:16})}),Fr&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:SE(),"aria-label":SE(),onClick:()=>void cs(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(wmt,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Gr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:hue()})]}),xs&&f.jsxs(Le,{type:"button",variant:"ghost",active:!0,className:"group",title:wE(),"aria-label":wE(),onClick:hi,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(c_,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Gr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:wD()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(qgt,{value:en,onSelect:Xs,permissionChoices:Ke!=null&&Ke.agentReady?(Ht==null?void 0:Ht.permissionModes)??[]:[],defaultPermissionId:(Ht==null?void 0:Ht.defaultPermissionMode)??null,onSelectPermission:ls,reasoningChoices:Ke!=null&&Ke.agentReady?vs.choices:[],defaultReasoningId:vs.defaultId,onSelectReasoning:Ls,lockHarness:!!Jt}),f.jsx(R8t,{usage:Jt==null?void 0:Jt.contextUsage})]}),$n&&!hr?f.jsx(Qt,{className:"send-btn",variant:"stop",title:DE(),"aria-label":DE(),onClick:lf,children:f.jsx(Gr,{size:16})}):f.jsx(Qt,{className:"send-btn",variant:"primary",title:xs?AE():N4(),"aria-label":xs?AE():N4(),onClick:()=>void(xs?of():af()),disabled:xs?!os||!I&&!(Ke!=null&&Ke.agentReady):!(Ke!=null&&Ke.agentReady)||!re.trim()&&pe.length===0&&Q.length===0,children:f.jsx(GO,{size:16})})]})]})]})]})]})}const Z9t=[],J9t=[];function Fa({className:e,...n}){return f.jsx("div",{className:Ds("relative flex min-h-0 flex-1 flex-col",e),...n})}function mh({className:e,...n}){return f.jsx("div",{className:Ds("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function Mo({className:e,...n}){return f.jsx("div",{className:Ds("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const zA=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function eEt({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){var x;const l=ct(Bl(e)),u=((x=l.data)==null?void 0:x.messages)??(l.isError?[]:null),_=R.useRef(null),d=R.useRef(null),p=R.useRef(!0);if(R.useLayoutEffect(()=>{p.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),R.useLayoutEffect(()=>{const S=_.current;S&&p.current&&(S.scrollTop=S.scrollHeight)},[u]),R.useEffect(()=>{const S=_.current,v=d.current;if(!S||!v)return;const b=new ResizeObserver(()=>{p.current&&(S.scrollTop=S.scrollHeight)});return b.observe(v),b.observe(S),()=>b.disconnect()},[u===null]),u===null)return f.jsx(Fa,{children:f.jsx("div",{className:zA,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:xat()})})});let m=null;for(const S of u)if(m=Mv(S.parts,n),m)break;return f.jsx(Fa,{children:f.jsx("div",{className:zA,ref:_,onScroll:S=>{const v=S.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:f.jsx("div",{ref:d,children:m?f.jsx($9t,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:Cat()})})})})}function tEt({experiment:e}){var s;const n=ct(mI(e.id)),t=n.data,r=(s=n.error)==null?void 0:s.message;return f.jsx(mh,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:r&&!t?f.jsxs(Mo,{children:[Dse()," ",Ne(r)]}):t?t.diff.trim()?f.jsxs(f.Fragment,{children:[t.truncated&&f.jsx(gB,{bytesRead:t.bytesRead,byteLimit:t.byteLimit}),f.jsx(bB,{diff:t.diff,partial:t.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?Hse():Tse()}):f.jsx(Mo,{children:Bse()})})}function NF({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:l}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":E0e(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:T0e()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:zD()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(em,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(ib,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:f.jsx(pb,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(Qt,{title:$E(),"aria-label":$E(),onClick:l,children:o?f.jsx(It,{}):f.jsx(Wmt,{size:13})})]})}const nEt=/\.(md|mdx|markdown)$/i,rEt=/\.tex$/i,sEt=/\.html?$/i,iEt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,aEt=/\.(csv|tsv|xlsx?|ods)$/i,oEt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,lEt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,cEt=/\.pdf$/i,uEt=/\.(docx?|log|rtf|txt)$/i;function dEt(e){return iEt.test(e)}function xk(e){return nEt.test(e)}function zF(e){return rEt.test(e)}function fEt(e){return sEt.test(e)}function Jh({name:e}){const n=xk(e)?"markdown":dEt(e)?"image":aEt.test(e)?"spreadsheet":oEt.test(e)?"code":lEt.test(e)?"archive":cEt.test(e)?"pdf":uEt.test(e)||zF(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function jF(e,n){const t=navigator.clipboard;if(!t){Qn(DD(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Qn(tp(),"success")).catch(r=>Qn(r instanceof Error?r.message:String(r),"error"))}function TF({name:e,onCommit:n,onCancel:t}){const[r,s]=R.useState(e),i=R.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(Wr,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Pbe({path:Ne(e)}),onFocus:o=>{const l=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,l>0?l:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function AF(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function RF({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=R.useRef(null),l=R.useRef(a);l.current=a;const[u,_]=R.useState({x:e.x,y:e.y});R.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),R.useEffect(()=>{const m=()=>l.current(),x=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||l.current()},S=v=>{if(v.key==="Tab"){v.preventDefault(),l.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),l.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const d=m=>{l.current(),m()},p=(m,x,S=!1)=>f.jsx(or,{size:"compact",role:"menuitem",danger:S,onClick:()=>d(x),children:f.jsx("span",{children:m})});return ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Rbe({path:Ne(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var b,w;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),v=m.key==="ArrowDown"?1:-1;(w=x[(S+v+x.length)%x.length])==null||w.focus()},children:[p(Obe(),n),t&&p(kD(),t),r&&p(zbe(),r),p(Sre(),s),i&&p(SD(),i,!0)]}),document.body)}const u5=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),jA=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function TA(){return{dirs:new Map,files:[]}}function MF(e){const n=TA();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?f.jsx(Uo,{size:13,className:jA}):f.jsx(Ta,{size:13,className:jA}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&f.jsx(wk,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:l,onRename:u,onCancelRename:_})]})}function wk({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),d=[...e.files].sort((p,m)=>p.localeCompare(m));return f.jsxs(f.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return f.jsx(hEt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:l,onCancelRename:u},`d:${m}`)}),d.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&l&&u)return f.jsxs("div",{className:u5,style:{paddingInlineStart:8+t*14},children:[f.jsx(Jh,{name:p}),f.jsx(TF,{name:p,onCommit:S=>l(m,S),onCancel:u})]},`f:${m}`);const x=Vr(S=>i(m,S));return f.jsxs("button",{type:"button",className:u5,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:mQ({name:Ne(m)}),children:[f.jsx(Jh,{name:p}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function _Et({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){var E,N;const l=t.branchName,u=ct({...vI(e,{ref:l}),enabled:r==="files",subscribed:r==="files"}),_=ct({..._v(t.chatSessionId??""),enabled:r==="files"&&!!t.chatSessionId,subscribed:r==="files"&&!!t.chatSessionId}),d=u.data,p=(E=u.error)==null?void 0:E.message,m=u.isFetching,x=mI(t.id),S=FG({queryKey:x.queryKey})>0,v=(N=_.data)!=null&&N.exists&&_.data.branch===l?t.chatSessionId??void 0:void 0,b=()=>{u.refetch()},w=R.useMemo(()=>d?MF(d.entries):null,[d]),y=r==="files"?m:S,C=R.useCallback(T=>{const j=new Set(s);j.has(T)?j.delete(T):j.add(T),a(j)},[s,a]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(NF,{view:r,onViewChange:i,branchLabel:l,branchTitle:`Committed branch ${l}`,githubHref:n.githubEnabled?nb(n.githubOwner,n.githubRepo,l):void 0,githubTitle:mD({branch:Ne(l)}),refreshing:y,onRefresh:()=>r==="files"?b():void nt.invalidateQueries(x)}),r==="changes"?f.jsx(tEt,{experiment:t},t.id):f.jsxs(f.Fragment,{children:[(d==null?void 0:d.truncated)&&f.jsx(Mo,{children:I0e()}),p&&w&&f.jsxs(Mo,{children:[G0e()," ",Ne(p)]}),f.jsx(mh,{children:w?w.dirs.size===0&&w.files.length===0?f.jsx(Mo,{children:F0e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:w,parentPath:"",depth:0,toggled:s,onToggle:C,onOpenFile:(T,j)=>v?o(T,v,void 0,j):o(T,void 0,l,j)})}):f.jsx(Mo,{children:p?jD({error:Ne(p)}):TD()})})]})]})}function Sk({icon:e,title:n,description:t}){return f.jsxs("div",{className:"flex h-full w-full min-w-0 flex-1 flex-col items-center justify-center gap-1.5 bg-background p-6 text-center text-muted",children:[f.jsx(e,{size:36,strokeWidth:1.5,className:"shrink-0"}),f.jsx("h3",{className:"mt-1.5 mb-0 max-w-full wrap-anywhere text-xl font-medium text-text",children:n}),t&&f.jsx("p",{className:"m-0 w-full max-w-105 wrap-anywhere text-base leading-[1.55] text-subtext",children:t})]})}function pEt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var I,L,F;const l=n.id,_=((I=ct(Ea(l)).data)==null?void 0:I.some(W=>W.id===e&&W.busy))??!1,d=ct({..._v(e??""),enabled:!!e,refetchInterval:_?5e3:!1}),p=d.data,m=e&&(p!=null&&p.exists)?{sessionId:e}:{ref:n.baselineBranch},x=ct({...vI(l,m),enabled:!e||d.isSuccess,refetchInterval:_?5e3:!1}),S=x.data,v=(L=d.error??x.error)==null?void 0:L.message,b=d.isFetching||x.isFetching,[w,y]=R.useState(null),[C,E]=R.useState(null),N=R.useCallback(()=>{e&&nt.invalidateQueries(_v(e)),nt.invalidateQueries({queryKey:zt("getCodeTree",l),predicate:W=>!lD(W)})},[e,l]),T=R.useRef(_);R.useEffect(()=>{T.current&&!_&&N(),T.current=_},[_,N]);const j=R.useMemo(()=>S?MF(S.entries):null,[S]),M=R.useCallback(W=>{const U=new Set(r);U.has(W)?U.delete(W):U.add(W),i(U)},[r,i]),O=e&&(p!=null&&p.exists)?p:null,B=(O==null?void 0:O.branch)??(O!=null&&O.baselineBranch?dut({branch:Ne(O.baselineBranch)}):u6()),$=((F=O==null?void 0:O.files)==null?void 0:F.length)??0,H=O?rut({branch:Ne(`${B}${$>0?"*":""}`)}):out({branch:Ne(n.baselineBranch)}),q=O?O.branch:n.baselineBranch,Y=(W,U)=>O?a(W,e,void 0,U):a(W,void 0,n.baselineBranch,U),G=(S==null?void 0:S.root)==="worktree",X=async(W,U)=>{try{await udt(l,W,U,{sessionId:e}),N()}catch(Z){Qn(Z instanceof Error?Z.message:String(Z),"error")}},te=W=>{const U=(S==null?void 0:S.path)??n.repoPath;jF(U,W)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(NF,{view:O?t:"files",onViewChange:s,showViewToggle:!!O,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&q?nb(n.githubOwner,n.githubRepo,q):void 0,githubTitle:q?mD({branch:Ne(q)}):void 0,refreshing:b,onRefresh:N}),v&&(p||S)&&f.jsxs(Mo,{children:[Aut()," ",Ne(v)]}),!S||e&&!p?f.jsx(mh,{children:f.jsx(Mo,{children:v?jD({error:Ne(v)}):TD()})}):O&&t==="changes"?f.jsx(mh,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!O.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:Sut()}):f.jsxs(f.Fragment,{children:[O.diff.truncated&&f.jsx(gB,{bytesRead:O.diff.bytesRead,byteLimit:O.diff.byteLimit}),f.jsx(bB,{diff:O.diff.diff,partial:O.diff.truncated})]})}):f.jsxs(mh,{children:[S.truncated&&f.jsx(Mo,{children:put()}),j?j.dirs.size===0&&j.files.length===0?f.jsx(Sk,{icon:Dd,title:Nut(),description:Q2e()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(wk,{node:j,parentPath:"",depth:0,toggled:r,onToggle:M,onOpenFile:Y,renamingPath:C,onContextMenu:(W,U)=>{y(AF(W,U))},onRename:(W,U)=>{E(null),X(W,{action:"rename",newName:U})},onCancelRename:()=>E(null)})}):f.jsx(Mo,{children:but()})]}),w&&f.jsx(RF,{target:w,onOpen:()=>Y(w.path,"keepOpen"),onRename:G&&o(w.path)?()=>E(w.path):void 0,onDuplicate:G?()=>void X(w.path,{action:"duplicate"}):void 0,onCopyPath:()=>te(w.path),onDelete:G?()=>{window.confirm(kbe({path:Ne(w.path)}))&&X(w.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function DF({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=R.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` `),d=FP(_,AS(n));return _.endsWith(` -`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Tv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Tv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function TA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[FD()," ",Ne(n)]})]})}function d5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(TA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(TA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[FD()," ",t]})})]})}const fEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...fEt(e),enabled:n,subscribed:n}).data??null}function hEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function _Et(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function pEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,mEt=8,gEt=280;function vEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return gEt}function bEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(hEt(i))return i;const a=_Et(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(v5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(pEt(t))})})}function yEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function xEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function wEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=yEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=xEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(d5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?DD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",bD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?rv():rh(),"data-tip-align":"end","aria-label":d?rv():rh(),onClick:()=>p(b=>!b),children:f.jsx(t3,{size:13})}),f.jsx(ab,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(t6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,mEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(t6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function SEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>bEt(e.id)),[l,u]=R.useState(vEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const H=Math.round($.clientX-((T==null?void 0:T.left)??0)),q=Math.min(Math.max(H,$F),PF);u(q);try{localStorage.setItem(IF,String(q))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),lft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await cft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(wEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Rmt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(t6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",kEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",CEt="text-sm font-normal text-text",EEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function NEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:nst()})]}):f.jsxs(f.Fragment,{children:[f.jsx(rgt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function zEt({skill:e,onError:n}){const t=mn({mutationFn:Aft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:CEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?Ynt():krt(),"data-tip-align":"end","aria-label":e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?ert({name:Ne(e.name)}):dnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function jEt({template:e,onError:n}){const t=mn({mutationFn:zft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:kEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:EEt,children:[e.entry,s>0&&(s===1?Hnt():lrt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":zrt(),"data-tip-align":"end","aria-label":Snt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(bnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function TEt(){var w;const e=mn({mutationFn:Tft}),n=ct(ght()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!NEt(y.name)){x(ust());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:Zrt()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Nnt()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Ant()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:ont()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[frt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Ort()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Urt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(zEt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function AEt(){var _;const e=mn({mutationFn:Nft}),n=ct(mht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(_st());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Rrt()}),f.jsx("p",{className:GF,children:ast()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Mat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(jEt,{template:d,onError:o},d.name))})]})}function REt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:yrt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Wnt()}),f.jsx(TEt,{}),f.jsx(AEt,{})]})}const MEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?MEt:""}`,onClick:i,onDoubleClick:a,title:s?jat({label:n}):n,"aria-label":s?Cat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Gr,{size:12})})]})}const AA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function DEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:AA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:AA,href:rb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:tv({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(mb,{size:12})]})}const Pw=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),RA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function MA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function DA(e,n){return np((e.endedAt??n)-e.createdAt)}function LEt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Vr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Vr(i),children:[f.jsx(pb,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:Pw,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(xpt,{size:13}),MA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Dpt,{size:13}),DA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(cmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:RA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:Pw,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(DEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:MA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:RA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Pw,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Vr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:DA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function LA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await Jut(e,a);if(i)return;if(d.dataBase64&&r.write(LA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=kht(e,d=>{if(i)return;const p=LA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function IEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx(LEt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(BEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function BEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():AD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(OEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let f5=!1;function OA(e){f5=!0;try{return window.confirm(e)}finally{f5=!1}}const h5=e=>e.replace(/\r\n/g,` -`),IA=(e,n,t)=>{const r=h5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r -`),conflict:null}},Cl=e=>e.draft!==e.baseline,$Et=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),PEt=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function FEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class HEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function qEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...Jgt(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),H=R.useRef(o);H.current=o;const q=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(q.current)return;Y.current=n,q.current=!0,m(!0);const L=H.current;T(null),b(null),E(null),cdt(e,n,{sessionId:t}).then(F=>{var U,Z;const W=F.pdfPath;if(F.ok&&W){S(ce=>({path:W,version:((ce==null?void 0:ce.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((U=F.log)==null?void 0:U.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((Z=F.log)==null?void 0:Z.trim())||S3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{q.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const UEt=3e4,GEt=3e4,WEt=5*6e4;function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>t1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ue=>ue&&{...ue,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const H=R.useRef(!1),q=R.useRef(l);q.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||H.current||Y.current?!1:(H.current=!0,C(!0),j(null),bdt(e,n,{sessionId:t,resolve:oe}).then(ue=>{G.current=!1,N(ue),ue.pulled.includes(n)&&(Y.current?O(!0):q.current(ue.pulled))}).catch(ue=>{G.current=!0,N(null),j(ue instanceof Error?ue.message:String(ue))}).finally(()=>{H.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;te.current!==oe&&X()&&(te.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),U=R.useRef(Promise.resolve()),Z=R.useRef(!1);Z.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const ce=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let oe=!1;const ue=()=>{const Se=ce.current;ce.current=!1,!(!Se&&Z.current)&&(U.current=U.current.then(()=>{if(!oe)return _dt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ue();const pe=setInterval(ue,GEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),U.current=U.current.then(()=>pdt(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>zht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):q.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{H.current||G.current||nt.fetchQuery({...n1t(e,n,{sessionId:t}),staleTime:0}).then(ue=>{ue.remoteChanged&&X()}).catch(ue=>{G.current=!0,j(ue instanceof Error?ue.message:String(ue))})},UEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,WEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{ce.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:xdt(e,n,{sessionId:t}),saveToken:async oe=>{const ue=await BL(oe);te.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ue.hasToken})},saveSession:async oe=>{const ue=await $L(oe,{host:m==null?void 0:m.host});B(ue.hasSession),ce.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await hdt({host:m==null?void 0:m.host});return B(oe.hasSession),ce.current=!0,w(ue=>ue+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,te.current=null,$(await gdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await vdt(e,n,{sessionId:t})),te.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function BA(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function KEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const $A=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],QEt=4e6,YEt=200,PA=16e6,XEt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),FA=e=>e.startsWith("//")?`https:${e}`:e;async function ZEt(e,n){var s;let t=QEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=YEt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await XEt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function JEt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll($A.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of $A){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,FA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await ZEt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",FA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function eNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${PA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>PA}}function tNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),eNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await JEt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",LD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function nNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?A4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(A4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Bpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Gr,{size:13})})}),f.jsx(oNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function rNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function sNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function iNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function HA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Wr,{className:"basis-full min-w-0","aria-label":T4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:T4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function aNt({overleaf:e}){if(!e.hasSession)return f.jsx(HA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:iNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(HA,{overleaf:e,replacing:!0})]})}function oNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?A4():rNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(aNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:p6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Wr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(sNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function lNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(fb,{size:13})})]})}function cNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Pr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",H=t==="abs",q=xk(n),Y=zF(n),G=lEt(n),X=q||G,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),U=S.set,Z=S.saving,ce=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ue=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=BA(Se,Ve,H))==null?void 0:xt.path)??null},[H,Se]),Ie=R.useCallback(Ve=>H?sdt(Ve):ye?Fh(e,Ve):BN(e,Ve,{sessionId:r,ref:s}),[ye,s,H,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=BA(Se,Ve,H);return xt?KEt(Ie(xt.path),xt):null},[H,Se,Ie]),vt=LF(ue==null?void 0:ue.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ue!=null&&!ue.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ue!=null&&!ue.binary&&!ue.truncated&&!vt&&!mt,ut=rt&&ue.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ue.version=="string"||Ct),Re=(W==null?void 0:W.draft)??h5((ue==null?void 0:ue.content)??""),Ze=(W==null?void 0:W.baseline)??h5((ue==null?void 0:ue.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=PEt(xt);ce(!0),Q(null);try{await nt.cancelQueries(E);const jt=await idt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof L4){const xn=S.getSnapshot();return!xn||!Cl(xn)||U({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{ce(!1)}},Zt=Y&&Ft&&!mt,We=qEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,ready:ue!=null&&!ue.notFound,source:we?Re:(ue==null?void 0:ue.content)??""}),Gt=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${BN(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await odt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{U(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!Z);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=FEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?U({...xt,conflict:On}):!On&&xt.conflict&&U({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(U(IA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,Z,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&r1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ue||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ue]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(Z||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(Z?Ei():I2e()),children:Z?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():OD()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(t3,{size:13}):f.jsx(hb,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(ab,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Upt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(nNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Qpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?rv():rh(),"data-tip-align":"end","aria-label":y?rv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(t3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ue!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Gr,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(lNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ue===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ue===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:LD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ue&&typeof ue.version=="string"?IA(ue.path,ue.content,ue.version):null);xt&&U($Et(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{f5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ue.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(d5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ue.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:DD()})]}):an&&ln&&cn?f.jsx(d5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):q&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ue.content,entries:x}):f.jsx(Fo,{text:ue.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(tNt,{html:ue.content,truncated:ue.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ue.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ue.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const Fw=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function uNt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:Fw,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:Fw,children:[f.jsx(hmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:Fw,children:[f.jsx(tmt,{size:14}),a4e()]})})]})]})})}function dNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:_b,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Vr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Vr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:_D({branch:Ne(x.branchName)}),...Vr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(pb,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():AD()]})]})]},x.id)})})]})}function fNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(dot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Fat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Gr,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Qat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:bot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[pot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:oot()}),Iat()]}),f.jsx("p",{dir:"auto",children:rot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Gat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():Jat()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function sy(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}I1.prototype=sy.prototype={constructor:I1,on:function(e,n){var t=this._,r=_Nt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),UA.hasOwnProperty(n)?{space:UA[n],local:e}:e}function mNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===_5&&n.documentElement.namespaceURI===_5?n.createElement(e):n.createElementNS(t,e)}}function gNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=iy(e);return(n.local?gNt:mNt)(n)}function vNt(){}function kk(e){return e==null?vNt:function(){return this.querySelector(e)}}function bNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function UNt(e){e||(e=GNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function WNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VNt(){return Array.from(this)}function KNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?izt:typeof n=="function"?ozt:azt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function czt(e){return function(){delete this[e]}}function uzt(e,n){return function(){this[e]=n}}function dzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function fzt(e,n){return arguments.length>1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Pzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function p5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}p5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yzt(e){return!e.ctrlKey&&!e.button}function Xzt(){return this.parentNode}function Zzt(e,n){return n??{x:e.x,y:e.y}}function Jzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=Yzt,n=Xzt,t=Zzt,r=Jzt,s={},i=sy("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Qzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Hw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=tjt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=njt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=rjt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=sjt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ijt.exec(e))?XA(n[1],n[2]/100,n[3]/100,1):(n=ajt.exec(e))?XA(n[1],n[2]/100,n[3]/100,n[4]):GA.hasOwnProperty(e)?KA(GA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function KA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function cjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function m5(e,n,t,r){return arguments.length===1?cjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,m5,dH(_m,{brighter(e){return e=e==null?Ov:Math.pow(Ov,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Iv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QA,formatHex:QA,formatHex8:ujt,formatRgb:YA,toString:YA}));function QA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function ujt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function YA(){const e=Iv(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Iv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function XA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function djt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,djt,dH(_m,{brighter(e){return e=e==null?Ov:Math.pow(Ov,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(qw(e>=240?e-240:e+120,s,r),qw(e,s,r),qw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(ZA(this.h),l1(this.s),l1(this.l),Iv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Iv(this.opacity);return`${e===1?"hsl(":"hsla("}${ZA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function qw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function fjt(e,n){return function(t){return e+t*n}}function hjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function _jt(e){return(e=+e)==1?hH:function(n,t){return t-n?hjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?fjt(e,t):Nk(isNaN(e)?n:e)}const Bv=(function e(n){var t=_jt(n);function r(s,i){var a=t((s=m5(s)).r,(i=m5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function pjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=Uw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function tR(){Fd=(Pv=Ep.now())+ay,t_=z0=0;try{Tjt()}finally{t_=0,Rjt(),Fd=0}}function Ajt(){var e=Ep.now(),n=e-Pv;n>gH&&(ay-=n,Pv=e)}function Rjt(){for(var e,n=$v,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:$v=t);j0=e,b5(r)}function b5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(tR,e-Ep.now()-ay)),y0&&(y0=clearInterval(y0))):(y0||(Pv=Ep.now(),y0=setInterval(Ajt,gH)),t_=1,vH(tR))}}function nR(e,n,t){var r=new Fv;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Mjt=sy("start","end","cancel","interrupt"),Djt=[],yH=0,rR=1,y5=2,$1=3,sR=4,x5=5,P1=6;function oy(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;Ljt(e,t,{name:n,index:r,group:s,on:Mjt,tween:Djt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>$1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Ljt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=rR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==rR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===$1)return nR(a);m.state===sR?(m.state=P1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_y5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function dTt(e,n,t){var r,s,i=uTt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function fTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(dTt(t,e,n))}function hTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function _Tt(){return this.on("end.remove",hTt(this._id))}function pTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function PTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ly=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ly;return e.__zoom}function Gw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function FTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iR(){return this.__zoom||ly}function qTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function GTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=FTt,n=HTt,t=GTt,r=qTt,s=UTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=B1,u=sy("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(q){q.property("__zoom",iR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,Y,G,X){var te=q.selection?q.selection():q;te.property("__zoom",iR),q!==te?E(q,Y,G,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(q,Y,G,X){b.scaleTo(q,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},G,X)},b.scaleTo=function(q,Y,G,X){b.transform(q,function(){var te=n.apply(this,arguments),I=this.__zoom,L=G==null?C(te):typeof G=="function"?G.apply(this,arguments):G,F=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,F),te,a)},G,X)},b.translateBy=function(q,Y,G,X){b.transform(q,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(q,Y,G,X,te){b.transform(q,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(ly.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,te)};function w(q,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===q.k?q:new Ol(Y,q.x,q.y)}function y(q,Y,G){var X=Y[0]-G[0]*q.k,te=Y[1]-G[1]*q.k;return X===q.x&&te===q.y?q:new Ol(q.k,X,te)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function E(q,Y,G,X){q.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),W=G==null?C(F):typeof G=="function"?G.apply(te,I):G,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=te.__zoom,ce=typeof Y=="function"?Y.apply(te,I):Y,re=l(Z.invert(W).concat(U/Z.k),ce.invert(W).concat(U/ce.k));return function(ne){if(ne===1)ne=ce;else{var Q=re(ne),le=U/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(q,Y,G){return!G&&q.__zooming||new T(q,Y)}function T(q,Y){this.that=q,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,Y),this.taps=0}T.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Y){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Y=Hi(this.that).datum();u.call(q,this.that,new PTt(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(q,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(q),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(q);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===te)return;G.mouse=[I,X.invert(I)],F1(this),G.start()}x0(q),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,te),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(q,...Y){if(p||!e.apply(this,arguments))return;var G=q.currentTarget,X=N(this,Y,!0).event(q),te=Hi(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",U,!0),I=Ua(q,G),L=q.clientX,F=q.clientY;lH(q.view),Gw(q),X.mouse=[I,this.__zoom.invert(I)],F1(this),X.start();function W(Z){if(x0(Z),!X.moved){var ce=Z.clientX-L,re=Z.clientY-F;X.moved=ce*ce+re*re>S}X.event(Z).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(Z,G),X.mouse[1]),X.extent,a))}function U(Z){te.on("mousemove.zoom mouseup.zoom",null),cH(Z.view,X.moved),x0(Z),X.event(Z).end()}}function O(q,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(q.changedTouches?q.changedTouches[0]:q,this),te=G.invert(X),I=G.k*(q.shiftKey?.5:2),L=t(y(w(G,I),X,te),n.apply(this,Y),a);x0(q),o>0?Hi(this).transition().duration(o).call(E,L,X,q):Hi(this).call(b.transform,L,X,q)}}function B(q,...Y){if(e.apply(this,arguments)){var G=q.touches,X=G.length,te=N(this,Y,q.changedTouches.length===X).event(q),I,L,F,W;for(Gw(q),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Hv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Hv||(Hv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const aR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,WTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},VTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?qv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return cy(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return uy(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=cy(t,qv(s)),r=!0)}),r?uy(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},KTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function QTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function YTt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=QTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function XTt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=KTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const oR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=oR(e.x,r,n.width-r)*t,i=oR(e.y,r,n.height-r)*t;return[s,i]},cy=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),w5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),uy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},qv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>uy(cy(w5(e),w5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},Uv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),lR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ZTt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function JTt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=ZTt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=JTt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function cR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function eAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function tAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},nAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:nAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},uR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=dR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=dR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const iAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,aAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),oAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||iAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},aAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const fR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},lAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function cAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=fR[n],l=fR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=lAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const q=Math.abs(e[p]-t[p]);if(q<=i){const Y=Math.min(i-1,i-q);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const q=p==="x"?"y":"x",Y=o[p]===l[q],G=u[q]>_[q],X=u[q]<_[q];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),H=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=H?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function uAt(e,n,t,r){const s=Math.min(hR(e,n)/2,hR(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function k5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function fAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=k5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,hAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_At={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function pAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function mAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function C5(e,n,t,r={}){var _,d;const s=Ik(_At,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:mAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function gAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*hAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=vAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function vAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function yAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function gR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;gR("source",l,_,e,s,a),gR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function vR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function xAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Ww({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function wAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function SAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:H}){const{nodeLookup:q,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:W}=n();i={x:$,y:H};let U=!1;const Z=o.size>1,ce=Z&&Y?w5(mm(o)):null,re=Z&&X?wAt({dragItems:o,snapGrid:G,x:$,y:H}):null;for(const[ne,Q]of o){if(!q.has(ne))continue;let le={x:$-Q.distance.x,y:H-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(Z&&Y&&!Q.extent&&ce){const{positionAbsolute:Se}=Q.internals,ye=Se.x-ce.x+Y[0][0],qe=Se.x+Q.measured.width-ce.x2+Y[1][0],Ie=Se.y-ce.y+Y[0][1],Te=Se.y+Q.measured.height-ce.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ue,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:q,nodeExtent:oe||Y,nodeOrigin:te,onError:F});U=U||Q.position.x!==ue.x||Q.position.y!==ue.y,Q.position=ue,Q.internals.positionAbsolute=pe}if(x=x||U,!!U&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Ww({nodeId:N,dragItems:o,nodeLookup:q});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:H,autoPanSpeed:q,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,q);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await H({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var Z;const{nodeLookup:H,multiSelectionActive:q,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!q&&N&&((Z=H.get(N))!=null&&Z.selected||W()),E&&I&&N&&(e==null||e(N));const U=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=U,o=xAt(H,Y,U,N),o.size>0&&(t||L||!N&&F)){const[ce,re]=Ww({nodeId:N,dragItems:o,nodeLookup:H});t==null||t($.sourceEvent,o,ce,re),L==null||L($.sourceEvent,ce,re),N||F==null||F($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:H,nodeDragThreshold:q,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,q===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:q,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&H&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,W=L.y-u.y;Math.sqrt(F*F+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:H,updateNodePositions:q,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(q(o,!1),x=!1),s||Y||!N&&G){const[X,te]=Ww({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||G==null||G($.sourceEvent,te)}}}).filter($=>{const H=$.target;return!$.button&&(!w||!vR(H,`.${w}`,C))&&(!y||vR(H,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function kAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Uv(s,jp(i))>0&&r.push(i);return r}const CAt=250;function EAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=kAt(e,t,n+CAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function NAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function zAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:H}=Za(e),q=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!q)return;const X=QH(s,q,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,W=null;function U(){if(!_||!Y)return;const[ue,pe]=Mk(te,Y,N);p({x:ue,y:pe}),O=requestAnimationFrame(U)}const Z={...X,nodeId:s,type:q,position:X.position},ce=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(ce,Z,Nt.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ce,to:te,toHandle:null,toPosition:aR[Z.position],toNode:null,pointer:te};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:q})}T===0&&Q();function le(ue){if(!G){const{x:Te,y:vt}=Za(ue),Dt=Te-$,Ut=vt-H;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!Z){oe(ue);return}const pe=C();te=Za(ue,Y),B=EAt(vm(te,pe,!1,[1,1]),t,l,Z),I||(U(),I=!0);const Se=ZH(ue,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,F=NAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,Z,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:aR[Z.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function oe(ue){if(!("touches"in ue&&ue.touches.length>0)){if(G){(B||W)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ue,ye),i&&(w==null||w(ue,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const E5={onPointerDown:zAt,isValid:ZH};function jAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const dy=e=>({x:e.x,y:e.y,zoom:e.k}),Vw=({x:e,y:n,zoom:t})=>ly.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),TAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Kw=(e,n=0,t=TAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function AAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=dy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function RAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function MAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=dy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function DAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,dy(i.transform)))}}function LAt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=dy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function OAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function IAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).transform(Kw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:q,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:W,zoomActivationKeyPressed:U,lib:Z,onTransformChange:ce,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){q&&!u.isZoomingOrPanning&&b();const le=Y&&!U&&!q;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?AAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):RAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ue=MAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ue);const pe=DAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:ce});d.on("zoom",pe);const Se=LAt({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=OAt({zoomActivationKeyPressed:U,panOnDrag:G,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:q,noPanClassName:$,noWheelClassName:B,lib:Z,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,H){const q=Vw(B),Y=d==null?void 0:d.constrain()(q,$,H);return Y&&await S(Y),Y}async function y(B,$){const H=Vw(B);return await S(H,$),H}function C(B){if(p){const $=Vw(B),H=p.property("__zoom");(H.k!==B.zoom||H.x!==B.x||H.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleTo(Kw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}async function T(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:B1).scaleBy(Kw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function BAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function bR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function yR(e,n){return e?!n:n}function $At(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,H=-i[1]*N;let q=f1(O,S,v),Y=f1(B,b,w);if(a){let te=0,I=0;l&&j<0?te=Hc(y+j+$,a[0][0]):!l&&j>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+H,a[0][1]):!u&&M>0&&(I=qc(C+B+H,a[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&j>0?te=qc(y+j,o[0][0]):!l&&j<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(s){if(_){const te=f1(O/T,b,w)*T;if(q=Math.max(q,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+H+O/T,a[1][1])*T:I=Hc(C+H+(l?j:-j)/T,a[0][1])*T,q=Math.max(q,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,q=Math.max(q,I)}}if(d){const te=f1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?q:-q),s&&(p?O>B*T?M=(yR(l,u)?-j:j)/T:j=(yR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},PAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function FAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function HAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:bR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...PAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:bR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:H,snapGrid:q,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:H,snapGrid:q,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const W=FAt(F,y,F.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:H,snapToGrid:q,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,W={},U=y.origin??Y,{width:Z,height:ce,x:re,y:ne}=$At(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,U,T,j),Q=Z!==L,le=ce!==F,oe=re!==te&&Q,ue=ne!==I&≤if(!oe&&!ue&&!Q&&!le)return;if((oe||ue||U[0]===1||U[1]===1)&&(W.x=oe?re:b.x,W.y=ue?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-te,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+U[0]*(Z-L),y:Te.position.y-Ie+U[1]*(ce-F)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=U[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const qAt={},xR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(qAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},UAt=e=>e?xR(e):xR,{useDebugValue:GAt}=Je,{useSyncExternalStoreWithSelector:WAt}=gV,VAt=e=>e;function nq(e,n=VAt,t){const r=WAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return GAt(r),r}const wR=(e,n)=>{const t=UAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},KAt=(e,n)=>e?wR(e,n):wR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const fy=R.createContext(null),QAt=fy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(fy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(fy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const SR={display:"none"},YAt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",XAt="react-flow__aria-live",ZAt=e=>e.ariaLiveMessage,JAt=e=>e.ariaLabelConfig;function eRt({rfId:e}){const n=An(ZAt);return f.jsx("div",{id:`${XAt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YAt,children:n})}function tRt({rfId:e,disableKeyboardA11y:n}){const t=An(JAt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:SR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:SR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(eRt,{rfId:e})]})}const hy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});hy.displayName="Panel";const kR="https://reactflow.dev?utm_source=attribution";function nRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(hy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kR}`,children:f.jsx("a",{href:kR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function sRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function iRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(rRt,sRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const aRt=e=>!!e.onSelectionChangeHandlers;function oRt({onSelectionChange:e}){const n=An(aRt);return e||n?f.jsx(iRt,{onSelectionChange:e}):null}const aq=[0,0],lRt={x:0,y:0,zoom:1},cRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CR=[...cRt,"rfId"],uRt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),ER={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(uRt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=ER,o()}),[]);const _=R.useRef(ER);return R.useEffect(()=>{for(const d of CR){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:tAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},CR.map(d=>e[d])),null}function NR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=NR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=NR())!=null&&r.matches?"dark":"light"}const zR=typeof document<"u"?document:null;function Ap(e=null,n={target:zR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` +`)?d.slice(0,-1):d},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=R.useRef(null);R.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:l}=YP(i.length),u=R.useMemo(()=>i.map((_,d)=>f.jsxs("div",{ref:d+1===a?o:void 0,className:`file-view-line flex items-stretch ${d+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":d+1,className:`${QP} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${l}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${jv} ${KP}`,children:HP(_)?f.jsx("br",{}):_})]},d)),[i,l,a]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${jv}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${l}ch`},"aria-hidden":"true"}),u]})}function LF(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function AA({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Y5e()," ",f.jsxs("a",{href:e,download:n,children:[HD()," ",Ne(n)]})]})}function d5({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=R.useState(!1);if(R.useEffect(()=>i(!1),[e,n]),s)return f.jsx(AA,{url:n,name:t});let a;return e==="image"?a=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(AA,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[HD()," ",t]})})]})}const mEt=e=>({queryKey:zt("fileVersion",e),staleTime:2e3,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchInterval:2e3,queryFn:async({signal:n})=>{const t=await fetch(e,{method:"HEAD",cache:"no-store",signal:n});if(t.status===404)return"missing";if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.headers.get("etag")??t.headers.get("content-length")}});function OF(e,n=!0){return ct({...mEt(e),enabled:n,subscribed:n}).data??null}function gEt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function vEt(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const d=new URLSearchParams(l);d.delete("path");const p=d.toString();return{path:_,url:`${Fh(e,_)}${p?`&${p}`:""}${i}`}}function bEt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const IF="orx:files-tree-width",BF="orx:artifacts-collapsed:",$F=180,PF=320,yEt=8,xEt=280;function wEt(){try{const e=Number(localStorage.getItem(IF));if(Number.isFinite(e)&&e>=$F&&e<=PF)return e}catch{}return xEt}function SEt(e){try{const n=localStorage.getItem(`${BF}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function wp(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=wp(t.children??[],n);if(r)return r}}return null}function FF({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(gEt(i))return i;const a=vEt(e,n,i);if(!a)return null;const o=wp(r,a.path);if(!o)return a.url;const l=a.url.indexOf("#"),u=l===-1?a.url:a.url.slice(0,l),_=l===-1?"":a.url.slice(l);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(w5t,{remarkPlugins:[IP,[BP,GP]],rehypePlugins:[fP],components:{a:({href:i,children:a,...o})=>{const l=!i||i.startsWith("#"),u=l?i:s(i);return u?f.jsx("a",{...o,href:u,...l?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):f.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&f.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...WP},children:qP(bEt(t))})})}function kEt(e){return e.presentation==="text"&&xk(e.name)?"markdown":LF(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function CEt(e,n,t,r){var u;const s=t==="markdown"||t==="text"&&n.size<=UL,i=U6(e,n.path),a=ct({...i,enabled:s,subscribed:s}),o=R.useRef({projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r});R.useEffect(()=>{const _=o.current;o.current={projectId:e,path:n.path,modifiedAt:n.modifiedAt,size:n.size,version:r},s&&_.projectId===e&&_.path===n.path&&(_.modifiedAt!==n.modifiedAt||_.size!==n.size||_.version!==null&&_.version!==r)&&nt.invalidateQueries({queryKey:i.queryKey,exact:!0})},[e,n.path,n.modifiedAt,n.size,r,s]);const l=a.data;return{text:l&&!l.binary?l.content:null,binary:(l==null?void 0:l.binary)??!1,truncated:(l==null?void 0:l.truncated)??!1,error:l?null:((u=a.error)==null?void 0:u.message)??(l===null?Nre():null),wantsText:s}}function EEt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=kEt(n),i=OF(Fh(e,n.path)),{text:a,binary:o,truncated:l,error:u,wantsText:_}=CEt(e,n,s,i),[d,p]=R.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${Fh(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(d5,{kind:s,url:S,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?bre():Ese()," ",f.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?LD():Are()})]}):u?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Wre()," ",Ne(u)]}):a===null?v=f.jsxs(ss,{children:[f.jsx(It,{})," ",yD()]}):m&&!d?v=f.jsx(FF,{projectId:e,folder:x,markdown:a,entries:r}):v=f.jsx(DF,{text:a,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(Jh,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[dse()," ",new Date(n.modifiedAt).toLocaleString(z(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Dl(n.size)}),m&&f.jsx(Qt,{size:"small",active:d,"data-tip":d?nv():rh(),"data-tip-align":"end","aria-label":d?nv():rh(),onClick:()=>p(b=>!b),children:f.jsx(t3,{size:13})}),f.jsx(ib,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":uE(),"data-tip-align":"end","aria-label":uE(),children:f.jsx(Md,{size:13})}),f.jsx(Qt,{size:"small","data-tip":cE(),"data-tip-align":"end","aria-label":cE(),onClick:()=>{window.confirm(t6({path:Ne(n.path)}))&&t(n.path)},children:f.jsx(Zd,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!d?"doc":""}`,children:[v,l&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Yre()})]})]})}function HF({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,yEt)*14};if(p.isDir){const S=!t.has(p.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?sre({name:Ne(p.name)}):pre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),s(p.path)},children:f.jsx(Ta,{size:13,className:S?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),f.jsx(Qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":Hre(),"data-tip-align":"end","aria-label":dre({name:Ne(p.name)}),onClick:v=>{v.stopPropagation(),window.confirm(t6({path:Ne(p.path)}))&&o(p.path)},children:f.jsx(Zd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&f.jsx(HF,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:l,onContextMenu:u,onRename:_,onCancelRename:d})]},p.path)}return l===p.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[f.jsx(Jh,{name:p.name}),f.jsx(TF,{name:p.name,onCommit:S=>_(p.path,S),onCancel:d})]},p.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:gK({path:Ne(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[f.jsx(Jh,{name:p.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function NEt({project:e,artifacts:n,onOpenFile:t,canRenameFile:r}){const[s,i]=R.useState(null),[a,o]=R.useState(()=>SEt(e.id)),[l,u]=R.useState(wEt),[_,d]=R.useState(null),[p,m]=R.useState(null),x=R.useRef(null);R.useEffect(()=>{try{localStorage.setItem(`${BF}${e.id}`,JSON.stringify([...a]))}catch{}},[e.id,a]);const S=N=>{var B;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const T=(B=x.current)==null?void 0:B.getBoundingClientRect(),j=document.body.style.userSelect;document.body.style.userSelect="none";const M=$=>{const H=Math.round($.clientX-((T==null?void 0:T.left)??0)),q=Math.min(Math.max(H,$F),PF);u(q);try{localStorage.setItem(IF,String(q))}catch{}},O=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),document.body.style.userSelect=j};window.addEventListener("pointermove",M),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)};R.useEffect(()=>{if(!s||!n)return;const N=wp(n.entries,s);(!N||N.isDir)&&i(null)},[s,n]);const v=N=>o(T=>{const j=new Set(T);return j.has(N)?j.delete(N):j.add(N),j}),b=N=>{(s===N||s!=null&&s.startsWith(N+"/"))&&i(null),fft(e.id,N).catch(()=>{})},w=async(N,T)=>{try{await hft(e.id,N,T),T.action==="rename"&&s===N&&i(null)}catch(j){Qn(j instanceof Error?j.message:String(j),"error")}},y=N=>{n&&jF(n.dir,N)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(ss,{className:"p-5",children:[f.jsx(It,{})," ",ose()]})});const C=N=>f.jsx(HF,{entries:N,depth:0,collapsed:a,selected:s,onToggle:v,onSelect:i,onOpenFile:t,onDelete:b,renamingPath:p,onContextMenu:(T,j)=>{d(AF(T,j))},onRename:(T,j)=>{m(null),w(T,{action:"rename",newName:j})},onCancelRename:()=>m(null)}),E=s?wp(n.entries,s):null;return n.entries.length===0?f.jsx(Sk,{icon:D6,title:pse(),description:wse()}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:x,style:{width:l},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:S}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[C(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:ese()})]})]}),E?f.jsx(EEt,{projectId:e.id,entry:E,onDelete:b,artifactEntries:n.entries},E.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(Omt,{size:22,strokeWidth:1.5}),f.jsx("span",{children:Lre()})]}),_&&f.jsx(RF,{target:_,onOpen:()=>t(_.path),onRename:r(_.path)?()=>m(_.path):void 0,onDuplicate:()=>void w(_.path,{action:"duplicate"}),onCopyPath:()=>y(_.path),onDelete:()=>{window.confirm(t6({path:Ne(_.path)}))&&b(_.path)},onClose:()=>d(null)})]})}const qF=20*1024*1024,UF="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",GF="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",zEt="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",jEt="text-sm font-normal text-text",TEt="mt-1 mb-0 text-sm leading-relaxed text-text";function WF(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function AEt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function VF({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=R.useState(!1),a=R.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&r(l)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var l;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(l=a.current)==null||l.click())},children:[f.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&r(l),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(It,{}),f.jsx("span",{children:ast()})]}):f.jsxs(f.Fragment,{children:[f.jsx(ogt,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function KF({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Dl(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",$o(n)]})]})}function REt({skill:e,onError:n}){const t=mn({mutationFn:Lft}),r=t.isPending;return f.jsxs("div",{className:"flex items-center gap-2 py-1 border-t border-t-border first:border-t-0",children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsx("span",{className:jEt,children:e.name}),e.origin&&f.jsx(Pt,{size:"small",children:e.origin})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{size:"small","data-tip":e.origin?ert():zrt(),"data-tip-align":"end","aria-label":e.origin?lrt({name:Ne(e.name)}):bnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(e.origin?srt({name:Ne(e.name)}):pnt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(s=>{n(s instanceof Error?s.message:String(s))})},children:f.jsx(Zd,{size:13})})]})}function MEt({template:e,onError:n}){const t=mn({mutationFn:Rft}),r=t.isPending,s=e.supportFiles.length;return f.jsxs("div",{className:zEt,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:TEt,children:[e.entry,s>0&&(s===1?Wnt():frt({count:Wt(s)}))]})]}),f.jsx(KF,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(Qt,{"data-tip":Rrt(),"data-tip-align":"end","aria-label":Nnt({name:Ne(e.name)}),disabled:r,onClick:()=>{window.confirm(Snt({name:Ne(e.name)}))&&t.mutateAsync(e.name).catch(i=>{n(i instanceof Error?i.message:String(i))})},children:f.jsx(Zd,{size:13})})]})}function DEt(){var w;const e=mn({mutationFn:Dft}),n=ct(xht()),t=n.data,r=R.useRef(null),[s,i]=R.useState(!1),[a,o]=R.useState(!1),l=R.useCallback(()=>{const y=r.current;i(!!y&&y.scrollTop>1),o(!!y&&y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);R.useLayoutEffect(()=>{l();const y=r.current;if(!y)return;const C=new ResizeObserver(l);return C.observe(y),()=>C.disconnect()},[t,l]);const u=n.isFetching,_=(w=n.error)==null?void 0:w.message,[d,p]=R.useState(!1),[m,x]=R.useState(null),S=()=>{n.refetch()},v=R.useRef(!1),b=R.useCallback(async y=>{if(!v.current){if(x(null),!AEt(y.name)){x(_st());return}if(y.size>qF){x(jL());return}v.current=!0,p(!0);try{await e.mutateAsync({filename:y.name,contentBase64:await WF(y)})}catch(C){x(C instanceof Error?C.message:String(C))}finally{v.current=!1,p(!1)}}},[]);return f.jsxs("section",{className:UF,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:nst()}),f.jsxs(Le,{className:"ms-auto",size:"small",onClick:S,disabled:u,children:[f.jsx(Aa,{size:12,className:u?"animate-[spin_0.9s_linear_infinite]":""})," ",Xp()]})]}),f.jsx("p",{className:GF,children:Ant()}),f.jsx(VF,{accept:".md,.markdown,.zip",busy:d,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:Lnt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:dnt()})]}),onFile:y=>void b(y)}),m&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:m}),_&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[mrt()," ",_]}),t===void 0?_?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Prt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Krt()}):f.jsxs("div",{className:"relative mt-1",children:[f.jsx("div",{ref:r,onScroll:l,className:"flex flex-col max-h-120 overflow-y-auto overscroll-contain",children:t.map(y=>f.jsx(REt,{skill:y,onError:x},y.name))}),s&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 top-0 h-10 bg-gradient-to-b from-background to-transparent"}),a&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-background to-transparent"})]})]})}function LEt(){var _;const e=mn({mutationFn:Aft}),n=ct(yht()),t=n.data,r=(_=n.error)==null?void 0:_.message,[s,i]=R.useState(!1),[a,o]=R.useState(null),l=R.useRef(!1),u=R.useCallback(async d=>{if(l.current)return;o(null);const p=d.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){o(vst());return}if(d.size>qF){o(jL());return}l.current=!0,i(!0);try{await e.mutateAsync({filename:d.name,contentBase64:await WF(d)})}catch(m){o(m instanceof Error?m.message:String(m))}finally{l.current=!1,i(!1)}},[]);return f.jsxs("section",{className:UF,children:[f.jsx("h3",{children:Ort()}),f.jsx("p",{className:GF,children:ust()}),f.jsx(VF,{accept:".tex,.zip",busy:s,prompt:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:$nt()}),f.jsx("span",{className:"block ps-4 mt-1 text-text",children:Iat()})]}),onFile:d=>void u(d)}),a&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),r&&f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[yrt()," ",r]}),t===void 0?r?null:f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(It,{})," ",Urt()]}):t.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:Zrt()}):f.jsx("div",{className:"flex flex-col mt-1",children:t.map(d=>f.jsx(MEt,{template:d,onError:o},d.name))})]})}function OEt(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:krt()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:Ynt()}),f.jsx(DEt,{}),f.jsx(LEt,{})]})}const IEt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Fc({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-0 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?IEt:""}`,onClick:i,onDoubleClick:a,title:s?Mat({label:n}):n,"aria-label":s?jat({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:b0e(),onPointerDown:l=>l.preventDefault(),onClick:l=>{l.stopPropagation(),o()},children:f.jsx(Gr,{size:12})})]})}const RA=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function BEt({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:RA,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:RA,href:nb(e,n,t),target:"_blank",rel:"noopener noreferrer",title:ev({name:Ne(t)}),children:[f.jsx("code",{children:t}),f.jsx(pb,{size:12})]})}const $w=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),MA=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function DA(e){return new Date(e).toLocaleString(z(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function LA(e,n){return np((e.endedAt??n)-e.createdAt)}function $Et({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[l,u]=R.useState(()=>Date.now());return R.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx($l,{status:a?Wi(a):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&f.jsxs(Le,{...Vr(_=>s(a.id,_)),children:[f.jsx(Uh,{size:15}),rve()]}),f.jsxs(Le,{...Vr(i),children:[f.jsx(_b,{size:15}),j1e()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:F1e()}),f.jsx(Fo,{text:e.description})]}),f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:a?C1e():bve()}),a&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx($l,{status:Wi(a)}),f.jsx(P6,{backend:a.backend}),f.jsxs("span",{title:pve(),children:[f.jsx(Cpt,{size:13}),DA(a.createdAt)]}),f.jsxs("span",{title:G1e(),children:[f.jsx(Bpt,{size:13}),LA(a,l)]}),a.commitSha&&f.jsxs("span",{title:M1e(),children:[f.jsx(hmt,{size:14}),f.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&f.jsxs("span",{children:[Q1e()," ",a.exitCode]})]}),a.command&&f.jsxs("code",{className:MA,children:["$ ",a.command]}),a.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:f.jsx(Fo,{text:a.resultMarkdown})})]})]}),f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(BEt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[J1e()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:DA(e.createdAt),children:[I1e()," ",$o(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&f.jsxs("code",{className:MA,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:$w,children:[f.jsx("h2",{children:dve()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,d)=>f.jsxs("button",{...Vr(p=>s(_.id,p)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[ove()," ",r.length-d]}),f.jsx($l,{status:Wi(_)}),f.jsx("span",{children:$o(_.createdAt)}),f.jsx("span",{children:LA(_,l)}),f.jsx(Uh,{size:13})]},_.id))})]})]})})}function OA(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=k6(t,!0);let i=!1,a=0,o=!1,l=!1;async function u(){if(o){l=!0;return}o=!0;try{for(;;){const d=await rdt(e,a);if(i)return;if(d.dataBase64&&r.write(OA(d.dataBase64)),a=d.nextOffset,d.eof)break}}catch{}finally{o=!1,l&&!i&&(l=!1,u())}}const _=zht(e,d=>{if(i)return;const p=OA(d.dataBase64);!o&&d.offset===a?(r.write(p),a+=p.length):d.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function FEt({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:l}){const u=r.filter(_=>_.experimentId===e.id).sort((_,d)=>d.createdAt-_.createdAt);return t==="overview"?f.jsx($Et,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,d)=>o("terminal",_,d),onOpenCode:_=>l("files",_)}):f.jsx(HEt,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function HEt({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=R.useState(null),[a,o]=R.useState(null),[l,u]=R.useState(!1),_=R.useRef(null),d=t?n.find(v=>v.id===t)??null:n[0]??null,p=(d==null?void 0:d.status)==="running"||(d==null?void 0:d.status)==="starting",m=!!(d&&p&&(d.cancelRequested||a===d.id)),x=v=>{const b=n.findIndex(w=>w.id===v);return b===-1?n.length:n.length-b};R.useEffect(()=>{if(!l)return;const v=b=>{var w;(w=_.current)!=null&&w.contains(b.target)||u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]);async function S(){if(d){i(null),o(d.id);try{await IL(d.id)}catch(v){o(null),i(v instanceof Error?v.message:String(v))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),p&&f.jsxs(Le,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[f.jsx(qO,{size:13}),m?Q0e():RD()]}),n.length>0&&d&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(Le,{title:qge(),"aria-expanded":l,onClick:()=>u(v=>!v),children:[f.jsxs("span",{children:[PE()," ",x(d.id)]}),f.jsx($l,{status:m?"cancelling":Wi(d)}),f.jsx(Uo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),l&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(v=>f.jsxs(or,{className:"justify-start",active:v.id===(d==null?void 0:d.id),onClick:()=>{r(v.id),u(!1)},children:[f.jsxs("span",{className:"font-medium",children:[PE()," ",x(v.id)]}),f.jsx($l,{status:Wi(v)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:$o(v.createdAt)})]},v.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:d?f.jsx(PEt,{runId:d.id},d.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?Ya():Oge()})})]})}let f5=!1;function IA(e){f5=!0;try{return window.confirm(e)}finally{f5=!1}}const h5=e=>e.replace(/\r\n/g,` +`),BA=(e,n,t)=>{const r=h5(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r +`),conflict:null}},Cl=e=>e.draft!==e.baseline,qEt=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),UEt=e=>e.crlf?e.draft.replace(/\n/g,`\r +`):e.draft;function GEt(e,n,t){return!Cl(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class WEt{constructor(){Fs(this,"buffer",null);Fs(this,"listeners",new Set);Fs(this,"saving",!1);Fs(this,"saveError",null);Fs(this,"revision",0);Fs(this,"saveRevision",0);Fs(this,"getSnapshot",()=>this.buffer);Fs(this,"getRevision",()=>this.revision);Fs(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Fs(this,"set",n=>{this.buffer=n,this.notify()});Fs(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Fs(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Fs(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(Cl(this.buffer)||this.buffer.conflict!==null)}}function VEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){var X,te,I;const l=ct({...r1t(),enabled:r,subscribed:r}),u=((X=l.data)==null?void 0:X.engine)??(l.isPending?void 0:null),_=((te=l.data)==null?void 0:te.hint)??null,d=((I=l.data)==null?void 0:I.installCommand)??null,[p,m]=R.useState(!1),[x,S]=R.useState(null),[v,b]=R.useState(null),[w,y]=R.useState(!1),[C,E]=R.useState(null),[N,T]=R.useState(null),[j,M]=R.useState(!1),[O,B]=R.useState(0),$=R.useCallback(L=>{M(L),L&&B(F=>F+1)},[]),H=R.useRef(o);H.current=o;const q=R.useRef(!1),Y=R.useRef(null),G=R.useCallback(()=>{if(q.current)return;Y.current=n,q.current=!0,m(!0);const L=H.current;T(null),b(null),E(null),hdt(e,n,{sessionId:t}).then(F=>{var U,Z;const W=F.pdfPath;if(F.ok&&W){S(ce=>({path:W,version:((ce==null?void 0:ce.version)??0)+1,source:L})),y(F.hadErrors),E(F.note),F.hadErrors&&b(((U=F.log)==null?void 0:U.trim())||null),$(!0);return}S(null),y(!1),E(F.note),M(!1),b(((Z=F.log)==null?void 0:Z.trim())||S3e())}).catch(F=>{S(null),y(!1),E(null),M(!1),T(F instanceof Error?F.message:String(F))}).finally(()=>{q.current=!1,m(!1)})},[e,n,t,$]);return R.useEffect(()=>{!r||!s||!a||!u||Y.current!==n&&G()},[r,s,a,u,n,G]),{engine:u,installHint:_,installCommand:d,compiling:p,compiled:x,stale:x!==null&&x.source!==o,log:v,builtWithErrors:w,note:C,error:N,showPdf:j,setShowPdf:$,viewNonce:O,compile:()=>{i==null||i(),G()},dismiss:()=>{T(null),b(null)}}}const KEt=3e4,QEt=3e4,YEt=5*6e4;function XEt({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:l}){var re,ne,Q,le;const u=R.useMemo(()=>i1t(e,n,{sessionId:t}),[e,n,t]),_=ct({...u,enabled:r,subscribed:r}),d=((re=_.data)==null?void 0:re.hasToken)??!1,p=((ne=_.data)==null?void 0:ne.hasSession)??!1,m=((Q=_.data)==null?void 0:Q.link)??null,x=!_.isPending,[S,v]=R.useState(null),[b,w]=R.useState(0),[y,C]=R.useState(!1),[E,N]=R.useState(null),[T,j]=R.useState(null),[M,O]=R.useState(!1),B=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,ue=>ue&&{...ue,hasSession:oe})},[u]),$=R.useCallback(oe=>{Fn(u.queryKey)&&nt.setQueryData(u.queryKey,oe)},[u]);R.useEffect(()=>{N(null),w(0),L.current=!1,j(null),O(!1),G.current=!1},[r,e,n,t]),R.useEffect(()=>{O(!1)},[a]);const H=R.useRef(!1),q=R.useRef(l);q.current=l;const Y=R.useRef(o);Y.current=o;const G=R.useRef(!1),X=R.useCallback(oe=>!d||!m||H.current||Y.current?!1:(H.current=!0,C(!0),j(null),Sdt(e,n,{sessionId:t,resolve:oe}).then(ue=>{G.current=!1,N(ue),ue.pulled.includes(n)&&(Y.current?O(!0):q.current(ue.pulled))}).catch(ue=>{G.current=!0,N(null),j(ue instanceof Error?ue.message:String(ue))}).finally(()=>{H.current=!1,C(!1)}),!0),[e,n,t,d,m]),te=R.useRef(null),I=(S==null?void 0:S.state)==="live";R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=`${n}:${m.projectId}:${a}`;te.current!==oe&&X()&&(te.current=oe)},[r,s,x,d,m,n,a,o,y,X,I]);const L=R.useRef(!1);!y&&E&&E.conflicts.length===0&&!T&&(L.current=!0);const F=r&&x&&!!m&&d&&p&&L.current,W=R.useRef(null),U=R.useRef(Promise.resolve()),Z=R.useRef(!1);Z.current=(S==null?void 0:S.state)==="stopped"&&S.error!=null;const ce=R.useRef(!1);return R.useEffect(()=>{if(!F)return;let oe=!1;const ue=()=>{const Se=ce.current;ce.current=!1,!(!Se&&Z.current)&&(U.current=U.current.then(()=>{if(!oe)return vdt(e,n,{sessionId:t,retry:Se}).then(ye=>{var qe;oe||((W.current===null||((qe=ye.status)==null?void 0:qe.state)==="stopped")&&v(ye.status),W.current=ye.key)}).catch(ye=>{oe||v({state:"stopped",error:ye instanceof Error?ye.message:String(ye),needsSession:!1,note:null})})}))};ue();const pe=setInterval(ue,QEt);return()=>{oe=!0,clearInterval(pe),W.current=null,v(null),U.current=U.current.then(()=>bdt(e,n,{sessionId:t})).catch(()=>{})}},[F,b,e,n,t]),R.useEffect(()=>Rht(oe=>{if(oe.key===W.current){if(oe.type==="live"){v(oe.status);return}oe.paths.includes(n)&&(Y.current?O(!0):q.current(oe.paths))}}),[n]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||o||I)return;const oe=setInterval(()=>{H.current||G.current||nt.fetchQuery({...a1t(e,n,{sessionId:t}),staleTime:0}).then(ue=>{ue.remoteChanged&&X()}).catch(ue=>{G.current=!0,j(ue instanceof Error?ue.message:String(ue))})},KEt);return()=>clearInterval(oe)},[r,s,x,d,m,o,e,n,t,X,I]),R.useEffect(()=>{if(!r||!s||!x||!d||!m||!I)return;const oe=setInterval(X,YEt);return()=>clearInterval(oe)},[r,s,x,d,m,I,X]),{hasToken:d,hasSession:p,live:S,retryLive:()=>{ce.current=!0,w(oe=>oe+1)},link:m,loaded:x,syncing:y,last:E,error:T??((le=_.error)==null?void 0:le.message)??null,blocked:o,staleOnDisk:M,reloaded:()=>O(!1),uploadUrl:Cdt(e,n,{sessionId:t}),saveToken:async oe=>{const ue=await BL(oe);te.current=null,G.current=!1,j(null),Fn(u.queryKey)&&nt.setQueryData(u.queryKey,pe=>pe&&{...pe,hasToken:ue.hasToken})},saveSession:async oe=>{const ue=await $L(oe,{host:m==null?void 0:m.host});B(ue.hasSession),ce.current=!0,w(pe=>pe+1)},importSession:async()=>{const oe=await gdt({host:m==null?void 0:m.host});return B(oe.hasSession),ce.current=!0,w(ue=>ue+1),oe.source},linkProject:async oe=>{N(null),v(null),L.current=!1,te.current=null,$(await xdt(e,n,{project:oe,sessionId:t})),i==null||i()},unlink:async()=>{$(await wdt(e,n,{sessionId:t})),te.current=null,G.current=!1,N(null),j(null)},sync:oe=>{G.current=!1,X(oe)&&(te.current=`${n}:${m==null?void 0:m.projectId}:${a}`,i==null||i())}}}function QF(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function $A(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),l=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),d=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(d.length===0)return null;d.pop();continue}d.push(p)}return d.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${d.join("/")}`,query:l,hash:i}}function ZEt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const PA=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],JEt=4e6,eNt=200,FA=16e6,tNt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),HA=e=>e.startsWith("//")?`https:${e}`:e;async function nNt(e,n){var s;let t=JEt;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:l}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=eNt)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",d=Number(u.headers.get("content-length"));if(!l.some(x=>_.startsWith(x))||!(Number.isFinite(d)&&d>0&&d<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await tNt(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function rNt(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(PA.map(l=>l.selector).join(", ")))for(const{selector:l,attribute:u,typePrefixes:_}of PA){if(!o.matches(l))continue;const d=o.getAttribute(u);if(!d)continue;const p=n(d);p&&(p===d?o.setAttribute(u,HA(d)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await nNt(s,t);for(const o of r.querySelectorAll("a[href]")){const l=o.getAttribute("href");!l||!QF(l)||(o.setAttribute("href",HA(l)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function sNt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${FA-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>FA}}function iNt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=R.useState(null);return R.useEffect(()=>{let o=!1;const l=new AbortController;return a(null),sNt(e,n,t,l.signal).then(async({text:u,partial:_})=>({source:await rNt(u,s,l.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,l.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(It,{})," ",OD()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:nxe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:axe({name:Ne(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function aNt({overleaf:e}){var d;const n=R.useRef(null),{open:t,setOpen:r,ref:s}=so(n),i=R.useId(),[a,o]=R.useState({top:0,left:0,maxHeight:0}),l=((d=e.last)==null?void 0:d.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?A4():l?tze():!e.hasToken||!e.link?wTe():e.syncing?JD():e.blocked?ZD():QD();return R.useEffect(()=>{l&&r(!0)},[l,r]),R.useEffect(()=>{u&&Qn(A4(),"error",{id:i,duration:5e3})},[u,e.error,i]),R.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),v=b=>{var w;b.target instanceof Node&&!((w=s.current)!=null&&w.contains(b.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(Qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":WQ({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(It,{}):f.jsx(Hpt,{size:13,className:u||l?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":bL(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(Qt,{size:"small","aria-label":Bye(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:f.jsx(Gr,{size:13})})}),f.jsx(dNt,{overleaf:e})]}),document.body)]})}const i1=e=>Oo(new Intl.ListFormat(z()).format(e.map(Ne)));function oNt(e){if(e.error)return Sze();if(e.syncing)return JD();if(e.blocked)return ZD();const n=e.last;return n?n.pulled.length&&n.pushed.length?Jje({pulled:i1(n.pulled),pushed:i1(n.pushed)}):n.pulled.length?Qje({paths:i1(n.pulled)}):n.pushed.length?rTe({paths:i1(n.pushed)}):n.conflicts.length?eje():QD():Fje()}function lNt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:XD()})}function cNt(e){return e.state==="live"?Lze():e.state==="connecting"?Aze():e.error??qze()}function qA({overleaf:e,replacing:n}){const[t,r]=R.useState(""),[s,i]=R.useState(!1),[a,o]=R.useState(!1),[l,u]=R.useState(null),_=p=>{s||(i(!0),u(null),p().then(()=>o(!1)).catch(m=>{u(m instanceof Error?m.message:String(m)),o(!0)}).finally(()=>i(!1)))},d=a?jTe():n?oTe():fze();return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsx("p",{className:"text-sm text-subtext",children:d}),a&&f.jsx(Wr,{className:"basis-full min-w-0","aria-label":T4(),type:"password",value:t,onChange:p=>r(p.target.value),placeholder:T4(),autoComplete:"off"}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s&&f.jsx(It,{}),a?f.jsx(Le,{type:"button",disabled:s||!t.trim(),onClick:()=>_(()=>e.saveSession(t.trim())),children:s?Ei():XNe()}):f.jsx(Le,{type:"button",disabled:s,onClick:()=>_(e.importSession),children:mze()}),f.jsx(Le,{variant:"ghost",type:"button",disabled:s,onClick:()=>o(!a),children:a?YD():Gje()})]}),l&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:l})]})}function uNt({overleaf:e}){if(!e.hasSession)return f.jsx(qA,{overleaf:e});const n=e.live;if(!n)return f.jsx("p",{className:"text-sm text-subtext",children:Vze()});const t=n.state==="stopped"&&n.needsSession,r=n.state==="live"?"bg-accent-green":n.state==="connecting"?"bg-accent-amber":"bg-accent-red";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{role:n.error?"alert":"status",className:`flex items-center gap-2 text-sm ${n.error?"text-accent-red":"text-subtext"}`,children:[f.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${r}`}),f.jsx("span",{className:"min-w-0 break-words",children:cNt(n)})]}),n.note&&f.jsx("p",{className:"text-sm text-accent-amber",children:n.note}),n.state==="stopped"&&!t&&f.jsx("div",{children:f.jsx(Le,{onClick:e.retryLive,children:$ze()})}),t&&f.jsx(qA,{overleaf:e,replacing:!0})]})}function dNt({overleaf:e}){var p,m,x;const[n,t]=R.useState(""),[r,s]=R.useState(!1),[i,a]=R.useState(null),[o,l]=R.useState(!1),u=()=>{t(""),a(null),l(!0)},_=!e.hasToken||o;async function d(S){S.preventDefault();const v=n.trim();if(!(r||!v)){s(!0),a(null);try{_?(await e.saveToken(v),l(!1)):await e.linkProject(v),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const S=((p=e.last)==null?void 0:p.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(It,{}),e.error?A4():oNt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsx(uNt,{overleaf:e}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(Le,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?dTe():((m=e.live)==null?void 0:m.state)==="live"?OTe():void 0,onClick:()=>e.sync(),children:e.error?Gi():Eje()}),f.jsxs(qh,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[bje()," ",f.jsx(Md,{size:12})]})]}),S.map(v=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:v})," ",dje()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"keep-local"}),children:pje()}),f.jsx(Le,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[v]:"take-overleaf"}),children:Ije()})]})]},v)),((x=e.last)==null?void 0:x.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:p6()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(Le,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:mN()}),f.jsx(qh,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:XD()}),f.jsx(Le,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(v=>{a(v instanceof Error?v.message:String(v))}),children:Tje()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:d,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?qTe():VTe()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(Wr,{className:"basis-full min-w-0","aria-label":_?_N():pN(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?_N():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(Le,{type:"submit",disabled:r||!n.trim(),children:r?_?Ei():Xi():_?vTe():Nze()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?ize():pN()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(lNt,{href:e.uploadUrl}),o?f.jsx(Le,{variant:"ghost",type:"button",onClick:()=>l(!1),children:YD()}):e.hasToken&&f.jsx(Le,{variant:"ghost",type:"button",onClick:u,children:mN()})]})]})}function fNt({command:e}){const[n,t]=R.useState("idle"),r=R.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(Qt,{"data-tip":n==="copied"?tp():n==="select"?m2e():fye(),"aria-label":mye(),onClick:()=>void s(),children:n==="copied"?f.jsx(Na,{size:13}):f.jsx(db,{size:13})})]})}function hNt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:l,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:d,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:v=!1,restored:b=!1,onRestoreActivated:w,showSource:y=!1,onShowSourceChange:C}){var rr,En;const E=yI(e,n,t??"repo",r,s),N=ct({...E,enabled:!S.saving}),T=N.data??null,j=((rr=N.error)==null?void 0:rr.message)??null,M=Ve=>{Pr(E.queryKey,xt=>(typeof Ve=="function"?Ve(xt??null):Ve)??void 0)},[O,B]=R.useState(0),$=t==="artifacts",H=t==="abs",q=xk(n),Y=zF(n),G=fEt(n),X=q||G,[te,I]=R.useState(!1),L=!b||te,F=()=>{I(!0),w==null||w()};R.useSyncExternalStore(S.subscribe,S.getRevision);const W=S.getSnapshot(),U=S.set,Z=S.saving,ce=S.setSaving,re=S.saveRevision,ne=S.saveError,Q=S.setSaveError,le=R.useRef(null),oe=R.useRef(l),ue=(T==null?void 0:T.file)??null,pe=W&&Cl(W)?W.path:(T==null?void 0:T.source)==="checkout"?T.file.path:n,Se=pe.split("/").slice(0,-1).join("/"),ye=(T==null?void 0:T.source)==="artifact",qe=R.useCallback(Ve=>{var xt;return((xt=$A(Se,Ve,H))==null?void 0:xt.path)??null},[H,Se]),Ie=R.useCallback(Ve=>H?ldt(Ve):ye?Fh(e,Ve):$N(e,Ve,{sessionId:r,ref:s}),[ye,s,H,e,r]),Te=R.useCallback(Ve=>{if(QF(Ve))return Ve;const xt=$A(Se,Ve,H);return xt?ZEt(Ie(xt.path),xt):null},[H,Se,Ie]),vt=LF(ue==null?void 0:ue.presentation),Dt=(T==null?void 0:T.source)==="artifact"&&!$,Ut=$&&(T==null?void 0:T.source)==="checkout",Ft=!s&&(T==null?void 0:T.source)==="checkout"&&ue!=null&&!ue.notFound,mt=r!=null&&(T==null?void 0:T.source)==="checkout"&&T.file.root==="clone",rt=Ft&&ue!=null&&!ue.binary&&!ue.truncated&&!vt&&!mt,ut=rt&&ue.version===void 0,Ct=W!==null&&Cl(W),we=!ut&&(rt&&typeof ue.version=="string"||Ct),Re=(W==null?void 0:W.draft)??h5((ue==null?void 0:ue.content)??""),Ze=(W==null?void 0:W.baseline)??h5((ue==null?void 0:ue.content)??""),_t=we&&W!==null&&Cl(W),wt=async Ve=>{const xt=S.getSnapshot();if(!we||!xt||!Cl(xt))return!0;if(S.saving)return!1;if(xt.conflict&&Ve===void 0)return Q(xt.conflict.exists?FE():qE()),!1;const lt=xt.draft,ft=UEt(xt);ce(!0),Q(null);try{await nt.cancelQueries(E);const jt=await cdt(e,pe,ft,{sessionId:r,expectedVersion:Ve??xt.version});return S.getSnapshot()?(S.saved(lt,jt.version),M(On=>On&&On.source==="checkout"?{source:"checkout",file:{...On.file,content:ft,version:jt.version}}:On),!0):!1}catch(jt){if(jt instanceof L4){const xn=S.getSnapshot();return!xn||!Cl(xn)||U({...xn,conflict:{currentVersion:jt.currentVersion,exists:jt.exists}}),!1}return Q(jt instanceof Error?jt.message:String(jt)),!1}finally{ce(!1)}},Zt=Y&&Ft&&!mt,We=VEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,ready:ue!=null&&!ue.notFound,source:we?Re:(ue==null?void 0:ue.content)??""}),Gt=XEt({projectId:e,filePath:pe,sessionId:r,enabled:Zt,autoRun:L,onManualAction:F,savedSource:Ze,dirty:_t,onPulled:R.useCallback(Ve=>{Ve.includes(pe)&&B(xt=>xt+1)},[pe])}),an=Y&&We.showPdf&&We.compiled!=null,yn=ut&&Ct,Vt=(we||yn)&&!(X&&!y)&&!an,Yn=We.compiled?`${$N(e,We.compiled.path,{sessionId:r})}&v=${We.compiled.version}`:null,ln=Yn?`${Yn}&view=${We.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,cn=We.compiled?We.compiled.path.split("/").pop()??We.compiled.path:null,br=async()=>{_t&&!await wt()||Y&&We.engine&&We.compile()},Xn=async()=>{_t&&(L?await br():await wt())},[Zn,Rn]=R.useState(!1),[Rr,Nr]=R.useState(null),bt=async()=>{Rn(!0),Nr(null);try{await ddt(e,pe,{sessionId:r})}catch(Ve){Nr(Ve instanceof Error?Ve.message:String(Ve))}finally{Rn(!1)}},fn=R.useCallback(()=>{S.saving||B(Ve=>Ve+1)},[S]),Cn=()=>{U(null),Q(null),fn()},tn=OF(Ie(pe),!s&&!Z);R.useEffect(()=>{if(!j||s)return;const Ve=window.setInterval(()=>{document.visibilityState!=="hidden"&&fn()},2e3);return()=>window.clearInterval(Ve)},[j,s,fn]);const nr=`${Ie(pe)}&v=${encodeURIComponent(tn??m??"")}&reload=${O}`;R.useEffect(()=>{var lt,ft;if(!T||S.saving)return;const Ve=T,xt=S.getSnapshot();if(xt&&Cl(xt)){const jt=Ve.source==="checkout"?Ve.file:null,xn=jt!==null&&jt.path===xt.path&&(!r||jt.root==="worktree"),On=GEt(xt,xn&&typeof jt.version=="string"?jt.version:null,xn&&!jt.notFound);On&&(On.currentVersion!==((lt=xt.conflict)==null?void 0:lt.currentVersion)||On.exists!==((ft=xt.conflict)==null?void 0:ft.exists))?U({...xt,conflict:On}):!On&&xt.conflict&&U({...xt,conflict:null})}(!xt||!Cl(xt))&&Ve.source==="checkout"&&!Ve.file.notFound&&!Ve.file.binary&&!Ve.file.truncated&&typeof Ve.file.version=="string"&&(U(BA(Ve.file.path,Ve.file.content,Ve.file.version)),Q(null))},[T,S,r,Z,re]);const un=JSON.stringify(E.queryKey),Mn=R.useRef({sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn});R.useEffect(()=>{const Ve=Mn.current;Mn.current={sourceKey:un,nonce:O,artifactVersion:m,diskVersion:tn},Ve.sourceKey===un&&(Ve.nonce!==O||Ve.diskVersion!==null&&Ve.diskVersion!==tn||Ve.artifactVersion!=null&&Ve.artifactVersion!==m)&&o1t(e,n,t??"repo",r,s)},[un,O,m,tn,e,n,t,r,s]),R.useLayoutEffect(()=>{const Ve=le.current,xt=oe.current;!Ve||!ue||!xt||(Ve.scrollTop=xt.top,Ve.scrollLeft=xt.left)},[ue]);const on=Ve=>{if(Ve.source==="absolute")return Cxe();if($)return gxe({root:r?jg():zg()});if(s)return xxe({branch:Ne(s)});if(r&&Ve.source==="checkout"&&Ve.file.root==="clone")return G2e();const xt=Ve.source==="checkout"?Ve.file.root:Ve.checkoutRoot;return jxe({root:xt==="worktree"?jg():zg()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(Jh,{name:pe}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ne(pe),children:pe.split("/").pop()||pe}),a&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:xK({branch:Ne(a)}),children:[f.jsx(em,{size:11}),a]}),Vt&&(Z||_t||ne)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ne?"text-accent-red":"text-muted"}`,title:ne??(Z?Ei():I2e()),children:Z?f.jsxs(f.Fragment,{children:[f.jsx(It,{})," ",f2e()]}):ne?l2e():ID()}),Y&&We.compiled&&f.jsx(Qt,{size:"small",active:!We.showPdf,"data-tip":We.stale&&We.showPdf?Kxe():We.showPdf?rh():KE(),"data-tip-align":"end","aria-label":We.showPdf?rh():KE(),onClick:()=>We.setShowPdf(!We.showPdf),children:We.showPdf?f.jsx(t3,{size:13}):f.jsx(fb,{size:13,className:We.stale?"text-accent-amber":void 0})}),Y&&Yn&&cn&&f.jsx(ib,{size:"small","data-tip":We.stale?Gye({name:Ne(cn)}):tE({name:Ne(cn)}),"data-tip-align":"end","aria-label":tE({name:Ne(cn)}),href:Yn,download:cn,children:f.jsx(Kpt,{size:13,className:We.stale?"text-accent-amber":void 0})}),Zt&&f.jsx(aNt,{overleaf:Gt}),Y&&Ft&&f.jsx(Qt,{size:"small","data-tip":We.compiled?VE():HE(),"data-tip-align":"end","aria-label":We.compiled?VE():HE(),disabled:We.compiling||!We.engine,onClick:()=>void br(),children:We.compiling?f.jsx(It,{}):f.jsx(Jpt,{size:13})}),X&&f.jsx(Qt,{size:"small",active:y,"data-tip":y?nv():rh(),"data-tip-align":"end","aria-label":y?nv():rh(),onClick:()=>C==null?void 0:C(!y),children:f.jsx(t3,{size:13})}),Ft&&!v&&f.jsx(Qt,{size:"small","data-tip":Rr??WE(),"data-tip-align":"end","aria-label":WE(),disabled:Zn,onClick:()=>void bt(),children:Zn?f.jsx(It,{}):f.jsx(Md,{size:13})})]}),!j&&Ut&&(T==null?void 0:T.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Mxe({root:T.file.root==="worktree"?jg():zg()})}),ut&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:F2e()}),j&&ue!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[GE()," ",Ne(j)]}),(W==null?void 0:W.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:W.conflict.exists?FE():qE()}),((En=W==null?void 0:W.conflict)==null?void 0:En.exists)&&W.conflict.currentVersion&&f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:()=>{var Ve;return void wt(((Ve=W.conflict)==null?void 0:Ve.currentVersion)??void 0)},children:Uxe()}),f.jsx(Le,{disabled:Z,onPointerDown:Ve=>Ve.preventDefault(),onClick:Cn,children:s2e()})]}),(We.error||We.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${We.builtWithErrors?"text-subtext":"text-accent-red"}`,children:We.error??(We.builtWithErrors?lye():tye())}),f.jsx(Qt,{"data-tip":Tye(),"data-tip-align":"end","aria-label":Dye(),onClick:We.dismiss,children:f.jsx(Gr,{size:13})})]}),We.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:We.log})]}),Zt&&Gt.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Pxe()}),f.jsx(Le,{onClick:()=>{Gt.reloaded(),B(Ve=>Ve+1)},children:Sye()})]}),Y&&Ft&&We.engine===null&&We.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[We.installHint,We.installCommand&&f.jsx(fNt,{command:We.installCommand})]}),We.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:We.note}),an&&We.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:E2e()}),f.jsxs("div",{ref:le,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Ve=>{const xt={top:Math.max(0,Ve.currentTarget.scrollTop),left:Math.max(0,Ve.currentTarget.scrollLeft)};oe.current=xt,u==null||u(xt)},children:[!Vt&&!j&&!$&&(T==null?void 0:T.source)==="checkout"&&!T.file.notFound&&!s&&r&&T.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T2e()}),!Vt&&!j&&(T==null?void 0:T.source)==="artifact"&&!T.file.notFound&&Dt&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ube({root:T.checkoutRoot==="worktree"?jg():zg()})}),j&&ue===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[GE()," ",Ne(j)]}):ue===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:OD()}):Vt?f.jsx(XP,{value:Re,onChange:Ve=>{const xt=S.getSnapshot()??(ue&&typeof ue.version=="string"?BA(ue.path,ue.content,ue.version):null);xt&&U(qEt(xt,Ve)),p==null||p(),ne&&Q(null)},onSave:()=>void Xn(),onBlur:()=>{f5||Xn()},readOnly:yn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d,scrollPosition:oe.current,onScrollPositionChange:Ve=>{oe.current=Ve,u==null||u(Ve)}}):ue.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:T?on(T):hxe()}):vt?f.jsx(d5,{kind:vt,url:nr,name:n.split("/").pop()??n}):ue.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Kbe()," ",f.jsx("a",{href:nr,download:n.split("/").pop()??n,children:LD()})]}):an&&ln&&cn?f.jsx(d5,{kind:"pdf",url:ln,name:cn,downloadBar:!1},ln):q&&!y?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ye?f.jsx(FF,{projectId:e,folder:Se,markdown:ue.content,entries:x}):f.jsx(Fo,{text:ue.content,resolveFilePath:qe,resolveImageSrc:Te,onOpenFile:o&&((Ve,xt,lt,ft,jt)=>o(Ve,r,s,jt))})}):G&&!y?f.jsx(iNt,{html:ue.content,truncated:ue.truncated,url:nr,name:pe,resolveSrc:Te}):f.jsxs(f.Fragment,{children:[f.jsx(DF,{text:ue.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:d}),ue.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Zye()})]})]})]})}const Pw=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function _Nt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=so(),l=R.useRef(null);return R.useEffect(()=>{if(!i)return;const u=_=>{var d;_.key==="Escape"&&((d=l.current)==null||d.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),f.jsx("div",{className:"rail-brand px-3 py-1.5 border-b border-border shrink-0",children:f.jsxs("div",{className:"project-switcher relative min-w-0",ref:o,children:[f.jsxs("div",{className:"flex h-7 items-center justify-between gap-1 px-0.5",children:[f.jsx(Qt,{size:"small",className:"project-back text-text","aria-label":QE(),onClick:n,children:f.jsx(op,{size:18})}),f.jsx("span",{className:"brand-project-label flex-1 text-xs font-medium tracking-wide uppercase text-subtext",children:h4e()}),s&&f.jsx(Qt,{size:"small","data-tip":YE(),"data-tip-align":"end","aria-label":YE(),onClick:s,children:f.jsx(ZO,{size:18})})]}),f.jsxs("button",{ref:l,className:`brand group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-start text-text hover:bg-surface focus-visible:outline-2 focus-visible:outline-text ${i?"open bg-surface":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[f.jsx("span",{className:"brand-project min-w-0 flex-1 truncate text-xl font-semibold",children:e}),f.jsx(Uo,{className:`project-chevron shrink-0 text-muted transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 ${i?"rotate-180 opacity-100":"opacity-0"}`,size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu w-52.5 z-70",children:[f.jsx(or,{onClick:()=>{a(!1),r()},children:f.jsxs("span",{className:Pw,children:[f.jsx(KO,{size:14}),n4e()]})}),f.jsx(or,{onClick:()=>{a(!1),n()},children:f.jsxs("span",{className:Pw,children:[f.jsx(gmt,{size:14}),QE()]})}),f.jsx(or,{onClick:()=>{var u;(u=l.current)==null||u.focus(),a(!1),t()},children:f.jsxs("span",{className:Pw,children:[f.jsx(imt,{size:14}),a4e()]})})]})]})})}function pNt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,l]=R.useState(new Set),[u,_]=R.useState(null),d=new Map;for(const x of e){const S=d.get(x.experimentId);S?S.push(x):d.set(x.experimentId,[x])}for(const x of d.values())x.sort((S,v)=>v.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var w,y,C,E;const v=((y=(w=d.get(x.id))==null?void 0:w[0])==null?void 0:y.createdAt)??x.createdAt;return(((E=(C=d.get(S.id))==null?void 0:C[0])==null?void 0:E.createdAt)??S.createdAt)-v});if(p.length===0)return f.jsx(Sk,{icon:hb,title:t??Ave(),description:t?void 0:Sve()});async function m(x){_(null),l(S=>new Set(S).add(x));try{await a(x)}catch(S){l(v=>{const b=new Set(v);return b.delete(x),b}),_(S instanceof Error?S.message:String(S))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[gbe()," ",u]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":cbe(),children:p.map(x=>{const S=d.get(x.id)??[],v=S[0]??null,b=S.find(E=>E.status==="running"||E.status==="starting"),w=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Wi(b):v?Wi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:E=>{E.button===1&&(E.preventDefault(),r(x,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Vr(E=>r(x,E),{stopPropagation:!0}),children:x.title||x.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[f.jsx(em,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:x.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx($l,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:S.length===1?$ve():Vve({count:Wt(S.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?$o(v.createdAt):Lve()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":hK({name:x.title||x.slug}),onClick:E=>E.stopPropagation(),onDoubleClick:E=>E.stopPropagation(),onAuxClick:E=>E.stopPropagation(),children:[f.jsxs(Le,{size:"small",disabled:!w,title:w?qve():Nve(),...Vr(E=>{w&&s(x.id,w.id,E)},{stopPropagation:!0}),children:[f.jsx(Uh,{size:15}),hbe()]}),f.jsxs(Le,{size:"small",title:pD({branch:Ne(x.branchName)}),...Vr(E=>i(x.id,E),{stopPropagation:!0}),children:[f.jsx(_b,{size:15}),ibe()]}),b&&f.jsxs(Le,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?Xve():tbe(),onClick:()=>void m(b.id),children:[f.jsx(qO,{size:15}),y?Dpe():RD()]})]})]},x.id)})})]})}function mNt({onClose:e,onCreateProject:n}){const[t,r]=R.useState(!1),[s,i]=R.useState(null),a=R.useRef(null),o=R.useCallback(l=>{t||(r(!0),i(null),l().catch(()=>i(pot())).finally(()=>r(!1)))},[t]);return R.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(()=>e("dismiss")))};return document.addEventListener("keydown",l,!0),()=>document.removeEventListener("keydown",l,!0)},[e,o]),R.useEffect(()=>{const l=a.current;if(!l)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...l.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??l).focus();const d=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),l.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0),u==null||u.focus()}},[]),ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(Qt,{className:"absolute end-3.5 top-3.5","aria-label":Gat(),onClick:()=>o(()=>e("dismiss")),disabled:t,children:f.jsx(Gr,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx($6,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:Jat()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:Sot()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[bot()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:dot()}),Fat()]}),f.jsx("p",{dir:"auto",children:oot()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(Le,{onClick:()=>o(n),disabled:t,children:Qat()}),f.jsx(Le,{variant:"primary",onClick:()=>o(()=>e("explore_demo")),disabled:t,children:t?Ei():rot()})]})]})}),document.body)}function as(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function ry(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}O1.prototype=ry.prototype={constructor:O1,on:function(e,n){var t=this._,r=vNt(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),GA.hasOwnProperty(n)?{space:GA[n],local:e}:e}function yNt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===_5&&n.documentElement.namespaceURI===_5?n.createElement(e):n.createElementNS(t,e)}}function xNt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YF(e){var n=sy(e);return(n.local?xNt:yNt)(n)}function wNt(){}function kk(e){return e==null?wNt:function(){return this.querySelector(e)}}function SNt(e){typeof e!="function"&&(e=kk(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=w+1);!(E=v[y])&&++y=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function KNt(e){e||(e=QNt);function n(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function YNt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function XNt(){return Array.from(this)}function ZNt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?czt:typeof n=="function"?dzt:uzt)(e,n,t??"")):e_(this.node(),e)}function e_(e,n){return e.style.getPropertyValue(n)||tH(e).getComputedStyle(e,null).getPropertyValue(n)}function hzt(e){return function(){delete this[e]}}function _zt(e,n){return function(){this[e]=n}}function pzt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function mzt(e,n){return arguments.length>1?this.each((n==null?hzt:typeof n=="function"?pzt:_zt)(e,n)):this.node()[e]}function nH(e){return e.trim().split(/^|\s+/)}function Ck(e){return e.classList||new rH(e)}function rH(e){this._node=e,this._names=nH(e.getAttribute("class")||"")}rH.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sH(e,n){for(var t=Ck(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function Uzt(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function p5(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:l,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}p5.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ejt(e){return!e.ctrlKey&&!e.button}function tjt(){return this.parentNode}function njt(e,n){return n??{x:e.x,y:e.y}}function rjt(){return navigator.maxTouchPoints||"ontouchstart"in this}function uH(){var e=ejt,n=tjt,t=njt,r=rjt,s={},i=ry("start","drag","end"),a=0,o,l,u,_,d=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,Jzt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,E){if(!(_||!e.call(this,C,E))){var N=y(this,n.call(this,C,E),C,E,"mouse");N&&(Hi(C.view).on("mousemove.drag",x,Sp).on("mouseup.drag",S,Sp),lH(C.view),Fw(C),u=!1,o=C.clientX,l=C.clientY,N("start",C))}}function x(C){if(gh(C),!u){var E=C.clientX-o,N=C.clientY-l;u=E*E+N*N>d}s.mouse("drag",C)}function S(C){Hi(C.view).on("mousemove.drag mouseup.drag",null),cH(C.view,u),gh(C),s.mouse("end",C)}function v(C,E){if(e.call(this,C,E)){var N=C.changedTouches,T=n.call(this,C,E),j=N.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?o1(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?o1(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=ijt.exec(e))?new Ci(n[1],n[2],n[3],1):(n=ajt.exec(e))?new Ci(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=ojt.exec(e))?o1(n[1],n[2],n[3],n[4]):(n=ljt.exec(e))?o1(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=cjt.exec(e))?ZA(n[1],n[2]/100,n[3]/100,1):(n=ujt.exec(e))?ZA(n[1],n[2]/100,n[3]/100,n[4]):WA.hasOwnProperty(e)?QA(WA[e]):e==="transparent"?new Ci(NaN,NaN,NaN,0):null}function QA(e){return new Ci(e>>16&255,e>>8&255,e&255,1)}function o1(e,n,t,r){return r<=0&&(e=n=t=NaN),new Ci(e,n,t,r)}function hjt(e){return e instanceof _m||(e=Pd(e)),e?(e=e.rgb(),new Ci(e.r,e.g,e.b,e.opacity)):new Ci}function m5(e,n,t,r){return arguments.length===1?hjt(e):new Ci(e,n,t,r??1)}function Ci(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}Ek(Ci,m5,dH(_m,{brighter(e){return e=e==null?Lv:Math.pow(Lv,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ci(zd(this.r),zd(this.g),zd(this.b),Ov(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:YA,formatHex:YA,formatHex8:_jt,formatRgb:XA,toString:XA}));function YA(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}`}function _jt(){return`#${cd(this.r)}${cd(this.g)}${cd(this.b)}${cd((isNaN(this.opacity)?1:this.opacity)*255)}`}function XA(){const e=Ov(this.opacity);return`${e===1?"rgb(":"rgba("}${zd(this.r)}, ${zd(this.g)}, ${zd(this.b)}${e===1?")":`, ${e})`}`}function Ov(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cd(e){return e=zd(e),(e<16?"0":"")+e.toString(16)}function ZA(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new Qa(e,n,t,r)}function fH(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof _m||(e=Pd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,l=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&l<1?0:a,new Qa(a,o,l,e.opacity)}function pjt(e,n,t,r){return arguments.length===1?fH(e):new Qa(e,n,t,r??1)}function Qa(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}Ek(Qa,pjt,dH(_m,{brighter(e){return e=e==null?Lv:Math.pow(Lv,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Ci(Hw(e>=240?e-240:e+120,s,r),Hw(e,s,r),Hw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Qa(JA(this.h),l1(this.s),l1(this.l),Ov(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ov(this.opacity);return`${e===1?"hsl(":"hsla("}${JA(this.h)}, ${l1(this.s)*100}%, ${l1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function JA(e){return e=(e||0)%360,e<0?e+360:e}function l1(e){return Math.max(0,Math.min(1,e||0))}function Hw(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const Nk=e=>()=>e;function mjt(e,n){return function(t){return e+t*n}}function gjt(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function vjt(e){return(e=+e)==1?hH:function(n,t){return t-n?gjt(n,t,e):Nk(isNaN(n)?t:n)}}function hH(e,n){var t=n-e;return t?mjt(e,t):Nk(isNaN(e)?n:e)}const Iv=(function e(n){var t=vjt(n);function r(s,i){var a=t((s=m5(s)).r,(i=m5(i)).r),o=t(s.g,i.g),l=t(s.b,i.b),u=hH(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=l(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function bjt(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:To(r,s)})),t=qw.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:d.push(s(d)+"rotate(",null,r)-2,x:To(u,_)})):_&&d.push(s(d)+"rotate("+_+r)}function o(u,_,d,p){u!==_?p.push({i:d.push(s(d)+"skewX(",null,r)-2,x:To(u,_)}):_&&d.push(s(d)+"skewX("+_+r)}function l(u,_,d,p,m,x){if(u!==d||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:To(u,d)},{i:S-2,x:To(_,p)})}else(d!==1||p!==1)&&m.push(s(m)+"scale("+d+","+p+")")}return function(u,_){var d=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,d,p),a(u.rotate,_.rotate,d,p),o(u.skewX,_.skewX,d,p),l(u.scaleX,u.scaleY,_.scaleX,_.scaleY,d,p),u=_=null,function(m){for(var x=-1,S=p.length,v;++x=0&&e._call.call(void 0,n),e=e._next;--t_}function nR(){Fd=($v=Ep.now())+iy,t_=z0=0;try{Djt()}finally{t_=0,Ojt(),Fd=0}}function Ljt(){var e=Ep.now(),n=e-$v;n>gH&&(iy-=n,$v=e)}function Ojt(){for(var e,n=Bv,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Bv=t);j0=e,b5(r)}function b5(e){if(!t_){z0&&(z0=clearTimeout(z0));var n=e-Fd;n>24?(e<1/0&&(z0=setTimeout(nR,e-Ep.now()-iy)),y0&&(y0=clearInterval(y0))):(y0||($v=Ep.now(),y0=setInterval(Ljt,gH)),t_=1,vH(nR))}}function rR(e,n,t){var r=new Pv;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Ijt=ry("start","end","cancel","interrupt"),Bjt=[],yH=0,sR=1,y5=2,B1=3,iR=4,x5=5,$1=6;function ay(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;$jt(e,t,{name:n,index:r,group:s,on:Ijt,tween:Bjt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yH})}function jk(e,n){var t=io(e,n);if(t.state>yH)throw new Error("too late; already scheduled");return t}function Yo(e,n){var t=io(e,n);if(t.state>B1)throw new Error("too late; already running");return t}function io(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function $jt(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=bH(i,0,t.time);function i(u){t.state=sR,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,d,p,m;if(t.state!==sR)return l();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===B1)return rR(a);m.state===iR?(m.state=$1,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_y5&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function pTt(e,n,t){var r,s,i=_Tt(n)?jk:Yo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function mTt(e,n){var t=this._id;return arguments.length<2?io(this.node(),t).on.on(e):this.each(pTt(t,e,n))}function gTt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function vTt(){return this.on("end.remove",gTt(this._id))}function bTt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function UTt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ol(e,n,t){this.k=e,this.x=n,this.y=t}Ol.prototype={constructor:Ol,scale:function(e){return e===1?this:new Ol(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ol(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var oy=new Ol(1,0,0);kH.prototype=Ol.prototype;function kH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return oy;return e.__zoom}function Uw(e){e.stopImmediatePropagation()}function x0(e){e.preventDefault(),e.stopImmediatePropagation()}function GTt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function WTt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function aR(){return this.__zoom||oy}function VTt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function KTt(){return navigator.maxTouchPoints||"ontouchstart"in this}function QTt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function CH(){var e=GTt,n=WTt,t=QTt,r=VTt,s=KTt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=I1,u=ry("start","zoom","end"),_,d,p,m=500,x=150,S=0,v=10;function b(q){q.property("__zoom",aR).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",B).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,Y,G,X){var te=q.selection?q.selection():q;te.property("__zoom",aR),q!==te?E(q,Y,G,X):te.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},b.scaleBy=function(q,Y,G,X){b.scaleTo(q,function(){var te=this.__zoom.k,I=typeof Y=="function"?Y.apply(this,arguments):Y;return te*I},G,X)},b.scaleTo=function(q,Y,G,X){b.transform(q,function(){var te=n.apply(this,arguments),I=this.__zoom,L=G==null?C(te):typeof G=="function"?G.apply(this,arguments):G,F=I.invert(L),W=typeof Y=="function"?Y.apply(this,arguments):Y;return t(y(w(I,W),L,F),te,a)},G,X)},b.translateBy=function(q,Y,G,X){b.transform(q,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof G=="function"?G.apply(this,arguments):G),n.apply(this,arguments),a)},null,X)},b.translateTo=function(q,Y,G,X,te){b.transform(q,function(){var I=n.apply(this,arguments),L=this.__zoom,F=X==null?C(I):typeof X=="function"?X.apply(this,arguments):X;return t(oy.translate(F[0],F[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof G=="function"?-G.apply(this,arguments):-G),I,a)},X,te)};function w(q,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===q.k?q:new Ol(Y,q.x,q.y)}function y(q,Y,G){var X=Y[0]-G[0]*q.k,te=Y[1]-G[1]*q.k;return X===q.x&&te===q.y?q:new Ol(q.k,X,te)}function C(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function E(q,Y,G,X){q.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var te=this,I=arguments,L=N(te,I).event(X),F=n.apply(te,I),W=G==null?C(F):typeof G=="function"?G.apply(te,I):G,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=te.__zoom,ce=typeof Y=="function"?Y.apply(te,I):Y,re=l(Z.invert(W).concat(U/Z.k),ce.invert(W).concat(U/ce.k));return function(ne){if(ne===1)ne=ce;else{var Q=re(ne),le=U/Q[2];ne=new Ol(le,W[0]-Q[0]*le,W[1]-Q[1]*le)}L.zoom(null,ne)}})}function N(q,Y,G){return!G&&q.__zooming||new T(q,Y)}function T(q,Y){this.that=q,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,Y),this.taps=0}T.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Y){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Y=Hi(this.that).datum();u.call(q,this.that,new UTt(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:u}),Y)}};function j(q,...Y){if(!e.apply(this,arguments))return;var G=N(this,Y).event(q),X=this.__zoom,te=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),I=Ua(q);if(G.wheel)(G.mouse[0][0]!==I[0]||G.mouse[0][1]!==I[1])&&(G.mouse[1]=X.invert(G.mouse[0]=I)),clearTimeout(G.wheel);else{if(X.k===te)return;G.mouse=[I,X.invert(I)],P1(this),G.start()}x0(q),G.wheel=setTimeout(L,x),G.zoom("mouse",t(y(w(X,te),G.mouse[0],G.mouse[1]),G.extent,a));function L(){G.wheel=null,G.end()}}function M(q,...Y){if(p||!e.apply(this,arguments))return;var G=q.currentTarget,X=N(this,Y,!0).event(q),te=Hi(q.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",U,!0),I=Ua(q,G),L=q.clientX,F=q.clientY;lH(q.view),Uw(q),X.mouse=[I,this.__zoom.invert(I)],P1(this),X.start();function W(Z){if(x0(Z),!X.moved){var ce=Z.clientX-L,re=Z.clientY-F;X.moved=ce*ce+re*re>S}X.event(Z).zoom("mouse",t(y(X.that.__zoom,X.mouse[0]=Ua(Z,G),X.mouse[1]),X.extent,a))}function U(Z){te.on("mousemove.zoom mouseup.zoom",null),cH(Z.view,X.moved),x0(Z),X.event(Z).end()}}function O(q,...Y){if(e.apply(this,arguments)){var G=this.__zoom,X=Ua(q.changedTouches?q.changedTouches[0]:q,this),te=G.invert(X),I=G.k*(q.shiftKey?.5:2),L=t(y(w(G,I),X,te),n.apply(this,Y),a);x0(q),o>0?Hi(this).transition().duration(o).call(E,L,X,q):Hi(this).call(b.transform,L,X,q)}}function B(q,...Y){if(e.apply(this,arguments)){var G=q.touches,X=G.length,te=N(this,Y,q.changedTouches.length===X).event(q),I,L,F,W;for(Uw(q),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Np=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],EH=["Enter"," ","Escape"],NH={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var n_;(function(e){e.Strict="strict",e.Loose="loose"})(n_||(n_={}));var jd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jd||(jd={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const zH={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Kc;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kc||(Kc={}));var Fv;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fv||(Fv={}));var Nt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Nt||(Nt={}));const oR={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function jH(e){return e===null?null:e?"valid":"invalid"}const TH=e=>"id"in e&&"source"in e&&"target"in e,YTt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ak=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pm=(e,n=[0,0])=>{const{width:t,height:r}=Yl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},XTt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):Ak(s)?s:n.nodeLookup.get(s.id));const o=a?Hv(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ly(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return cy(t)},mm=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=ly(t,Hv(s)),r=!0)}),r?cy(t):{x:0,y:0,width:0,height:0}},Rk=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,l=(n.y-r)/s,u=n.width/s,_=n.height/s,d=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const v=m.width??p.width??p.initialWidth??0,b=m.height??p.height??p.initialHeight??0,{x:w,y}=p.internals.positionAbsolute,C=DH(o,l,u,_,w,y,v,b),E=v*b,N=i&&C>0;(!p.internals.handleBounds||N||C>=E||p.dragging)&&d.push(p)}return d},ZTt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function JTt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function eAt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=JTt(e,a),l=mm(o),u=Dk(l,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function AH({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:l,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let d=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",to.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(d=[[l,u],[l+m,u+x]])}else o&&qd(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);const p=qd(d)?Hd(n,d,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",to.error015())),{position:{x:p.x-l+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function tAt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),l=r.filter(p=>p.deletable!==!1),_=ZTt(a,l);for(const p of l)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const d=await s({nodes:a,edges:_});return typeof d=="boolean"?d?{edges:_,nodes:a}:{edges:[],nodes:[]}:d}const r_=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Hd=(e={x:0,y:0},n,t)=>({x:r_(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:r_(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function RH(e,n,t){const{width:r,height:s}=Yl(t),{x:i,y:a}=t.internals.positionAbsolute;return Hd(e,[[i,a],[i+r,a+s]],n)}const lR=(e,n,t)=>et?-r_(Math.abs(e-t),1,n)/n:0,Mk=(e,n,t=15,r=40)=>{const s=lR(e.x,r,n.width-r)*t,i=lR(e.y,r,n.height-r)*t;return[s,i]},ly=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),w5=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),cy=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),jp=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Hv=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=Ak(e)?e.internals.positionAbsolute:pm(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},MH=(e,n)=>cy(ly(w5(e),w5(n))),DH=(e,n,t,r,s,i,a,o)=>{const l=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(l*u)},qv=(e,n)=>DH(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),cR=e=>Xa(e.width)&&Xa(e.height)&&Xa(e.x)&&Xa(e.y),Xa=e=>!isNaN(e)&&isFinite(e),LH=(e,n)=>(t,r)=>{},gm=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),vm=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?gm(o,a):o},s_=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Qf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nAt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Qf(e,t),s=Qf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Qf(e.top??e.y??0,t),s=Qf(e.bottom??e.y??0,t),i=Qf(e.left??e.x??0,n),a=Qf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rAt(e,n,t,r,s,i){const{x:a,y:o}=s_(e,[n,t,r]),{x:l,y:u}=s_({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-l,d=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(d)}}const Dk=(e,n,t,r,s,i)=>{const a=nAt(i,n,t),o=(n-a.x)/e.width,l=(t-a.y)/e.height,u=Math.min(o,l),_=r_(u,r,s),d=e.x+e.width/2,p=e.y+e.height/2,m=n/2-d*_,x=t/2-p*_,S=rAt(e,m,x,_,n,t),v={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:x-v.top+v.bottom,zoom:_}},Tp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function qd(e){return e!=null&&e!=="parent"}function Yl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function OH(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function IH(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function uR(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function sAt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function iAt(e){return{...NH,...e||{}}}function V0(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=Za(e),o=vm({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:l,y:u}=t?gm(o,n):o;return{xSnapped:l,ySnapped:u,...o}}const Lk=e=>({width:e.offsetWidth,height:e.offsetHeight}),BH=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},aAt=["INPUT","SELECT","TEXTAREA"];function $H(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:aAt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const PH=e=>"clientX"in e,Za=(e,n)=>{var i,a;const t=PH(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},dR=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...Lk(a)}})};function FH({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const l=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(l-e),d=Math.abs(u-n);return[l,u,_,d]}function d1(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function fR({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case Nt.Left:return[n-d1(n-r,i),t];case Nt.Right:return[n+d1(r-n,i),t];case Nt.Top:return[n,t-d1(t-s,i)];case Nt.Bottom:return[n,t+d1(s-t,i)]}}function HH({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top,curvature:a=.25}){const[o,l]=fR({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=fR({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[d,p,m,x]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${l} ${u},${_} ${r},${s}`,d,p,m,x]}function qH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const cAt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,uAt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),dAt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",to.error006()),n;const r=t.getEdgeId||cAt;let s;return TH(e)?s={...e}:s={...e,id:r(e)},uAt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function UH({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=qH({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const hR={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},fAt=({source:e,sourcePosition:n=Nt.Bottom,target:t})=>n===Nt.Left||n===Nt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function hAt({source:e,sourcePosition:n=Nt.Bottom,target:t,targetPosition:r=Nt.Top,center:s,offset:i,stepPosition:a}){const o=hR[n],l=hR[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+l.x*i,y:t.y+l.y*i},d=fAt({source:u,sourcePosition:n,target:_}),p=d.x!==0?"x":"y",m=d[p];let x=[],S,v;const b={x:0,y:0},w={x:0,y:0},[,,y,C]=qH({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*l[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,v=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,v=s.y??u.y+(_.y-u.y)*a);const j=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:v},{x:_.x,y:v}];o[p]===m?x=p==="x"?j:M:x=p==="x"?M:j}else{const j=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:j:x=o.y===m?j:M,n===r){const q=Math.abs(e[p]-t[p]);if(q<=i){const Y=Math.min(i-1,i-q);o[p]===m?b[p]=(u[p]>e[p]?-1:1)*Y:w[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const q=p==="x"?"y":"x",Y=o[p]===l[q],G=u[q]>_[q],X=u[q]<_[q];(o[p]===1&&(!Y&&G||Y&&X)||o[p]!==1&&(!Y&&X||Y&&G))&&(x=p==="x"?j:M)}const O={x:u.x+b.x,y:u.y+b.y},B={x:_.x+w.x,y:_.y+w.y},$=Math.max(Math.abs(O.x-x[0].x),Math.abs(B.x-x[0].x)),H=Math.max(Math.abs(O.y-x[0].y),Math.abs(B.y-x[0].y));$>=H?(S=(O.x+B.x)/2,v=x[0].y):(S=x[0].x,v=(O.y+B.y)/2)}const E={x:u.x+b.x,y:u.y+b.y},N={x:_.x+w.x,y:_.y+w.y};return[[e,...E.x!==x[0].x||E.y!==x[0].y?[E]:[],...x,...N.x!==x[x.length-1].x||N.y!==x[x.length-1].y?[N]:[],t],S,v,y,C]}function _At(e,n,t,r){const s=Math.min(_R(e,n)/2,_R(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function k5(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function mAt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const u=k5(l,n);i.has(u)||(a.push({id:u,color:l.color||t,...l}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const GH=1e3,gAt=10,Ok={nodeOrigin:[0,0],nodeExtent:Np,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},vAt={...Ok,checkEquality:!0};function Ik(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function bAt(e,n,t){const r=Ik(Ok,t);for(const s of e.values())if(s.parentId)$k(s,e,n,r);else{const i=pm(s,r.nodeOrigin),a=qd(s.extent)?s.extent:r.nodeExtent,o=Hd(i,a,Yl(s));s.internals.positionAbsolute=o}}function yAt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function Bk(e){return e==="manual"}function C5(e,n,t,r={}){var _,d;const s=Ik(vAt,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!Bk(s.zIndexMode)?GH:0;let l=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=pm(p,s.nodeOrigin),S=qd(p.extent)?p.extent:s.nodeExtent,v=Hd(x,S,Yl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(d=p.measured)==null?void 0:d.height},internals:{positionAbsolute:v,handleBounds:yAt(p,m),z:WH(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(l=!1),p.parentId&&$k(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:u}}function xAt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function $k(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=Ik(Ok,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}xAt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&l==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*gAt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const d=i&&!Bk(l)?GH:0,{x:p,y:m,z:x}=wAt(e,_,a,o,d,l),{positionAbsolute:S}=e.internals,v=p!==S.x||m!==S.y;(v||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:p,y:m}:S,z:x}})}function WH(e,n,t){const r=Xa(e.zIndex)?e.zIndex:0;return Bk(t)?r:r+(e.selected?n:0)}function wAt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,l=Yl(e),u=pm(e,t),_=qd(e.extent)?Hd(u,e.extent,l):u;let d=Hd({x:a+_.x,y:o+_.y},r,l);e.extent==="parent"&&(d=RH(d,l,n));const p=WH(e,s,i),m=n.internals.z??0;return{x:d.x,y:d.y,z:m>=p?m+1:p}}function Pk(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const l=n.get(o.parentId);if(!l)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??jp(l),_=MH(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:l})}return i.size>0&&i.forEach(({expandedRect:o,parent:l},u)=>{var y;const _=l.internals.positionAbsolute,d=Yl(l),p=l.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(d.width,Math.round(o.width)),v=Math.max(d.height,Math.round(o.height)),b=(S-d.width)*p[0],w=(v-d.height)*p[1];(m>0||x>0||b||w)&&(s.push({id:u,type:"position",position:{x:l.position.x-m+b,y:l.position.y-x+w}}),(y=t.get(u))==null||y.forEach(C=>{e.some(E=>E.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(d.width0){const m=Pk(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:l}}async function kAt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function vR(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function VH(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;vR("source",l,_,e,s,a),vR("target",l,u,e,i,o),n.set(r.id,r)}}function KH(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:KH(t,n):!1}function bR(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function CAt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!KH(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return s}function Gw({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,l;const s=[];for(const[u,_]of n){const d=(a=t.get(u))==null?void 0:a.internals.userNode;d&&s.push({...d,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((l=n.get(e))==null?void 0:l.position)||i.position,dragging:r}:s[0],s]}function EAt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=gm(i,n);return{x:a.x-i.x,y:a.y-i.y}}function NAt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,l=!1,u={x:0,y:0},_=null,d=!1,p=null,m=!1,x=!1,S=null;function v({noDragClassName:w,handleSelector:y,domNode:C,isSelectable:E,nodeId:N,nodeClickDistance:T=0}){p=Hi(C);function j({x:$,y:H}){const{nodeLookup:q,nodeExtent:Y,snapGrid:G,snapToGrid:X,nodeOrigin:te,onNodeDrag:I,onSelectionDrag:L,onError:F,updateNodePositions:W}=n();i={x:$,y:H};let U=!1;const Z=o.size>1,ce=Z&&Y?w5(mm(o)):null,re=Z&&X?EAt({dragItems:o,snapGrid:G,x:$,y:H}):null;for(const[ne,Q]of o){if(!q.has(ne))continue;let le={x:$-Q.distance.x,y:H-Q.distance.y};X&&(le=re?{x:Math.round(le.x+re.x),y:Math.round(le.y+re.y)}:gm(le,G));let oe=null;if(Z&&Y&&!Q.extent&&ce){const{positionAbsolute:Se}=Q.internals,ye=Se.x-ce.x+Y[0][0],qe=Se.x+Q.measured.width-ce.x2+Y[1][0],Ie=Se.y-ce.y+Y[0][1],Te=Se.y+Q.measured.height-ce.y2+Y[1][1];oe=[[ye,Ie],[qe,Te]]}const{position:ue,positionAbsolute:pe}=AH({nodeId:ne,nextPosition:le,nodeLookup:q,nodeExtent:oe||Y,nodeOrigin:te,onError:F});U=U||Q.position.x!==ue.x||Q.position.y!==ue.y,Q.position=ue,Q.internals.positionAbsolute=pe}if(x=x||U,!!U&&(W(o,!0),S&&(r||I||!N&&L))){const[ne,Q]=Gw({nodeId:N,dragItems:o,nodeLookup:q});r==null||r(S,o,ne,Q),I==null||I(S,ne,Q),N||L==null||L(S,Q)}}async function M(){if(!_)return;const{transform:$,panBy:H,autoPanSpeed:q,autoPanOnNodeDrag:Y}=n();if(!Y){l=!1,cancelAnimationFrame(a);return}const[G,X]=Mk(u,_,q);(G!==0||X!==0)&&(i.x=(i.x??0)-G/$[2],i.y=(i.y??0)-X/$[2],await H({x:G,y:X})&&j(i)),a=requestAnimationFrame(M)}function O($){var Z;const{nodeLookup:H,multiSelectionActive:q,nodesDraggable:Y,transform:G,snapGrid:X,snapToGrid:te,selectNodesOnDrag:I,onNodeDragStart:L,onSelectionDragStart:F,unselectNodesAndEdges:W}=n();d=!0,(!I||!E)&&!q&&N&&((Z=H.get(N))!=null&&Z.selected||W()),E&&I&&N&&(e==null||e(N));const U=V0($.sourceEvent,{transform:G,snapGrid:X,snapToGrid:te,containerBounds:_});if(i=U,o=CAt(H,Y,U,N),o.size>0&&(t||L||!N&&F)){const[ce,re]=Gw({nodeId:N,dragItems:o,nodeLookup:H});t==null||t($.sourceEvent,o,ce,re),L==null||L($.sourceEvent,ce,re),N||F==null||F($.sourceEvent,re)}}const B=uH().clickDistance(T).on("start",$=>{const{domNode:H,nodeDragThreshold:q,transform:Y,snapGrid:G,snapToGrid:X}=n();_=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,x=!1,S=$.sourceEvent,q===0&&O($),i=V0($.sourceEvent,{transform:Y,snapGrid:G,snapToGrid:X,containerBounds:_}),u=Za($.sourceEvent,_)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:q,snapGrid:Y,snapToGrid:G,nodeDragThreshold:X,nodeLookup:te}=n(),I=V0($.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:G,containerBounds:_});if(S=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!te.has(N))&&(m=!0),!m){if(!l&&H&&d&&(l=!0,M()),!d){const L=Za($.sourceEvent,_),F=L.x-u.x,W=L.y-u.y;Math.sqrt(F*F+W*W)>X&&O($)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&o&&d&&(u=Za($.sourceEvent,_),j(I))}}).on("end",$=>{if(!d||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(l=!1,d=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:H,updateNodePositions:q,onNodeDragStop:Y,onSelectionDragStop:G}=n();if(x&&(q(o,!1),x=!1),s||Y||!N&&G){const[X,te]=Gw({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});s==null||s($.sourceEvent,o,X,te),Y==null||Y($.sourceEvent,X,te),N||G==null||G($.sourceEvent,te)}}}).filter($=>{const H=$.target;return!$.button&&(!w||!bR(H,`.${w}`,C))&&(!y||bR(H,y,C))});p.call(B)}function b(){p==null||p.on(".drag",null)}return{update:v,destroy:b}}function zAt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())qv(s,jp(i))>0&&r.push(i);return r}const jAt=250;function TAt(e,n,t,r){var o,l;let s=[],i=1/0;const a=zAt(e,t,n+jAt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of _){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:m}=Ud(u,d,d.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function QH(e,n,t,r,s,i=!1){var u,_,d;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((d=a.internals.handleBounds)==null?void 0:d.target)??[]],l=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return l&&i?{...l,...Ud(a,l,l.position,!0)}:l}function YH(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function AAt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const XH=()=>!0;function RAt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:l,lib:u,autoPanOnConnect:_,flowId:d,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:v,isValidConnection:b=XH,onReconnectEnd:w,updateConnection:y,getTransform:C,getFromHandle:E,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:j}){const M=BH(e.target);let O=0,B;const{x:$,y:H}=Za(e),q=YH(i,j),Y=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!Y||!q)return;const X=QH(s,q,r,l,n);if(!X)return;let te=Za(e,Y),I=!1,L=null,F=!1,W=null;function U(){if(!_||!Y)return;const[ue,pe]=Mk(te,Y,N);p({x:ue,y:pe}),O=requestAnimationFrame(U)}const Z={...X,nodeId:s,type:q,position:X.position},ce=l.get(s);let ne={inProgress:!0,isValid:null,from:Ud(ce,Z,Nt.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ce,to:te,toHandle:null,toPosition:oR[Z.position],toNode:null,pointer:te};function Q(){G=!0,y(ne),x==null||x(e,{nodeId:s,handleId:r,handleType:q})}T===0&&Q();function le(ue){if(!G){const{x:Te,y:vt}=Za(ue),Dt=Te-$,Ut=vt-H;if(!(Dt*Dt+Ut*Ut>T*T))return;Q()}if(!E()||!Z){oe(ue);return}const pe=C();te=Za(ue,Y),B=TAt(vm(te,pe,!1,[1,1]),t,l,Z),I||(U(),I=!0);const Se=ZH(ue,{handle:B,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:b,doc:M,lib:u,flowId:d,nodeLookup:l});W=Se.handleDomNode,L=Se.connection,F=AAt(!!B,Se.isValid);const ye=l.get(s),qe=ye?Ud(ye,Z,Nt.Left,!0):ne.from,Ie={...ne,from:qe,isValid:F,to:Se.toHandle&&F?s_({x:Se.toHandle.x,y:Se.toHandle.y},pe):te,toHandle:Se.toHandle,toPosition:F&&Se.toHandle?Se.toHandle.position:oR[Z.position],toNode:Se.toHandle?l.get(Se.toHandle.nodeId):null,pointer:te};y(Ie),ne=Ie}function oe(ue){if(!("touches"in ue&&ue.touches.length>0)){if(G){(B||W)&&L&&F&&(S==null||S(L));const{inProgress:pe,...Se}=ne,ye={...Se,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ue,ye),i&&(w==null||w(ue,ye))}m(),cancelAnimationFrame(O),I=!1,F=!1,L=null,W=null,M.removeEventListener("mousemove",le),M.removeEventListener("mouseup",oe),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",oe)}}M.addEventListener("mousemove",le),M.addEventListener("mouseup",oe),M.addEventListener("touchmove",le),M.addEventListener("touchend",oe)}function ZH(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:l,isValidConnection:u=XH,nodeLookup:_}){const d=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${l}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=Za(e),S=a.elementFromPoint(m,x),v=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=YH(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),E=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!w)return b;const T={source:d?y:r,sourceHandle:d?C:s,target:d?r:y,targetHandle:d?s:C};b.connection=T;const M=E&&N&&(t===n_.Strict?d&&w==="source"||!d&&w==="target":y!==r||C!==s);b.isValid=M&&u(T),b.toHandle=QH(y,w,C,_,t,!0)}return b}const E5={onPointerDown:RAt,isValid:ZH};function MAt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Hi(e);function i({translateExtent:o,width:l,height:u,zoomStep:_=1,pannable:d=!0,zoomable:p=!0,inversePan:m=!1}){const x=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),E=y.sourceEvent.ctrlKey&&Tp()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,T=C[2]*Math.pow(2,N*E);n.scaleTo(T)};let S=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[E[0]-S[0],E[1]-S[1]];S=E;const T=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),j={x:C[0]-N[0]*T,y:C[1]-N[1]*T},M=[[0,0],[l,u]];n.setViewportConstrained({x:j.x,y:j.y,zoom:C[2]},M,o)},w=CH().on("start",v).on("zoom",d?b:null).on("zoom.wheel",p?x:null);s.call(w,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:Ua}}const uy=e=>({x:e.x,y:e.y,zoom:e.k}),Ww=({x:e,y:n,zoom:t})=>oy.translate(e,n).scale(t),ah=(e,n)=>e.target.closest(`.${n}`),JH=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),DAt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Vw=(e,n=0,t=DAt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},eq=e=>{const n=e.ctrlKey&&Tp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function LAt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:u}){return _=>{if(ah(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const d=t.property("__zoom").k||1;if(_.ctrlKey&&a){const v=Ua(_),b=eq(_),w=d*Math.pow(2,b);r.scaleTo(t,w,v,_);return}const p=_.deltaMode===1?20:1;let m=s===jd.Vertical?0:_.deltaX*p,x=s===jd.Horizontal?0:_.deltaY*p;!Tp()&&_.shiftKey&&s!==jd.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/d)*i,-(x/d)*i,{internal:!0});const S=uy(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function OAt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=ah(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function IAt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=uy(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function BAt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&JH(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,uy(i.transform)))}}function $At({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&JH(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const l=uy(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,l)},t?150:0)}}}function PAt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:u,connectionInProgress:_}){return d=>{var v;const p=e||n,m=t&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(ah(d,`${u}-flow__node`)||ah(d,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||ah(d,o)&&x||ah(d,l)&&(!x||s&&x&&!e)||!t&&d.ctrlKey&&x)return!1;if(!t&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x)&&S}}function FAt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),d=CH().scaleExtent([n,t]).translateExtent(r),p=Hi(e).call(d);w({x:s.x,y:s.y,zoom:r_(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");d.wheelDelta(eq);async function S(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).transform(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:$,onPaneContextMenu:H,userSelectionActive:q,panOnScroll:Y,panOnDrag:G,panOnScrollMode:X,panOnScrollSpeed:te,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:F,zoomOnDoubleClick:W,zoomActivationKeyPressed:U,lib:Z,onTransformChange:ce,connectionInProgress:re,paneClickDistance:ne,selectionOnDrag:Q}){q&&!u.isZoomingOrPanning&&b();const le=Y&&!U&&!q;d.clickDistance(Q?1/0:!Xa(ne)||ne<0?0:ne);const oe=le?LAt({zoomPanValues:u,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:te,zoomOnPinch:L,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):OAt({noWheelClassName:B,preventScrolling:I,d3ZoomHandler:m});p.on("wheel.zoom",oe,{passive:!1});const ue=IAt({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",ue);const pe=BAt({zoomPanValues:u,panOnDrag:G,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:ce});d.on("zoom",pe);const Se=$At({zoomPanValues:u,panOnDrag:G,panOnScroll:Y,onPaneContextMenu:H,onPanZoomEnd:o,onDraggingChange:l});d.on("end",Se);const ye=PAt({zoomActivationKeyPressed:U,panOnDrag:G,zoomOnScroll:F,panOnScroll:Y,zoomOnDoubleClick:W,zoomOnPinch:L,userSelectionActive:q,noPanClassName:$,noWheelClassName:B,lib:Z,connectionInProgress:re});d.filter(ye),W?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(B,$,H){const q=Ww(B),Y=d==null?void 0:d.constrain()(q,$,H);return Y&&await S(Y),Y}async function y(B,$){const H=Ww(B);return await S(H,$),H}function C(B){if(p){const $=Ww(B),H=p.property("__zoom");(H.k!==B.zoom||H.x!==B.x||H.y!==B.y)&&(d==null||d.transform(p,$,null,{sync:!0}))}}function E(){const B=p?kH(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function N(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleTo(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}async function T(B,$){return p?new Promise(H=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?W0:I1).scaleBy(Vw(p,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>H(!0)),B)}):!1}function j(B){d==null||d.scaleExtent(B)}function M(B){d==null||d.translateExtent(B)}function O(B){const $=!Xa(B)||B<0?0:B;d==null||d.clickDistance($)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:w,getViewport:E,scaleTo:N,scaleBy:T,setScaleExtent:j,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var i_;(function(e){e.Line="line",e.Handle="handle"})(i_||(i_={}));function HAt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(l[0]=l[0]*-1),o&&i&&(l[1]=l[1]*-1),l}function yR(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Hc(e,n){return Math.max(0,n-e)}function qc(e,n){return Math.max(0,e-n)}function f1(e,n,t){return Math.max(0,n-e,e-t)}function xR(e,n){return e?!n:n}function qAt(e,n,t,r,s,i,a,o){let{affectsX:l,affectsY:u}=n;const{isHorizontal:_,isVertical:d}=n,p=_&&d,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:v,minHeight:b,maxHeight:w}=r,{x:y,y:C,width:E,height:N,aspectRatio:T}=e;let j=Math.floor(_?m-e.pointerX:0),M=Math.floor(d?x-e.pointerY:0);const O=E+(l?-j:j),B=N+(u?-M:M),$=-i[0]*E,H=-i[1]*N;let q=f1(O,S,v),Y=f1(B,b,w);if(a){let te=0,I=0;l&&j<0?te=Hc(y+j+$,a[0][0]):!l&&j>0&&(te=qc(y+O+$,a[1][0])),u&&M<0?I=Hc(C+M+H,a[0][1]):!u&&M>0&&(I=qc(C+B+H,a[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(o){let te=0,I=0;l&&j>0?te=qc(y+j,o[0][0]):!l&&j<0&&(te=Hc(y+O,o[1][0])),u&&M>0?I=qc(C+M,o[0][1]):!u&&M<0&&(I=Hc(C+B,o[1][1])),q=Math.max(q,te),Y=Math.max(Y,I)}if(s){if(_){const te=f1(O/T,b,w)*T;if(q=Math.max(q,te),a){let I=0;!l&&!u||l&&!u&&p?I=qc(C+H+O/T,a[1][1])*T:I=Hc(C+H+(l?j:-j)/T,a[0][1])*T,q=Math.max(q,I)}if(o){let I=0;!l&&!u||l&&!u&&p?I=Hc(C+O/T,o[1][1])*T:I=qc(C+(l?j:-j)/T,o[0][1])*T,q=Math.max(q,I)}}if(d){const te=f1(B*T,S,v)/T;if(Y=Math.max(Y,te),a){let I=0;!l&&!u||u&&!l&&p?I=qc(y+B*T+$,a[1][0])/T:I=Hc(y+(u?M:-M)*T+$,a[0][0])/T,Y=Math.max(Y,I)}if(o){let I=0;!l&&!u||u&&!l&&p?I=Hc(y+B*T,o[1][0])/T:I=qc(y+(u?M:-M)*T,o[0][0])/T,Y=Math.max(Y,I)}}}M=M+(M<0?Y:-Y),j=j+(j<0?q:-q),s&&(p?O>B*T?M=(xR(l,u)?-j:j)/T:j=(xR(l,u)?-M:M)*T:_?(M=j/T,u=l):(j=M*T,l=u));const G=l?y+j:y,X=u?C+M:C;return{width:E+(l?-j:j),height:N+(u?-M:M),x:i[0]*j*(l?-1:1)+G,y:i[1]*M*(u?-1:1)+X}}const tq={width:0,height:0,x:0,y:0},UAt={...tq,pointerX:0,pointerY:0,aspectRatio:1};function GAt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,l=t[1]*a;return[[r-o,s-l],[r+i-o,s+a-l]]}function WAt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Hi(e);let a={controlDirection:yR("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:d,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:v}){let b={...tq},w={...UAt};a={boundaries:_,resizeDirection:p,keepAspectRatio:d,controlDirection:yR(u)};let y,C=null,E=[],N,T,j,M=!1;const O=uH().on("start",B=>{const{nodeLookup:$,transform:H,snapGrid:q,snapToGrid:Y,nodeOrigin:G,paneDomNode:X}=t();if(y=$.get(n),!y)return;C=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:te,ySnapped:I}=V0(B.sourceEvent,{transform:H,snapGrid:q,snapToGrid:Y,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},w={...b,pointerX:te,pointerY:I,aspectRatio:b.width/b.height},N=void 0,T=qd(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=$.get(y.parentId)),N&&y.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),E=[],j=void 0;for(const[L,F]of $)if(F.parentId===n&&(E.push({id:L,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const W=GAt(F,y,F.origin??G);j?j=[[Math.min(W[0][0],j[0][0]),Math.min(W[0][1],j[0][1])],[Math.max(W[1][0],j[1][0]),Math.max(W[1][1],j[1][1])]]:j=W}m==null||m(B,{...b})}).on("drag",B=>{const{transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y}=t(),G=V0(B.sourceEvent,{transform:$,snapGrid:H,snapToGrid:q,containerBounds:C}),X=[];if(!y)return;const{x:te,y:I,width:L,height:F}=b,W={},U=y.origin??Y,{width:Z,height:ce,x:re,y:ne}=qAt(w,a.controlDirection,G,a.boundaries,a.keepAspectRatio,U,T,j),Q=Z!==L,le=ce!==F,oe=re!==te&&Q,ue=ne!==I&≤if(!oe&&!ue&&!Q&&!le)return;if((oe||ue||U[0]===1||U[1]===1)&&(W.x=oe?re:b.x,W.y=ue?ne:b.y,b.x=W.x,b.y=W.y,E.length>0)){const qe=re-te,Ie=ne-I;for(const Te of E)Te.position={x:Te.position.x-qe+U[0]*(Z-L),y:Te.position.y-Ie+U[1]*(ce-F)},X.push(Te)}if((Q||le)&&(W.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:b.width,W.height=le&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:b.height,b.width=W.width,b.height=W.height),N&&y.expandParent){const qe=U[0]*(W.width??0);W.x&&W.x{M&&(S==null||S(B,{...b}),s==null||s({...b}),M=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}const VAt={},wR=e=>{let n;const t=new Set,r=(_,d)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=d??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,l={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(VAt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=n=e(r,s,l);return l},KAt=e=>e?wR(e):wR,{useDebugValue:QAt}=Je,{useSyncExternalStoreWithSelector:YAt}=gV,XAt=e=>e;function nq(e,n=XAt,t){const r=YAt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return QAt(r),r}const SR=(e,n)=>{const t=KAt(e),r=(s,i=n)=>nq(t,s,i);return Object.assign(r,t),r},ZAt=(e,n)=>e?SR(e,n):SR;function kr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const dy=R.createContext(null),JAt=dy.Provider,rq=to.error001("react");function An(e,n){const t=R.useContext(dy);if(t===null)throw new Error(rq);return nq(t,e,n)}function Er(){const e=R.useContext(dy);if(e===null)throw new Error(rq);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const kR={display:"none"},eRt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sq="react-flow__node-desc",iq="react-flow__edge-desc",tRt="react-flow__aria-live",nRt=e=>e.ariaLiveMessage,rRt=e=>e.ariaLabelConfig;function sRt({rfId:e}){const n=An(nRt);return f.jsx("div",{id:`${tRt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:eRt,children:n})}function iRt({rfId:e,disableKeyboardA11y:n}){const t=An(rRt);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${sq}-${e}`,style:kR,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${iq}-${e}`,style:kR,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(sRt,{rfId:e})]})}const fy=R.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return f.jsx("div",{className:as(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});fy.displayName="Panel";const CR="https://reactflow.dev?utm_source=attribution";function aRt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(fy,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${CR}`,children:f.jsx("a",{href:CR,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const oRt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},h1=e=>e.id;function lRt(e,n){return kr(e.selectedNodes.map(h1),n.selectedNodes.map(h1))&&kr(e.selectedEdges.map(h1),n.selectedEdges.map(h1))}function cRt({onSelectionChange:e}){const n=Er(),{selectedNodes:t,selectedEdges:r}=An(oRt,lRt);return R.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const uRt=e=>!!e.onSelectionChangeHandlers;function dRt({onSelectionChange:e}){const n=An(uRt);return e||n?f.jsx(cRt,{onSelectionChange:e}):null}const aq=[0,0],fRt={x:0,y:0,zoom:1},hRt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],ER=[...hRt,"rfId"],_Rt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),NR={translateExtent:Np,nodeOrigin:aq,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function pRt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=An(_Rt,kr),u=Er();R.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{_.current=NR,o()}),[]);const _=R.useRef(NR);return R.useEffect(()=>{for(const d of ER){const p=e[d],m=_.current[d];p!==m&&(typeof e[d]>"u"||(d==="nodes"?n(p):d==="edges"?t(p):d==="minZoom"?r(p):d==="maxZoom"?s(p):d==="translateExtent"?i(p):d==="nodeExtent"?a(p):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:iAt(p)}):d==="fitView"?u.setState({fitViewQueued:p}):d==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[d]:p})))}_.current=e},ER.map(d=>e[d])),null}function zR(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function mRt(e){var r;const[n,t]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){t(e);return}const s=zR(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=zR())!=null&&r.matches?"dark":"light"}const jR=typeof document<"u"?document:null;function Ap(e=null,n={target:jR,actInsideInputWithModifier:!0}){const[t,r]=R.useState(!1),s=R.useRef(!1),i=R.useRef(new Set([])),[a,o]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??zR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=TR(m.code,o);if(i.current.add(m[S]),jR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=TR(m.code,o);jR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function jR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function TR(e,n){return n.includes(e)?"code":"key"}const hRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)_Rt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function _Rt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function pRt(e,n){return oq(e,n)}function mRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function AR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function RR(e){return{id:e.id,type:"remove"}}const gRt=LH();function vRt(e,n,t={}){return oAt(e,n,{...t,onError:t.onError??gRt})}const MR=e=>WTt(e),bRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const yRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function DR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>xRt(()=>t(s=>s+BigInt(1))));return yRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function xRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function wRt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=AR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=DR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(AR({items:m,lookup:p}))},[]),i=DR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function SRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kRt=e=>!!e.panZoom;function Fk(){const e=hRt(),n=Er(),t=SRt(),r=An(kRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=MR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&MR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&bRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await XTt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(RR);v==null||v(N),w(M)}if(j){const M=E.map(RR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=lR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=Uv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=lR(d)?d:l(d);if(!S)return!1;const v=Uv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return VTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??eAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const LR=e=>e.selected,CRt=typeof window<"u"?window:void 0;function ERt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:CRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(LR),edges:a.filter(LR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function NRt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const _y={position:"absolute",width:"100%",height:"100%",top:0,left:0},zRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(zRt,kr),O=Ap(p),B=R.useRef();NRt(N);const $=R.useCallback(H=>{b==null||b({x:H[0],y:H[1],zoom:H[2]}),w||E.setState({transform:H})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=IAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoom:(G,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(G,X),te==null||te(X)}});const{x:H,y:q,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[H,q,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:_y,children:x})}const TRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ARt(){const{userSelectionActive:e,userSelectionRect:n}=An(TRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Qw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},RRt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(RRt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),H=R.useRef(!1),q=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(H.current||$.current||b.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{H.current&&(Q.stopPropagation(),H.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ue=Q.target===j.current;if(!ue&&!!Q.target.closest(".nokey")||!e||!(a&&ue||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),H.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ue||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ue,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ue),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!cR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!cR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(q.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!H.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ue,y:pe}=q.current;F(ue,pe),v.current=requestAnimationFrame(W)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>U(),[]);const Z=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ue}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);q.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!H.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ue(),o==null||o(Q)}H.current=!0,Y.current||(W(),Y.current=!0),F(pe,Se)},ce=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),U())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),U()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Qw(G,j),onContextMenu:Qw(X,j),onWheel:Qw(te,j),onPointerEnter:T?void 0:p,onPointerMove:T?Z:m,onPointerUp:ce,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:_y,children:[S,f.jsx(ARt,{})]})}function N5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=SAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{N5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const DRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=DRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),LRt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),ORt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function IRt({children:e}){const n=An(ORt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function BRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $Rt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PRt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return $Rt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function FRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=BRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(PRt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:W,setEdges:U,onError:Z}=v.getState();U(vRt(F,W,{onError:Z}))}I==null||I(F),o==null||o(F)},H=X=>{if(!b)return;const te=PH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();E5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},q=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:W,lib:U,rfId:Z,nodeLookup:ce,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=E5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:Z,doc:ne,lib:U,nodeLookup:ce});oe&&le&&$(le);const ue=structuredClone(re);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,I==null||I(X,ue),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:w?q:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(FRt));function HRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function qRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function URt(){return null}function GRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const Gv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},OR={input:HRt,default:qRt,output:GRt,group:URt};function WRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const VRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function KRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(VRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Gv,m.key)&&(m.preventDefault(),l({direction:Gv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const IR=typeof window<"u"?window:void 0,QRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,preventScrolling:q,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:W}=An(QRt,kr),U=Ap(u,{target:IR}),Z=Ap(S,{target:IR}),ce=Z||j,re=Z||C,ne=_&&ce!==!0,Q=U||W||ne;return ERt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(jRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!U&&ce,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,zoomActivationKeyCode:v,preventScrolling:q,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(MRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ce,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(KRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}_q.displayName="FlowRenderer";const YRt=R.memo(_q),XRt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function ZRt(e){return An(R.useCallback(XRt(e),[e]),kr)}const JRt=e=>e.updateNodeInternals;function eMt(){const e=An(JRt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function tMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function nMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||OR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||OR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),H=OH(y),q=tMt({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),Y=uq({nodeRef:q,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),te=WRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,U=i?Q=>i(Q,{...C.userNode}):void 0,Z=a?Q=>a(Q,{...C.userNode}):void 0,ce=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&N5({id:e,store:$,nodeRef:q}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";N5({id:e,store:$,unselect:le,nodeRef:q})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(Gv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:Gv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=q.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ue,setCenter:pe}=$.getState();if(!ue)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:H?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:W,onContextMenu:U,onClick:ce,onDoubleClick:Z,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(LRt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var rMt=R.memo(nMt);const sMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(sMt,kr),a=ZRt(e.onlyRenderVisibleElements),o=eMt();return f.jsx("div",{className:"react-flow__nodes",style:_y,children:a.map(l=>f.jsx(rMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const iMt=R.memo(pq);function aMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&sAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const oMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},lMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},BR={[Hv.Arrow]:oMt,[Hv.ArrowClosed]:lMt};function cMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(BR,e)?BR[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const uMt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=cMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>fAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(uMt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var dMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const fMt=R.memo(gq);function py({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(fMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function $R({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=$R({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=$R({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(py,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const hMt=bq({isInternal:!1}),yq=bq({isInternal:!0});hMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=S5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(py,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const _Mt=kq({isInternal:!1}),Cq=kq({isInternal:!0});_Mt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(py,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const pMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});pMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(py,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const mMt=zq({isInternal:!1}),jq=zq({isInternal:!0});mMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const PR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},FR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,vMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,HR="react-flow__edgeupdater";function qR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([HR,`${HR}-${o}`]),cx:gMt(n,r,e),cy:vMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function bMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:H,rfId:q,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",te=(F,W)=>{p(!1),d==null||d(F,t,E.type,W)},I=F=>u==null?void 0:u(t,F),L=(F,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,W)};E5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:q,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var W,U;return((U=(W=x.getState()).isValidConnection)==null?void 0:U.call(W,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var W,U;return(U=(W=x.getState()).onConnectEnd)==null?void 0:U.call(W,...F)},onReconnectEnd:te,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(qR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(qR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function yMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||PR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||PR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[H,q]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return FR;const qe=dAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=rAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||FR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),U=R.useMemo(()=>y.markerStart?`url('#${k5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),Z=R.useMemo(()=>y.markerEnd?`url('#${k5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const ce=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ue=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:ce,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ue:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!H&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(bMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,setUpdateHover:$,setReconnecting:q})]})})}var xMt=R.memo(yMt);const wMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(wMt,kr),C=aMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(xMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const SMt=R.memo(Tq),kMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CMt({children:e}){const n=An(kMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function EMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const NMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function zMt(e){const n=An(NMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function jMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function TMt(e){return jMt}function AMt(e){const n=TMt();return An(n,kr)}const RMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(RMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=AMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=S5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=S5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const DMt={};function UR(e=DMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function LMt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ue,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return UR(e),UR(n),LMt(),EMt(t),zMt(Re),f.jsx(YRt,{onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ue,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(CMt,{children:[f.jsx(SMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(MMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(iMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const OMt=R.memo(Rq),IMt=LH(),GR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=C5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:IMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>KAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await YTt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...GR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=C5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=bAt(v,w,y,C,E,N,M);B&&(pAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),H={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const q=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:q})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(H)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=pRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=mRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(C5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return yAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...GR()})}},Object.is);function $Mt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>BMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(QAt,{value:x,children:f.jsx(wRt,{children:f.jsx(IRt,{children:m})})})}function PMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(fy)?f.jsx(f.Fragment,{children:e}):f.jsx($Mt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const FMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:H,onSelectionDragStart:q,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:W=Kc.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ue=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=lRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Fr},Lr){const cs=Ma||"1",bs=fRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Fr,onScroll:yr,style:{...sa,...FMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(PMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(dRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:q,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(OMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ue,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(oRt,{onSelectionChange:H}),fn,f.jsx(nRt,{proOptions:zi,position:ao}),f.jsx(tRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var qMt=lq(HMt);function UMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function GMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const WMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},VMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(VMt,kr),x=r||WMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,..._y,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(GMt,{radius:y/2,className:_}):f.jsx(UMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const KMt=R.memo(Mq);function QMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function YMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function ZMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const eDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(eDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(hy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(QMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(YMt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(XMt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(JMt,{}):f.jsx(ZMt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function tDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const nDt=R.memo(tDt),rDt=e=>e.nodes.map(n=>n.id),Yw=e=>e instanceof Function?e:()=>e;function sDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=nDt,onClick:a}){const o=An(rDt,kr),l=Yw(n),u=Yw(e),_=Yw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(aDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function iDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const aDt=R.memo(iDt);var oDt=R.memo(sDt);const lDt=200,cDt=150,uDt=e=>!e.hidden,dDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:uDt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:H,ariaLabelConfig:q}=An(dDt,kr),Y=(e==null?void 0:e.width)??lDt,G=(e==null?void 0:e.height)??cDt,X=T.width/Y,te=T.height/G,I=Math.max(X,te),L=I*Y,F=I*G,W=C*I,U=T.x-(L-T.width)/2-W,Z=T.y-(F-T.height)/2-W,ce=L+W*2,re=F+W*2,ne=`${fDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=jAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:H,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,H]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ue=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??q["minimap.ariaLabel"];return f.jsx(hy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${U} ${Z} ${ce} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(oDt,{onClick:ue,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-W},${Z-W}h${ce+W*2}v${re+W*2}h${-ce-W*2}z - M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const hDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,_Dt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function pDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(hDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??_Dt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=HAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:H,nodeLookup:q,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],te={x:B.x,y:B.y},I=q.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,F=B.width??I.measured.width??0,W=B.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:F,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:W},I.parentId,q,L)}},Z=Pk([U],q,Y,G);X.push(...Z),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*W,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}H(X)},onEnd:({width:B,height:$})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(pDt);function mDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function gDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Xw=380,Zw=12,vDt=350,bDt=150,z5=new EventTarget;function yDt(){z5.dispatchEvent(new Event("move"))}function xDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return z5.addEventListener("move",u),()=>{z5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},vDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),bDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function wDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function SDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=mDt(),_=s.right+Zw+Xw<=window.innerWidth,d=s.x-Zw-Xw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=gDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Zw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...Xgt(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` +`)),_=u.reduce((d,p)=>d.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return R.useEffect(()=>{const l=(n==null?void 0:n.target)??jR,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var v,b;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&$H(m))return!1;const S=AR(m.code,o);if(i.current.add(m[S]),TR(a,i.current,!1)){const w=((b=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:b[0])||m.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&m.preventDefault(),r(!0)}},d=m=>{const x=AR(m.code,o);TR(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",_),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{l==null||l.removeEventListener("keydown",_),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function TR(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function AR(e,n){return n.includes(e)?"code":"key"}const gRt=()=>{const e=Er();return R.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),l=Dk(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:l}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-l},_=t.snapGrid??s,d=t.snapToGrid??i;return vm(u,r,d,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=s_(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function oq(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const l of a)vRt(l,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function vRt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function bRt(e,n){return oq(e,n)}function yRt(e,n){return oq(e,n)}function sd(e,n){return{id:e,type:"select",selected:n}}function oh(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(sd(i.id,a)))}return r}function RR({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),l=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;l!==void 0&&l!==a&&t.push({id:a.id,item:a,type:"replace"}),l===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function MR(e){return{id:e.id,type:"remove"}}const xRt=LH();function wRt(e,n,t={}){return dAt(e,n,{...t,onError:t.onError??xRt})}const DR=e=>YTt(e),SRt=e=>TH(e);function lq(e){return R.forwardRef(e)}const kRt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function LR(e){const[n,t]=R.useState(BigInt(0)),[r]=R.useState(()=>CRt(()=>t(s=>s+BigInt(1))));return kRt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function CRt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const cq=R.createContext(null);function ERt({children:e}){const n=Er(),t=R.useCallback(o=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:_,onNodesChange:d,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=l;for(const b of o)S=typeof b=="function"?b(S):b;let v=RR({items:S,lookup:p});for(const b of x.values())v=b(v);_&&u(S),v.length>0?d==null||d(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:y}=n.getState();b&&y(w)})},[]),r=LR(t),s=R.useCallback(o=>{const{edges:l=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:d,edgeLookup:p}=n.getState();let m=l;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):d&&d(RR({items:m,lookup:p}))},[]),i=LR(s),a=R.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(cq.Provider,{value:a,children:e})}function NRt(){const e=R.useContext(cq);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zRt=e=>!!e.panZoom;function Fk(){const e=gRt(),n=Er(),t=NRt(),r=An(zRt),s=R.useMemo(()=>{const i=d=>n.getState().nodeLookup.get(d),a=d=>{t.nodeQueue.push(d)},o=d=>{t.edgeQueue.push(d)},l=d=>{var b,w;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=DR(d)?d:p.get(d.id),S=x.parentId?IH(x.position,x.measured,x.parentId,p,m):x.position,v={...x,position:S,width:((b=x.measured)==null?void 0:b.width)??x.width,height:((w=x.measured)==null?void 0:w.height)??x.height};return jp(v)},u=(d,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&DR(v)?v:{...S,...v}}return S}))},_=(d,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===d){const v=typeof p=="function"?p(S):p;return m.replace&&SRt(v)?v:{...S,...v}}return S}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=i(d))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(p=>({...p}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:a,setEdges:o,addNodes:d=>{const p=Array.isArray(d)?d:[d];t.nodeQueue.push(m=>[...m,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:m}=n.getState(),[x,S,v]=m;return{nodes:d.map(b=>({...b})),edges:p.map(b=>({...b})),viewport:{x,y:S,zoom:v}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:E,edges:N}=await tAt({nodesToRemove:d,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),T=N.length>0,j=E.length>0;if(T){const M=N.map(MR);v==null||v(N),w(M)}if(j){const M=E.map(MR);S==null||S(E),b(M)}return(j||T)&&(y==null||y({nodes:E,edges:N})),{deletedNodes:E,deletedEdges:N}},getIntersectingNodes:(d,p=!0,m)=>{const x=cR(d),S=x?d:l(d),v=m!==void 0;return S?(m||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!x&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const y=jp(v?b:w),C=qv(y,S);return p&&C>0||C>=y.width*y.height||C>=S.width*S.height}):[]},isNodeIntersecting:(d,p,m=!0)=>{const S=cR(d)?d:l(d);if(!S)return!1;const v=qv(S,p);return m&&v>0||v>=p.width*p.height||v>=S.width*S.height},updateNode:u,updateNodeData:(d,p,m={replace:!1})=>{u(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(d,p,m={replace:!1})=>{_(d,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return XTt(d,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:d,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${d}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:x.values())??[])},fitView:async d=>{const p=n.getState().fitViewResolver??sAt();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return R.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const OR=e=>e.selected,jRt=typeof window<"u"?window:void 0;function TRt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=Er(),{deleteElements:r}=Fk(),s=Ap(e,{actInsideInputWithModifier:!1}),i=Ap(n,{target:jRt});R.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(OR),edges:a.filter(OR)}),t.setState({nodesSelectionActive:!1})}},[s]),R.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function ARt(e){const n=Er();R.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=Lk(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",to.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const hy={position:"absolute",width:"100%",height:"100%",top:0,left:0},RRt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function MRt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=jd.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:u,minZoom:_,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:y,selectionOnDrag:C}){const E=Er(),N=R.useRef(null),{userSelectionActive:T,lib:j,connectionInProgress:M}=An(RRt,kr),O=Ap(p),B=R.useRef();ARt(N);const $=R.useCallback(H=>{b==null||b({x:H[0],y:H[1],zoom:H[2]}),w||E.setState({transform:H})},[b,w]);return R.useEffect(()=>{if(N.current){B.current=FAt({domNode:N.current,minZoom:_,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:G=>E.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:te,onMoveStart:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoom:(G,X)=>{const{onViewportChange:te,onMove:I}=E.getState();I==null||I(G,X),te==null||te(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:te,onMoveEnd:I}=E.getState();I==null||I(G,X),te==null||te(X)}});const{x:H,y:q,zoom:Y}=B.current.getViewport();return E.setState({panZoom:B.current,transform:[H,q,Y],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=B.current)==null||G.destroy()}}},[]),R.useEffect(()=>{var H;(H=B.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:S,lib:j,onTransformChange:$,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,a,o,O,m,v,T,S,j,$,M,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:hy,children:x})}const DRt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function LRt(){const{userSelectionActive:e,userSelectionRect:n}=An(DRt,kr);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Kw=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},ORt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function IRt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:d,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const v=R.useRef(0),b=Er(),{userSelectionActive:w,elementsSelectable:y,dragging:C,panBy:E,autoPanSpeed:N}=An(ORt,kr),T=y&&(e||w),j=R.useRef(null),M=R.useRef(),O=R.useRef(new Set),B=R.useRef(new Set),$=R.useRef(!1),H=R.useRef(!1),q=R.useRef({x:0,y:0}),Y=R.useRef(!1),G=Q=>{if(H.current||$.current||b.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(Q),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},X=Q=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Q.preventDefault();return}_==null||_(Q)},te=d?Q=>d(Q):void 0,I=Q=>{H.current&&(Q.stopPropagation(),H.current=!1)},L=Q=>{var Te,vt;const{domNode:le,transform:oe}=b.getState();if(M.current=le==null?void 0:le.getBoundingClientRect(),!M.current)return;const ue=Q.target===j.current;if(!ue&&!!Q.target.closest(".nokey")||!e||!(a&&ue||n)||Q.button!==0||!Q.isPrimary)return;(vt=(Te=Q.target)==null?void 0:Te.setPointerCapture)==null||vt.call(Te,Q.pointerId),H.current=!1;const{x:ye,y:qe}=Za(Q.nativeEvent,M.current),Ie=vm({x:ye,y:qe},oe);b.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:ye,y:qe}}),ue||(Q.stopPropagation(),Q.preventDefault())};function F(Q,le){const{userSelectionRect:oe}=b.getState();if(!oe)return;const{transform:ue,nodeLookup:pe,edgeLookup:Se,connectionLookup:ye,triggerNodeChanges:qe,triggerEdgeChanges:Ie,defaultEdgeOptions:Te}=b.getState(),vt={x:oe.startX,y:oe.startY},{x:Dt,y:Ut}=s_(vt,ue),Ft={startX:vt.x,startY:vt.y,x:QCt.id)),B.current=new Set;const ut=(Te==null?void 0:Te.selectable)??!0;for(const Ct of O.current){const we=ye.get(Ct);if(we)for(const{edgeId:Re}of we.values()){const Ze=Se.get(Re);Ze&&(Ze.selectable??ut)&&B.current.add(Re)}}if(!uR(mt,O.current)){const Ct=oh(pe,O.current,!0);qe(Ct)}if(!uR(rt,B.current)){const Ct=oh(Se,B.current);Ie(Ct)}b.setState({userSelectionRect:Ft,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!M.current)return;const[Q,le]=Mk(q.current,M.current,N);E({x:Q,y:le}).then(oe=>{if(!H.current||!oe){v.current=requestAnimationFrame(W);return}const{x:ue,y:pe}=q.current;F(ue,pe),v.current=requestAnimationFrame(W)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,Y.current=!1};R.useEffect(()=>()=>U(),[]);const Z=Q=>{const{userSelectionRect:le,transform:oe,resetSelectedElements:ue}=b.getState();if(!M.current||!le)return;const{x:pe,y:Se}=Za(Q.nativeEvent,M.current);q.current={x:pe,y:Se};const ye=s_({x:le.startX,y:le.startY},oe);if(!H.current){const qe=n?0:i;if(Math.hypot(pe-ye.x,Se-ye.y)<=qe)return;ue(),o==null||o(Q)}H.current=!0,Y.current||(W(),Y.current=!0),F(pe,Se)},ce=Q=>{var le,oe;if(!T){Q.target===j.current&&b.getState().connection.inProgress&&($.current=!0);return}Q.button===0&&((oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),!w&&Q.target===j.current&&b.getState().userSelectionRect&&(G==null||G(Q)),b.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l==null||l(Q),b.setState({nodesSelectionActive:O.current.size>0})),U())},re=Q=>{var le,oe;(oe=(le=Q.target)==null?void 0:le.releasePointerCapture)==null||oe.call(le,Q.pointerId),U()},ne=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:as(["react-flow__pane",{draggable:ne,dragging:C,selection:e}]),onClick:T?void 0:Kw(G,j),onContextMenu:Kw(X,j),onWheel:Kw(te,j),onPointerEnter:T?void 0:p,onPointerMove:T?Z:m,onPointerUp:ce,onPointerCancel:T?re:void 0,onPointerDownCapture:T?L:void 0,onClickCapture:T?I:void 0,onPointerLeave:x,ref:j,style:hy,children:[S,f.jsx(LRt,{})]})}function N5({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:l}=n.getState(),u=o.get(e);if(!u){l==null||l("012",to.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function uq({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=Er(),[l,u]=R.useState(!1),_=R.useRef();return R.useEffect(()=>{_.current=NAt({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{N5({id:d,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),R.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var d;(d=_.current)==null||d.destroy()}},[t,r,n,i,e,s,a]),l}const BRt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function dq(){const e=Er();return R.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:u,nodeOrigin:_}=e.getState(),d=new Map,p=BRt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,v=t.direction.y*x*t.factor;for(const[,b]of u){if(!p(b))continue;let w={x:b.internals.positionAbsolute.x+S,y:b.internals.positionAbsolute.y+v};s&&(w=gm(w,i));const{position:y,positionAbsolute:C}=AH({nodeId:b.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,d.set(b.id,b)}l(d)},[])}const Hk=R.createContext(null),$Rt=Hk.Provider;Hk.Consumer;const fq=()=>R.useContext(Hk),PRt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hq=R.createContext(null);function FRt({children:e}){const n=An(PRt,kr);return f.jsx(hq.Provider,{value:n,children:e})}function HRt(){const e=R.useContext(hq);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const qRt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},URt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:l,isValid:u}=a;if(!o&&!s)return qRt;const _=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===n&&(l==null?void 0:l.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===n_.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function GRt({type:e="source",position:n=Nt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:l,className:u,onMouseDown:_,onTouchStart:d,...p},m){var Y,G;const x=a||null,S=e==="target",v=Er(),b=fq(),{connectOnClick:w,noPanClassName:y,rfId:C}=HRt(),{connectingFrom:E,connectingTo:N,clickConnecting:T,isPossibleEndHandle:j,connectionInProcess:M,clickConnectionInProcess:O,valid:B}=An(URt(b,x,e),kr);b||(G=(Y=v.getState()).onError)==null||G.call(Y,"010",to.error010());const $=X=>{const{defaultEdgeOptions:te,onConnect:I,hasDefaultEdges:L}=v.getState(),F={...te,...X};if(L){const{edges:W,setEdges:U,onError:Z}=v.getState();U(wRt(F,W,{onError:Z}))}I==null||I(F),o==null||o(F)},H=X=>{if(!b)return;const te=PH(X.nativeEvent);if(s&&(te&&X.button===0||!te)){const I=v.getState();E5.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:S,handleId:x,nodeId:b,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...L)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...L)},updateConnection:I.updateConnection,onConnect:$,isValidConnection:t||((...L)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}te?_==null||_(X):d==null||d(X)},q=X=>{const{onClickConnectStart:te,onClickConnectEnd:I,connectionClickStartHandle:L,connectionMode:F,isValidConnection:W,lib:U,rfId:Z,nodeLookup:ce,connection:re}=v.getState();if(!b||!L&&!s)return;if(!L){te==null||te(X.nativeEvent,{nodeId:b,handleId:x,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:x}});return}const ne=BH(X.target),Q=t||W,{connection:le,isValid:oe}=E5.isValid(X.nativeEvent,{handle:{nodeId:b,id:x,type:e},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:Q,flowId:Z,doc:ne,lib:U,nodeLookup:ce});oe&&le&&$(le);const ue=structuredClone(re);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,I==null||I(X,ue),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":x,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${x}-${e}`,className:as(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:E,connectingto:N,valid:B,connectionindicator:r&&(!M||j)&&(M||O?i:s)}]),onMouseDown:H,onTouchStart:H,onClick:w?q:void 0,ref:m,...p,children:l})}const yu=R.memo(lq(GRt));function WRt({data:e,isConnectable:n,sourcePosition:t=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(yu,{type:"source",position:t,isConnectable:n})]})}function VRt({data:e,isConnectable:n,targetPosition:t=Nt.Top,sourcePosition:r=Nt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(yu,{type:"source",position:r,isConnectable:n})]})}function KRt(){return null}function QRt({data:e,isConnectable:n,targetPosition:t=Nt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(yu,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const Uv={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},IR={input:WRt,default:VRt,output:QRt,group:KRt};function YRt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const XRt=e=>{const{width:n,height:t,x:r,y:s}=mm(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xa(n)?n:null,height:Xa(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function ZRt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=Er(),{width:s,height:i,transformString:a,userSelectionActive:o}=An(XRt,kr),l=dq(),u=R.useRef(null);R.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(uq({nodeRef:u,disabled:!_}),!_)return null;const d=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Uv,m.key)&&(m.preventDefault(),l({direction:Uv[m.key],factor:m.shiftKey?4:1}))};return f.jsx("div",{className:as(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const BR=typeof window<"u"?window:void 0,JRt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _q({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:_,selectionMode:d,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:j,autoPanOnSelection:M,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,preventScrolling:q,onSelectionContextMenu:Y,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:te,onViewportChange:I,isControlledViewport:L}){const{nodesSelectionActive:F,userSelectionActive:W}=An(JRt,kr),U=Ap(u,{target:BR}),Z=Ap(S,{target:BR}),ce=Z||j,re=Z||C,ne=_&&ce!==!0,Q=U||W||ne;return TRt({deleteKeyCode:l,multiSelectionKeyCode:x}),f.jsx(MRt,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:E,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!U&&ce,defaultViewport:O,translateExtent:B,minZoom:$,maxZoom:H,zoomActivationKeyCode:v,preventScrolling:q,noWheelClassName:G,noPanClassName:X,onViewportChange:I,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:ne,children:f.jsxs(IRt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:ce,autoPanOnSelection:M,isSelecting:!!Q,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:ne,children:[e,F&&f.jsx(ZRt,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:te})]})})}_q.displayName="FlowRenderer";const eMt=R.memo(_q),tMt=e=>n=>e?Rk(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function nMt(e){return An(R.useCallback(tMt(e),[e]),kr)}const rMt=e=>e.updateNodeInternals;function sMt(){const e=An(rMt),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function iMt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=Er(),i=R.useRef(null),a=R.useRef(null),o=R.useRef(e.sourcePosition),l=R.useRef(e.targetPosition),u=R.useRef(n),_=t&&!!e.internals.handleBounds;return R.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),R.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),R.useEffect(()=>{if(i.current){const d=u.current!==n,p=o.current!==e.sourcePosition,m=l.current!==e.targetPosition;(d||p||m)&&(u.current=n,o.current=e.sourcePosition,l.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function aMt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:u,nodesFocusable:_,resizeObserver:d,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:y,internals:C,isParent:E}=An(Q=>{const le=Q.nodeLookup.get(e),oe=Q.parentLookup.has(e);return{node:le,internals:le.internals,isParent:oe}},kr);let N=y.type||"default",T=(v==null?void 0:v[N])||IR[N];T===void 0&&(w==null||w("003",to.error003(N)),N="default",T=(v==null?void 0:v.default)||IR.default);const j=!!(y.draggable||o&&typeof y.draggable>"u"),M=!!(y.selectable||l&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),B=!!(y.focusable||_&&typeof y.focusable>"u"),$=Er(),H=OH(y),q=iMt({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),Y=uq({nodeRef:q,disabled:y.hidden||!j,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:b}),G=dq();if(y.hidden)return null;const X=Yl(y),te=YRt(y),I=M||j||n||t||r||s,L=t?Q=>t(Q,{...C.userNode}):void 0,F=r?Q=>r(Q,{...C.userNode}):void 0,W=s?Q=>s(Q,{...C.userNode}):void 0,U=i?Q=>i(Q,{...C.userNode}):void 0,Z=a?Q=>a(Q,{...C.userNode}):void 0,ce=Q=>{const{selectNodesOnDrag:le,nodeDragThreshold:oe}=$.getState();M&&(!le||!j||oe>0)&&N5({id:e,store:$,nodeRef:q}),n&&n(Q,{...C.userNode})},re=Q=>{if(!($H(Q.nativeEvent)||x)){if(EH.includes(Q.key)&&M){const le=Q.key==="Escape";N5({id:e,store:$,unselect:le,nodeRef:q})}else if(j&&y.selected&&Object.prototype.hasOwnProperty.call(Uv,Q.key)){Q.preventDefault();const{ariaLabelConfig:le}=$.getState();$.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),G({direction:Uv[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var ye;if(x||!((ye=q.current)!=null&&ye.matches(":focus-visible")))return;const{transform:Q,width:le,height:oe,autoPanOnNodeFocus:ue,setCenter:pe}=$.getState();if(!ue)return;Rk(new Map([[e,y]]),{x:0,y:0,width:le,height:oe},Q,!0).length>0||pe(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:Q[2]})};return f.jsx("div",{className:as(["react-flow__node",`react-flow__node-${N}`,{[m]:j},y.className,{selected:y.selected,selectable:M,parent:E,draggable:j,dragging:Y}]),ref:q,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:H?"visible":"hidden",...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:F,onMouseLeave:W,onContextMenu:U,onClick:ce,onDoubleClick:Z,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:y.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${sq}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx($Rt,{value:e,children:f.jsx(T,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:M,draggable:j,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...X})})})}var oMt=R.memo(aMt);const lMt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function pq(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=An(lMt,kr),a=nMt(e.onlyRenderVisibleElements),o=sMt();return f.jsx("div",{className:"react-flow__nodes",style:hy,children:a.map(l=>f.jsx(oMt,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}pq.displayName="NodeRenderer";const cMt=R.memo(pq);function uMt(e){return An(R.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&lAt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),kr)}const dMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},fMt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},$R={[Fv.Arrow]:dMt,[Fv.ArrowClosed]:fMt};function hMt(e){const n=Er();return R.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call($R,e)?$R[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",to.error009(e)),null)},[e])}const _Mt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=hMt(n);return l?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(l,{color:t,strokeWidth:a})}):null},mq=({defaultColor:e,rfId:n})=>{const t=An(i=>i.edges),r=An(i=>i.defaultEdgeOptions),s=R.useMemo(()=>mAt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(_Mt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};mq.displayName="MarkerDefinitions";var pMt=R.memo(mq);function gq({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:u,..._}){const[d,p]=R.useState({x:1,y:0,width:0,height:0}),m=as(["react-flow__edge-textwrapper",u]),x=R.useRef(null);return R.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:x,style:r,children:t}),l]}):null}gq.displayName="EdgeText";const mMt=R.memo(gq);function _y({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:u=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:as(["react-flow__edge-path",_.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Xa(n)&&Xa(t)?f.jsx(mMt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function PR({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===Nt.Left||e===Nt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function vq({sourceX:e,sourceY:n,sourcePosition:t=Nt.Bottom,targetX:r,targetY:s,targetPosition:i=Nt.Top}){const[a,o]=PR({pos:t,x1:e,y1:n,x2:r,y2:s}),[l,u]=PR({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,d,p,m]=FH({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u});return[`M${e},${n} C${a},${o} ${l},${u} ${r},${s}`,_,d,p,m]}function bq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})=>{const[w,y,C]=vq({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),E=e.isInternal?void 0:n;return f.jsx(_y,{id:E,path:w,labelX:y,labelY:C,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:b})})}const gMt=bq({isInternal:!1}),yq=bq({isInternal:!0});gMt.displayName="SimpleBezierEdge";yq.displayName="SimpleBezierEdgeInternal";function xq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,sourcePosition:m=Nt.Bottom,targetPosition:x=Nt.Top,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=S5({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(_y,{id:N,path:y,labelX:C,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:S,markerStart:v,interactionWidth:w})})}const wq=xq({isInternal:!1}),Sq=xq({isInternal:!0});wq.displayName="SmoothStepEdge";Sq.displayName="SmoothStepEdgeInternal";function kq(e){return R.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(wq,{...t,id:r,pathOptions:R.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const vMt=kq({isInternal:!1}),Cq=kq({isInternal:!0});vMt.displayName="StepEdge";Cq.displayName="StepEdgeInternal";function Eq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[v,b,w]=UH({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(_y,{id:y,path:v,labelX:b,labelY:w,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:d,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const bMt=Eq({isInternal:!1}),Nq=Eq({isInternal:!0});bMt.displayName="StraightEdge";Nq.displayName="StraightEdgeInternal";function zq(e){return R.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Nt.Bottom,targetPosition:o=Nt.Top,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[y,C,E]=HH({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(_y,{id:N,path:y,labelX:C,labelY:E,label:l,labelStyle:u,labelShowBg:_,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:v,interactionWidth:w})})}const yMt=zq({isInternal:!1}),jq=zq({isInternal:!0});yMt.displayName="BezierEdge";jq.displayName="BezierEdgeInternal";const FR={default:jq,straight:Nq,step:Cq,smoothstep:Sq,simplebezier:yq},HR={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},xMt=(e,n,t)=>t===Nt.Left?e-n:t===Nt.Right?e+n:e,wMt=(e,n,t)=>t===Nt.Top?e-n:t===Nt.Bottom?e+n:e,qR="react-flow__edgeupdater";function UR({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:as([qR,`${qR}-${o}`]),cx:xMt(n,r,e),cy:wMt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function SMt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:u,onReconnectStart:_,onReconnectEnd:d,setReconnecting:p,setUpdateHover:m}){const x=Er(),S=(C,E)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:j,connectionRadius:M,lib:O,onConnectStart:B,cancelConnection:$,nodeLookup:H,rfId:q,panBy:Y,updateConnection:G}=x.getState(),X=E.type==="target",te=(F,W)=>{p(!1),d==null||d(F,t,E.type,W)},I=F=>u==null?void 0:u(t,F),L=(F,W)=>{p(!0),_==null||_(C,t,E.type),B==null||B(F,W)};E5.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:j,connectionRadius:M,domNode:T,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:E.type,lib:O,flowId:q,cancelConnection:$,panBy:Y,isValidConnection:(...F)=>{var W,U;return((U=(W=x.getState()).isValidConnection)==null?void 0:U.call(W,...F))??!0},onConnect:I,onConnectStart:L,onConnectEnd:(...F)=>{var W,U;return(U=(W=x.getState()).onConnectEnd)==null?void 0:U.call(W,...F)},onReconnectEnd:te,updateConnection:G,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),w=()=>m(!0),y=()=>m(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(UR,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(UR,{position:l,centerX:i,centerY:a,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:y,type:"target"})]})}function kMt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let y=An(pe=>pe.edgeLookup.get(e));const C=An(pe=>pe.defaultEdgeOptions);y=C?{...C,...y}:y;let E=y.type||"default",N=(S==null?void 0:S[E])||FR[E];N===void 0&&(b==null||b("011",to.error011(E)),E="default",N=(S==null?void 0:S.default)||FR.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),j=typeof d<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),M=!!(y.selectable||r&&typeof y.selectable>"u"),O=R.useRef(null),[B,$]=R.useState(!1),[H,q]=R.useState(!1),Y=Er(),{zIndex:G=y.zIndex,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W}=An(R.useCallback(pe=>{const Se=pe.nodeLookup.get(y.source),ye=pe.nodeLookup.get(y.target);if(!Se||!ye)return HR;const qe=pAt({id:e,sourceNode:Se,targetNode:ye,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:pe.connectionMode,onError:b}),Ie=oAt({selected:y.selected,zIndex:y.zIndex,sourceNode:Se,targetNode:ye,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode});return{...qe||HR,zIndex:Ie}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kr),U=R.useMemo(()=>y.markerStart?`url('#${k5(y.markerStart,x)}')`:void 0,[y.markerStart,x]),Z=R.useMemo(()=>y.markerEnd?`url('#${k5(y.markerEnd,x)}')`:void 0,[y.markerEnd,x]);if(y.hidden||X===null||te===null||I===null||L===null)return null;const ce=pe=>{var Ie;const{addSelectedEdges:Se,unselectNodesAndEdges:ye,multiSelectionActive:qe}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),y.selected&&qe?(ye({nodes:[],edges:[y]}),(Ie=O.current)==null||Ie.blur()):Se([e])),s&&s(pe,y)},re=i?pe=>{i(pe,{...y})}:void 0,ne=a?pe=>{a(pe,{...y})}:void 0,Q=o?pe=>{o(pe,{...y})}:void 0,le=l?pe=>{l(pe,{...y})}:void 0,oe=u?pe=>{u(pe,{...y})}:void 0,ue=pe=>{var Se;if(!w&&EH.includes(pe.key)&&M){const{unselectNodesAndEdges:ye,addSelectedEdges:qe}=Y.getState();pe.key==="Escape"?((Se=O.current)==null||Se.blur(),ye({edges:[y]})):qe([e])}};return f.jsx("svg",{style:{zIndex:G},children:f.jsxs("g",{className:as(["react-flow__edge",`react-flow__edge-${E}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!M&&!s,updating:B,selectable:M}]),onClick:ce,onDoubleClick:re,onContextMenu:ne,onMouseEnter:Q,onMouseMove:le,onMouseLeave:oe,onKeyDown:T?ue:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${iq}-${x}`:void 0,ref:O,...y.domAttributes,children:[!H&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:M,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),j&&f.jsx(SMt,{edge:y,isReconnectable:j,reconnectRadius:_,onReconnect:d,onReconnectStart:p,onReconnectEnd:m,sourceX:X,sourceY:te,targetX:I,targetY:L,sourcePosition:F,targetPosition:W,setUpdateHover:$,setReconnecting:q})]})})}var CMt=R.memo(kMt);const EMt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Tq({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:y}=An(EMt,kr),C=uMt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(pMt,{defaultColor:e,rfId:t}),C.map(E=>f.jsx(CMt,{id:E,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:u,onClick:_,reconnectRadius:d,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:S},E))]})}Tq.displayName="EdgeRenderer";const NMt=R.memo(Tq),zMt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jMt({children:e}){const n=An(zMt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function TMt(e){const n=Fk(),t=R.useRef(!1);R.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const AMt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function RMt(e){const n=An(AMt),t=Er();return R.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function MMt(e){return e.connection.inProgress?{...e.connection,to:vm(e.connection.to,e.transform)}:{...e.connection}}function DMt(e){return MMt}function LMt(e){const n=DMt();return An(n,kr)}const OMt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function IMt({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:l}=An(OMt,kr);return!(i&&s&&l)?null:f.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:as(["react-flow__connection",jH(o)]),children:f.jsx(Aq,{style:n,type:t,CustomComponent:r,isValid:o})})})}const Aq=({style:e,type:n=Kc.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:l,to:u,toNode:_,toHandle:d,toPosition:p,pointer:m}=LMt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:p,connectionStatus:jH(r),toNode:_,toHandle:d,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case Kc.Bezier:[x]=HH(S);break;case Kc.SimpleBezier:[x]=vq(S);break;case Kc.Step:[x]=S5({...S,borderRadius:0});break;case Kc.SmoothStep:[x]=S5(S);break;default:[x]=UH(S)}return f.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};Aq.displayName="ConnectionLine";const BMt={};function GR(e=BMt){R.useRef(e),Er(),R.useEffect(()=>{},[e])}function $Mt(){Er(),R.useRef(!1),R.useEffect(()=>{},[])}function Rq({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:j,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,preventScrolling:Y,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:te,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:W,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:le,onPaneContextMenu:oe,paneClickDistance:ue,nodeClickDistance:pe,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we,viewport:Re,onViewportChange:Ze}){return GR(e),GR(n),$Mt(),TMt(t),RMt(Re),f.jsx(eMt,{onPaneClick:ce,onPaneMouseEnter:re,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:oe,onPaneScroll:le,paneClickDistance:ue,deleteKeyCode:j,selectionKeyCode:w,selectionOnDrag:y,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:O,zoomOnScroll:X,zoomOnPinch:te,zoomOnDoubleClick:W,panOnScroll:I,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:B,translateExtent:$,minZoom:H,maxZoom:q,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ft,noWheelClassName:mt,noPanClassName:rt,disableKeyboardA11y:ut,onViewportChange:Ze,isControlledViewport:!!Re,children:f.jsxs(jMt,{children:[f.jsx(NMt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:vt,onReconnectStart:Dt,onReconnectEnd:Ut,onlyRenderVisibleElements:M,onEdgeContextMenu:Se,onEdgeMouseEnter:ye,onEdgeMouseMove:qe,onEdgeMouseLeave:Ie,reconnectRadius:Te,defaultMarkerColor:G,noPanClassName:rt,disableKeyboardA11y:ut,rfId:we}),f.jsx(IMt,{style:S,type:x,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(cMt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:pe,onlyRenderVisibleElements:M,noPanClassName:rt,noDragClassName:Ft,disableKeyboardA11y:ut,nodeExtent:Ct,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}Rq.displayName="GraphView";const PMt=R.memo(Rq),FMt=LH(),WR=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:d,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,v=new Map,b=r??n??[],w=t??e??[],y=_??[0,0],C=d??Np;VH(S,v,b);const{nodesInitialized:E}=C5(w,m,x,{nodeOrigin:y,nodeExtent:C,zIndexMode:p});let N=[0,0,1];if(a&&s&&i){const T=mm(m,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:j,y:M,zoom:O}=Dk(T,s,i,l,u,(o==null?void 0:o.padding)??.1);N=[j,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:w,nodesInitialized:E,nodeLookup:m,parentLookup:x,edges:b,edgeLookup:v,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Np,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n_.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:o,fitViewResolver:null,connection:{...zH},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:FMt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NH,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},HMt=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p})=>ZAt((m,x)=>{async function S(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:y,width:C,height:E,minZoom:N,maxZoom:T}=x();b&&(await eAt({nodes:v,width:C,height:E,panZoom:b,minZoom:N,maxZoom:T},w),y==null||y.resolve(!0),m({fitViewResolver:null}))}return{...WR({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:u,nodeOrigin:_,nodeExtent:d,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:T}=x(),{nodesInitialized:j,hasSelectedNodes:M}=C5(v,b,w,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),O=T&&M;E&&j?(S(),m({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:v,nodesInitialized:j,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=x();VH(b,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=x();w(v),m({hasDefaultNodes:!0})}if(b){const{setEdges:w}=x();w(b),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:y,domNode:C,nodeOrigin:E,nodeExtent:N,debug:T,fitViewQueued:j,zIndexMode:M}=x(),{changes:O,updatedInternals:B}=SAt(v,w,y,C,E,N,M);B&&(bAt(w,y,{nodeOrigin:E,nodeExtent:N,zIndexMode:M}),j?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(T&&console.log("React Flow: trigger node changes",O),b==null||b(O)))},updateNodePositions:(v,b=!1)=>{const w=[];let y=[];const{nodeLookup:C,triggerNodeChanges:E,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:j}=x();for(const[M,O]of v){const B=C.get(M),$=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(O!=null&&O.position)),H={id:M,type:"position",position:$?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:b};if(B&&N.inProgress&&N.fromNode.id===B.id){const q=Ud(B,N.fromHandle,Nt.Left,!0);T({...N,from:q})}$&&B.parentId&&w.push({id:M,parentId:B.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),y.push(H)}if(w.length>0){const{parentLookup:M,nodeOrigin:O}=x(),B=Pk(w,C,M,O);y.push(...B)}for(const M of j.values())y=M(y);E(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:y,hasDefaultNodes:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=bRt(v,y);w(N)}E&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:y,hasDefaultEdges:C,debug:E}=x();if(v!=null&&v.length){if(C){const N=yRt(v,y);w(N)}E&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));C(N);return}C(oh(y,new Set([...v]),!0)),E(oh(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:E}=x();if(b){const N=v.map(T=>sd(T,!0));E(N);return}E(oh(w,new Set([...v]))),C(oh(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:y,nodeLookup:C,triggerNodeChanges:E,triggerEdgeChanges:N}=x(),T=v||y,j=b||w,M=[];for(const B of T){if(!B.selected)continue;const $=C.get(B.id);$&&($.selected=!1),M.push(sd(B.id,!1))}const O=[];for(const B of j)B.selected&&O.push(sd(B.id,!1));E(M),N(O)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=x();b==null||b.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=x();b==null||b.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var b;(b=x().panZoom)==null||b.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:y,elementsSelectable:C}=x();if(!C)return;const E=b.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]),N=v.reduce((T,j)=>j.selected?[...T,sd(j.id,!1)]:T,[]);w(E),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:E,nodeExtent:N,zIndexMode:T}=x();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(C5(b,w,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:T}),m({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:y,panZoom:C,translateExtent:E}=x();return kAt({delta:v,panZoom:C,transform:b,translateExtent:E,width:w,height:y})},setCenter:async(v,b,w)=>{const{width:y,height:C,maxZoom:E,panZoom:N}=x();if(!N)return!1;const T=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:E;return await N.setViewport({x:y/2-v*T,y:C/2-b*T,zoom:T},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...zH}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...WR()})}},Object.is);function qMt({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:u,nodeOrigin:_,nodeExtent:d,zIndexMode:p,children:m}){const[x]=R.useState(()=>HMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:_,nodeExtent:d,zIndexMode:p}));return f.jsx(JAt,{value:x,children:f.jsx(ERt,{children:f.jsx(FRt,{children:m})})})}function UMt({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:u,maxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m}){return R.useContext(dy)?f.jsx(f.Fragment,{children:e}):f.jsx(qMt,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:d,nodeExtent:p,zIndexMode:m,children:e})}const GMt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function WMt({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:u,onMove:_,onMoveStart:d,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onSelectionChange:H,onSelectionDragStart:q,onSelectionDrag:Y,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onBeforeDelete:L,connectionMode:F,connectionLineType:W=Kc.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:le=zp.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ue=Tp()?"Meta":"Control",zoomActivationKeyCode:pe=Tp()?"Meta":"Control",snapToGrid:Se,snapGrid:ye,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Ie,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,nodeOrigin:Ft=aq,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut=!0,defaultViewport:Ct=fRt,minZoom:we=.5,maxZoom:Re=2,translateExtent:Ze=Np,preventScrolling:_t=!0,nodeExtent:wt,defaultMarkerColor:Zt="#b1b1b7",zoomOnScroll:We=!0,zoomOnPinch:Gt=!0,panOnScroll:an=!1,panOnScrollSpeed:yn=.5,panOnScrollMode:Vt=jd.Free,zoomOnDoubleClick:Yn=!0,panOnDrag:ln=!0,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr=1,nodeClickDistance:bt=0,children:fn,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve=10,onNodesChange:xt,onEdgesChange:lt,noDragClassName:ft="nodrag",noWheelClassName:jt="nowheel",noPanClassName:xn="nopan",fitView:On,fitViewOptions:di,connectOnClick:Xl,attributionPosition:ao,proOptions:zi,defaultEdgeOptions:Ra,elevateNodesOnSelect:Jt=!0,elevateEdgesOnSelect:Ys=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanOnSelection:Ht=!0,autoPanSpeed:ji,connectionRadius:os,isValidConnection:ks,onError:gs,style:sa,id:Ma,nodeDragThreshold:oo,connectionDragThreshold:Cs,viewport:Da,onViewportChange:Kr,width:Dr,height:en,colorMode:vs="light",debug:Xs,onScroll:dr,ariaLabelConfig:ls,zIndexMode:Ls="basic",...Fr},Lr){const cs=Ma||"1",bs=mRt(vs),yr=R.useCallback(ys=>{ys.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),dr==null||dr(ys)},[dr]);return f.jsx("div",{"data-testid":"rf__wrapper",...Fr,onScroll:yr,style:{...sa,...GMt},ref:Lr,className:as(["react-flow",s,bs]),id:Ma,role:"application",children:f.jsxs(UMt,{nodes:e,edges:n,width:Dr,height:en,fitView:On,fitViewOptions:di,minZoom:we,maxZoom:Re,nodeOrigin:Ft,nodeExtent:wt,zIndexMode:Ls,children:[f.jsx(pRt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Te,autoPanOnNodeFocus:vt,nodesConnectable:Dt,nodesFocusable:Ut,edgesFocusable:mt,edgesReconnectable:rt,elementsSelectable:ut,elevateNodesOnSelect:Jt,elevateEdgesOnSelect:Ys,minZoom:we,maxZoom:Re,nodeExtent:wt,onNodesChange:xt,onEdgesChange:lt,snapToGrid:Se,snapGrid:ye,connectionMode:F,translateExtent:Ze,connectOnClick:Xl,defaultEdgeOptions:Ra,fitView:On,fitViewOptions:di,onNodesDelete:O,onEdgesDelete:B,onDelete:$,onNodeDragStart:T,onNodeDrag:j,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:q,onSelectionDragStop:G,onMove:_,onMoveStart:d,onMoveEnd:p,noPanClassName:xn,nodeOrigin:Ft,rfId:cs,autoPanOnConnect:Mr,autoPanOnNodeDrag:Ke,autoPanSpeed:ji,onError:gs,connectionRadius:os,isValidConnection:ks,selectNodesOnDrag:Ie,nodeDragThreshold:oo,connectionDragThreshold:Cs,onBeforeDelete:L,debug:Xs,ariaLabelConfig:ls,zIndexMode:Ls}),f.jsx(PMt,{onInit:u,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:w,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:E,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:ce,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:ue,panActivationKeyCode:oe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:Ct,translateExtent:Ze,minZoom:we,maxZoom:Re,preventScrolling:_t,zoomOnScroll:We,zoomOnPinch:Gt,zoomOnDoubleClick:Yn,panOnScroll:an,panOnScrollSpeed:yn,panOnScrollMode:Vt,panOnDrag:ln,autoPanOnSelection:Ht,onPaneClick:cn,onPaneMouseEnter:br,onPaneMouseMove:Xn,onPaneMouseLeave:Zn,onPaneScroll:Rn,onPaneContextMenu:Rr,paneClickDistance:Nr,nodeClickDistance:bt,onSelectionContextMenu:X,onSelectionStart:te,onSelectionEnd:I,onReconnect:Cn,onReconnectStart:tn,onReconnectEnd:nr,onEdgeContextMenu:un,onEdgeDoubleClick:Mn,onEdgeMouseEnter:on,onEdgeMouseMove:rr,onEdgeMouseLeave:En,reconnectRadius:Ve,defaultMarkerColor:Zt,noDragClassName:ft,noWheelClassName:jt,noPanClassName:xn,rfId:cs,disableKeyboardA11y:ur,nodeExtent:wt,viewport:Da,onViewportChange:Kr}),f.jsx(dRt,{onSelectionChange:H}),fn,f.jsx(aRt,{proOptions:zi,position:ao}),f.jsx(iRt,{rfId:cs,disableKeyboardA11y:ur})]})})}var VMt=lq(WMt);function KMt({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:as(["react-flow__background-pattern",t,r])})}function QMt({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:as(["react-flow__background-pattern","dots",n])})}var Fl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fl||(Fl={}));const YMt={[Fl.Dots]:1,[Fl.Lines]:1,[Fl.Cross]:6},XMt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mq({id:e,variant:n=Fl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:l,className:u,patternClassName:_}){const d=R.useRef(null),{transform:p,patternId:m}=An(XMt,kr),x=r||YMt[n],S=n===Fl.Dots,v=n===Fl.Cross,b=Array.isArray(t)?t:[t,t],w=[b[0]*p[2]||1,b[1]*p[2]||1],y=x*p[2],C=Array.isArray(i)?i:[i,i],E=v?[y,y]:w,N=[C[0]*p[2]||1+E[0]/2,C[1]*p[2]||1+E[1]/2],T=`${m}${e||""}`;return f.jsxs("svg",{className:as(["react-flow__background",u]),style:{...l,...hy,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:T,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:S?f.jsx(QMt,{radius:y/2,className:_}):f.jsx(KMt,{dimensions:E,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}Mq.displayName="Background";const ZMt=R.memo(Mq);function JMt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function eDt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function tDt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function nDt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function rDt(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _1({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:as(["react-flow__controls-button",n]),...t,children:e})}const sDt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Dq({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:u,children:_,position:d="bottom-left",orientation:p="vertical","aria-label":m}){const x=Er(),{isInteractive:S,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=An(sDt,kr),{zoomIn:y,zoomOut:C,fitView:E}=Fk(),N=()=>{y(),i==null||i()},T=()=>{C(),a==null||a()},j=()=>{E(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l==null||l(!S)},O=p==="horizontal"?"horizontal":"vertical";return f.jsxs(fy,{className:as(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(_1,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(JMt,{})}),f.jsx(_1,{onClick:T,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(eDt,{})})]}),t&&f.jsx(_1,{className:"react-flow__controls-fitview",onClick:j,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:f.jsx(tDt,{})}),r&&f.jsx(_1,{className:"react-flow__controls-interactive",onClick:M,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:S?f.jsx(rDt,{}):f.jsx(nDt,{})}),_]})}Dq.displayName="Controls";R.memo(Dq);function iDt({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:l,className:u,borderRadius:_,shapeRendering:d,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},v=a||x||S;return f.jsx("rect",{className:as(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:d,onClick:m?b=>m(b,e):void 0})}const aDt=R.memo(iDt),oDt=e=>e.nodes.map(n=>n.id),Qw=e=>e instanceof Function?e:()=>e;function lDt({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=aDt,onClick:a}){const o=An(oDt,kr),l=Qw(n),u=Qw(e),_=Qw(t),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(p=>f.jsx(uDt,{id:p,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:d},p))})}function cDt({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:u,x:_,y:d,width:p,height:m}=An(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const v=S.internals.userNode,{x:b,y:w}=S.internals.positionAbsolute,{width:y,height:C}=Yl(v);return{node:v,x:b,y:w,width:y,height:C}},kr);return!u||u.hidden||!OH(u)?null:f.jsx(o,{x:_,y:d,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:l,id:u.id})}const uDt=R.memo(cDt);var dDt=R.memo(lDt);const fDt=200,hDt=150,_Dt=e=>!e.hidden,pDt=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?MH(mm(e.nodeLookup,{filter:_Dt}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},mDt="react-flow__minimap-desc";function Lq({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:u,maskStrokeColor:_,maskStrokeWidth:d,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:y=1,offsetScale:C=5}){const E=Er(),N=R.useRef(null),{boundingRect:T,viewBB:j,rfId:M,panZoom:O,translateExtent:B,flowWidth:$,flowHeight:H,ariaLabelConfig:q}=An(pDt,kr),Y=(e==null?void 0:e.width)??fDt,G=(e==null?void 0:e.height)??hDt,X=T.width/Y,te=T.height/G,I=Math.max(X,te),L=I*Y,F=I*G,W=C*I,U=T.x-(L-T.width)/2-W,Z=T.y-(F-T.height)/2-W,ce=L+W*2,re=F+W*2,ne=`${mDt}-${M}`,Q=R.useRef(0),le=R.useRef();Q.current=I,R.useEffect(()=>{if(N.current&&O)return le.current=MAt({domNode:N.current,panZoom:O,getTransform:()=>E.getState().transform,getViewScale:()=>Q.current}),()=>{var Se;(Se=le.current)==null||Se.destroy()}},[O]),R.useEffect(()=>{var Se;(Se=le.current)==null||Se.update({translateExtent:B,width:$,height:H,inversePan:w,pannable:S,zoomStep:y,zoomable:v})},[S,v,w,y,B,$,H]);const oe=m?Se=>{var Ie;const[ye,qe]=((Ie=le.current)==null?void 0:Ie.pointer(Se))||[0,0];m(Se,{x:ye,y:qe})}:void 0,ue=x?R.useCallback((Se,ye)=>{const qe=E.getState().nodeLookup.get(ye).internals.userNode;x(Se,qe)},[]):void 0,pe=b??q["minimap.ariaLabel"];return f.jsx(fy,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:as(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Y,height:G,viewBox:`${U} ${Z} ${ce} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:N,onClick:oe,children:[pe&&f.jsx("title",{id:ne,children:pe}),f.jsx(dDt,{onClick:ue,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-W},${Z-W}h${ce+W*2}v${re+W*2}h${-ce-W*2}z + M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lq.displayName="MiniMap";R.memo(Lq);const gDt=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,vDt={[i_.Line]:"right",[i_.Handle]:"bottom-right"};function bDt({nodeId:e,position:n,variant:t=i_.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:v,onResizeEnd:b}){const w=fq(),y=typeof e=="string"?e:w,C=Er(),E=R.useRef(null),N=t===i_.Handle,T=An(R.useCallback(gDt(N&&m),[N,m]),kr),j=R.useRef(null),M=n??vDt[t];R.useEffect(()=>{if(!(!E.current||!y))return j.current||(j.current=WAt({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,domNode:G}=C.getState();return{nodeLookup:B,transform:$,snapGrid:H,snapToGrid:q,nodeOrigin:Y,paneDomNode:G}},onChange:(B,$)=>{const{triggerNodeChanges:H,nodeLookup:q,parentLookup:Y,nodeOrigin:G}=C.getState(),X=[],te={x:B.x,y:B.y},I=q.get(y);if(I&&I.expandParent&&I.parentId){const L=I.origin??G,F=B.width??I.measured.width??0,W=B.height??I.measured.height??0,U={id:I.id,parentId:I.parentId,rect:{width:F,height:W,...IH({x:B.x??I.position.x,y:B.y??I.position.y},{width:F,height:W},I.parentId,q,L)}},Z=Pk([U],q,Y,G);X.push(...Z),te.x=B.x?Math.max(L[0]*F,B.x):void 0,te.y=B.y?Math.max(L[1]*W,B.y):void 0}if(te.x!==void 0&&te.y!==void 0){const L={id:y,type:"position",position:{...te}};X.push(L)}if(B.width!==void 0&&B.height!==void 0){const F={id:y,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};X.push(F)}for(const L of $){const F={...L,type:"position"};X.push(F)}H(X)},onEnd:({width:B,height:$})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:B,height:$}};C.getState().triggerNodeChanges([H])}})),j.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:l,maxWidth:u,maxHeight:_},keepAspectRatio:d,resizeDirection:p,onResizeStart:S,onResize:v,onResizeEnd:b,shouldResize:x}),()=>{var B;(B=j.current)==null||B.destroy()}},[M,o,l,u,_,d,S,v,b,x]);const O=M.split("-");return f.jsx("div",{className:as(["react-flow__resize-control","nodrag",...O,t,r]),ref:E,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}R.memo(bDt);function yDt(){const[e,n]=R.useState(0),[t,r]=R.useState(0);return{ref:R.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),l=new MutationObserver(a);return o.observe(i),l.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),l.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const p1=8;function xDt(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=R.useState({viewWidth:0,viewHeight:0});R.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,l=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,l=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,l=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,l=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,l=e.y-r-_;break}const d=o,p=l;o=Math.min(Math.max(o,p1),i-t-p1),l=Math.min(Math.max(l,p1),s-r-p1),u=e.anchor==="left"||e.anchor==="right"?p-l:d-o}return{x:o,y:l,arrowAdjustment:u}}const Yw=380,Xw=12,wDt=350,SDt=150,z5=new EventTarget;function kDt(){z5.dispatchEvent(new Event("move"))}function CDt(e,n){const[t,r]=R.useState(null),s=R.useRef(void 0),i=R.useRef(void 0);R.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return z5.addEventListener("move",u),()=>{z5.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),R.useEffect(()=>{r(u=>{var d;if(!u)return u;const _=((d=e.current)==null?void 0:d.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=R.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},wDt)},[e]),o=R.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),SDt)},[]),l=R.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:l}}function EDt(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(z(),t)}function NDt({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:l}){const u=yDt(),_=s.right+Xw+Yw<=window.innerWidth,d=s.x-Xw-Yw>=0,p=_?"right":d?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=xDt({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:Xw},u),S=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null,{data:v}=ct({...t1t(S??""),enabled:!!S,subscribed:!!S}),b=R.useMemo(()=>{if(!v)return null;const B=v;let $=B.diff;if(B.truncated){const G=$.lastIndexOf(` diff --git `);$=G!==-1?$.slice(0,G+1):$.slice(0,$.lastIndexOf(` -`)+1)}let H=[];try{H=$.trim()?a3($):[]}catch{return null}if(B.truncated&&H.every(G=>G.hunks.length===0))return null;let q=0,Y=0;for(const G of H){const X=Ob(G);q+=X.additions,Y+=X.deletions}return{fileCount:H.length,additions:q,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Xw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Vr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Vr(a),children:[f.jsx(pb,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?TD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&v6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",wDt(e.createdAt)]})]})]}),document.body)}const WR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),kDt=264,VR=132,H1=44,CDt=72,EDt=148,NDt=44;function zDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function jDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function j5(e){return e.kind==="exp"?kDt:EDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function q1(e){if(e.children.length===0)return j5(e);const n=e.children.reduce((t,r)=>t+q1(r),0)+H1*(e.children.length-1);return Math.max(j5(e),n)}function TDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const ADt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Sot():p?Bot():El(),x=s.slice(-8),S=R.useRef(null),v=xDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Vr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Slt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${TDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:dlt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:plt(),...Vr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:_D({branch:Ne(t.branchName)}),...Vr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(pb,{size:13}),Yot()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:tv({name:Ne(t.branchName)}),"aria-label":tv({name:Ne(t.branchName)}),href:rb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(mb,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(SDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),RDt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Nlt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Dot():Tot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:blt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),MDt={exp:ADt,elided:RDt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},DDt={...Oq.style,strokeDasharray:"4 4"};function LDt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=jDt(zDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-j5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(VR-NDt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+q1(O),0)+H1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=q1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:DDt}:{}}),b(M,j+O/2,E+VR+CDt),j+=O+H1}}let w=0;for(const y of S){const C=q1(y);b(y,w+C/2,0),w+=C+H1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):u.length===0&&i?f.jsxs("div",{className:WR,children:[f.jsx("p",{className:"empty-state-title",children:rlt()}),f.jsx("p",{className:"empty-state-hint",children:Hot()})]}):f.jsx(qMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:MDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:yDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(KMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function ODt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function IDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?ODt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function BDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Wv=360,$Dt=10,KR=1448,PDt=272,FDt=380,HDt=PDt+56,qDt=80,UDt=48;function T0(){return Math.max(Wv,window.innerWidth-HDt-FDt)}function GDt(){const e=T0();return Math.max(Wv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function QR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function YR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function WDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Out}),s=li(),i=aD({select:J=>J.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const J=t?Wa(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var J;return((J=w.data)==null?void 0:J.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((J,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:E1(je.projectId,je.activeSessionId,J),replace:ge})},[s]),B=R.useCallback(J=>{const ge=Ll(J);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),H=R.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:J??void 0})},[t,O]),q=R.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Y=R.useCallback(J=>{var ge;if(n)if(J==="chat"){const je=l.current;s.navigate({href:E1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(J=>{Pr(te.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[te]),W=R.useMemo(()=>Zp(),[n]),U=ct(W),Z=U.data??null,ce=R.useCallback(J=>{Pr(W.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[W]),re=R.useRef(void 0);re.current=Z==null?void 0:Z.tourCompleted;const ne=[!w.data&&w.error?yD():null,!I.data&&I.error?D0():null,!U.data&&U.error?Bne():null].filter(J=>J!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(V4(n)),ue=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ue);Ct.current=ue;const Re=ct(Zgt(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ue.every(J=>J.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ue:ue.filter(J=>J.chatSessionId===u),[ue,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const J=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>J.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=J=>{let ge=En.current.get(J);return ge||(ge=new HEt,En.current.set(J,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(GDt),[gs,sa]=R.useState(()=>window.innerWidth>=KR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(J=>{const ge=[...J];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(J=>{dr.current=J,zi(J)},[]),Fr=R.useCallback(J=>{const ge=Et(J);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in J){const Me=Ms(je,en.current,J);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(J=>{const ge=Et(J),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(J)];vs.current=je,Rn(je),B(J)},[B]),cs=R.useCallback((J,ge,je)=>{const $e=Et(J),Me=dr.current,at=hCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Fr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(J));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(J)];vs.current=tt,Rn(tt),O(Ll(J,je))},[Fr,ls,Ls,O]),bs=R.useCallback(J=>{const ge=dr.current;ge&&Et(ge)===Et(J)&&Ls(null)},[Ls]);R.useEffect(()=>{let J=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),J=!0;return}if(J&&$e.key==="Enter"){$e.preventDefault(),J=!1;const Lt=dr.current;Lt&&bs(Lt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((J,ge)=>{const je=Et(J),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=_Ct({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(J=>J+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((J,ge,je)=>{if(Rn(J.tabHistory),vs.current=J.tabHistory,Nr(J.experimentsTabOpen),fn(J.filesTabOpen),tn(J.artifactsTabOpen),un(J.expTabs),on(J.fileTabs),lt(Me=>Me===J.planTabs?Me:J.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(J.subagentTabs),On(J.codeTabs),ls(J.contentTabOrder),Ls(J.previewTab),Jt(J.filesView),ur(J.filesToggled),Zt(J.scope),Ke(J.panelMax),ji(J.treeViewport),Yn(M.current.activeSessionId===O0&&J.fileTabs.some(Me=>Yu(Me,{path:k1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of J.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Hr,workspace:oa}=K0t({projectId:Z&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(Z==null?void 0:Z.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const J=Jl.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((J,ge)=>{var at;if(!n)return;J&&ge!=null&&ge.replace&&u===null&&(Hr(),W0t(n,J));const je=cu(DO(n),J??"new"),$e=je?je.active:Wc(n)?(at=T6(J??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&J&&u===null?M.current.pane:$e;s.navigate({href:E1(n,J,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Hr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(J=>J+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:J})=>{var ge;return((ge=Rd(J.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!OA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(J=>J.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const J=cb(i.href);!Z||!$n||!J||(ub.queue({lastLocation:J,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===J?250:0),La.current=J)},[i.href,Z,$n,oo,os,Ze]);const ec=(Z==null?void 0:Z.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async J=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:J}),ce($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||Z!=null&&Z.tourCompleted||Ai()},[n,ec,Ai,Z==null?void 0:Z.tourCompleted]);const Mt=(L==null?void 0:L.find(J=>J.id===n))??null;R.useEffect(()=>{const J=Q||Z===null?null:Mt==null?void 0:Mt.name;document.title=J?`${Oo(J)} — OpenResearch`:"OpenResearch"},[Q,Z,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(J=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:J})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},J))},[O,xs]),Ri=()=>{I.refetch(),U.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!Z||lo.current)return;lo.current=!0,le.current=Z.preferredAgent;const J=N6()??Z.workspace;J&&(Cs(J.railOpen),ks(Math.min(J.panelWidth,T0())),_t(J.experimentsView))},[Z]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(J=>{const ge=++sc.current;ce($e=>$e&&{...$e,preferredAgent:J});const je=co.current.then(()=>r.mutateAsync({preferredAgent:J})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const J=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=KR)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Os=R.useCallback(J=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(J)).then(je=>{if(hr.current!==J||Ut.current!==J||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Qut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);Lht({onReconnect:()=>{const J=hr.current;J&&(Ut.current=J,vt.current.clear(),Dt.current.clear(),Os(J))},onRun:J=>{if(J.projectId!==hr.current||J.projectId!==Ut.current)return;const ge=vt.current.get(J.id),je=Dt.current.has(J.id);if(ge&&ge.updatedAt>J.updatedAt||(vt.current.set(J.id,J),Dt.current.add(J.id),J.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(J.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=J.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(J.id,J)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((J,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:J,view:ge};un(at=>at.some(tt=>L2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((J,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ue.map(J=>{var ge;return[J.id,((ge=J.title)==null?void 0:ge.trim())||J.slug||El()]})),[ue,G]),Zs=YR(zu),el=R.useMemo(()=>{const J=new Map;for(const ge of Ie)J.set(ge.id,Zs.get(ge.experimentId)??El());return J},[Zs,Ie,G]),tl=YR(el),ac=R.useCallback(J=>{const ge=tl.get(J);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(J=>{const ge=Zs.get(J);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((J,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===J||$e.id.startsWith(J));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(J=>{const ge=nr.findIndex(je=>L2(je,J));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[nr,yr,b]),uo=R.useCallback((J,ge="preview")=>{J.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,J);Dr.current.fileTabs.some(at=>Yu(at,J))||C.current.delete(Me),E.current.add(Me)}const $e=RO(J);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,J));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(J,ge)},[cs]),fi=R.useCallback((J,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=IDt(J,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((J,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(J,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(J=>uo({path:J,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((J,ge,je,$e,Me,at="preview")=>{const tt=fi(J,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((J,ge)=>{bs(J),ge()},[bs]),of=R.useCallback(J=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,J));if(ge===-1)return;const je=n?Ms(n,u,J):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!OA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(J,{path:k1,source:"artifacts"})&&Yn(!1),yr(J,Et(b)===Et(J)))},[u,Mn,yr,n,b]),lf=R.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),x_=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:J};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(J=>{const ge=xt.findIndex(je=>je.promptId===J.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,xt,b]),lc=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(J=>{const ge=ft.findIndex(je=>je.spawnPartId===J.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let J=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Dv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:M9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{J&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=lv(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{J=!1,at()}},[ft]);const uc=R.useCallback((J,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:J,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:J,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((J,ge)=>{On(je=>je.map($e=>qf($e,J)?{...$e,...ge}:$e)),ge.view&&O(Ll({...J,...ge}))},[]),S_=R.useCallback(J=>{const ge=xn.findIndex(je=>qf(je,J));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(J=>{J==="experiments"?Nr(!1):J==="files"?fn(!1):tn(!1),yr(J,b===J)},[yr,b]),ff=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=J.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+qDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Wv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(J,ge)=>{F(je=>je?QR(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(J=>Yu(J,{path:k1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const J=nl.data.messages.flatMap(je=>{const $e=Dv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=J==null?void 0:J.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(J=>qf(J,Ae))??null:null,Ue=new Map;for(const J of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(J),J);const zn=ca?Et(ca):null,jn=di.filter(J=>J!==zn).map(J=>Ue.get(J)).filter(q0t),fr=J=>ao!==null&&Et(ao)===Et(J),Ln=J=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>of(J)},`file:${z6(J)}`),_r=Bs?ue.find(J=>J.id===Bs.id)??null:null,da=Oe?ue.find(J=>J.id===Oe.experimentId&&J.branchName===Oe.branch)??null:null,_f=J=>{var je,$e;if("path"in J)return Ln(J);if("id"in J){const Me=ue.find(at=>at.id===J.id);return f.jsx(Fc,{active:Bs!==null&&L2(Bs,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(Spt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>Tu(J)},Et(J))}if("kind"in J&&J.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===J.promptId,label:CD(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>w_(J)},Et(J));if("kind"in J)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===J.spawnPartId,label:((je=uf[J.spawnPartId])==null?void 0:je.label)??J.label??Wne(),shimmer:(($e=uf[J.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>cf(J)},Et(J));const ge=ue.find(Me=>Me.id===J.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,J),label:(ge==null?void 0:ge.slug)??J.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>S_(J)},Et(J))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||Z===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(hv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});const Mu=f.jsx(uNt,{projectName:((rl=L.find(J=>J.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(V9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(Z==null?void 0:Z.tourCompleted)===!1?jut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:Z.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(REt,{}):o!=="chat"?f.jsx(m8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:J=>{F(ge=>ge?QR(ge,J):[J])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(sxt,{expanded:Ma,experiments:ue,runs:Ie,onOpenExperiment:(J,ge)=>Is(J,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:N4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:gD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:vD(),icon:f.jsx(_b,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(J=>!J),children:Mr?f.jsx(Emt,{size:14}):f.jsx(Smt,{size:14})}),f.jsx(Qt,{title:nv(),"aria-label":nv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Gr,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(J=>J.id===d&&J.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(SEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(J=>!J),children:f.jsx(smt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx(LDt,{experiments:ue,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(dNt,{runs:Xn,emptyHint:cn==="agent"&&ue.length>0?gne():void 0,experiments:br,onOpen:(J,ge)=>{Is(J.id,"overview",ge)},onOpenLogs:(J,ge,je)=>{Is(J,"terminal",je,ge)},onOpenCode:(J,ge)=>{const je=ue.find($e=>$e.id===J);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(dEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(J,ge,je,$e)=>oc(J,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(cNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const J=Ms(n,u,Dn);C.current.delete(J),E.current.add(J)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:J=>{N.current[Ms(n,u,Dn)]=J,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:BDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(J,ge,je,$e)=>hi(Dn,()=>oc(J,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:J=>{rr.current.set(Ms(n,u,Dn),J),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(J=>J.promptId===Qr.promptId))==null?void 0:ho.plan)||bD(),onOpenFile:(J,ge,je,$e,Me)=>hi(Qr,()=>oc(J,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(Y9t,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(J,ge,je,$e,Me)=>hi(be,()=>Au(J,be.sessionId,ge,je,$e,Me)),onOpenRun:(J,ge)=>hi(be,()=>Oa(J,ge)),runExperimentName:ac,onOpenExperiment:(J,ge)=>hi(be,()=>ju(J,ge)),experimentName:sf,onOpenSubagent:(J,ge,je)=>hi(be,()=>lc(be.sessionId,J,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(uEt,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:J=>df(Oe,{view:J}),onToggledChange:J=>df(Oe,{toggled:J}),onOpenFile:(J,ge,je,$e)=>hi(Oe,()=>oc(J,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(IEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:H,parentExperiment:ue.find(J=>J.id===_r.parentExperimentId)??null,onOpenView:(J,ge,je)=>{hi(Bs,()=>Is(_r.id,J,je,ge))},onOpenCode:(J,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,J,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(J,ge)=>{Kr(!1),k_(J,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(fNt,{onClose:Nn,onCreateProject:rc})]})}const T5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:VDt});function VDt(){const{projectId:e}=T5.useParams(),{pane:n}=T5.useSearch(),t=li(),r=aD({select:s=>s.location});return R.useEffect(()=>{const s=KDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(WDt,{projectId:e,pane:n,runtime:LO()},e)]})}function KDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:QDt});function QDt(){const{projectId:e}=Iq.useParams();return f.jsx(Ggt,{projectId:e})}const YDt=qo()({}),XDt=qo()({}),ZDt=qo()({}),JDt=qo()({}),eLt=Vgt.update({id:"/",path:"/",getParentRoute:()=>db}),qk=Kgt.update({id:"/projects",path:"/projects",getParentRoute:()=>db}),tLt=Qgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>db}),nLt=Ygt.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=T5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),rLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),sLt=YDt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),iLt=XDt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),aLt=ZDt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),oLt=JDt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),lLt={ProjectsProjectIdSkillsRoute:sLt,ProjectsProjectIdIndexRoute:rLt,ProjectsProjectIdSettingsTabRoute:iLt,ProjectsProjectIdTasksSessionIdRoute:aLt,ProjectsProjectIdTasksNewRoute:oLt},cLt=b_._addFileChildren(lLt),uLt={ProjectsProjectIdRoute:cLt,ProjectsIndexRoute:nLt},dLt=qk._addFileChildren(uLt),fLt={IndexRoute:eLt,ProjectsRoute:dLt,RemoteLaunchRoute:tLt},hLt=db._addFileChildren(fLt)._addFileTypes(),_Lt=FV({routeTree:hLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:qgt}),pLt=z();document.documentElement.lang=pLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:_Lt})}),f.jsx(k0t,{})]})); +`)+1)}let H=[];try{H=$.trim()?a3($):[]}catch{return null}if(B.truncated&&H.every(G=>G.hunks.length===0))return null;let q=0,Y=0;for(const G of H){const X=Lb(G);q+=X.additions,Y+=X.deletions}return{fileCount:H.length,additions:q,deletions:Y,truncated:B.truncated}},[v]),w={done:0,failed:0,cancelled:0,live:0};for(const B of n)B.status==="done"?w.done+=1:B.status==="failed"?w.failed+=1:B.status==="cancelled"?w.cancelled+=1:w.live+=1;const y=t?np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,E=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=R.useRef(null),[T,j]=R.useState(!1),[M,O]=R.useState(!1);return R.useEffect(()=>{j(!1)},[E]),R.useEffect(()=>{const B=N.current;B&&O(B.scrollHeight>B.clientHeight+1)},[E,T]),ro.createPortal(f.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Yw,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:l,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx($l,{status:t?Wi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...Vr(i),children:[f.jsx(Uh,{size:13}),x1e()]}),f.jsxs("button",{type:"button",...Vr(a),children:[f.jsx(_b,{size:13}),c1e()]})]}),E&&f.jsx("div",{className:`hc-body${T?" expanded":""}`,ref:N,children:E}),E&&(M||T)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>j(B=>!B),children:T?AD():Npe()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(z(),{style:"short"}).format([n.length===1?G4e():Q4e({count:Wt(n.length)}),...w.done>0?[x4e({count:Wt(w.done)})]:[],...w.failed>0?[C4e({count:Wt(w.failed)})]:[],...w.cancelled>0?[g4e({count:Wt(w.cancelled)})]:[],...w.live>0?[I4e({count:Wt(w.live)})]:[]])}),t&&v6(t.backend)&&f.jsx(P6,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:$o(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(em,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[g1e()," ",f.jsx("span",{children:r})]})]}),b&&b.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:b.truncated?PK({parent:Ne(r??"parent")}):OK({parent:Ne(r??"parent")}),children:f.jsxs("span",{children:[b.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",b.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",b.deletions]})," · ",b.fileCount===1&&!b.truncated?F4e():b.truncated?M4e({count:Wt(b.fileCount)}):j4e({count:Wt(b.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[h1e()," ",EDt(e.createdAt)]})]})]}),document.body)}const VR=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),zDt=264,KR=132,F1=44,jDt=72,TDt=148,ADt=44;function RDt(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function MDt(e,n){const t=new Map,r=o=>{const l=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,l),l},s=new Map,i=o=>{const l=s.get(o)??(n(o)||o.children.some(i));return s.set(o,l),l};function a(o){if(n(o)){const _=[];let d=0;for(const p of o.children)i(p)?_.push(...a(p)):d+=r(p);return d>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:d,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let l=0;const u=[];return(function _(d){l+=1;for(const p of d.children)n(p)?u.push(...a(p)):i(p)?_(p):l+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:l,children:u}]}return e.flatMap(a)}function j5(e){return e.kind==="exp"?zDt:TDt}function m1(e){return e.kind==="exp"?e.exp.id:e.id}function H1(e){if(e.children.length===0)return j5(e);const n=e.children.reduce((t,r)=>t+H1(r),0)+F1*(e.children.length-1);return Math.max(j5(e),n)}function DDt(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const LDt=R.memo(function({data:n}){Yd();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:l,onOpenView:u,onOpenCode:_}=n,d=r?Wi(r):void 0,p=d==="running"||d==="starting"||d==="cancelling",m=i?Not():p?Hot():El(),x=s.slice(-8),S=R.useRef(null),v=CDt(S,n);return f.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Vr(b=>u(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:m}),f.jsx($l,{status:d??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:Nlt()}),x.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${DDt(Wi(b))}`,title:G6(Wi(b))},b.id))}):f.jsx("span",{children:plt()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:$o(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:blt(),...Vr(b=>u(t.id,"terminal",b)),children:[f.jsx(Uh,{size:13}),AL()]}),f.jsxs("button",{className:"node-action",title:pD({branch:Ne(t.branchName)}),...Vr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(_b,{size:13}),elt()]}),o&&l&&f.jsx("a",{className:"node-action node-action-ext",title:ev({name:Ne(t.branchName)}),"aria-label":ev({name:Ne(t.branchName)}),href:nb(o,l,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(pb,{size:13})})]}),f.jsx(yu,{type:"source",position:Nt.Bottom}),v.rect&&f.jsx(NDt,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:v.rect,onOpenLogs:s.length>0?b=>u(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),ODt=R.memo(function({data:n}){Yd();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:Alt(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(yu,{type:"target",position:Nt.Top}),f.jsx(R6,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?Bot():Dot({count:Wt(t)}),f.jsx("span",{className:"elided-node-sub",children:Slt()})]}),f.jsx(yu,{type:"source",position:Nt.Bottom})]})}),IDt={exp:LDt,elided:ODt},Oq={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},BDt={...Oq.style,strokeDasharray:"4 4"};function $Dt({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a,viewport:o,onViewportChange:l}){const{nodes:u,edges:_}=R.useMemo(()=>{const d=new Map;for(const y of n){const C=d.get(y.experimentId);C?C.push(y):d.set(y.experimentId,[y])}for(const y of d.values())y.sort((C,E)=>C.createdAt-E.createdAt);const p=[],m=[],x=y=>!i||y.exp.chatSessionId===i,S=MDt(RDt(e),x),v=new Map(e.map(y=>[y.id,y.slug]));function b(y,C,E){const N=C-j5(y)/2;if(y.kind==="exp"){const M=d.get(y.exp.id)??[];p.push({id:y.exp.id,type:"exp",position:{x:N,y:E},data:{exp:y.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!y.exp.parentExperimentId,parentSlug:y.exp.parentExperimentId?v.get(y.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else p.push({id:y.id,type:"elided",position:{x:N,y:E+(KR-ADt)/2},data:{count:y.count,onShowProjectScope:a}});if(y.children.length===0)return;const T=y.children.reduce((M,O)=>M+H1(O),0)+F1*(y.children.length-1);let j=C-T/2;for(const M of y.children){const O=H1(M),B=y.kind==="elided"||M.kind==="elided";m.push({id:`e-${m1(y)}-${m1(M)}`,source:m1(y),target:m1(M),...B?{style:BDt}:{}}),b(M,j+O/2,E+KR+jDt),j+=O+F1}}let w=0;for(const y of S){const C=H1(y);b(y,w+C/2,0),w+=C+F1}return{nodes:p,edges:m}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?f.jsxs("div",{className:VR,children:[f.jsx("p",{className:"empty-state-title",children:dlt()}),f.jsx("p",{className:"empty-state-hint",children:Yot()})]}):u.length===0&&i?f.jsxs("div",{className:VR,children:[f.jsx("p",{className:"empty-state-title",children:olt()}),f.jsx("p",{className:"empty-state-hint",children:Wot()})]}):f.jsx(VMt,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:u,edges:_,nodeTypes:IDt,defaultEdgeOptions:Oq,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:kDt,onMoveEnd:(d,p)=>{d&&l(p)},minZoom:.15,defaultViewport:o??void 0,fitView:o===null,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(ZMt,{variant:Fl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const w0=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function PDt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FDt(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),l=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&l?u(l):null,d=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(d!==null)i=d;else{const p=s?PDt(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function HDt(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Gv=360,qDt=10,QR=1448,UDt=272,GDt=380,WDt=UDt+56,VDt=80,KDt=48;function T0(){return Math.max(Gv,window.innerWidth-WDt-GDt)}function QDt(){const e=T0();return Math.max(Gv,Math.min(760,e,Math.round(window.innerWidth*.4)))}function YR(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function XR(e){const n=R.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function YDt({runtime:e,projectId:n,pane:t}){var rl,$s,ho;const r=mn({mutationFn:Put}),s=li(),i=oD({select:J=>J.location}),a=Rd(i.pathname),o=(a==null?void 0:a.kind)==="skills"?"skills":(a==null?void 0:a.kind)==="settings"?a.section??"settings":"chat",l=R.useRef(null),u=(a==null?void 0:a.kind)==="task"?a.sessionId??null:l.current;(a==null?void 0:a.kind)==="task"&&(l.current=u);const _=t!==void 0,d=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[p,m]=R.useState(null),[x,S]=R.useState(0),v=R.useRef({href:"",jump:0,value:0});(v.current.href!==i.href||v.current.jump!==x)&&(v.current={href:i.href,jump:x,value:v.current.value+1});const b=R.useMemo(()=>{const J=t?Wa(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&p!==v.current.value?{...J,lineScrollRequest:v.current.value}:J},[t,p,i.href,x]),w=ct(Ea(n)),y=R.useMemo(()=>{var J;return((J=w.data)==null?void 0:J.map(ge=>ge.id))??null},[w.data]),C=R.useRef(new Set),E=R.useRef(new Set),N=R.useRef({}),[T,j]=R.useState(0),M=R.useRef({projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"});M.current={projectId:n,activeSessionId:u,pane:t,isTask:(a==null?void 0:a.kind)==="task"};const O=R.useCallback((J,ge=!1)=>{const je=M.current;je.projectId&&s.navigate({href:C1(je.projectId,je.activeSessionId,J),replace:ge})},[s]),B=R.useCallback(J=>{const ge=Ll(J);O(ge.kind==="file"?{...ge,line:void 0}:ge)},[O]),$=R.useCallback(()=>O(void 0),[O]),H=R.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&O({...t,runId:J??void 0})},[t,O]),q=R.useCallback(J=>{s.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[s]),Y=R.useCallback(J=>{var ge;if(n)if(J==="chat"){const je=l.current;s.navigate({href:C1(n,je,(ge=cu(oa.current,je??"new"))==null?void 0:ge.active)})}else s.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[s,n]),G=Yd(),{status:X}=F6(e.kind==="local"),te=R.useMemo(()=>rp(),[n]),I=ct(te),L=I.data??null,F=R.useCallback(J=>{Pr(te.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[te]),W=R.useMemo(()=>Zp(),[n]),U=ct(W),Z=U.data??null,ce=R.useCallback(J=>{Pr(W.queryKey,ge=>(typeof J=="function"?J(ge??null):J)??void 0)},[W]),re=R.useRef(void 0);re.current=Z==null?void 0:Z.tourCompleted;const ne=[!w.data&&w.error?xD():null,!I.data&&I.error?D0():null,!U.data&&U.error?Bne():null].filter(J=>J!==null),Q=ne.length?Hne({items:new Intl.ListFormat(G).format(ne)}):null,le=R.useRef(null),oe=ct(V4(n)),ue=oe.data??[],pe=!oe.isPending,[Se,ye]=R.useState(!1),Ie=ct(iu(n)).data??[],Te=R.useRef(Ie);Te.current=Ie;const vt=R.useRef(new Map),Dt=R.useRef(new Set),Ut=R.useRef(null),Ft=R.useRef(!1),mt=R.useRef(new Map),rt=R.useRef(new Map),ut=R.useRef(0),Ct=R.useRef(ue);Ct.current=ue;const Re=ct(n1t(n)).data??null,[Ze,_t]=R.useState("table"),[wt,Zt]=R.useState("project"),We=R.useRef(null),{open:Gt,setOpen:an,ref:yn}=so(We),[Vt,Yn]=R.useState(!1),ln=ue.every(J=>J.chatSessionId),cn=u&&ln?wt:"project",br=R.useMemo(()=>cn!=="agent"?ue:ue.filter(J=>J.chatSessionId===u),[ue,cn,u]),Xn=R.useMemo(()=>{if(cn!=="agent")return Ie;const J=new Set(br.map(ge=>ge.id));return Ie.filter(ge=>J.has(ge.experimentId))},[Ie,br,cn]),[Zn,Rn]=R.useState([]),[Rr,Nr]=R.useState(!1),[bt,fn]=R.useState(!1),[Cn,tn]=R.useState(!1),[nr,un]=R.useState([]),[Mn,on]=R.useState([]),rr=R.useRef(new Map),En=R.useRef(new Map),Ve=J=>{let ge=En.current.get(J);return ge||(ge=new WEt,En.current.set(J,ge)),ge},[xt,lt]=R.useState([]),[ft,jt]=R.useState([]),[xn,On]=R.useState([]),[di,Xl]=R.useState([]),[ao,zi]=R.useState(null),[Ra,Jt]=R.useState("files"),[Ys,ur]=R.useState(new Set),[Mr,Ke]=R.useState(!1),[Ht,ji]=R.useState(null),[os,ks]=R.useState(QDt),[gs,sa]=R.useState(()=>window.innerWidth>=QR),Ma=o==="chat"&&!_&&gs,[oo,Cs]=R.useState(!0),[Da,Kr]=R.useState(!1),Dr=R.useRef(j6()),en=R.useRef(u);en.current=u;const vs=R.useRef(Zn);vs.current=Zn;const Xs=R.useRef(di);Xs.current=di;const dr=R.useRef(null),ls=R.useCallback(J=>{const ge=[...J];Xs.current=ge,Xl(ge)},[]),Ls=R.useCallback(J=>{dr.current=J,zi(J)},[]),Fr=R.useCallback(J=>{const ge=Et(J);un(Me=>u0(Me,ge)),on(Me=>u0(Me,ge)),lt(Me=>u0(Me,ge)),jt(Me=>u0(Me,ge)),On(Me=>u0(Me,ge));const je=hr.current;if(je&&"path"in J){const Me=Ms(je,en.current,J);rr.current.delete(Me),En.current.delete(Me),E.current.delete(Me),C.current.delete(Me)}const $e=vs.current.filter(Me=>Et(Me)!==ge);vs.current=$e,Rn($e)},[]),Lr=R.useCallback(J=>{const ge=Et(J),je=[...vs.current.filter($e=>Et($e)!==ge),Bg(J)];vs.current=je,Rn(je),B(J)},[B]),cs=R.useCallback((J,ge,je)=>{const $e=Et(J),Me=dr.current,at=gCt({order:Xs.current,previewKey:Me?Et(Me):null},$e,ge);at.replacedKey&&Me&&typeof Me!="string"&&Et(Me)===at.replacedKey&&Fr(Me),ls(at.order),at.previewKey===null?Ls(null):at.previewKey===$e&&Ls(Bg(J));const tt=[...vs.current.filter(Lt=>Et(Lt)!==$e),Bg(J)];vs.current=tt,Rn(tt),O(Ll(J,je))},[Fr,ls,Ls,O]),bs=R.useCallback(J=>{const ge=dr.current;ge&&Et(ge)===Et(J)&&Ls(null)},[Ls]);R.useEffect(()=>{let J=!1;const ge=$e=>{const Me=dr.current,at=$e.target;if(at instanceof Element&&at.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(Me&&Et(Me)===Et(Dr.current.rightTab)&&($e.metaKey||$e.ctrlKey)&&!$e.altKey&&!$e.shiftKey&&$e.key.toLowerCase()==="k"){$e.preventDefault(),J=!0;return}if(J&&$e.key==="Enter"){$e.preventDefault(),J=!1;const Lt=dr.current;Lt&&bs(Lt);return}J=!1},je=()=>{J=!1};return window.addEventListener("keydown",ge),window.addEventListener("blur",je),window.addEventListener("pointerdown",je),()=>{window.removeEventListener("keydown",ge),window.removeEventListener("blur",je),window.removeEventListener("pointerdown",je)}},[bs]);const yr=R.useCallback((J,ge)=>{const je=Et(J),$e=dr.current;$e&&Et($e)===je&&Ls(null);const Me=vCt({order:Xs.current,previewKey:$e?Et($e):null},je,vs.current.map(Et));ls(Me.order);const at=vs.current.filter(Lt=>Et(Lt)!==je);if(vs.current=at,Rn(at),!ge)return;const tt=Me.fallbackKey?at.find(Lt=>Et(Lt)===Me.fallbackKey):void 0;tt?B(tt):($(),Ke(!1))},[ls,Ls,B,$]),ys=Y,ia=R.useMemo(()=>({rightTab:Bg(b),tabHistory:Zn,experimentsTabOpen:Rr,filesTabOpen:bt,artifactsTabOpen:Cn,expTabs:nr,fileTabs:Mn,planTabs:xt,subagentTabs:ft,codeTabs:xn,contentTabOrder:Xs.current,previewTab:dr.current,filesView:Ra,filesToggled:Ys,selectedRunId:d,scope:wt,panelOpen:_,panelMax:Mr,treeViewport:Ht}),[b,Zn,Rr,bt,Cn,nr,Mn,xt,ft,xn,di,ao,Ra,Ys,d,wt,_,Mr,Ht]);Dr.current=ia;const aa=R.useCallback(()=>Object.fromEntries(rr.current),[]),Xo=R.useRef(void 0),Es=R.useCallback(()=>{clearTimeout(Xo.current),Xo.current=setTimeout(()=>j(J=>J+1),200)},[]);R.useEffect(()=>()=>clearTimeout(Xo.current),[]);const Nu=R.useCallback((J,ge,je)=>{if(Rn(J.tabHistory),vs.current=J.tabHistory,Nr(J.experimentsTabOpen),fn(J.filesTabOpen),tn(J.artifactsTabOpen),un(J.expTabs),on(J.fileTabs),lt(Me=>Me===J.planTabs?Me:J.planTabs.map(at=>{var tt;return{...at,plan:((tt=Me.find(Lt=>Lt.sessionId===at.sessionId&&Lt.promptId===at.promptId))==null?void 0:tt.plan)??""}})),jt(J.subagentTabs),On(J.codeTabs),ls(J.contentTabOrder),Ls(J.previewTab),Jt(J.filesView),ur(J.filesToggled),Zt(J.scope),Ke(J.panelMax),ji(J.treeViewport),Yn(M.current.activeSessionId===O0&&J.fileTabs.some(Me=>Yu(Me,{path:S1,source:"artifacts"}))),je){for(const[Me,at]of Object.entries((ge==null?void 0:ge.scroll)??{}))rr.current.set(Me,at);Object.assign(N.current,ge==null?void 0:ge.sourceModes)}const $e=M.current;if($e.projectId)for(const Me of J.fileTabs){const at=Ms($e.projectId,$e.activeSessionId,Me);E.current.has(at)||C.current.add(at)}},[ls,Ls]),{ready:$n,loaded:y_,error:Zl,retry:Zo,capture:Hr,workspace:oa}=Z0t({projectId:Z&&y!==null&&((a==null?void 0:a.kind)!=="task"||!u||y.includes(u))?n:null,taskKey:u??"new",location:i.href,pane:t,isTask:(a==null?void 0:a.kind)==="task",demoOverview:(Z==null?void 0:Z.tourCompleted)===!1,state:ia,apply:Nu,getScroll:aa,sourceModes:N.current,revision:T}),Jl=R.useRef(null);R.useLayoutEffect(()=>{if(!$n||!pe||(a==null?void 0:a.kind)!=="task")return;const J=Jl.current;(J==null?void 0:J.projectId)===n&&J.taskId===u&&J.scope!==cn&&ji(null),Jl.current={projectId:n,taskId:u,scope:cn}},[$n,pe,a==null?void 0:a.kind,n,u,cn]);const Ti=R.useCallback((J,ge)=>{var at;if(!n)return;J&&ge!=null&&ge.replace&&u===null&&(Hr(),Y0t(n,J));const je=cu(DO(n),J??"new"),$e=je?je.active:Wc(n)?(at=T6(J??void 0,re.current===!1))==null?void 0:at.active:void 0,Me=ge!=null&&ge.replace&&J&&u===null?M.current.pane:$e;s.navigate({href:C1(n,J,Me),replace:ge==null?void 0:ge.replace})},[s,n,u,Hr]);R.useEffect(()=>{$n&&(a==null?void 0:a.kind)!=="task"&&!l.current&&oa.current.lastTaskId&&(y!=null&&y.includes(oa.current.lastTaskId))&&(l.current=oa.current.lastTaskId,j(J=>J+1))},[$n,a==null?void 0:a.kind,oa,y]),WV({shouldBlockFn:({next:J})=>{var ge;return((ge=Rd(J.pathname))==null?void 0:ge.projectId)!==n&&[...En.current.values()].some(je=>je.needsProtection)&&!IA(UE())},enableBeforeUnload:()=>[...En.current.values()].some(J=>J.needsProtection)});const La=R.useRef(null);R.useEffect(()=>{const J=lb(i.href);!Z||!$n||!J||(cb.queue({lastLocation:J,railOpen:oo,panelWidth:os,experimentsView:Ze},La.current===J?250:0),La.current=J)},[i.href,Z,$n,oo,os,Ze]);const ec=(Z==null?void 0:Z.onboardingCompleted)??!1,[tc,nc]=R.useState(!1),Ai=R.useCallback(()=>nc(!0),[]),Nn=R.useCallback(async J=>{const ge=re.current===!1,je=await r.mutateAsync({tourCompleted:!0});ge&&Vc({name:"demo_welcome_choice",choice:J}),ce($e=>$e&&{...$e,tourCompleted:je.tourCompleted}),nc(!1)},[]),rc=R.useCallback(async()=>{await Nn("create_project"),Kr(!0)},[Nn]);R.useEffect(()=>{!n||!Wc(n)||!ec||Z!=null&&Z.tourCompleted||Ai()},[n,ec,Ai,Z==null?void 0:Z.tourCompleted]);const Mt=(L==null?void 0:L.find(J=>J.id===n))??null;R.useEffect(()=>{const J=Q||Z===null?null:Mt==null?void 0:Mt.name;document.title=J?`${Oo(J)} — OpenResearch`:"OpenResearch"},[Q,Z,Mt]);const hr=R.useRef(n);hr.current=n;const xs=R.useCallback(J=>{n&&Vc({name:"first_action",surface:Wc(n)?"demo":"project",action:J})},[n]);R.useEffect(()=>{o!=="chat"&&o!=="skills"&&xs("open_settings")},[o,xs]);const la=R.useCallback((J=!1)=>{J&&(!M.current.isTask||M.current.pane)||(xs("open_experiment"),Nr(!0),O({kind:"home",view:"experiments"},J))},[O,xs]),Ri=()=>{I.refetch(),U.refetch(),w.refetch()},lo=R.useRef(!1);R.useEffect(()=>{if(!Z||lo.current)return;lo.current=!0,le.current=Z.preferredAgent;const J=N6()??Z.workspace;J&&(Cs(J.railOpen),ks(Math.min(J.panelWidth,T0())),_t(J.experimentsView))},[Z]),R.useEffect(()=>{y&&l.current&&!y.includes(l.current)&&(l.current=null)},[y]);const co=R.useRef(Promise.resolve()),sc=R.useRef(0),us=R.useCallback(J=>{const ge=++sc.current;ce($e=>$e&&{...$e,preferredAgent:J});const je=co.current.then(()=>r.mutateAsync({preferredAgent:J})).then($e=>{le.current=$e.preferredAgent,ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:$e.preferredAgent})}).catch($e=>{throw ge===sc.current&&ce(Me=>Me&&{...Me,preferredAgent:le.current}),$e});return co.current=je.catch(()=>{}),je},[]);R.useEffect(()=>{const J=()=>{ks(ge=>Math.min(ge,T0())),sa(window.innerWidth>=QR)};return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Os=R.useCallback(J=>{Ft.current=!1,mt.current.clear(),rt.current.clear();const ge=++ut.current;nt.fetchQuery(iu(J)).then(je=>{if(hr.current!==J||Ut.current!==J||ut.current!==ge)return;mt.current=new Map(je.map(Me=>[Me.id,Me]));const $e=[...rt.current.values()].some(Me=>{const at=mt.current.get(Me.id);return!at||at.status!=="running"&&at.updatedAt<=Me.updatedAt});rt.current.clear();for(const Me of je){const at=vt.current.get(Me.id);(!at||at.updatedAt{ut.current===ge&&(rt.current.clear(),ye(!0))})},[la]);R.useEffect(()=>{if(n)return Ut.current=n,vt.current.clear(),Dt.current.clear(),Jut(n).catch(()=>{}),Os(n),()=>{ut.current++}},[Os,n]);const ic=R.useCallback(()=>{tn(!0),Lr("artifacts")},[Lr]);$ht({onReconnect:()=>{const J=hr.current;J&&(Ut.current=J,vt.current.clear(),Dt.current.clear(),Os(J))},onRun:J=>{if(J.projectId!==hr.current||J.projectId!==Ut.current)return;const ge=vt.current.get(J.id),je=Dt.current.has(J.id);if(ge&&ge.updatedAt>J.updatedAt||(vt.current.set(J.id,J),Dt.current.add(J.id),J.status!=="running"||(ge==null?void 0:ge.status)==="running"))return;const $e=mt.current.get(J.id),Me=Ft.current&&(!$e||$e.status!=="running"&&$e.updatedAt<=J.updatedAt);je&&ge||Me?la(!0):Ft.current||rt.current.set(J.id,J)}});const Jo=R.useCallback(()=>Zt("project"),[]),Is=R.useCallback((J,ge="overview",je="preview",$e)=>{xs("open_experiment");const Me={id:J,view:ge};un(at=>at.some(tt=>D2(tt,Me))?at:[...at,Me]),cs(Me,je,$e)},[cs]),Oa=R.useCallback((J,ge="preview")=>{const je=Te.current.filter(Me=>Me.id===J||Me.id.startsWith(J)),$e=je.length===1?je[0]:null;$e&&Is($e.experimentId,"terminal",ge,$e.id)},[Is]),zu=R.useMemo(()=>new Map(ue.map(J=>{var ge;return[J.id,((ge=J.title)==null?void 0:ge.trim())||J.slug||El()]})),[ue,G]),Zs=XR(zu),el=R.useMemo(()=>{const J=new Map;for(const ge of Ie)J.set(ge.id,Zs.get(ge.experimentId)??El());return J},[Zs,Ie,G]),tl=XR(el),ac=R.useCallback(J=>{const ge=tl.get(J);if(ge)return ge;const je=[...tl].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[tl]),sf=R.useCallback(J=>{const ge=Zs.get(J);if(ge)return ge;const je=[...Zs].filter(([$e])=>$e.startsWith(J));return je.length===1?je[0][1]:""},[Zs]),ju=R.useCallback((J,ge="preview")=>{const je=Ct.current.filter($e=>$e.id===J||$e.id.startsWith(J));je.length===1&&Is(je[0].id,"overview",ge)},[Is]),Tu=R.useCallback(J=>{const ge=nr.findIndex(je=>D2(je,J));ge!==-1&&(un(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[nr,yr,b]),uo=R.useCallback((J,ge="preview")=>{J.line!=null&&S(Me=>Me+1);const je=hr.current;if(je){const Me=Ms(je,en.current,J);Dr.current.fileTabs.some(at=>Yu(at,J))||C.current.delete(Me),E.current.add(Me)}const $e=RO(J);on(Me=>{const at=Me.findIndex(Lt=>Yu(Lt,J));if(at===-1)return[...Me,$e];const tt=Me.slice();return tt[at]=$e,tt}),cs(J,ge)},[cs]),fi=R.useCallback((J,ge,je,$e,Me,at)=>{const tt=L==null?void 0:L.find(Ps=>Ps.id===n),Lt=FDt(J,tt==null?void 0:tt.repoPath,ge,(tt==null?void 0:tt.artifactsDir)??(tt==null?void 0:tt.filesDir),tt==null?void 0:tt.slug);if(!Lt)return null;const Wn=Me?Ct.current.find(Ps=>Ps.id===Me||Me.length>=6&&Ps.id.startsWith(Me)):void 0,Ns=je??(Wn==null?void 0:Wn.branchName),zs=Lt.source==null||Lt.source==="repo";return Ns&&zs&&(Lt.ref=Ns),at&&!Lt.ref&&zs&&(Lt.branchLabel=at),$e!=null&&(Lt.line=$e),Lt},[L,n]),oc=R.useCallback((J,ge,je,$e,Me,at,tt="preview")=>{const Lt=fi(J,ge,je,$e,Me,at);Lt&&uo(Lt,tt)},[uo,fi]),af=R.useCallback(J=>uo({path:J,source:"artifacts"},"keepOpen"),[uo]),Au=R.useCallback((J,ge,je,$e,Me,at="preview")=>{const tt=fi(J,ge,Me,je,$e);tt&&uo(tt,at)},[uo,fi]),hi=R.useCallback((J,ge)=>{bs(J),ge()},[bs]),of=R.useCallback(J=>{var $e;const ge=Mn.findIndex(Me=>Yu(Me,J));if(ge===-1)return;const je=n?Ms(n,u,J):null;je&&(($e=En.current.get(je))!=null&&$e.needsProtection)&&!IA(UE())||(on(Me=>Me.filter((at,tt)=>tt!==ge)),je&&(rr.current.delete(je),En.current.delete(je),E.current.delete(je),C.current.delete(je),delete N.current[je]),u===O0&&Yu(J,{path:S1,source:"artifacts"})&&Yn(!1),yr(J,Et(b)===Et(J)))},[u,Mn,yr,n,b]),lf=R.useCallback(J=>{J.lineScrollRequest!==void 0&&m(J.lineScrollRequest)},[]),x_=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"plan",sessionId:ge,promptId:je,plan:J};lt(at=>{const tt=at.findIndex(Wn=>Wn.promptId===je);if(tt===-1)return[...at,Me];const Lt=at.slice();return Lt[tt]=Me,Lt}),cs(Me,$e)},[cs]),w_=R.useCallback(J=>{const ge=xt.findIndex(je=>je.promptId===J.promptId);ge!==-1&&(lt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,xt,b]),lc=R.useCallback((J,ge,je,$e="preview")=>{const Me={kind:"subagent",sessionId:J,spawnPartId:ge,label:je};jt(at=>at.some(tt=>tt.spawnPartId===ge)?at:[...at,Me]),cs(Me,$e)},[cs]),cf=R.useCallback(J=>{const ge=ft.findIndex(je=>je.spawnPartId===J.spawnPartId);ge!==-1&&(jt(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[yr,b,ft]),[uf,cc]=R.useState({});R.useEffect(()=>{if(cc(tt=>{const Lt=new Set(ft.map(Wn=>Wn.spawnPartId));return Object.keys(tt).every(Wn=>Lt.has(Wn))?tt:Object.fromEntries(Object.entries(tt).filter(([Wn])=>Lt.has(Wn)))}),ft.length===0)return;let J=!0;const ge=new Set,je=(tt,Lt,Wn)=>{cc(Ns=>{var Ps;let zs=Ns;for(const _i of Lt)if(!(Wn&&ge.has(_i.spawnPartId)))for(const Tn of tt){const Yr=Mv(Tn.parts,_i.spawnPartId);if(!Yr)continue;Wn||ge.add(_i.spawnPartId);const Js={label:I9t(Yr),running:((Ps=Yr.state)==null?void 0:Ps.status)==="running"},sr=zs[_i.spawnPartId];(!sr||sr.label!==Js.label||sr.running!==Js.running)&&(zs===Ns&&(zs={...Ns}),zs[_i.spawnPartId]=Js);break}return zs})};let $e=0;const Me=()=>{const tt=++$e;for(const Lt of new Set(ft.map(Wn=>Wn.sessionId)))nt.fetchQuery({...Bl(Lt),staleTime:0}).then(({messages:Wn})=>{J&&tt===$e&&je(Wn,ft.filter(Ns=>Ns.sessionId===Lt),!0)}).catch(()=>{})};Me();const at=ov(tt=>{if(tt.type==="reconnected"){ge.clear(),Me();return}if(tt.type!=="message")return;const Lt=ft.filter(Wn=>Wn.sessionId===tt.sessionId);Lt.length&&je([tt.message],Lt,!1)});return()=>{J=!1,at()}},[ft]);const uc=R.useCallback((J,ge,je="files",$e="preview")=>{const Me={code:!0,experimentId:J,branch:ge,view:je,toggled:new Set};On(at=>at.some(tt=>qf(tt,Me))?at.map(tt=>qf(tt,Me)?{...tt,experimentId:J,view:je}:tt):[...at,Me]),cs(Me,$e)},[cs]),df=R.useCallback((J,ge)=>{On(je=>je.map($e=>qf($e,J)?{...$e,...ge}:$e)),ge.view&&O(Ll({...J,...ge}))},[]),S_=R.useCallback(J=>{const ge=xn.findIndex(je=>qf(je,J));ge!==-1&&(On(je=>je.filter(($e,Me)=>Me!==ge)),yr(J,Et(b)===Et(J)))},[xn,yr,b]),fo=R.useCallback(()=>{fn(!0),Lr("files")},[Lr]),dc=R.useCallback(J=>{J==="experiments"?Nr(!1):J==="files"?fn(!1):tn(!1),yr(J,b===J)},[yr,b]),ff=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const je=document.body.style.userSelect;document.body.style.userSelect="none";const $e=Mr,Me=J.clientX,at=os;let tt=!1;function Lt(){window.removeEventListener("pointermove",Wn),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),document.body.style.userSelect=je}function Wn(Ns){if($e){const Tn=Ns.clientX-Me;if(tt||TnPs+VDt){Ke(!0);return}Ke(!1);const _i=Math.min(Math.max(zs,Gv),Ps);ks(_i)}window.addEventListener("pointermove",Wn),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)},k_=(J,ge)=>{F(je=>je?YR(je,J):[J]),s.navigate({href:`/projects/${encodeURIComponent(J.id)}${ge?"/settings/git":""}`}),ge&&Qn(ge,"error")},Bs=typeof b=="object"&&"id"in b?b:null,Dn=typeof b=="object"&&"path"in b?b:null,Ru=(Dn==null?void 0:Dn.source)==="artifacts"&&Re?wp(Re.entries,Dn.path):null,fc=Ru?`${Ru.modifiedAt}:${Ru.size}`:null,ca=u===O0&&Vt?Mn.find(J=>Yu(J,{path:S1,source:"artifacts"})):void 0,hf=ca?[ca]:[],Qr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,ua=Qr==null?void 0:Qr.sessionId,Ia=Qr==null?void 0:Qr.promptId,hc=!!(ua&&Ia&&(y!=null&&y.includes(ua))),nl=ct({...Bl(ua??""),enabled:hc,subscribed:hc}),ie=R.useMemo(()=>{var ge;if(!ua||!Ia||!nl.data)return null;const J=nl.data.messages.flatMap(je=>{const $e=Mv(je.parts,Ia);return $e?[$e]:[]})[0];return{key:`${ua}:${Ia}`,text:((ge=J==null?void 0:J.prompt)==null?void 0:ge.plan)??null}},[ua,Ia,nl.data]),be=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,Ae=typeof b=="object"&&"code"in b?b:null,Oe=Ae?xn.find(J=>qf(J,Ae))??null:null,Ue=new Map;for(const J of[...nr,...Mn,...xt,...ft,...xn])Ue.set(Et(J),J);const zn=ca?Et(ca):null,jn=di.filter(J=>J!==zn).map(J=>Ue.get(J)).filter(V0t),fr=J=>ao!==null&&Et(ao)===Et(J),Ln=J=>f.jsx(Fc,{active:Dn!==null&&Yu(Dn,J),label:J.path.split("/").pop()||J.path,icon:f.jsx(VO,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>of(J)},`file:${z6(J)}`),_r=Bs?ue.find(J=>J.id===Bs.id)??null:null,da=Oe?ue.find(J=>J.id===Oe.experimentId&&J.branchName===Oe.branch)??null:null,_f=J=>{var je,$e;if("path"in J)return Ln(J);if("id"in J){const Me=ue.find(at=>at.id===J.id);return f.jsx(Fc,{active:Bs!==null&&D2(Bs,J),label:Me?Me.title||Me.slug:"…",icon:J.view==="overview"?f.jsx(Npt,{size:12,className:"shrink-0"}):f.jsx(Uh,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>Tu(J)},Et(J))}if("kind"in J&&J.kind==="plan")return f.jsx(Fc,{active:Qr!==null&&Qr.promptId===J.promptId,label:ED(),icon:f.jsx(O6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>w_(J)},Et(J));if("kind"in J)return f.jsx(Fc,{active:be!==null&&be.spawnPartId===J.spawnPartId,label:((je=uf[J.spawnPartId])==null?void 0:je.label)??J.label??Wne(),shimmer:(($e=uf[J.spawnPartId])==null?void 0:$e.running)??!1,icon:f.jsx(B6,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>cf(J)},Et(J));const ge=ue.find(Me=>Me.id===J.experimentId);return f.jsx(Fc,{active:Oe!==null&&qf(Oe,J),label:(ge==null?void 0:ge.slug)??J.branch,icon:f.jsx(Dd,{size:12,className:"shrink-0"}),preview:fr(J),onSelect:()=>Lr(J),onPromote:()=>bs(J),onClose:()=>S_(J)},Et(J))};if(!a||a.kind==="resume")return null;if(Q)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:w0,children:[f.jsx("p",{children:Q}),f.jsx(Le,{variant:"primary",onClick:Ri,children:Gi()})]}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]});if(L&&!Mt)return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});if(Zl&&!$n)return f.jsxs("div",{className:w0,children:[f.jsx("p",{role:"alert",children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]});if(L===null||Z===null||!y_||y===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:w0,children:f.jsx(It,{})}),e.kind==="ssh"&&f.jsx(fv,{runtime:e,corner:!0})]});if(!Mt||(a==null?void 0:a.kind)==="task"&&u&&!(y!=null&&y.includes(u)))return f.jsxs("div",{className:w0,children:[Ya(),f.jsx(Le,{onClick:()=>q(null),children:D0()})]});const Mu=f.jsx(_Nt,{projectName:((rl=L.find(J=>J.id===n))==null?void 0:rl.name)??"",onHome:()=>void s.navigate({to:"/projects"}),onNewProject:()=>Kr(!0),onRepository:()=>ys("git"),onCollapse:()=>Cs(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(cI,{}),e.kind==="local"&&f.jsx(_I,{status:X}),Zl&&f.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[f.jsx("span",{children:Zl}),f.jsx(Le,{onClick:Zo,children:Gi()})]}),f.jsxs("div",{className:`app-body workspace-body relative flex flex-1 min-h-0 py-0 px-3.5 ${Ma?"workspace-card-visible":""}`,children:[n&&f.jsx(X9t,{projectId:n,projectName:(Mt==null?void 0:Mt.name)??"",railHeader:Mu,railOpen:oo,onShowRail:()=>Cs(!0),mainView:o,onSelectMainView:ys,onOpenFile:Au,onOpenRun:Oa,runExperimentName:ac,onOpenExperiment:ju,experimentName:sf,onOpenPlan:x_,onOpenSubagent:lc,composerPrefill:Mt&&Wc(Mt.id)&&(Z==null?void 0:Z.tourCompleted)===!1?Mut:null,runtime:e,onOpenDemoWelcome:Mt&&Wc(Mt.id)?Ai:void 0,activeSessionId:u,onActiveSessionChange:Ti,preferredAgent:Z.preferredAgent,onPreferredAgentChange:us,children:o==="skills"?f.jsx(OEt,{}):o!=="chat"?f.jsx(y8t,{remote:e.kind==="ssh",tab:o,project:Mt,onProjectUpdate:J=>{F(ge=>ge?YR(ge,J):[J])},onSelectTab:ys}):null}),o==="chat"&&f.jsx(lxt,{expanded:Ma,experiments:ue,runs:Ie,onOpenExperiment:(J,ge)=>Is(J,"overview","preview",ge),rightOffset:_?os+28:void 0,activeView:_&&(b==="files"||b==="artifacts"||b==="experiments")?b:null,projectId:Mt.id,onCompute:()=>ys("compute"),sessionId:u,busy:(($s=w.data)==null?void 0:$s.some(J=>J.id===u&&J.busy))??!1,onChanges:()=>{Jt("changes"),fo()},onFiles:()=>{Jt("files"),fo()},onArtifacts:ic,onExperiments:()=>la()}),o==="chat"&&_&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Mr?"max":""}`,style:Mr?void 0:{width:os},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Mr?"cursor-e-resize":"cursor-col-resize"}`,title:Mr?$te():Lte(),onPointerDown:ff}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[hf.map(Ln),bt&&f.jsx(Fc,{active:b==="files",label:E4(),icon:f.jsx(Dd,{size:12,className:"shrink-0"}),onSelect:()=>Lr("files"),onClose:()=>dc("files")}),Cn&&f.jsx(Fc,{active:b==="artifacts",label:vD(),icon:f.jsx(D6,{size:12,className:"shrink-0"}),onSelect:()=>Lr("artifacts"),onClose:()=>dc("artifacts")}),Rr&&f.jsx(Fc,{active:b==="experiments",label:bD(),icon:f.jsx(hb,{size:12,className:"shrink-0"}),onSelect:()=>Lr("experiments"),onClose:()=>dc("experiments")}),jn.map(_f)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(Qt,{title:Mr?lE():oE(),"aria-label":Mr?lE():oE(),onClick:()=>Ke(J=>!J),children:Mr?f.jsx(Tmt,{size:14}):f.jsx(Nmt,{size:14})}),f.jsx(Qt,{title:tv(),"aria-label":tv(),onClick:()=>{$(),Ke(!1)},children:f.jsx(Gr,{size:14})})]})]}),!$n||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!pe||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!Se?f.jsx(Fa,{children:f.jsx(It,{})}):Bs&&(!_r||d&&!Ie.some(J=>J.id===d&&J.experimentId===Bs.id))||Ae&&!da||t&&"sessionId"in t&&t.sessionId&&!(y!=null&&y.includes(t.sessionId))?f.jsx(Fa,{children:f.jsx("div",{className:"p-6 text-subtext",children:Ya()})}):b==="artifacts"?f.jsx(Fa,{children:Mt&&f.jsx(NEt,{project:Mt,artifacts:Re,onOpenFile:af,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"artifacts"})))!=null&&ge.needsProtection)}},Mt.id)}):b==="experiments"?f.jsxs(Fa,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:yn,children:[f.jsx(Qt,{size:"small",ref:We,className:"experiment-scope-trigger",active:cn==="agent",title:Qte({scope:cn==="agent"?iE():aE()}),"aria-label":cne(),"aria-expanded":Gt,onClick:()=>an(J=>!J),children:f.jsx(lmt,{size:16,strokeWidth:2.5})}),Gt&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(or,{"aria-pressed":cn==="agent",disabled:!u||!ln,title:u?ln?void 0:hne():xne(),onClick:()=>{Zt("agent"),an(!1)},children:[f.jsx("span",{children:iE()}),cn==="agent"&&f.jsx(Na,{size:13})]}),f.jsxs(or,{"aria-pressed":cn==="project",onClick:()=>{Zt("project"),an(!1)},children:[f.jsx("span",{children:aE()}),cn==="project"&&f.jsx(Na,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":Jte(),children:[f.jsx("button",{className:Ze==="table"?"active":"","aria-pressed":Ze==="table",onClick:()=>_t("table"),children:Yne()}),f.jsx("button",{className:Ze==="tree"?"active":"","aria-pressed":Ze==="tree",onClick:()=>_t("tree"),children:ere()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:Ze==="tree"?Mt&&f.jsx($Dt,{experiments:ue,runs:Xn,project:Mt,onOpenView:Is,onOpenCode:uc,agentSessionId:cn==="agent"?u:null,onShowProjectScope:Jo,viewport:Ht,onViewportChange:ji}):f.jsx(pNt,{runs:Xn,emptyHint:cn==="agent"&&ue.length>0?gne():void 0,experiments:br,onOpen:(J,ge)=>{Is(J.id,"overview",ge)},onOpenLogs:(J,ge,je)=>{Is(J,"terminal",je,ge)},onOpenCode:(J,ge)=>{const je=ue.find($e=>$e.id===J);je&&uc(je.id,je.branchName,"files",ge)},onCancel:IL})})]}):b==="files"?f.jsx(Fa,{children:Mt?f.jsx(pEt,{sessionId:u??void 0,project:Mt,view:Ra,toggled:Ys,onViewChange:Jt,onToggledChange:ur,canRenameFile:J=>{var ge;return!((ge=En.current.get(Ms(Mt.id,u,{path:J,source:"repo",sessionId:u??void 0})))!=null&&ge.needsProtection)},onOpenFile:(J,ge,je,$e)=>oc(J,ge,je,void 0,void 0,void 0,$e)},`files:${u??`project:${Mt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(mh,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(KO,{size:22}),f.jsx("p",{children:Dne()})]})})})}):Dn?f.jsx(Fa,{children:n&&f.jsx(hNt,{remote:e.kind==="ssh",restored:C.current.has(Ms(n,u,Dn)),onRestoreActivated:()=>{const J=Ms(n,u,Dn);C.current.delete(J),E.current.add(J)},showSource:N.current[Ms(n,u,Dn)]??!1,onShowSourceChange:J=>{N.current[Ms(n,u,Dn)]=J,j(ge=>ge+1)},projectId:n,path:Dn.path,source:Dn.source,sessionId:Dn.source==="artifacts"?u??void 0:Dn.sessionId,gitRef:Dn.ref,line:Dn.line,branchLabel:HDt(Dn,Mt==null?void 0:Mt.baselineBranch),artifactVersion:fc,artifactEntries:Dn.source==="artifacts"?Re==null?void 0:Re.entries:void 0,bufferSession:Ve(Ms(n,u,Dn)),onOpenFile:(J,ge,je,$e)=>hi(Dn,()=>oc(J,ge,je,void 0,void 0,void 0,$e)),scrollPosition:rr.current.get(Ms(n,u,Dn)),onScrollPositionChange:J=>{rr.current.set(Ms(n,u,Dn),J),Es()},lineScrollRequest:Dn.lineScrollRequest,onLineScrollRequestHandled:()=>lf(Dn),onEdit:()=>bs(Dn)},Ms(n,u,Dn))}):Qr?f.jsx(Fa,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx(Fo,{text:(ie==null?void 0:ie.key)===`${Qr.sessionId}:${Qr.promptId}`?ie.text??Ya():((ho=xt.find(J=>J.promptId===Qr.promptId))==null?void 0:ho.plan)||yD(),onOpenFile:(J,ge,je,$e,Me)=>hi(Qr,()=>oc(J,Qr.sessionId,$e,ge,je,void 0,Me))})})}):be?f.jsx(eEt,{sessionId:be.sessionId,spawnPartId:be.spawnPartId,onOpenFile:(J,ge,je,$e,Me)=>hi(be,()=>Au(J,be.sessionId,ge,je,$e,Me)),onOpenRun:(J,ge)=>hi(be,()=>Oa(J,ge)),runExperimentName:ac,onOpenExperiment:(J,ge)=>hi(be,()=>ju(J,ge)),experimentName:sf,onOpenSubagent:(J,ge,je)=>hi(be,()=>lc(be.sessionId,J,ge,je))},be.spawnPartId):Oe?f.jsx(Fa,{children:n&&Mt&&Oe&&da&&f.jsx(_Et,{projectId:n,project:Mt,experiment:da,view:Oe.view,toggled:Oe.toggled,onViewChange:J=>df(Oe,{view:J}),onToggledChange:J=>df(Oe,{toggled:J}),onOpenFile:(J,ge,je,$e)=>hi(Oe,()=>oc(J,ge,je,void 0,void 0,da.branchName,$e))},`code:${Oe.branch}`)}):f.jsx(Fa,{children:Bs&&_r&&Mt&&f.jsx(FEt,{experiment:_r,project:Mt,view:Bs.view,runs:Ie,selectedRunId:d,onSelectRun:H,parentExperiment:ue.find(J=>J.id===_r.parentExperimentId)??null,onOpenView:(J,ge,je)=>{hi(Bs,()=>Is(_r.id,J,je,ge))},onOpenCode:(J,ge)=>hi(Bs,()=>uc(_r.id,_r.branchName,J,ge))},`${Bs.id}:${Bs.view}`)})]})]}),Da&&f.jsx(lI,{remote:e.kind==="ssh",onClose:()=>Kr(!1),onCreated:(J,ge)=>{Kr(!1),k_(J,ge)}}),tc&&Mt&&Wc(Mt.id)&&f.jsx(mNt,{onClose:Nn,onCreateProject:rc})]})}const T5=qo()({validateSearch:e=>({pane:E6(e.pane)}),beforeLoad:({location:e})=>{if(!Rd(e.pathname))throw bW()},component:XDt});function XDt(){const{projectId:e}=T5.useParams(),{pane:n}=T5.useSearch(),t=li(),r=oD({select:s=>s.location});return R.useEffect(()=>{const s=ZDt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),f.jsxs(f.Fragment,{children:[f.jsx(Z0,{}),f.jsx(YDt,{projectId:e,pane:n,runtime:LO()},e)]})}function ZDt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&E6(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const Iq=qo()({component:JDt});function JDt(){const{projectId:e}=Iq.useParams();return f.jsx(Qgt,{projectId:e})}const eLt=qo()({}),tLt=qo()({}),nLt=qo()({}),rLt=qo()({}),sLt=Xgt.update({id:"/",path:"/",getParentRoute:()=>ub}),qk=Zgt.update({id:"/projects",path:"/projects",getParentRoute:()=>ub}),iLt=Jgt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>ub}),aLt=e1t.update({id:"/",path:"/",getParentRoute:()=>qk}),b_=T5.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>qk}),oLt=Iq.update({id:"/",path:"/",getParentRoute:()=>b_}),lLt=eLt.update({id:"/skills",path:"/skills",getParentRoute:()=>b_}),cLt=tLt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>b_}),uLt=nLt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>b_}),dLt=rLt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>b_}),fLt={ProjectsProjectIdSkillsRoute:lLt,ProjectsProjectIdIndexRoute:oLt,ProjectsProjectIdSettingsTabRoute:cLt,ProjectsProjectIdTasksSessionIdRoute:uLt,ProjectsProjectIdTasksNewRoute:dLt},hLt=b_._addFileChildren(fLt),_Lt={ProjectsProjectIdRoute:hLt,ProjectsIndexRoute:aLt},pLt=qk._addFileChildren(_Lt),mLt={IndexRoute:sLt,ProjectsRoute:pLt,RemoteLaunchRoute:iLt},gLt=ub._addFileChildren(mLt)._addFileTypes(),vLt=FV({routeTree:gLt,context:{queryClient:nt},trailingSlash:"never",defaultPendingComponent:H6,defaultErrorComponent:q6,defaultNotFoundComponent:Vgt}),bLt=z();document.documentElement.lang=bLt;document.documentElement.dir="ltr";QG.createRoot(document.getElementById("root")).render(f.jsxs(R.StrictMode,{children:[f.jsx(cG,{client:nt,children:f.jsx(UV,{router:vLt})}),f.jsx(z0t,{})]})); diff --git a/ui/dist/index.html b/ui/dist/index.html index f1a17b0f2..4acee68e3 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/messages/en.json b/ui/messages/en.json index 9ea6bc949..2f2c11f01 100644 --- a/ui/messages/en.json +++ b/ui/messages/en.json @@ -1150,5 +1150,6 @@ "new_project_form_extra_topics_comma_separated_e_g_llm": "Extra topics (comma-separated), e.g. llm, benchmark", "settings_page_auto_apply_git_hub_topics_for_new_projects": "Auto-apply GitHub topics for new projects", "settings_page_auto_apply_git_hub_topics_help": "Tag new repositories with openresearch, and with arxiv-xxxx and paper-repro when the project starts from a paper.", - "settings_page_repository_topics": "Repository topics" + "settings_page_repository_topics": "Repository topics", + "settings_page_add_topics_automatically": "Add topics automatically" } diff --git a/ui/messages/fa.json b/ui/messages/fa.json index 7afbb6f07..efb5adbc5 100644 --- a/ui/messages/fa.json +++ b/ui/messages/fa.json @@ -1150,5 +1150,6 @@ "new_project_form_extra_topics_comma_separated_e_g_llm": "موضوع‌های افزوده (با کاما جدا شوند)، مانند llm, benchmark", "settings_page_auto_apply_git_hub_topics_for_new_projects": "اعمال خودکار موضوع‌های GitHub برای پروژه‌های جدید", "settings_page_auto_apply_git_hub_topics_help": "مخزن‌های جدید با openresearch برچسب می‌خورند و اگر پروژه از یک مقاله باشد، arxiv-xxxx و paper-repro نیز افزوده می‌شود.", - "settings_page_repository_topics": "موضوع‌های مخزن" + "settings_page_repository_topics": "موضوع‌های مخزن", + "settings_page_add_topics_automatically": "افزودن خودکار موضوع‌ها" } diff --git a/ui/messages/zh-CN.json b/ui/messages/zh-CN.json index 03740ba90..75d9a31bb 100644 --- a/ui/messages/zh-CN.json +++ b/ui/messages/zh-CN.json @@ -1150,5 +1150,6 @@ "new_project_form_extra_topics_comma_separated_e_g_llm": "附加 topic(逗号分隔),例如 llm, benchmark", "settings_page_auto_apply_git_hub_topics_for_new_projects": "为新项目自动添加 GitHub topic", "settings_page_auto_apply_git_hub_topics_help": "为新仓库添加 openresearch;项目来自论文时还会添加 arxiv-xxxx 与 paper-repro。", - "settings_page_repository_topics": "仓库 topic" + "settings_page_repository_topics": "仓库 topic", + "settings_page_add_topics_automatically": "自动添加 topic" } diff --git a/ui/src/components/NewProjectForm.tsx b/ui/src/components/NewProjectForm.tsx index 07b3a26f6..059c706f8 100644 --- a/ui/src/components/NewProjectForm.tsx +++ b/ui/src/components/NewProjectForm.tsx @@ -646,7 +646,7 @@ export function NewProjectForm({ value={githubTopics} onChange={(event) => setGithubTopics(event.target.value)} placeholder={m.new_project_form_extra_topics_comma_separated_e_g_llm()} - aria-label={m.settings_page_repository_topics()} + aria-label={m.new_project_form_extra_topics_comma_separated_e_g_llm()} disabled={pending} /> diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index 234ace020..6162ea771 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -3183,7 +3183,7 @@ function GitTab({ setTopicsAuto((current) => !(current ?? false))} />